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

void smoothstep_6c4975(tint_module_vars_struct tint_module_vars) {
  float res = 0.5f;
  (*tint_module_vars.prevent_dce) = res;
}
float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
  smoothstep_6c4975(tint_module_vars);
  return float4(0.0f);
}
fragment void fragment_main(device float* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  smoothstep_6c4975(tint_module_vars);
}
kernel void compute_main(device float* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  smoothstep_6c4975(tint_module_vars);
}
vertex vertex_main_outputs vertex_main(device float* 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)};
}
