#include <metal_stdlib>
using namespace metal;

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

void textureStore_dde364(tint_module_vars_struct tint_module_vars) {
  int2 arg_1 = int2(1);
  int arg_2 = 1;
  uint4 arg_3 = uint4(1u);
  int const v = arg_2;
  uint4 const v_1 = arg_3;
  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
}

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

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