#include <metal_stdlib>

using namespace metal;
float4 textureLoad_fd9606(texture2d_array<float, access::read_write> tint_symbol) {
  float4 res = tint_symbol.read(uint2(uint2(1u)), 1);
  return res;
}

fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]], texture2d_array<float, access::read_write> tint_symbol_2 [[texture(0)]]) {
  *(tint_symbol_1) = textureLoad_fd9606(tint_symbol_2);
  return;
}

kernel void compute_main(device float4* tint_symbol_3 [[buffer(0)]], texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
  *(tint_symbol_3) = textureLoad_fd9606(tint_symbol_4);
  return;
}

