#include <metal_stdlib>

using namespace metal;
half subgroupShuffleDown_9c6714() {
  half res = simd_shuffle_down(1.0h,1u);
  return res;
}

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

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

