#include <metal_stdlib>

using namespace metal;
int4 subgroupBroadcastFirst_9dccee() {
  int4 res = simd_broadcast_first(int4(1));
  return res;
}

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

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

