#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  texture3d<int, access::write> arg_0;
};

void textureStore_b706b1(tint_module_vars_struct tint_module_vars) {
  int3 arg_1 = int3(1);
  int4 arg_2 = int4(1);
  int4 const v = arg_2;
  tint_module_vars.arg_0.write(v, uint3(arg_1));
}

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

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