#include <metal_stdlib>
using namespace metal;

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

void textureStore_2173fd(tint_module_vars_struct tint_module_vars) {
  uint arg_1 = 1u;
  uint4 arg_2 = uint4(1u);
  tint_module_vars.arg_0.write(arg_2, arg_1);
  const_cast<texture1d<uint, access::read_write>thread &>(tint_module_vars.arg_0).fence();
}

fragment void fragment_main(texture1d<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_2173fd(tint_module_vars);
}

kernel void compute_main(texture1d<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_2173fd(tint_module_vars);
}
