#include <metal_stdlib>

using namespace metal;
void textureStore_bcc97a(texture2d<int, access::read_write> tint_symbol) {
  int2 arg_1 = int2(1);
  int4 arg_2 = int4(1);
  tint_symbol.write(arg_2, uint2(arg_1)); tint_symbol.fence();
}

fragment void fragment_main(texture2d<int, access::read_write> tint_symbol_1 [[texture(0)]]) {
  textureStore_bcc97a(tint_symbol_1);
  return;
}

kernel void compute_main(texture2d<int, access::read_write> tint_symbol_2 [[texture(0)]]) {
  textureStore_bcc97a(tint_symbol_2);
  return;
}

