#include <metal_stdlib>

using namespace metal;
int3 subgroupShuffleDown_1b530f() {
  int3 res = simd_shuffle_down(int3(1),1u);
  return res;
}

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

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

