#include <metal_stdlib>

using namespace metal;
float4 textureLoad_99d8fa(texture3d<float, access::read_write> tint_symbol) {
  float4 res = tint_symbol.read(uint3(int3(1)));
  return res;
}

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

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

