#include <metal_stdlib>

using namespace metal;

struct frexp_result_vec2_f32 {
  float2 fract;
  int2 exp;
};
void frexp_6fb3ad() {
  frexp_result_vec2_f32 res = frexp_result_vec2_f32{.fract=float2(0.5f), .exp=int2(1)};
}

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

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

struct VertexOutput {
  float4 pos;
};

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

VertexOutput vertex_main_inner() {
  VertexOutput out = {};
  out.pos = float4(0.0f);
  frexp_6fb3ad();
  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;
}

