#include <metal_stdlib>

using namespace metal;
int3 subgroupExclusiveAdd_c08160() {
  int3 res = simd_prefix_exclusive_sum(int3(1));
  return res;
}

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

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

