#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 i = 0;
    while(true) {
      TINT_ISOLATE_UB(tint_volatile_false)
      if ((i < 2)) {
      } else {
        break;
      }
      bool 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)));
        }
        continue;
      }
      {
        i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
      }
      continue;
    }
  }
}
