#include <metal_stdlib>

using namespace metal;
float4 subgroupInclusiveMul_69326e() {
  float4 res = simd_prefix_inclusive_product(float4(1.0f));
  return res;
}

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

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

