#include <metal_stdlib>

using namespace metal;
int4 textureLoad_d72de9(texture2d<int, access::read_write> tint_symbol) {
  int4 res = tint_symbol.read(uint2(int2(1)));
  return res;
}

fragment void fragment_main(device int4* tint_symbol_1 [[buffer(0)]], texture2d<int, access::read_write> tint_symbol_2 [[texture(0)]]) {
  *(tint_symbol_1) = textureLoad_d72de9(tint_symbol_2);
  return;
}

kernel void compute_main(device int4* tint_symbol_3 [[buffer(0)]], texture2d<int, access::read_write> tint_symbol_4 [[texture(0)]]) {
  *(tint_symbol_3) = textureLoad_d72de9(tint_symbol_4);
  return;
}

