#include <metal_stdlib>

using namespace metal;

struct frexp_result_vec3_f32 {
  float3 fract;
  int3 exp;
};
void frexp_bf45ae() {
  frexp_result_vec3_f32 res = frexp_result_vec3_f32{.fract=float3(0.5f), .exp=int3(1)};
}

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

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

struct VertexOutput {
  float4 pos;
};

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

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

