#include <metal_stdlib>
using namespace metal;

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

kernel void tint_symbol() {
  {
    int i = 0;
    TINT_ISOLATE_UB(tint_volatile_true) while(true) {
      if ((i < 2)) {
      } else {
        break;
      }
      {
        int j = 0;
        TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
          if ((j < 2)) {
          } else {
            break;
          }
          switch(i) {
            case 0:
            {
              {
                j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)));
              }
              continue;
            }
            default:
            {
              break;
            }
          }
          {
            j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)));
          }
          continue;
        }
      }
      {
        i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)));
      }
      continue;
    }
  }
}
