#include <metal_stdlib>

using namespace metal;

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

kernel void tint_symbol() {
  int j = 0;
  bool tint_continue = false;
  for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
    TINT_ISOLATE_UB(tint_volatile_false);
    tint_continue = false;
    switch(i) {
      case 0: {
        switch(j) {
          case 0: {
            tint_continue = true;
            break;
          }
          default: {
            break;
          }
        }
        if (tint_continue) {
          break;
        }
        break;
      }
      default: {
        break;
      }
    }
    if (tint_continue) {
      continue;
    }
  }
  return;
}

