#include <metal_stdlib>

using namespace metal;

struct frexp_result_vec2_f32 {
  float2 fract;
  int2 exp;
};
frexp_result_vec2_f32 tint_frexp(float2 param_0) {
  frexp_result_vec2_f32 result;
  result.fract = frexp(param_0, result.exp);
  return result;
}

kernel void tint_symbol() {
  float2 const runtime_in = float2(1.25f, 3.75f);
  frexp_result_vec2_f32 res = frexp_result_vec2_f32{.fract=float2(0.625f, 0.9375f), .exp=int2(1, 2)};
  res = tint_frexp(runtime_in);
  frexp_result_vec2_f32 const tint_symbol_1 = frexp_result_vec2_f32{.fract=float2(0.625f, 0.9375f), .exp=int2(1, 2)};
  res = tint_symbol_1;
  float2 const fract = res.fract;
  int2 const exp = res.exp;
  return;
}

