#include <metal_stdlib>

using namespace metal;
int4 quadBroadcast_bed00b() {
  int4 arg_0 = int4(1);
  int4 res = quad_broadcast(arg_0,1u);
  return res;
}

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

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

