#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  texture2d_array<uint, access::read_write> arg_0;
};

void textureStore_8cd841(tint_module_vars_struct tint_module_vars) {
  int2 arg_1 = int2(1);
  uint arg_2 = 1u;
  uint4 arg_3 = uint4(1u);
  uint const v = arg_2;
  uint4 const v_1 = arg_3;
  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
  const_cast<texture2d_array<uint, access::read_write>thread &>(tint_module_vars.arg_0).fence();
}

fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_8cd841(tint_module_vars);
}

kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_8cd841(tint_module_vars);
}
