#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
  device half3* prevent_dce;
};
struct vertex_main_outputs {
  float4 tint_symbol [[position]];
};

void refract_8984af(tint_module_vars_struct tint_module_vars) {
  half3 res = half3(-5.0h);
  (*tint_module_vars.prevent_dce) = res;
}
float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
  refract_8984af(tint_module_vars);
  return float4(0.0f);
}
fragment void fragment_main(device half3* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  refract_8984af(tint_module_vars);
}
kernel void compute_main(device half3* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  refract_8984af(tint_module_vars);
}
vertex vertex_main_outputs vertex_main(device half3* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
}
