#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  device int4* prevent_dce;
};

int4 subgroupInclusiveMul_517979() {
  int4 arg_0 = int4(1);
  int4 res = simd_prefix_inclusive_product(arg_0);
  return res;
}

fragment void fragment_main(device int4* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  (*tint_module_vars.prevent_dce) = subgroupInclusiveMul_517979();
}

kernel void compute_main(device int4* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  (*tint_module_vars.prevent_dce) = subgroupInclusiveMul_517979();
}
