#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  device half4* prevent_dce;
};

half4 subgroupBroadcastFirst_705aad() {
  half4 arg_0 = half4(1.0h);
  half4 res = simd_broadcast_first(arg_0);
  return res;
}

fragment void fragment_main(device half4* 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) = subgroupBroadcastFirst_705aad();
}

kernel void compute_main(device half4* 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) = subgroupBroadcastFirst_705aad();
}
