#include <metal_stdlib>

using namespace metal;
kernel void tint_symbol() {
  for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) {
    switch(i) {
      case 0: {
        for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) {
          switch(j) {
            case 0: {
              continue;
              break;
            }
            default: {
              break;
            }
          }
        }
        continue;
        break;
      }
      default: {
        break;
      }
    }
  }
  return;
}

