#include <metal_stdlib>

using namespace metal;

struct modf_result_vec4_f16 {
  half4 fract;
  half4 whole;
};
modf_result_vec4_f16 tint_modf(half4 param_0) {
  modf_result_vec4_f16 result;
  result.fract = modf(param_0, result.whole);
  return result;
}

void modf_995934() {
  modf_result_vec4_f16 res = tint_modf(half4(1.0h));
}

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

float4 vertex_main_inner() {
  modf_995934();
  return float4(0.0f);
}

vertex tint_symbol vertex_main() {
  float4 const inner_result = vertex_main_inner();
  tint_symbol wrapper_result = {};
  wrapper_result.value = inner_result;
  return wrapper_result;
}

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

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

