#include <metal_stdlib>

using namespace metal;
int3 quadBroadcast_0e0e6e() {
  int3 res = quad_broadcast(int3(1),1u);
  return res;
}

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

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

