#include <metal_stdlib>
using namespace metal;

int f() {
  int i = 0;
  {
    uint2 tint_loop_idx = 0u;
    while(true) {
      if (all((tint_loop_idx == uint2(4294967295u)))) {
        break;
      }
      if ((i < 4)) {
      } else {
        break;
      }
      i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
      {
        uint const tint_low_inc = (tint_loop_idx.x + 1u);
        tint_loop_idx.x = tint_low_inc;
        uint const tint_carry = uint((tint_low_inc == 0u));
        tint_loop_idx.y = (tint_loop_idx.y + tint_carry);
      }
      continue;
    }
  }
  return i;
}
