#include <metal_stdlib>
using namespace metal;

struct frexp_result_vec2_f16 {
  half2 fract;
  int2 exp;
};

struct VertexOutput {
  float4 pos;
};

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

void frexp_5f47bf() {
  frexp_result_vec2_f16 res = frexp_result_vec2_f16{.fract=half2(0.5h), .exp=int2(1)};
}

fragment void fragment_main() {
  frexp_5f47bf();
}

kernel void compute_main() {
  frexp_5f47bf();
}

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