#include <metal_stdlib>

using namespace metal;
uint3 subgroupBroadcast_34ae44() {
  uint3 res = simd_broadcast(uint3(1u),ushort(1));
  return res;
}

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

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

