#include <metal_stdlib>

using namespace metal;
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* tint_symbol [[buffer(0)]]) {
  *(tint_symbol) = subgroupShuffleUp_b58804();
  return;
}

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

