#include <metal_stdlib>
using namespace metal;

struct frexp_result_vec2_f32 {
  float2 fract;
  int2 exp;
};

struct VertexOutput {
  float4 pos;
};

struct vertex_main_outputs {
  float4 VertexOutput_pos [[position]];
};

void frexp_eb2421() {
  float2 arg_0 = float2(1.0f);
  frexp_result_vec2_f32 v = {};
  v.fract = frexp(arg_0, v.exp);
  frexp_result_vec2_f32 res = v;
}

fragment void fragment_main() {
  frexp_eb2421();
}

kernel void compute_main() {
  frexp_eb2421();
}

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

vertex vertex_main_outputs vertex_main() {
  vertex_main_outputs tint_wrapper_result = {};
  tint_wrapper_result.VertexOutput_pos = vertex_main_inner().pos;
  return tint_wrapper_result;
}
