#include <metal_stdlib>

using namespace metal;
float4 subgroupShuffle_5dfeab() {
  float4 arg_0 = float4(1.0f);
  int arg_1 = 1;
  float4 res = simd_shuffle(arg_0,arg_1);
  return res;
}

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

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

