#include <metal_stdlib>

using namespace metal;

#define TINT_ISOLATE_UB(VOLATILE_NAME) \
  {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}

kernel void f() {
  int i = 0;
  bool tint_continue = false;
  while(true) {
    TINT_ISOLATE_UB(tint_volatile_false);
    tint_continue = false;
    switch(i) {
      case 0: {
        tint_continue = true;
        break;
      }
      default: {
        break;
      }
    }
    if (tint_continue) {
      {
        i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
        if ((i >= 4)) { break; }
      }
      continue;
    }
    {
      i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
      if ((i >= 4)) { break; }
    }
  }
  return;
}

