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

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