#include <metal_stdlib>

using namespace metal;
int4 subgroupBroadcastFirst_9dccee() {
  int4 arg_0 = int4(1);
  int4 res = simd_broadcast_first(arg_0);
  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;
}

