#include <metal_stdlib>

using namespace metal;
float4 textureSample_2149ec(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
  float3 arg_2 = float3(1.0f);
  float4 res = tint_symbol.sample(tint_symbol_1, arg_2, int3(1));
  return res;
}

fragment void fragment_main(device float4* tint_symbol_2 [[buffer(0)]], texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]]) {
  *(tint_symbol_2) = textureSample_2149ec(tint_symbol_3, tint_symbol_4);
  return;
}

