#include <metal_stdlib>

using namespace metal;
void inverseSqrt_f60c1c() {
  float2 res = float2(1.0f);
}

fragment void fragment_main() {
  inverseSqrt_f60c1c();
  return;
}

kernel void compute_main() {
  inverseSqrt_f60c1c();
  return;
}

struct VertexOutput {
  float4 pos;
};

struct tint_symbol {
  float4 pos [[position]];
};

VertexOutput vertex_main_inner() {
  VertexOutput out = {};
  out.pos = float4(0.0f);
  inverseSqrt_f60c1c();
  return out;
}

vertex tint_symbol vertex_main() {
  VertexOutput const inner_result = vertex_main_inner();
  tint_symbol wrapper_result = {};
  wrapper_result.pos = inner_result.pos;
  return wrapper_result;
}

