#include <metal_stdlib>

using namespace metal;
half3 subgroupBroadcastFirst_0e58ec() {
  half3 res = simd_broadcast_first(half3(1.0h));
  return res;
}

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

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

