#include <metal_stdlib>
using namespace metal;

struct modf_result_vec4_f16 {
  half4 fract;
  half4 whole;
};

struct VertexOutput {
  float4 pos;
};

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

void modf_995934() {
  half4 arg_0 = half4(-1.5h);
  modf_result_vec4_f16 v = {};
  v.fract = modf(arg_0, v.whole);
  modf_result_vec4_f16 res = v;
}

fragment void fragment_main() {
  modf_995934();
}

kernel void compute_main() {
  modf_995934();
}

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