#include <metal_stdlib>

using namespace metal;
int4 subgroupExclusiveAdd_406ab4() {
  int4 res = simd_prefix_exclusive_sum(int4(1));
  return res;
}

fragment void fragment_main(device int4* tint_symbol [[buffer(0)]]) {
  *(tint_symbol) = subgroupExclusiveAdd_406ab4();
  return;
}

kernel void compute_main(device int4* tint_symbol_1 [[buffer(0)]]) {
  *(tint_symbol_1) = subgroupExclusiveAdd_406ab4();
  return;
}

