#include <metal_stdlib>
using namespace metal;

#define TINT_ISOLATE_UB(VOLATILE_NAME) \
  volatile bool VOLATILE_NAME = true; \
  if (VOLATILE_NAME)

void some_loop_body() {
}

void f() {
  int j = 0;
  {
    int i = 0;
    TINT_ISOLATE_UB(tint_volatile_true) while(true) {
      bool v = false;
      if ((i < 5)) {
        v = (j < 10);
      } else {
        v = false;
      }
      if (v) {
      } else {
        break;
      }
      some_loop_body();
      j = as_type<int>((as_type<uint>(i) * as_type<uint>(30)));
      {
        i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
      }
      continue;
    }
  }
}
