#include <metal_stdlib>

using namespace metal;
int3 quadBroadcast_704803() {
  int3 arg_0 = int3(1);
  int3 res = quad_broadcast(arg_0,1);
  return res;
}

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

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

