#include <metal_stdlib>

using namespace metal;
uint subgroupShuffleUp_3242a6() {
  uint arg_0 = 1u;
  uint arg_1 = 1u;
  uint res = simd_shuffle_up(arg_0,arg_1);
  return res;
}

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

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

