#include <metal_stdlib>

using namespace metal;
float3 subgroupBroadcastFirst_5c6962() {
  float3 res = simd_broadcast_first(float3(1.0f));
  return res;
}

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

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

