#include <metal_stdlib>
using namespace metal;

struct modf_result_vec3_f16 {
  half3 fract;
  half3 whole;
};

struct VertexOutput {
  float4 pos;
};

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

void modf_45005f() {
  modf_result_vec3_f16 res = modf_result_vec3_f16{.fract=half3(-0.5h), .whole=half3(-1.0h)};
}

fragment void fragment_main() {
  modf_45005f();
}

kernel void compute_main() {
  modf_45005f();
}

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