#include <metal_stdlib>

using namespace metal;
void textureStore_c2ca46(texture2d_array<int, access::write> tint_symbol) {
  uint2 arg_1 = uint2(1u);
  uint arg_2 = 1u;
  int4 arg_3 = int4(1);
  tint_symbol.write(arg_3, uint2(arg_1), arg_2);
}

fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_1 [[texture(0)]]) {
  textureStore_c2ca46(tint_symbol_1);
  return;
}

kernel void compute_main(texture2d_array<int, access::write> tint_symbol_2 [[texture(0)]]) {
  textureStore_c2ca46(tint_symbol_2);
  return;
}

