#include <metal_stdlib>

using namespace metal;
void textureStore_d3a22b(texture3d<uint, access::read_write> tint_symbol) {
  tint_symbol.write(uint4(1u), uint3(uint3(1u))); tint_symbol.fence();
}

fragment void fragment_main(texture3d<uint, access::read_write> tint_symbol_1 [[texture(0)]]) {
  textureStore_d3a22b(tint_symbol_1);
  return;
}

kernel void compute_main(texture3d<uint, access::read_write> tint_symbol_2 [[texture(0)]]) {
  textureStore_d3a22b(tint_symbol_2);
  return;
}

