#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  device float2* prevent_dce;
};

float2 subgroupShuffleUp_b58804() {
  float2 arg_0 = float2(1.0f);
  uint arg_1 = 1u;
  float2 res = simd_shuffle_up(arg_0, arg_1);
  return res;
}

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

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