#include <metal_stdlib>

using namespace metal;
int3 subgroupInclusiveMul_769def() {
  int3 arg_0 = int3(1);
  int3 res = simd_prefix_inclusive_product(arg_0);
  return res;
}

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

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

