#include <metal_stdlib>

using namespace metal;
float textureSampleCompare_dd431d(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
  float2 arg_2 = float2(1.0f);
  int arg_3 = 1;
  float arg_4 = 1.0f;
  float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, max(0, arg_3), arg_4);
  return res;
}

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

