#include <metal_stdlib>

using namespace metal;
uint3 subgroupShuffle_4cbb69() {
  uint3 res = simd_shuffle(uint3(1u),1);
  return res;
}

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

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

