#include <metal_stdlib>

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

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

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

