#include <metal_stdlib>

using namespace metal;
float textureSampleCompare_3a5923(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
  float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1.0f);
  return res;
}

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

