#include <metal_stdlib>

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

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

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

