#include <metal_stdlib>
using namespace metal;

struct modf_result_vec3_f32 {
  float3 fract;
  float3 whole;
};

struct VertexOutput {
  float4 pos;
};

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

void modf_5ea256() {
  float3 arg_0 = float3(-1.5f);
  modf_result_vec3_f32 v = {};
  v.fract = modf(arg_0, v.whole);
  modf_result_vec3_f32 res = v;
}

fragment void fragment_main() {
  modf_5ea256();
}

kernel void compute_main() {
  modf_5ea256();
}

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