#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
  device uint4* prevent_dce;
};
struct VertexOutput {
  float4 pos;
  uint4 prevent_dce;
};
struct vertex_main_outputs {
  float4 VertexOutput_pos [[position]];
  uint4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
};

uint4 insertBits_51ede1() {
  uint4 arg_0 = uint4(1u);
  uint4 arg_1 = uint4(1u);
  uint arg_2 = 1u;
  uint arg_3 = 1u;
  uint4 const v = arg_0;
  uint4 const v_1 = arg_1;
  uint const v_2 = arg_3;
  uint const v_3 = min(arg_2, 32u);
  uint4 res = insert_bits(v, v_1, v_3, min(v_2, (32u - v_3)));
  return res;
}
fragment void fragment_main(device uint4* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  (*tint_module_vars.prevent_dce) = insertBits_51ede1();
}
kernel void compute_main(device uint4* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  (*tint_module_vars.prevent_dce) = insertBits_51ede1();
}
VertexOutput vertex_main_inner() {
  VertexOutput out = {};
  out.pos = float4(0.0f);
  out.prevent_dce = insertBits_51ede1();
  return out;
}
vertex vertex_main_outputs vertex_main() {
  VertexOutput const v_4 = vertex_main_inner();
  return vertex_main_outputs{.VertexOutput_pos=v_4.pos, .VertexOutput_prevent_dce=v_4.prevent_dce};
}
