module name=sample_integrator_backward_cuda, target=x86-64-linux-avx-cuda-cuda_capability_35-f16c-profile-sse41 {
func sample_integrator_backward_cuda(samples, coordinates, projections, biases, nsize, d_output, d_samples, d_projections, d_biases)
{
register_destructor("halide_profiler_pipeline_end", halide_profiler_get_state())
allocate profiling_func_names[(void *) * 8]
profiling_func_names[3] = "tup_sample_reduced"
profiling_func_names[4] = "tup_image_reduce_intm_intm"
profiling_func_names[5] = "tup_image_reduce_intm"
profiling_func_names[2] = "tup_image_reduce"
profiling_func_names[0] = "overhead"
profiling_func_names[1] = "d_samples"
profiling_func_names[6] = "d_projections"
profiling_func_names[7] = "d_biases"
allocate profiling_func_stack_peak_buf[uint64 * 8]
profiling_func_stack_peak_buf[0] = (uint64)0
profiling_func_stack_peak_buf[1] = (uint64)0
profiling_func_stack_peak_buf[2] = (uint64)0
profiling_func_stack_peak_buf[3] = (uint64)0
profiling_func_stack_peak_buf[4] = (uint64)0
profiling_func_stack_peak_buf[5] = (uint64)512
profiling_func_stack_peak_buf[6] = (uint64)0
profiling_func_stack_peak_buf[7] = (uint64)0

let profiler_token = halide_profiler_pipeline_start("sample_integrator_backward_cuda", 8, profiling_func_names)

assert((0 <= profiler_token), profiler_token)

let profiler_state = halide_profiler_get_state()

let profiler_pipeline_state = halide_profiler_get_pipeline_state("sample_integrator_backward_cuda")

halide_profiler_incr_active_threads(profiler_state)
halide_profiler_stack_peak_update(profiler_pipeline_state, profiling_func_stack_peak_buf)
assert((reinterpret(samples.buffer) != (uint64)0), halide_error_buffer_argument_is_null("samples"))
assert((reinterpret(projections.buffer) != (uint64)0), halide_error_buffer_argument_is_null("projections"))
assert((reinterpret(d_samples.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_samples"))
assert((reinterpret(d_projections.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_projections"))
assert((reinterpret(d_output.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_output"))
assert((reinterpret(d_biases.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_biases"))
assert((reinterpret(coordinates.buffer) != (uint64)0), halide_error_buffer_argument_is_null("coordinates"))
assert((reinterpret(biases.buffer) != (uint64)0), halide_error_buffer_argument_is_null("biases"))

let biases = _halide_buffer_get_host(biases.buffer)

let biases.type.code = _halide_buffer_get_type_code(biases.buffer)

let biases.type.bits = _halide_buffer_get_type_bits(biases.buffer)

let biases.type.lanes = _halide_buffer_get_type_lanes(biases.buffer)

let biases.min.0 = _halide_buffer_get_min(biases.buffer, 0)

let biases.extent.0 = _halide_buffer_get_extent(biases.buffer, 0)

let biases.stride.0 = _halide_buffer_get_stride(biases.buffer, 0)

let coordinates = _halide_buffer_get_host(coordinates.buffer)

let coordinates.type.code = _halide_buffer_get_type_code(coordinates.buffer)

let coordinates.type.bits = _halide_buffer_get_type_bits(coordinates.buffer)

let coordinates.type.lanes = _halide_buffer_get_type_lanes(coordinates.buffer)

let coordinates.min.0 = _halide_buffer_get_min(coordinates.buffer, 0)

let coordinates.extent.0 = _halide_buffer_get_extent(coordinates.buffer, 0)

let coordinates.stride.0 = _halide_buffer_get_stride(coordinates.buffer, 0)

let coordinates.min.1 = _halide_buffer_get_min(coordinates.buffer, 1)

let coordinates.extent.1 = _halide_buffer_get_extent(coordinates.buffer, 1)

let coordinates.stride.1 = _halide_buffer_get_stride(coordinates.buffer, 1)

let coordinates.min.2 = _halide_buffer_get_min(coordinates.buffer, 2)

let coordinates.extent.2 = _halide_buffer_get_extent(coordinates.buffer, 2)

let coordinates.stride.2 = _halide_buffer_get_stride(coordinates.buffer, 2)

let coordinates.min.3 = _halide_buffer_get_min(coordinates.buffer, 3)

let coordinates.extent.3 = _halide_buffer_get_extent(coordinates.buffer, 3)

let coordinates.stride.3 = _halide_buffer_get_stride(coordinates.buffer, 3)

let coordinates.min.4 = _halide_buffer_get_min(coordinates.buffer, 4)

let coordinates.extent.4 = _halide_buffer_get_extent(coordinates.buffer, 4)

let coordinates.stride.4 = _halide_buffer_get_stride(coordinates.buffer, 4)

let d_biases = _halide_buffer_get_host(d_biases.buffer)

let d_biases.type.code = _halide_buffer_get_type_code(d_biases.buffer)

let d_biases.type.bits = _halide_buffer_get_type_bits(d_biases.buffer)

let d_biases.type.lanes = _halide_buffer_get_type_lanes(d_biases.buffer)

let d_biases.min.0 = _halide_buffer_get_min(d_biases.buffer, 0)

let d_biases.extent.0 = _halide_buffer_get_extent(d_biases.buffer, 0)

let d_biases.stride.0 = _halide_buffer_get_stride(d_biases.buffer, 0)

let d_output = _halide_buffer_get_host(d_output.buffer)

let d_output.type.code = _halide_buffer_get_type_code(d_output.buffer)

let d_output.type.bits = _halide_buffer_get_type_bits(d_output.buffer)

let d_output.type.lanes = _halide_buffer_get_type_lanes(d_output.buffer)

let d_output.min.0 = _halide_buffer_get_min(d_output.buffer, 0)

let d_output.extent.0 = _halide_buffer_get_extent(d_output.buffer, 0)

let d_output.stride.0 = _halide_buffer_get_stride(d_output.buffer, 0)

let d_output.min.1 = _halide_buffer_get_min(d_output.buffer, 1)

let d_output.extent.1 = _halide_buffer_get_extent(d_output.buffer, 1)

let d_output.stride.1 = _halide_buffer_get_stride(d_output.buffer, 1)

let d_output.min.2 = _halide_buffer_get_min(d_output.buffer, 2)

let d_output.extent.2 = _halide_buffer_get_extent(d_output.buffer, 2)

let d_output.stride.2 = _halide_buffer_get_stride(d_output.buffer, 2)

let d_output.min.3 = _halide_buffer_get_min(d_output.buffer, 3)

let d_output.extent.3 = _halide_buffer_get_extent(d_output.buffer, 3)

let d_output.stride.3 = _halide_buffer_get_stride(d_output.buffer, 3)

let d_projections = _halide_buffer_get_host(d_projections.buffer)

let d_projections.type.code = _halide_buffer_get_type_code(d_projections.buffer)

let d_projections.type.bits = _halide_buffer_get_type_bits(d_projections.buffer)

let d_projections.type.lanes = _halide_buffer_get_type_lanes(d_projections.buffer)

let d_projections.min.0 = _halide_buffer_get_min(d_projections.buffer, 0)

let d_projections.extent.0 = _halide_buffer_get_extent(d_projections.buffer, 0)

let d_projections.stride.0 = _halide_buffer_get_stride(d_projections.buffer, 0)

let d_projections.min.1 = _halide_buffer_get_min(d_projections.buffer, 1)

let d_projections.extent.1 = _halide_buffer_get_extent(d_projections.buffer, 1)

let d_projections.stride.1 = _halide_buffer_get_stride(d_projections.buffer, 1)

let d_samples = _halide_buffer_get_host(d_samples.buffer)

let d_samples.type.code = _halide_buffer_get_type_code(d_samples.buffer)

let d_samples.type.bits = _halide_buffer_get_type_bits(d_samples.buffer)

let d_samples.type.lanes = _halide_buffer_get_type_lanes(d_samples.buffer)

let d_samples.min.0 = _halide_buffer_get_min(d_samples.buffer, 0)

let d_samples.extent.0 = _halide_buffer_get_extent(d_samples.buffer, 0)

let d_samples.stride.0 = _halide_buffer_get_stride(d_samples.buffer, 0)

let d_samples.min.1 = _halide_buffer_get_min(d_samples.buffer, 1)

let d_samples.extent.1 = _halide_buffer_get_extent(d_samples.buffer, 1)

let d_samples.stride.1 = _halide_buffer_get_stride(d_samples.buffer, 1)

let d_samples.min.2 = _halide_buffer_get_min(d_samples.buffer, 2)

let d_samples.extent.2 = _halide_buffer_get_extent(d_samples.buffer, 2)

let d_samples.stride.2 = _halide_buffer_get_stride(d_samples.buffer, 2)

let d_samples.min.3 = _halide_buffer_get_min(d_samples.buffer, 3)

let d_samples.extent.3 = _halide_buffer_get_extent(d_samples.buffer, 3)

let d_samples.stride.3 = _halide_buffer_get_stride(d_samples.buffer, 3)

let d_samples.min.4 = _halide_buffer_get_min(d_samples.buffer, 4)

let d_samples.extent.4 = _halide_buffer_get_extent(d_samples.buffer, 4)

let d_samples.stride.4 = _halide_buffer_get_stride(d_samples.buffer, 4)

let projections = _halide_buffer_get_host(projections.buffer)

let projections.type.code = _halide_buffer_get_type_code(projections.buffer)

let projections.type.bits = _halide_buffer_get_type_bits(projections.buffer)

let projections.type.lanes = _halide_buffer_get_type_lanes(projections.buffer)

let projections.min.0 = _halide_buffer_get_min(projections.buffer, 0)

let projections.extent.0 = _halide_buffer_get_extent(projections.buffer, 0)

let projections.stride.0 = _halide_buffer_get_stride(projections.buffer, 0)

let projections.min.1 = _halide_buffer_get_min(projections.buffer, 1)

let projections.extent.1 = _halide_buffer_get_extent(projections.buffer, 1)

let projections.stride.1 = _halide_buffer_get_stride(projections.buffer, 1)

let samples = _halide_buffer_get_host(samples.buffer)

let samples.type.code = _halide_buffer_get_type_code(samples.buffer)

let samples.type.bits = _halide_buffer_get_type_bits(samples.buffer)

let samples.type.lanes = _halide_buffer_get_type_lanes(samples.buffer)

let samples.min.0 = _halide_buffer_get_min(samples.buffer, 0)

let samples.extent.0 = _halide_buffer_get_extent(samples.buffer, 0)

let samples.stride.0 = _halide_buffer_get_stride(samples.buffer, 0)

let samples.min.1 = _halide_buffer_get_min(samples.buffer, 1)

let samples.extent.1 = _halide_buffer_get_extent(samples.buffer, 1)

let samples.stride.1 = _halide_buffer_get_stride(samples.buffer, 1)

let samples.min.2 = _halide_buffer_get_min(samples.buffer, 2)

let samples.extent.2 = _halide_buffer_get_extent(samples.buffer, 2)

let samples.stride.2 = _halide_buffer_get_stride(samples.buffer, 2)

let samples.min.3 = _halide_buffer_get_min(samples.buffer, 3)

let samples.extent.3 = _halide_buffer_get_extent(samples.buffer, 3)

let samples.stride.3 = _halide_buffer_get_stride(samples.buffer, 3)

let samples.min.4 = _halide_buffer_get_min(samples.buffer, 4)

let samples.extent.4 = _halide_buffer_get_extent(samples.buffer, 4)

let samples.stride.4 = _halide_buffer_get_stride(samples.buffer, 4)

let tup_image_reduce.s1.k.max.s = max((d_biases.min.0 + d_biases.extent.0), (d_projections.min.1 + d_projections.extent.1))

let tup_image_reduce.s1.k.min = min(d_biases.min.0, d_projections.min.1)

let tup_image_reduce_intm.s1.r2$x.r2$x.r2$x.r2$x.max.s = (samples.extent.4 * (samples.extent.2 * samples.extent.1))

let tup_sample_reduced.s1.n.max = (((((tup_image_reduce_intm.s1.r2$x.r2$x.r2$x.r2$x.max.s + -1) / 64) * 64) + 63) / max((samples.extent.2 * samples.extent.1), 1))

let tup_sample_reduced.s1.y.max = ((int32(abs(max((samples.extent.2 * samples.extent.1), 1))) + -1) / max(samples.extent.1, 1))

let tup_sample_reduced.s1.x.max.s = int32(abs(max(samples.extent.1, 1)))

let projected_coord.s1.n.max = max(((d_samples.min.4 + d_samples.extent.4) + -1), tup_sample_reduced.s1.n.max)

let projected_coord.s1.k.max.s = max(biases.extent.0, tup_image_reduce.s1.k.max.s)

let projected_coord.s1.y.max = max((((d_samples.min.2 + d_samples.extent.2) - ((0 - nsize) / 2)) + -2), tup_sample_reduced.s1.y.max)

let projected_coord.s1.y.min.s = (d_samples.min.2 - (nsize / 2))

let projected_coord.s1.x.max = max((((d_samples.min.1 + d_samples.extent.1) - ((0 - nsize) / 2)) + -2), (tup_sample_reduced.s1.x.max.s + -1))

let projected_coord.s1.x.min.s = (d_samples.min.1 - (nsize / 2))

let projected_coord.s1.s.max.s = max((d_samples.min.0 + d_samples.extent.0), samples.extent.0)

let biases.extent.0.required.s = (let t5719 = (projected_coord.s1.n.max - min(d_samples.min.4, 0)) in ((int32(abs(max(((t5719 + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))), 1))) + -1) / max((t5719 + 1), 1)))

let coordinates.extent.0.required.s = (let t5720 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5721.s = (((((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))) * ((projected_coord.s1.y.max - min(projected_coord.s1.y.min.s, 0)) + 1)) * ((projected_coord.s1.x.max - min(projected_coord.s1.x.min.s, 0)) + 1)) in (let t5723 = (((((t5721.s * t5720) * t5720) * (projected_coord.s1.s.max.s - min(d_samples.min.0, 0))) + -1) / max(((t5721.s * t5720) * t5720), 1)) in (max(max(min((min(d_samples.min.0, 0) + max(t5723, 0)), ((coordinates.min.0 + coordinates.extent.0) + -1)), (min(samples.extent.0, (coordinates.min.0 + coordinates.extent.0)) + -1)), coordinates.min.0) - max(min(min((min(t5723, 0) + min(d_samples.min.0, 0)), ((coordinates.min.0 + coordinates.extent.0) + -1)), 0), coordinates.min.0)))))

let coordinates.min.0.required = (let t5725 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5726.s = (((((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))) * ((projected_coord.s1.y.max - min(projected_coord.s1.y.min.s, 0)) + 1)) * ((projected_coord.s1.x.max - min(projected_coord.s1.x.min.s, 0)) + 1)) in max(min(min((min((((((t5726.s * t5725) * t5725) * (projected_coord.s1.s.max.s - min(d_samples.min.0, 0))) + -1) / max(((t5726.s * t5725) * t5725), 1)), 0) + min(d_samples.min.0, 0)), ((coordinates.min.0 + coordinates.extent.0) + -1)), 0), coordinates.min.0)))

let coordinates.extent.1.required.s = (let t5729 = ((((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))) * ((projected_coord.s1.y.max - min(projected_coord.s1.y.min.s, 0)) + 1)) in (let t5731 = (t5729 * ((projected_coord.s1.x.max - min(projected_coord.s1.x.min.s, 0)) + 1)) in (let t5732 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5734 = ((int32(abs(max(((t5731 * t5732) * t5732), 1))) + -1) / max((t5731 * t5732), 1)) in (max(max(min((((max(t5734, 0) + (min(projected_coord.s1.x.min.s, 0) + ((int32(abs(max(t5731, 1))) + -1) / max(t5729, 1)))) + ((0 - nsize) / 2)) + 1), ((coordinates.min.1 + coordinates.extent.1) + -1)), (min((int32(abs(max(tup_sample_reduced.s1.x.max.s, 1))) + (nsize / 2)), (coordinates.min.1 + coordinates.extent.1)) + -1)), coordinates.min.1) - max(min((min(((0 - nsize) / 2), ((min(projected_coord.s1.x.min.s, 0) + min(t5734, 0)) + ((0 - nsize) / 2))) + 1), ((coordinates.min.1 + coordinates.extent.1) + -1)), coordinates.min.1))))))

let coordinates.min.1.required = (let t5736 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5738.s = (((((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))) * ((projected_coord.s1.y.max - min(projected_coord.s1.y.min.s, 0)) + 1)) * ((projected_coord.s1.x.max - min(projected_coord.s1.x.min.s, 0)) + 1)) in max(min((min(((0 - nsize) / 2), ((min(projected_coord.s1.x.min.s, 0) + min(((int32(abs(max(((t5738.s * t5736) * t5736), 1))) + -1) / max((t5738.s * t5736), 1)), 0)) + ((0 - nsize) / 2))) + 1), ((coordinates.min.1 + coordinates.extent.1) + -1)), coordinates.min.1)))

let coordinates.extent.2.required.s = (let t5740 = (((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1) * (projected_coord.s1.k.max.s - min(tup_image_reduce.s1.k.min, 0))) in (let t5742 = (t5740 * ((projected_coord.s1.y.max - min(projected_coord.s1.y.min.s, 0)) + 1)) in (let t5743 = (t5742 * ((projected_coord.s1.x.max - min(projected_coord.s1.x.min.s, 0)) + 1)) in (max(min(max((((int32(abs(max((tup_sample_reduced.s1.x.max.s * (tup_sample_reduced.s1.y.max + 1)), 1))) + -1) / max(tup_sample_reduced.s1.x.max.s, 1)) + (nsize / 2)), ((((min(projected_coord.s1.y.min.s, 0) + ((int32(abs(max(t5742, 1))) + -1) / max(t5740, 1))) + ((int32(abs(max((t5743 * ((nsize / 2) - ((0 - nsize) / 2))), 1))) + -1) / max(t5743, 1))) + ((0 - nsize) / 2)) + 1)), ((coordinates.min.2 + coordinates.extent.2) + -1)), coordinates.min.2) - max(min((min((min(projected_coord.s1.y.min.s, 0) + ((0 - nsize) / 2)), ((0 - nsize) / 2)) + 1), ((coordinates.min.2 + coordinates.extent.2) + -1)), coordinates.min.2)))))

let coordinates.min.2.required = max(min((min((min(projected_coord.s1.y.min.s, 0) + ((0 - nsize) / 2)), ((0 - nsize) / 2)) + 1), ((coordinates.min.2 + coordinates.extent.2) + -1)), coordinates.min.2)

let coordinates.stride.2.required = ((coordinates.extent.0.required.s + 1) * (coordinates.extent.1.required.s + 1))

let coordinates.extent.3.required.s = (let t5745 = ((tup_sample_reduced.s1.x.max.s * (tup_sample_reduced.s1.y.max + 1)) * (tup_sample_reduced.s1.n.max + 1)) in (max(min(max((coordinates.extent.3 + -1), (min(d_projections.min.0, 0) + (((((((t5745 * ((tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min) * ((max(((d_projections.min.0 + d_projections.extent.0) + -1), 0) - min(d_projections.min.0, 0)) + 1))) + -1) / 8) * 8) + 7) / max(t5745, 1)) / max((tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min), 1)))), ((coordinates.min.3 + coordinates.extent.3) + -1)), coordinates.min.3) - max(min(min(d_projections.min.0, ((coordinates.min.3 + coordinates.extent.3) + -1)), 0), coordinates.min.3)))

let coordinates.min.3.required = max(min(min(d_projections.min.0, ((coordinates.min.3 + coordinates.extent.3) + -1)), 0), coordinates.min.3)

let coordinates.stride.3.required = (coordinates.stride.2.required * (coordinates.extent.2.required.s + 1))

let coordinates.extent.4.required.s = (let t5749 = (tup_sample_reduced.s1.x.max.s * (tup_sample_reduced.s1.y.max + 1)) in (max(max(min(((int32(abs(max((t5749 * (tup_sample_reduced.s1.n.max + 1)), 1))) + -1) / max(t5749, 1)), ((coordinates.min.4 + coordinates.extent.4) + -1)), (min((min(d_samples.min.4, 0) + int32(abs(max(((projected_coord.s1.n.max - min(d_samples.min.4, 0)) + 1), 1)))), (coordinates.min.4 + coordinates.extent.4)) + -1)), coordinates.min.4) - max(min(min(d_samples.min.4, ((coordinates.min.4 + coordinates.extent.4) + -1)), 0), coordinates.min.4)))

let coordinates.min.4.required = max(min(min(d_samples.min.4, ((coordinates.min.4 + coordinates.extent.4) + -1)), 0), coordinates.min.4)

let coordinates.stride.4.required = (coordinates.stride.3.required * (coordinates.extent.3.required.s + 1))

let d_output.extent.0.required.s = (let t5752 = (((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) * (tup_sample_reduced.s1.y.max + 1)) in (max(max(min(((int32(abs(max((t5752 * tup_sample_reduced.s1.x.max.s), 1))) + -1) / max(t5752, 1)), ((d_output.min.0 + d_output.extent.0) + -1)), (min(((((((((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -1) / 8) * 8) + 7) / max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1)) + d_samples.min.1) - ((0 - nsize) / 2)), (d_output.min.0 + d_output.extent.0)) + -1)), d_output.min.0) - max(min(min(projected_coord.s1.x.min.s, ((d_output.min.0 + d_output.extent.0) + -1)), 0), d_output.min.0)))

let d_output.min.0.required = max(min(min(projected_coord.s1.x.min.s, ((d_output.min.0 + d_output.extent.0) + -1)), 0), d_output.min.0)

let d_output.extent.1.required.s = (let t5755 = ((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) in (max(max(min(((int32(abs(max((t5755 * (tup_sample_reduced.s1.y.max + 1)), 1))) + -1) / max(t5755, 1)), ((d_output.min.1 + d_output.extent.1) + -1)), (min(((((int32(abs(max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1))) + -1) / max((d_samples.extent.4 * d_samples.extent.3), 1)) + d_samples.min.2) - ((0 - nsize) / 2)), (d_output.min.1 + d_output.extent.1)) + -1)), d_output.min.1) - max(min(min(projected_coord.s1.y.min.s, ((d_output.min.1 + d_output.extent.1) + -1)), 0), d_output.min.1)))

let d_output.min.1.required = max(min(min(projected_coord.s1.y.min.s, ((d_output.min.1 + d_output.extent.1) + -1)), 0), d_output.min.1)

let d_output.extent.2.required.s = (let t5758 = (samples.extent.3 < 0) in (let t5760.s = ((int32(abs(max(((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)), 1))) + -1) / max((tup_sample_reduced.s1.n.max + 1), 1)) in (max(max(min(((((int32(abs(max((d_samples.extent.4 * d_samples.extent.3), 1))) + -1) / max(d_samples.extent.4, 1)) + d_samples.min.3) + (select(t5758, 0, (biases.extent.0 + -1)) * samples.extent.3)), ((d_output.min.2 + d_output.extent.2) + -1)), (min(((select(t5758, tup_image_reduce.s1.k.min, (t5760.s + tup_image_reduce.s1.k.min)) + 1) * samples.extent.3), (d_output.min.2 + d_output.extent.2)) + -1)), d_output.min.2) - max(min(min((select(t5758, (t5760.s + tup_image_reduce.s1.k.min), tup_image_reduce.s1.k.min) * samples.extent.3), (d_samples.min.3 + (select(t5758, (biases.extent.0 + -1), 0) * samples.extent.3))), ((d_output.min.2 + d_output.extent.2) + -1)), d_output.min.2))))

let d_output.min.2.required = (let t5761 = (samples.extent.3 < 0) in max(min(min((select(t5761, (((int32(abs(max(((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)), 1))) + -1) / max((tup_sample_reduced.s1.n.max + 1), 1)) + tup_image_reduce.s1.k.min), tup_image_reduce.s1.k.min) * samples.extent.3), (d_samples.min.3 + (select(t5761, (biases.extent.0 + -1), 0) * samples.extent.3))), ((d_output.min.2 + d_output.extent.2) + -1)), d_output.min.2))

let d_output.stride.2.required = ((d_output.extent.0.required.s + 1) * (d_output.extent.1.required.s + 1))

let d_output.extent.3.required = (max(min(max((int32(abs(max(d_samples.extent.4, 1))) + d_samples.min.4), int32(abs(max((tup_sample_reduced.s1.n.max + 1), 1)))), (d_output.min.3 + d_output.extent.3)), (d_output.min.3 + 1)) - max(min(min(d_samples.min.4, ((d_output.min.3 + d_output.extent.3) + -1)), 0), d_output.min.3))

let d_output.min.3.required = max(min(min(d_samples.min.4, ((d_output.min.3 + d_output.extent.3) + -1)), 0), d_output.min.3)

let d_output.stride.3.required = (d_output.stride.2.required * (d_output.extent.2.required.s + 1))

let d_samples.extent.1.required.s = ((max(((min(((((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -1) / 8) * 8), ((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -8)) + 7) / max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1)), ((((((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -1) / 8) * 8) + 7) / max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1))) + d_samples.min.1) - min(((min(((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -8), 0) / max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1)) + d_samples.min.1), d_samples.min.1))

let d_samples.min.1.required = min(((min(((((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2) * d_samples.extent.1) + -8), 0) / max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1)) + d_samples.min.1), d_samples.min.1)

let d_samples.extent.2.required.s = (((int32(abs(max(((d_samples.extent.4 * d_samples.extent.3) * d_samples.extent.2), 1))) + -1) / max((d_samples.extent.4 * d_samples.extent.3), 1)) + d_samples.min.2)

let d_samples.stride.2.required = (d_samples.extent.0 * (d_samples.extent.1.required.s + 1))

let d_samples.extent.3.required.s = ((int32(abs(max((d_samples.extent.4 * d_samples.extent.3), 1))) + -1) / max(d_samples.extent.4, 1))

let d_samples.stride.3.required = (d_samples.stride.2.required * ((d_samples.extent.2.required.s - d_samples.min.2) + 1))

let d_samples.extent.4.required = int32(abs(max(d_samples.extent.4, 1)))

let d_samples.stride.4.required = (d_samples.stride.3.required * (d_samples.extent.3.required.s + 1))

let samples.extent.0.required.s = (let t5768 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5769.s = (((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) * (tup_sample_reduced.s1.y.max + 1)) in (let t5770 = ((((((t5769.s * tup_sample_reduced.s1.x.max.s) * t5768) * t5768) * samples.extent.0) + -1) / max((((t5769.s * tup_sample_reduced.s1.x.max.s) * t5768) * t5768), 1)) in (max(min(max(t5770, 0), ((samples.min.0 + samples.extent.0) + -1)), samples.min.0) - max(min(min(t5770, ((samples.min.0 + samples.extent.0) + -1)), 0), samples.min.0)))))

let samples.min.0.required = (let t5772 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5773.s = (((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) * (tup_sample_reduced.s1.y.max + 1)) in max(min(min(((((((t5773.s * tup_sample_reduced.s1.x.max.s) * t5772) * t5772) * samples.extent.0) + -1) / max((((t5773.s * tup_sample_reduced.s1.x.max.s) * t5772) * t5772), 1)), ((samples.min.0 + samples.extent.0) + -1)), 0), samples.min.0)))

let samples.extent.1.required.s = (let t5774 = (((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) * (tup_sample_reduced.s1.y.max + 1)) in (let t5775 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5778 = ((int32(abs(max((((t5774 * tup_sample_reduced.s1.x.max.s) * t5775) * t5775), 1))) + -1) / max(((t5774 * tup_sample_reduced.s1.x.max.s) * t5775), 1)) in (max(min((((max(t5778, 0) + ((int32(abs(max((t5774 * tup_sample_reduced.s1.x.max.s), 1))) + -1) / max(t5774, 1))) + ((0 - nsize) / 2)) + 1), ((samples.min.1 + samples.extent.1) + -1)), samples.min.1) - max(min(((min(t5778, 0) + ((0 - nsize) / 2)) + 1), ((samples.min.1 + samples.extent.1) + -1)), samples.min.1)))))

let samples.min.1.required = (let t5780 = ((nsize / 2) - ((0 - nsize) / 2)) in (let t5781.s = (((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) * (tup_sample_reduced.s1.y.max + 1)) in max(min(((min(((int32(abs(max((((t5781.s * tup_sample_reduced.s1.x.max.s) * t5780) * t5780), 1))) + -1) / max(((t5781.s * tup_sample_reduced.s1.x.max.s) * t5780), 1)), 0) + ((0 - nsize) / 2)) + 1), ((samples.min.1 + samples.extent.1) + -1)), samples.min.1)))

let samples.extent.2.required.s = (let t5782 = ((tup_sample_reduced.s1.n.max + 1) * (tup_image_reduce.s1.k.max.s - tup_image_reduce.s1.k.min)) in (let t5783 = (t5782 * (tup_sample_reduced.s1.y.max + 1)) in (max(min((((((int32(abs(max(t5783, 1))) + -1) / max(t5782, 1)) + ((int32(abs(max(((t5783 * tup_sample_reduced.s1.x.max.s) * ((nsize / 2) - ((0 - nsize) / 2))), 1))) + -1) / max((t5783 * tup_sample_reduced.s1.x.max.s), 1))) + ((0 - nsize) / 2)) + 1), ((samples.min.2 + samples.extent.2) + -1)), samples.min.2) - max(min((((0 - nsize) / 2) + 1), ((samples.min.2 + samples.extent.2) + -1)), samples.min.2))))

let samples.min.2.required = max(min((((0 - nsize) / 2) + 1), ((samples.min.2 + samples.extent.2) + -1)), samples.min.2)

let samples.stride.2.required = ((samples.extent.0.required.s + 1) * (samples.extent.1.required.s + 1))

let samples.extent.3.required.s = (max((min(samples.extent.3, (samples.min.3 + samples.extent.3)) + -1), samples.min.3) - max(min(((samples.min.3 + samples.extent.3) + -1), 0), samples.min.3))

let samples.min.3.required = max(min(((samples.min.3 + samples.extent.3) + -1), 0), samples.min.3)

let samples.stride.3.required = (samples.stride.2.required * (samples.extent.2.required.s + 1))

let samples.extent.4.required = (max(min(int32(abs(max((tup_sample_reduced.s1.n.max + 1), 1))), (samples.min.4 + samples.extent.4)), (samples.min.4 + 1)) - max(min(((samples.min.4 + samples.extent.4) + -1), 0), samples.min.4))

let samples.min.4.required = max(min(((samples.min.4 + samples.extent.4) + -1), 0), samples.min.4)

let samples.stride.4.required = (samples.stride.3.required * (samples.extent.3.required.s + 1))

if (_halide_buffer_is_bounds_query(biases.buffer))
{
_halide_buffer_init(biases.buffer, _halide_buffer_get_shape(biases.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 1, make_struct(min(tup_image_reduce.s1.k.min, 0), (biases.extent.0.required.s + 1), 1, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(coordinates.buffer))
{
_halide_buffer_init(coordinates.buffer, _halide_buffer_get_shape(coordinates.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 5, make_struct(coordinates.min.0.required, (coordinates.extent.0.required.s + 1), 1, 0, coordinates.min.1.required, (coordinates.extent.1.required.s + 1), (coordinates.extent.0.required.s + 1), 0, coordinates.min.2.required, (coordinates.extent.2.required.s + 1), coordinates.stride.2.required, 0, coordinates.min.3.required, (coordinates.extent.3.required.s + 1), coordinates.stride.3.required, 0, coordinates.min.4.required, (coordinates.extent.4.required.s + 1), coordinates.stride.4.required, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_biases.buffer))
{
_halide_buffer_init(d_biases.buffer, _halide_buffer_get_shape(d_biases.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 1, make_struct(d_biases.min.0, d_biases.extent.0, 1, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_output.buffer))
{
_halide_buffer_init(d_output.buffer, _halide_buffer_get_shape(d_output.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 4, make_struct(d_output.min.0.required, (d_output.extent.0.required.s + 1), 1, 0, d_output.min.1.required, (d_output.extent.1.required.s + 1), (d_output.extent.0.required.s + 1), 0, d_output.min.2.required, (d_output.extent.2.required.s + 1), d_output.stride.2.required, 0, d_output.min.3.required, d_output.extent.3.required, d_output.stride.3.required, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_projections.buffer))
{
_halide_buffer_init(d_projections.buffer, _halide_buffer_get_shape(d_projections.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 2, make_struct(d_projections.min.0, d_projections.extent.0, 1, 0, d_projections.min.1, d_projections.extent.1, d_projections.extent.0, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_samples.buffer))
{
_halide_buffer_init(d_samples.buffer, _halide_buffer_get_shape(d_samples.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 5, make_struct(d_samples.min.0, d_samples.extent.0, 1, 0, d_samples.min.1.required, (d_samples.extent.1.required.s + 1), d_samples.extent.0, 0, d_samples.min.2, ((d_samples.extent.2.required.s - d_samples.min.2) + 1), d_samples.stride.2.required, 0, d_samples.min.3, (d_samples.extent.3.required.s + 1), d_samples.stride.3.required, 0, d_samples.min.4, d_samples.extent.4.required, d_samples.stride.4.required, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(projections.buffer))
{
_halide_buffer_init(projections.buffer, _halide_buffer_get_shape(projections.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 2, make_struct(0, coordinates.extent.3, 1, 0, min(tup_image_reduce.s1.k.min, 0), (biases.extent.0.required.s + 1), coordinates.extent.3, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(samples.buffer))
{
_halide_buffer_init(samples.buffer, _halide_buffer_get_shape(samples.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 5, make_struct(samples.min.0.required, (samples.extent.0.required.s + 1), 1, 0, samples.min.1.required, (samples.extent.1.required.s + 1), (samples.extent.0.required.s + 1), 0, samples.min.2.required, (samples.extent.2.required.s + 1), samples.stride.2.required, 0, samples.min.3.required, (samples.extent.3.required.s + 1), samples.stride.3.required, 0, samples.min.4.required, samples.extent.4.required, samples.stride.4.required, 0), (uint64)0)
}
if (!(((((((_halide_buffer_is_bounds_query(biases.buffer) || _halide_buffer_is_bounds_query(coordinates.buffer)) || _halide_buffer_is_bounds_query(d_biases.buffer)) || _halide_buffer_is_bounds_query(d_output.buffer)) || _halide_buffer_is_bounds_query(d_projections.buffer)) || _halide_buffer_is_bounds_query(d_samples.buffer)) || _halide_buffer_is_bounds_query(projections.buffer)) || _halide_buffer_is_bounds_query(samples.buffer)))
{
assert((((biases.type.code == (uint8)2) && (biases.type.bits == (uint8)32)) && (biases.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer biases", biases.type.code, (uint8)2, biases.type.bits, (uint8)32, biases.type.lanes, (uint16)1))
assert((((coordinates.type.code == (uint8)2) && (coordinates.type.bits == (uint8)32)) && (coordinates.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer coordinates", coordinates.type.code, (uint8)2, coordinates.type.bits, (uint8)32, coordinates.type.lanes, (uint16)1))
assert((((d_biases.type.code == (uint8)2) && (d_biases.type.bits == (uint8)32)) && (d_biases.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_biases", d_biases.type.code, (uint8)2, d_biases.type.bits, (uint8)32, d_biases.type.lanes, (uint16)1))
assert((((d_output.type.code == (uint8)2) && (d_output.type.bits == (uint8)32)) && (d_output.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer d_output", d_output.type.code, (uint8)2, d_output.type.bits, (uint8)32, d_output.type.lanes, (uint16)1))
assert((((d_projections.type.code == (uint8)2) && (d_projections.type.bits == (uint8)32)) && (d_projections.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_projections", d_projections.type.code, (uint8)2, d_projections.type.bits, (uint8)32, d_projections.type.lanes, (uint16)1))
assert((((d_samples.type.code == (uint8)2) && (d_samples.type.bits == (uint8)32)) && (d_samples.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_samples", d_samples.type.code, (uint8)2, d_samples.type.bits, (uint8)32, d_samples.type.lanes, (uint16)1))
assert((((projections.type.code == (uint8)2) && (projections.type.bits == (uint8)32)) && (projections.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer projections", projections.type.code, (uint8)2, projections.type.bits, (uint8)32, projections.type.lanes, (uint16)1))
assert((((samples.type.code == (uint8)2) && (samples.type.bits == (uint8)32)) && (samples.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer samples", samples.type.code, (uint8)2, samples.type.bits, (uint8)32, samples.type.lanes, (uint16)1))
assert(((biases.min.0 <= min(tup_image_reduce.s1.k.min, 0)) && ((((min(tup_image_reduce.s1.k.min, 0) + biases.extent.0.required.s) - biases.extent.0) + 1) <= biases.min.0)), halide_error_access_out_of_bounds("Input buffer biases", 0, min(tup_image_reduce.s1.k.min, 0), (min(tup_image_reduce.s1.k.min, 0) + biases.extent.0.required.s), biases.min.0, ((biases.min.0 + biases.extent.0) + -1)))
assert((0 <= biases.extent.0), halide_error_buffer_extents_negative("Input buffer biases", 0, biases.extent.0))
assert(((coordinates.min.0 <= coordinates.min.0.required) && ((((coordinates.min.0.required + coordinates.extent.0.required.s) - coordinates.extent.0) + 1) <= coordinates.min.0)), halide_error_access_out_of_bounds("Input buffer coordinates", 0, coordinates.min.0.required, (coordinates.min.0.required + coordinates.extent.0.required.s), coordinates.min.0, ((coordinates.min.0 + coordinates.extent.0) + -1)))
assert((0 <= coordinates.extent.0), halide_error_buffer_extents_negative("Input buffer coordinates", 0, coordinates.extent.0))
assert(((coordinates.min.1 <= coordinates.min.1.required) && ((((coordinates.min.1.required + coordinates.extent.1.required.s) - coordinates.extent.1) + 1) <= coordinates.min.1)), halide_error_access_out_of_bounds("Input buffer coordinates", 1, coordinates.min.1.required, (coordinates.min.1.required + coordinates.extent.1.required.s), coordinates.min.1, ((coordinates.min.1 + coordinates.extent.1) + -1)))
assert((0 <= coordinates.extent.1), halide_error_buffer_extents_negative("Input buffer coordinates", 1, coordinates.extent.1))
assert(((coordinates.min.2 <= coordinates.min.2.required) && ((((coordinates.min.2.required + coordinates.extent.2.required.s) - coordinates.extent.2) + 1) <= coordinates.min.2)), halide_error_access_out_of_bounds("Input buffer coordinates", 2, coordinates.min.2.required, (coordinates.min.2.required + coordinates.extent.2.required.s), coordinates.min.2, ((coordinates.min.2 + coordinates.extent.2) + -1)))
assert((0 <= coordinates.extent.2), halide_error_buffer_extents_negative("Input buffer coordinates", 2, coordinates.extent.2))
assert(((coordinates.min.3 <= coordinates.min.3.required) && ((((coordinates.min.3.required + coordinates.extent.3.required.s) - coordinates.extent.3) + 1) <= coordinates.min.3)), halide_error_access_out_of_bounds("Input buffer coordinates", 3, coordinates.min.3.required, (coordinates.min.3.required + coordinates.extent.3.required.s), coordinates.min.3, ((coordinates.min.3 + coordinates.extent.3) + -1)))
assert((0 <= coordinates.extent.3), halide_error_buffer_extents_negative("Input buffer coordinates", 3, coordinates.extent.3))
assert(((coordinates.min.4 <= coordinates.min.4.required) && ((((coordinates.min.4.required + coordinates.extent.4.required.s) - coordinates.extent.4) + 1) <= coordinates.min.4)), halide_error_access_out_of_bounds("Input buffer coordinates", 4, coordinates.min.4.required, (coordinates.min.4.required + coordinates.extent.4.required.s), coordinates.min.4, ((coordinates.min.4 + coordinates.extent.4) + -1)))
assert((0 <= coordinates.extent.4), halide_error_buffer_extents_negative("Input buffer coordinates", 4, coordinates.extent.4))
assert((0 <= d_biases.extent.0), halide_error_buffer_extents_negative("Output buffer d_biases", 0, d_biases.extent.0))
assert(((d_output.min.0 <= d_output.min.0.required) && ((((d_output.min.0.required + d_output.extent.0.required.s) - d_output.extent.0) + 1) <= d_output.min.0)), halide_error_access_out_of_bounds("Input buffer d_output", 0, d_output.min.0.required, (d_output.min.0.required + d_output.extent.0.required.s), d_output.min.0, ((d_output.min.0 + d_output.extent.0) + -1)))
assert((0 <= d_output.extent.0), halide_error_buffer_extents_negative("Input buffer d_output", 0, d_output.extent.0))
assert(((d_output.min.1 <= d_output.min.1.required) && ((((d_output.min.1.required + d_output.extent.1.required.s) - d_output.extent.1) + 1) <= d_output.min.1)), halide_error_access_out_of_bounds("Input buffer d_output", 1, d_output.min.1.required, (d_output.min.1.required + d_output.extent.1.required.s), d_output.min.1, ((d_output.min.1 + d_output.extent.1) + -1)))
assert((0 <= d_output.extent.1), halide_error_buffer_extents_negative("Input buffer d_output", 1, d_output.extent.1))
assert(((d_output.min.2 <= d_output.min.2.required) && ((((d_output.min.2.required + d_output.extent.2.required.s) - d_output.extent.2) + 1) <= d_output.min.2)), halide_error_access_out_of_bounds("Input buffer d_output", 2, d_output.min.2.required, (d_output.min.2.required + d_output.extent.2.required.s), d_output.min.2, ((d_output.min.2 + d_output.extent.2) + -1)))
assert((0 <= d_output.extent.2), halide_error_buffer_extents_negative("Input buffer d_output", 2, d_output.extent.2))
assert(((d_output.min.3 <= d_output.min.3.required) && (((d_output.min.3.required + d_output.extent.3.required) - d_output.extent.3) <= d_output.min.3)), halide_error_access_out_of_bounds("Input buffer d_output", 3, d_output.min.3.required, ((d_output.min.3.required + d_output.extent.3.required) + -1), d_output.min.3, ((d_output.min.3 + d_output.extent.3) + -1)))
assert((0 <= d_output.extent.3), halide_error_buffer_extents_negative("Input buffer d_output", 3, d_output.extent.3))
assert((0 <= d_projections.extent.0), halide_error_buffer_extents_negative("Output buffer d_projections", 0, d_projections.extent.0))
assert((0 <= d_projections.extent.1), halide_error_buffer_extents_negative("Output buffer d_projections", 1, d_projections.extent.1))
assert((0 <= d_samples.extent.0), halide_error_buffer_extents_negative("Output buffer d_samples", 0, d_samples.extent.0))
assert(((d_samples.min.1 <= d_samples.min.1.required) && ((((d_samples.min.1.required + d_samples.extent.1.required.s) - d_samples.extent.1) + 1) <= d_samples.min.1)), halide_error_access_out_of_bounds("Output buffer d_samples", 1, d_samples.min.1.required, (d_samples.min.1.required + d_samples.extent.1.required.s), d_samples.min.1, ((d_samples.min.1 + d_samples.extent.1) + -1)))
assert((0 <= d_samples.extent.1), halide_error_buffer_extents_negative("Output buffer d_samples", 1, d_samples.extent.1))
assert((((d_samples.extent.2.required.s - d_samples.extent.2) + 1) <= d_samples.min.2), halide_error_access_out_of_bounds("Output buffer d_samples", 2, d_samples.min.2, d_samples.extent.2.required.s, d_samples.min.2, ((d_samples.min.2 + d_samples.extent.2) + -1)))
assert((0 <= d_samples.extent.2), halide_error_buffer_extents_negative("Output buffer d_samples", 2, d_samples.extent.2))
assert(((((d_samples.min.3 + d_samples.extent.3.required.s) - d_samples.extent.3) + 1) <= d_samples.min.3), halide_error_access_out_of_bounds("Output buffer d_samples", 3, d_samples.min.3, (d_samples.min.3 + d_samples.extent.3.required.s), d_samples.min.3, ((d_samples.min.3 + d_samples.extent.3) + -1)))
assert((0 <= d_samples.extent.3), halide_error_buffer_extents_negative("Output buffer d_samples", 3, d_samples.extent.3))
assert((((d_samples.min.4 + d_samples.extent.4.required) - d_samples.extent.4) <= d_samples.min.4), halide_error_access_out_of_bounds("Output buffer d_samples", 4, d_samples.min.4, ((d_samples.min.4 + d_samples.extent.4.required) + -1), d_samples.min.4, ((d_samples.min.4 + d_samples.extent.4) + -1)))
assert((0 <= d_samples.extent.4), halide_error_buffer_extents_negative("Output buffer d_samples", 4, d_samples.extent.4))
assert(((projections.min.0 <= 0) && ((coordinates.extent.3 - projections.extent.0) <= projections.min.0)), halide_error_access_out_of_bounds("Input buffer projections", 0, 0, (coordinates.extent.3 + -1), projections.min.0, ((projections.min.0 + projections.extent.0) + -1)))
assert((0 <= projections.extent.0), halide_error_buffer_extents_negative("Input buffer projections", 0, projections.extent.0))
assert(((projections.min.1 <= min(tup_image_reduce.s1.k.min, 0)) && ((((min(tup_image_reduce.s1.k.min, 0) + biases.extent.0.required.s) - projections.extent.1) + 1) <= projections.min.1)), halide_error_access_out_of_bounds("Input buffer projections", 1, min(tup_image_reduce.s1.k.min, 0), (min(tup_image_reduce.s1.k.min, 0) + biases.extent.0.required.s), projections.min.1, ((projections.min.1 + projections.extent.1) + -1)))
assert((0 <= projections.extent.1), halide_error_buffer_extents_negative("Input buffer projections", 1, projections.extent.1))
assert(((samples.min.0 <= samples.min.0.required) && ((((samples.min.0.required + samples.extent.0.required.s) - samples.extent.0) + 1) <= samples.min.0)), halide_error_access_out_of_bounds("Input buffer samples", 0, samples.min.0.required, (samples.min.0.required + samples.extent.0.required.s), samples.min.0, ((samples.min.0 + samples.extent.0) + -1)))
assert((0 <= samples.extent.0), halide_error_buffer_extents_negative("Input buffer samples", 0, samples.extent.0))
assert(((samples.min.1 <= samples.min.1.required) && ((((samples.min.1.required + samples.extent.1.required.s) - samples.extent.1) + 1) <= samples.min.1)), halide_error_access_out_of_bounds("Input buffer samples", 1, samples.min.1.required, (samples.min.1.required + samples.extent.1.required.s), samples.min.1, ((samples.min.1 + samples.extent.1) + -1)))
assert((0 <= samples.extent.1), halide_error_buffer_extents_negative("Input buffer samples", 1, samples.extent.1))
assert(((samples.min.2 <= samples.min.2.required) && ((((samples.min.2.required + samples.extent.2.required.s) - samples.extent.2) + 1) <= samples.min.2)), halide_error_access_out_of_bounds("Input buffer samples", 2, samples.min.2.required, (samples.min.2.required + samples.extent.2.required.s), samples.min.2, ((samples.min.2 + samples.extent.2) + -1)))
assert((0 <= samples.extent.2), halide_error_buffer_extents_negative("Input buffer samples", 2, samples.extent.2))
assert(((samples.min.3 <= samples.min.3.required) && ((((samples.min.3.required + samples.extent.3.required.s) - samples.extent.3) + 1) <= samples.min.3)), halide_error_access_out_of_bounds("Input buffer samples", 3, samples.min.3.required, (samples.min.3.required + samples.extent.3.required.s), samples.min.3, ((samples.min.3 + samples.extent.3) + -1)))
assert((0 <= samples.extent.3), halide_error_buffer_extents_negative("Input buffer samples", 3, samples.extent.3))
assert(((samples.min.4 <= samples.min.4.required) && (((samples.min.4.required + samples.extent.4.required) - samples.extent.4) <= samples.min.4)), halide_error_access_out_of_bounds("Input buffer samples", 4, samples.min.4.required, ((samples.min.4.required + samples.extent.4.required) + -1), samples.min.4, ((samples.min.4 + samples.extent.4) + -1)))
assert((0 <= samples.extent.4), halide_error_buffer_extents_negative("Input buffer samples", 4, samples.extent.4))
assert((biases.stride.0 == 1), halide_error_constraint_violated("biases.stride.0", biases.stride.0, "1", 1))
assert((coordinates.stride.0 == 1), halide_error_constraint_violated("coordinates.stride.0", coordinates.stride.0, "1", 1))
assert((d_biases.stride.0 == 1), halide_error_constraint_violated("d_biases.stride.0", d_biases.stride.0, "1", 1))
assert((d_output.stride.0 == 1), halide_error_constraint_violated("d_output.stride.0", d_output.stride.0, "1", 1))
assert((d_projections.stride.0 == 1), halide_error_constraint_violated("d_projections.stride.0", d_projections.stride.0, "1", 1))
assert((d_samples.stride.0 == 1), halide_error_constraint_violated("d_samples.stride.0", d_samples.stride.0, "1", 1))
assert((projections.stride.0 == 1), halide_error_constraint_violated("projections.stride.0", projections.stride.0, "1", 1))
assert((samples.stride.0 == 1), halide_error_constraint_violated("samples.stride.0", samples.stride.0, "1", 1))

let coordinates.total_extent.1 = (int64(coordinates.extent.1) * int64(coordinates.extent.0))

let coordinates.total_extent.3 = (int64(coordinates.extent.3) * (int64(coordinates.extent.2) * coordinates.total_extent.1))

let d_output.total_extent.1 = (int64(d_output.extent.1) * int64(d_output.extent.0))

let d_output.total_extent.3 = (int64(d_output.extent.3) * (int64(d_output.extent.2) * d_output.total_extent.1))

let d_projections.total_extent.1 = (int64(d_projections.extent.1) * int64(d_projections.extent.0))

let d_samples.total_extent.1 = (int64(d_samples.extent.1) * int64(d_samples.extent.0))

let d_samples.total_extent.3 = (int64(d_samples.extent.3) * (int64(d_samples.extent.2) * d_samples.total_extent.1))

let projections.total_extent.1 = (int64(projections.extent.1) * int64(projections.extent.0))

let samples.total_extent.1 = (int64(samples.extent.1) * int64(samples.extent.0))

let samples.total_extent.3 = (int64(samples.extent.3) * (int64(samples.extent.2) * samples.total_extent.1))

assert((abs(int64(biases.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("biases", abs(int64(biases.extent.0)), (uint64)2147483647))
assert((abs(int64(coordinates.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("coordinates", abs(int64(coordinates.extent.0)), (uint64)2147483647))
assert((abs((int64(coordinates.extent.1) * int64(coordinates.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("coordinates", abs((int64(coordinates.extent.1) * int64(coordinates.stride.1))), (uint64)2147483647))
assert((coordinates.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("coordinates", coordinates.total_extent.1, (int64)2147483647))
assert((abs((int64(coordinates.extent.2) * int64(coordinates.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("coordinates", abs((int64(coordinates.extent.2) * int64(coordinates.stride.2))), (uint64)2147483647))
assert(((int64(coordinates.extent.2) * coordinates.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("coordinates", (int64(coordinates.extent.2) * coordinates.total_extent.1), (int64)2147483647))
assert((abs((int64(coordinates.extent.3) * int64(coordinates.stride.3))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("coordinates", abs((int64(coordinates.extent.3) * int64(coordinates.stride.3))), (uint64)2147483647))
assert((coordinates.total_extent.3 <= (int64)2147483647), halide_error_buffer_extents_too_large("coordinates", coordinates.total_extent.3, (int64)2147483647))
assert((abs((int64(coordinates.extent.4) * int64(coordinates.stride.4))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("coordinates", abs((int64(coordinates.extent.4) * int64(coordinates.stride.4))), (uint64)2147483647))
assert(((int64(coordinates.extent.4) * coordinates.total_extent.3) <= (int64)2147483647), halide_error_buffer_extents_too_large("coordinates", (int64(coordinates.extent.4) * coordinates.total_extent.3), (int64)2147483647))
assert((abs(int64(d_biases.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_biases", abs(int64(d_biases.extent.0)), (uint64)2147483647))
assert((abs(int64(d_output.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_output", abs(int64(d_output.extent.0)), (uint64)2147483647))
assert((abs((int64(d_output.extent.1) * int64(d_output.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_output", abs((int64(d_output.extent.1) * int64(d_output.stride.1))), (uint64)2147483647))
assert((d_output.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_output", d_output.total_extent.1, (int64)2147483647))
assert((abs((int64(d_output.extent.2) * int64(d_output.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_output", abs((int64(d_output.extent.2) * int64(d_output.stride.2))), (uint64)2147483647))
assert(((int64(d_output.extent.2) * d_output.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_output", (int64(d_output.extent.2) * d_output.total_extent.1), (int64)2147483647))
assert((abs((int64(d_output.extent.3) * int64(d_output.stride.3))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_output", abs((int64(d_output.extent.3) * int64(d_output.stride.3))), (uint64)2147483647))
assert((d_output.total_extent.3 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_output", d_output.total_extent.3, (int64)2147483647))
assert((abs(int64(d_projections.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_projections", abs(int64(d_projections.extent.0)), (uint64)2147483647))
assert((abs((int64(d_projections.extent.1) * int64(d_projections.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_projections", abs((int64(d_projections.extent.1) * int64(d_projections.stride.1))), (uint64)2147483647))
assert((d_projections.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_projections", d_projections.total_extent.1, (int64)2147483647))
assert((abs(int64(d_samples.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_samples", abs(int64(d_samples.extent.0)), (uint64)2147483647))
assert((abs((int64(d_samples.extent.1) * int64(d_samples.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_samples", abs((int64(d_samples.extent.1) * int64(d_samples.stride.1))), (uint64)2147483647))
assert((d_samples.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_samples", d_samples.total_extent.1, (int64)2147483647))
assert((abs((int64(d_samples.extent.2) * int64(d_samples.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_samples", abs((int64(d_samples.extent.2) * int64(d_samples.stride.2))), (uint64)2147483647))
assert(((int64(d_samples.extent.2) * d_samples.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_samples", (int64(d_samples.extent.2) * d_samples.total_extent.1), (int64)2147483647))
assert((abs((int64(d_samples.extent.3) * int64(d_samples.stride.3))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_samples", abs((int64(d_samples.extent.3) * int64(d_samples.stride.3))), (uint64)2147483647))
assert((d_samples.total_extent.3 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_samples", d_samples.total_extent.3, (int64)2147483647))
assert((abs((int64(d_samples.extent.4) * int64(d_samples.stride.4))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_samples", abs((int64(d_samples.extent.4) * int64(d_samples.stride.4))), (uint64)2147483647))
assert(((int64(d_samples.extent.4) * d_samples.total_extent.3) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_samples", (int64(d_samples.extent.4) * d_samples.total_extent.3), (int64)2147483647))
assert((abs(int64(projections.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("projections", abs(int64(projections.extent.0)), (uint64)2147483647))
assert((abs((int64(projections.extent.1) * int64(projections.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("projections", abs((int64(projections.extent.1) * int64(projections.stride.1))), (uint64)2147483647))
assert((projections.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("projections", projections.total_extent.1, (int64)2147483647))
assert((abs(int64(samples.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("samples", abs(int64(samples.extent.0)), (uint64)2147483647))
assert((abs((int64(samples.extent.1) * int64(samples.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("samples", abs((int64(samples.extent.1) * int64(samples.stride.1))), (uint64)2147483647))
assert((samples.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("samples", samples.total_extent.1, (int64)2147483647))
assert((abs((int64(samples.extent.2) * int64(samples.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("samples", abs((int64(samples.extent.2) * int64(samples.stride.2))), (uint64)2147483647))
assert(((int64(samples.extent.2) * samples.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("samples", (int64(samples.extent.2) * samples.total_extent.1), (int64)2147483647))
assert((abs((int64(samples.extent.3) * int64(samples.stride.3))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("samples", abs((int64(samples.extent.3) * int64(samples.stride.3))), (uint64)2147483647))
assert((samples.total_extent.3 <= (int64)2147483647), halide_error_buffer_extents_too_large("samples", samples.total_extent.3, (int64)2147483647))
assert((abs((int64(samples.extent.4) * int64(samples.stride.4))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("samples", abs((int64(samples.extent.4) * int64(samples.stride.4))), (uint64)2147483647))
assert(((int64(samples.extent.4) * samples.total_extent.3) <= (int64)2147483647), halide_error_buffer_extents_too_large("samples", (int64(samples.extent.4) * samples.total_extent.3), (int64)2147483647))
assert((d_biases != reinterpret((uint64)0)), halide_error_host_is_null("Output buffer d_biases"))
assert((d_projections != reinterpret((uint64)0)), halide_error_host_is_null("Output buffer d_projections"))
produce d_samples
{
halide_profiler_set_current_func(profiler_state, profiler_token, 1)

let halide_copy_to_device_result$3 = halide_copy_to_device(d_samples.buffer, halide_cuda_device_interface())

assert((halide_copy_to_device_result$3 == 0), halide_copy_to_device_result$3)
halide_profiler_decr_active_threads(profiler_state)

let t6532 = (d_samples.extent.4 * d_samples.extent.3)

let t6533 = ((t6532 * d_samples.extent.2) * d_samples.extent.1)

let t6530 = max(d_samples.extent.4, 1)

let t6527 = ((t6533 + 7) / 8)

let t6528 = (t6533 + -8)

let t6531 = ((((d_samples.min.0 + (d_samples.min.1 * d_samples.stride.1)) + (d_samples.min.2 * d_samples.stride.2)) + (d_samples.min.3 * d_samples.stride.3)) + (d_samples.min.4 * d_samples.stride.4))

gpu_block (d_samples.s0.n.nc.ncy.ncyx.ncyx.__block_id_x, 0, t6527)
{
gpu_thread (.__thread_id_x, 0, 8)
{

let d_samples.s0.n.nc.ncy.ncyx.xi.base = min((d_samples.s0.n.nc.ncy.ncyx.ncyx.__block_id_x * 8), t6528)

let t6534 = (d_samples.s0.n.nc.ncy.ncyx.xi.base + .__thread_id_x)

for (d_samples.s0.s, d_samples.min.0, d_samples.extent.0)
{
d_samples[(let t5795 = (t6534 % max((t6532 * d_samples.extent.2), 1)) in (let t5797 = (t5795 % max(t6532, 1)) in (((((((d_samples.min.1 + (t6534 / max((t6532 * d_samples.extent.2), 1))) * d_samples.stride.1) - t6531) + ((d_samples.min.2 + (t5795 / max(t6532, 1))) * d_samples.stride.2)) + ((d_samples.min.3 + (t5797 / t6530)) * d_samples.stride.3)) + ((d_samples.min.4 + (t5797 % t6530)) * d_samples.stride.4)) + d_samples.s0.s)))] = 0.000000f
}
}
}
halide_profiler_incr_active_threads(profiler_state)
_halide_buffer_set_device_dirty(d_samples.buffer, (uint1)1)

let d_samples.s1.r$y.loop_extent = ((nsize / 2) - ((0 - nsize) / 2))

let halide_copy_to_device_result = halide_copy_to_device(biases.buffer, halide_cuda_device_interface())

assert((halide_copy_to_device_result == 0), halide_copy_to_device_result)

let halide_copy_to_device_result$1 = halide_copy_to_device(coordinates.buffer, halide_cuda_device_interface())

assert((halide_copy_to_device_result$1 == 0), halide_copy_to_device_result$1)

let halide_copy_to_device_result$2 = halide_copy_to_device(d_output.buffer, halide_cuda_device_interface())

assert((halide_copy_to_device_result$2 == 0), halide_copy_to_device_result$2)

let halide_copy_to_device_result$4 = halide_copy_to_device(projections.buffer, halide_cuda_device_interface())

assert((halide_copy_to_device_result$4 == 0), halide_copy_to_device_result$4)

let t3926 = min(max(coordinates.min.0, d_samples.min.0), (d_samples.extent.0 + d_samples.min.0))

let t3927 = max(min((coordinates.min.0 + coordinates.extent.0), (d_samples.min.0 + d_samples.extent.0)), min(max(coordinates.min.0, d_samples.min.0), (d_samples.extent.0 + d_samples.min.0)))

let t3928 = min(max(coordinates.min.3, 0), coordinates.extent.3)

let t3929 = min(max((coordinates.min.3 + coordinates.extent.3), max(coordinates.min.3, 0)), coordinates.extent.3)

halide_profiler_decr_active_threads(profiler_state)

let t6574 = ((0 - nsize) / 2)

let t6575 = (d_output.min.1 * d_output.stride.1)

let t6576 = (d_output.min.2 * d_output.stride.2)

let t6577 = (d_output.min.3 * d_output.stride.3)

let t6578 = (d_samples.min.1 - d_output.min.0)

let t6579 = (d_samples.min.2 - d_output.min.1)

let t6580 = (d_samples.extent.4 * d_samples.extent.3)

let t6581 = float32(nsize)

let t6582 = (t6580 * d_samples.extent.2)

let t6540 = max(t6582, 1)

let t6539 = max(d_samples.extent.4, 1)

let t6557 = (1.000000f / ((t6581 * t6581) * float32(samples.extent.0)))

let t6535 = (((t6582 * d_samples.extent.1) + 7) / 8)

let t6551 = (t6581 * 0.500000f)

let t6572 = (((t6578 - t6575) - t6576) - t6577)

let t6573 = ((d_samples.min.0 + d_samples.extent.0) - t3927)

let t6556 = ((((d_samples.min.0 + (d_samples.min.1 * d_samples.stride.1)) + (d_samples.min.2 * d_samples.stride.2)) + (d_samples.min.3 * d_samples.stride.3)) + (d_samples.min.4 * d_samples.stride.4))

let t6549 = ((((coordinates.min.0 + (coordinates.min.1 * coordinates.stride.1)) + (coordinates.min.2 * coordinates.stride.2)) + (coordinates.min.3 * coordinates.stride.3)) + (coordinates.min.4 * coordinates.stride.4))

let t6561 = (((d_output.min.0 + t6575) + t6576) + t6577)

let t6550 = (projections.min.0 + (projections.min.1 * projections.stride.1))

let t6555 = (d_output.min.3 + d_output.extent.3)

let t6554 = (d_output.min.2 + d_output.extent.2)

let t6545 = (coordinates.min.4 + coordinates.extent.4)

let t6543 = (coordinates.min.2 + coordinates.extent.2)

let t6542 = (coordinates.min.1 + coordinates.extent.1)

let t6541 = (coordinates.min.0 + coordinates.extent.0)

gpu_block (d_samples.s1.n.nc.ncy.ncyx.ncyx.__block_id_x, 0, t6535)
{
gpu_thread (.__thread_id_x, 0, 8)
{

let t6599 = ((d_samples.s1.n.nc.ncy.ncyx.ncyx.__block_id_x * 8) + .__thread_id_x)

let t6600 = (t6599 % max((t6580 * d_samples.extent.2), 1))

let t6601 = max(t6580, 1)

let t6602 = (t6600 % t6601)

let t6585 = (t6602 % t6539)

let t6586 = (t6602 / t6539)

let t6587 = (t6600 / t6601)

let t6588 = (t6599 / t6540)

let t6583 = (t3926 - d_samples.min.0)

let t6584 = (t6574 + 1)

let t6595 = (d_output.min.1 + d_output.extent.1)

let t6594 = (d_output.min.0 + d_output.extent.0)

for (d_samples.s1.s, d_samples.min.0, t6583)
{

let t6604 = (d_samples.s1.s < coordinates.min.0)

for (d_samples.s1.r$z, 0, biases.extent.0)
{

let t6617 = (samples.extent.3 * d_samples.s1.r$z)

let t6616 = ((d_samples.s1.r$z * projections.stride.1) - t6550)

let t6611 = (d_samples.s1.r$z - biases.min.0)

for (d_samples.s1.r$y, t6584, d_samples.s1.r$y.loop_extent)
{

let t6627 = ((d_output.min.1 - d_samples.min.2) + d_samples.s1.r$y)

let t6625 = float32(d_samples.s1.r$y)

for (d_samples.s1.r$x, t6584, d_samples.s1.r$y.loop_extent)
{

let d_samples.s1.n.min_1.s = t6585

let d_samples.s1.ci.min_1.s = t6586

let d_samples.s1.y.min_1.s = t6587

let d_samples.s1.x.min_1.s = t6588

allocate projected_coord[float32 * 1]
produce projected_coord
{
projected_coord[0] = biases[t6611]

let t6631 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6630 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6632 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6636 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, 0, coordinates.extent.3)
{
projected_coord[0] = (let t5807 = select((((((((((t6604 || (t6541 <= d_samples.s1.s)) || t6630) || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6631) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (projected_coord.s1.r4$x < coordinates.min.3)) || ((coordinates.min.3 + coordinates.extent.3) <= projected_coord.s1.r4$x)) || t6632) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((max(min(d_samples.s1.s, (t6541 + -1)), coordinates.min.0) + ((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4))) + (max(min(projected_coord.s1.r4$x, ((coordinates.min.3 + coordinates.extent.3) + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6616 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5807 + t6636) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5807 + t6625) + -0.500000f) / t6551), t5807)))))
}
}
consume projected_coord
{
d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + d_samples.s1.y.min_1.s) * d_samples.stride.2)) + ((d_samples.min.3 + d_samples.s1.ci.min_1.s) * d_samples.stride.3)) + ((d_samples.min.4 + d_samples.s1.n.min_1.s) * d_samples.stride.4)) + d_samples.s1.s)] = (let t5809 = (t6599 % max((t6580 * d_samples.extent.2), 1)) in (let t5811 = (t5809 / max(t6580, 1)) in (let t5812 = (t5809 % max(t6580, 1)) in (let t5814 = (t5812 % t6539) in (let t5815 = projected_coord[(((t5811 - d_samples.s1.y.min_1.s) + t5814) - d_samples.s1.n.min_1.s)] in (let t5816 = exp_f32(t5815) in (let t5817 = (d_samples.min.3 + (t5812 / t6539)) in (d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + t5811) * d_samples.stride.2)) + (t5817 * d_samples.stride.3)) + ((d_samples.min.4 + t5814) * d_samples.stride.4)) + d_samples.s1.s)] + ((t6557 * select((0.000000f < t5815), (1.000000f / (exp_f32((0.000000f - t5815)) + 1.000000f)), (t5816 / (t5816 + 1.000000f)))) * select(((((((((d_samples.s1.x.min_1.s < ((d_output.min.0 - d_samples.min.1) + d_samples.s1.r$x)) || (((t6594 - d_samples.min.1) + d_samples.s1.r$x) <= d_samples.s1.x.min_1.s)) || (t5811 < t6627)) || (((t6595 - d_samples.min.2) + d_samples.s1.r$y) <= t5811)) || (t5817 < (d_output.min.2 - t6617))) || ((t6554 - t6617) <= t5817)) || (t5814 < (d_output.min.3 - d_samples.min.4))) || ((t6555 - d_samples.min.4) <= t5814)), 0.000000f, d_output[(max(min(((d_samples.min.1 + d_samples.s1.x.min_1.s) - d_samples.s1.r$x), (t6594 + -1)), d_output.min.0) + ((((max(min((d_samples.min.4 + t5814), (t6555 + -1)), d_output.min.3) * d_output.stride.3) - t6561) + (max(min((t5817 + t6617), (t6554 + -1)), d_output.min.2) * d_output.stride.2)) + (max(min(((d_samples.min.2 + t5811) - d_samples.s1.r$y), (t6595 + -1)), d_output.min.1) * d_output.stride.1)))]))))))))))
}
free projected_coord
}
}
}
}

let t6660 = (t6574 + d_samples.s1.r$y.loop_extent)

let t6661 = ((d_samples.s1.n.nc.ncy.ncyx.ncyx.__block_id_x * 8) + .__thread_id_x)

let t6662 = (t6661 / t6540)

let t6663 = (t6661 % max((t6580 * d_samples.extent.2), 1))

let t6664 = max(t6580, 1)

let t6665 = (t6663 / t6664)

let t6666 = (t6663 % t6664)

let t6667 = (d_samples.s1.r$y.loop_extent + t6574)

let t6668 = min(max(((t6579 - d_output.extent.1) + t6665), t6574), t6667)

let t6669 = min(max(((t6578 - d_output.extent.0) + t6662), t6574), t6667)

let t6656 = max(min((t6578 + t6662), t6660), t6669)

let t6639 = max(min((t6579 + t6665), t6660), t6668)

let t6641 = (t6666 % t6539)

let t6642 = (t6666 / t6539)

let t6637 = (t3927 - t3926)

let t6651 = (d_output.min.1 + d_output.extent.1)

let t6650 = (d_output.min.0 + d_output.extent.0)

for (d_samples.s1.s, t3926, t6637)
{
for (d_samples.s1.r$z, 0, biases.extent.0)
{

let d_samples.s1.r$y.prologue.s = t6668

let d_samples.s1.r$y.epilogue.s = t6639

let t6688 = (samples.extent.3 * d_samples.s1.r$z)

let t6687 = ((d_samples.s1.r$z * projections.stride.1) - t6550)

let t6682 = (d_samples.s1.r$z - biases.min.0)

let t6681 = (d_samples.s1.r$y.prologue.s - t6574)

let t6680 = (t6574 + 1)

for (d_samples.s1.r$y, t6680, t6681)
{

let t6698 = ((d_output.min.1 - d_samples.min.2) + d_samples.s1.r$y)

let t6696 = float32(d_samples.s1.r$y)

for (d_samples.s1.r$x, t6680, d_samples.s1.r$y.loop_extent)
{

let d_samples.s1.n.min_1.s = t6641

let d_samples.s1.ci.min_1.s = t6642

let d_samples.s1.y.min_1.s = t6665

let d_samples.s1.x.min_1.s = t6662

allocate projected_coord[float32 * 1]
produce projected_coord
{
projected_coord[0] = biases[t6682]

let t6702 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6701 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6703 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6707 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, 0, coordinates.extent.3)
{
projected_coord[0] = (let t5840 = select((((((((t6701 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6702) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (projected_coord.s1.r4$x < coordinates.min.3)) || ((coordinates.min.3 + coordinates.extent.3) <= projected_coord.s1.r4$x)) || t6703) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (max(min(projected_coord.s1.r4$x, ((coordinates.min.3 + coordinates.extent.3) + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6687 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5840 + t6707) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5840 + t6696) + -0.500000f) / t6551), t5840)))))
}
}
consume projected_coord
{
d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + d_samples.s1.y.min_1.s) * d_samples.stride.2)) + ((d_samples.min.3 + d_samples.s1.ci.min_1.s) * d_samples.stride.3)) + ((d_samples.min.4 + d_samples.s1.n.min_1.s) * d_samples.stride.4)) + d_samples.s1.s)] = (let t5842 = (t6661 % max((t6580 * d_samples.extent.2), 1)) in (let t5844 = (t5842 / max(t6580, 1)) in (let t5845 = (t5842 % max(t6580, 1)) in (let t5847 = (t5845 % t6539) in (let t5848 = projected_coord[(((t5844 - d_samples.s1.y.min_1.s) + t5847) - d_samples.s1.n.min_1.s)] in (let t5849 = exp_f32(t5848) in (let t5850 = (d_samples.min.3 + (t5845 / t6539)) in (d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + t5844) * d_samples.stride.2)) + (t5850 * d_samples.stride.3)) + ((d_samples.min.4 + t5847) * d_samples.stride.4)) + d_samples.s1.s)] + ((t6557 * select((0.000000f < t5848), (1.000000f / (exp_f32((0.000000f - t5848)) + 1.000000f)), (t5849 / (t5849 + 1.000000f)))) * select(((((((((d_samples.s1.x.min_1.s < ((d_output.min.0 - d_samples.min.1) + d_samples.s1.r$x)) || (((t6650 - d_samples.min.1) + d_samples.s1.r$x) <= d_samples.s1.x.min_1.s)) || (t5844 < t6698)) || (((t6651 - d_samples.min.2) + d_samples.s1.r$y) <= t5844)) || (t5850 < (d_output.min.2 - t6688))) || ((t6554 - t6688) <= t5850)) || (t5847 < (d_output.min.3 - d_samples.min.4))) || ((t6555 - d_samples.min.4) <= t5847)), 0.000000f, d_output[(max(min(((d_samples.min.1 + d_samples.s1.x.min_1.s) - d_samples.s1.r$x), (t6650 + -1)), d_output.min.0) + ((((max(min((d_samples.min.4 + t5847), (t6555 + -1)), d_output.min.3) * d_output.stride.3) - t6561) + (max(min((t5850 + t6688), (t6554 + -1)), d_output.min.2) * d_output.stride.2)) + (max(min(((d_samples.min.2 + t5844) - d_samples.s1.r$y), (t6651 + -1)), d_output.min.1) * d_output.stride.1)))]))))))))))
}
free projected_coord
}
}

let t6717 = (samples.extent.3 * d_samples.s1.r$z)

let t6716 = ((d_samples.s1.r$z * projections.stride.1) - t6550)

let t6711 = (d_samples.s1.r$z - biases.min.0)

let t6709 = (d_samples.s1.r$y.epilogue.s - d_samples.s1.r$y.prologue.s)

let t6708 = (d_samples.s1.r$y.prologue.s + 1)

for (d_samples.s1.r$y, t6708, t6709)
{

let d_samples.s1.r$x.prologue.s = t6669

let d_samples.s1.r$x.epilogue.s = t6656

let t6723 = (d_samples.s1.r$x.prologue.s - t6574)

let t6722 = (t6574 + 1)

let t6728 = float32(d_samples.s1.r$y)

for (d_samples.s1.r$x, t6722, t6723)
{

let d_samples.s1.n.min_1.s = t6641

let d_samples.s1.ci.min_1.s = t6642

let d_samples.s1.y.min_1.s = t6665

let d_samples.s1.x.min_1.s = t6662

allocate projected_coord[float32 * 1]
produce projected_coord
{
projected_coord[0] = biases[t6711]

let t6733 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6732 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6734 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6738 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, 0, coordinates.extent.3)
{
projected_coord[0] = (let t5871 = select((((((((t6732 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6733) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (projected_coord.s1.r4$x < coordinates.min.3)) || ((coordinates.min.3 + coordinates.extent.3) <= projected_coord.s1.r4$x)) || t6734) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (max(min(projected_coord.s1.r4$x, ((coordinates.min.3 + coordinates.extent.3) + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6716 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5871 + t6738) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5871 + t6728) + -0.500000f) / t6551), t5871)))))
}
}
consume projected_coord
{
d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + d_samples.s1.y.min_1.s) * d_samples.stride.2)) + ((d_samples.min.3 + d_samples.s1.ci.min_1.s) * d_samples.stride.3)) + ((d_samples.min.4 + d_samples.s1.n.min_1.s) * d_samples.stride.4)) + d_samples.s1.s)] = (let t5873 = (t6661 % max((t6580 * d_samples.extent.2), 1)) in (let t5875 = (t5873 / max(t6580, 1)) in (let t5876 = (t5873 % max(t6580, 1)) in (let t5878 = (t5876 % t6539) in (let t5879 = projected_coord[(((t5875 - d_samples.s1.y.min_1.s) + t5878) - d_samples.s1.n.min_1.s)] in (let t5880 = exp_f32(t5879) in (let t5881 = (d_samples.min.3 + (t5876 / t6539)) in (d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + t5875) * d_samples.stride.2)) + (t5881 * d_samples.stride.3)) + ((d_samples.min.4 + t5878) * d_samples.stride.4)) + d_samples.s1.s)] + ((t6557 * select((0.000000f < t5879), (1.000000f / (exp_f32((0.000000f - t5879)) + 1.000000f)), (t5880 / (t5880 + 1.000000f)))) * select(((((((d_samples.s1.x.min_1.s < ((d_output.min.0 - d_samples.min.1) + d_samples.s1.r$x)) || (((t6650 - d_samples.min.1) + d_samples.s1.r$x) <= d_samples.s1.x.min_1.s)) || (t5881 < (d_output.min.2 - t6717))) || ((t6554 - t6717) <= t5881)) || (t5878 < (d_output.min.3 - d_samples.min.4))) || ((t6555 - d_samples.min.4) <= t5878)), 0.000000f, d_output[(max(min(((d_samples.min.1 + d_samples.s1.x.min_1.s) - d_samples.s1.r$x), (t6650 + -1)), d_output.min.0) + ((((max(min((d_samples.min.4 + t5878), (t6555 + -1)), d_output.min.3) * d_output.stride.3) - t6561) + (max(min((t5881 + t6717), (t6554 + -1)), d_output.min.2) * d_output.stride.2)) + (((d_samples.min.2 + t5875) - d_samples.s1.r$y) * d_output.stride.1)))]))))))))))
}
free projected_coord
}

let t6740 = (d_samples.s1.r$x.epilogue.s - d_samples.s1.r$x.prologue.s)

let t6747 = (coordinates.extent.3 - t3929)

let t6739 = (d_samples.s1.r$x.prologue.s + 1)

let t6741 = (coordinates.min.3 + coordinates.extent.3)

let t6745 = float32(d_samples.s1.r$y)

for (d_samples.s1.r$x, t6739, t6740)
{

let d_samples.s1.n.min_1.s = t6641

let d_samples.s1.ci.min_1.s = t6642

let d_samples.s1.y.min_1.s = t6665

let d_samples.s1.x.min_1.s = t6662

allocate projected_coord[float32 * 1]
produce projected_coord
{
projected_coord[0] = biases[t6711]

let t6750 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6749 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6751 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6755 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, 0, t3928)
{
projected_coord[0] = (let t5896 = select((((((((t6749 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6750) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (projected_coord.s1.r4$x < coordinates.min.3)) || (t6741 <= projected_coord.s1.r4$x)) || t6751) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (max(min(projected_coord.s1.r4$x, (t6741 + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6716 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5896 + t6755) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5896 + t6745) + -0.500000f) / t6551), t5896)))))
}

let t6758 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6757 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6759 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6756 = (t3929 - t3928)

let t6763 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, t3928, t6756)
{
projected_coord[0] = (let t5900 = select((((((t6757 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6758) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || t6759) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (projected_coord.s1.r4$x * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6716 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5900 + t6763) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5900 + t6745) + -0.500000f) / t6551), t5900)))))
}

let t6765 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6764 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6766 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6770 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, t3929, t6747)
{
projected_coord[0] = (let t5905 = select(((((((t6764 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6765) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (t6741 <= projected_coord.s1.r4$x)) || t6766) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (max(min(projected_coord.s1.r4$x, (t6741 + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6716 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5905 + t6770) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5905 + t6745) + -0.500000f) / t6551), t5905)))))
}
}
consume projected_coord
{
d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + d_samples.s1.y.min_1.s) * d_samples.stride.2)) + ((d_samples.min.3 + d_samples.s1.ci.min_1.s) * d_samples.stride.3)) + ((d_samples.min.4 + d_samples.s1.n.min_1.s) * d_samples.stride.4)) + d_samples.s1.s)] = (let t5907 = (t6661 % max((t6580 * d_samples.extent.2), 1)) in (let t5909 = (t5907 / max(t6580, 1)) in (let t5910 = (t5907 % max(t6580, 1)) in (let t5912 = (t5910 % t6539) in (let t5913 = projected_coord[(((t5909 - d_samples.s1.y.min_1.s) + t5912) - d_samples.s1.n.min_1.s)] in (let t5914 = exp_f32(t5913) in (let t5915 = (d_samples.min.3 + (t5910 / t6539)) in (d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + t5909) * d_samples.stride.2)) + (t5915 * d_samples.stride.3)) + ((d_samples.min.4 + t5912) * d_samples.stride.4)) + d_samples.s1.s)] + ((t6557 * select((0.000000f < t5913), (1.000000f / (exp_f32((0.000000f - t5913)) + 1.000000f)), (t5914 / (t5914 + 1.000000f)))) * select(((((t5915 < (d_output.min.2 - t6717)) || ((t6554 - t6717) <= t5915)) || (t5912 < (d_output.min.3 - d_samples.min.4))) || ((t6555 - d_samples.min.4) <= t5912)), 0.000000f, d_output[(((((t6572 + d_samples.s1.x.min_1.s) + (max(min((d_samples.min.4 + t5912), (t6555 + -1)), d_output.min.3) * d_output.stride.3)) + (max(min((t5915 + t6717), (t6554 + -1)), d_output.min.2) * d_output.stride.2)) + (((d_samples.min.2 + t5909) - d_samples.s1.r$y) * d_output.stride.1)) - d_samples.s1.r$x)]))))))))))
}
free projected_coord
}

let t6772 = (t6660 - d_samples.s1.r$x.epilogue.s)

let t6771 = (d_samples.s1.r$x.epilogue.s + 1)

let t6777 = float32(d_samples.s1.r$y)

for (d_samples.s1.r$x, t6771, t6772)
{

let d_samples.s1.n.min_1.s = t6641

let d_samples.s1.ci.min_1.s = t6642

let d_samples.s1.y.min_1.s = t6665

let d_samples.s1.x.min_1.s = t6662

allocate projected_coord[float32 * 1]
produce projected_coord
{
projected_coord[0] = biases[t6711]

let t6782 = (d_samples.s1.y.min_1.s < (coordinates.min.2 - d_samples.min.2))

let t6781 = (d_samples.s1.x.min_1.s < (coordinates.min.1 - d_samples.min.1))

let t6783 = (d_samples.s1.n.min_1.s < (coordinates.min.4 - d_samples.min.4))

let t6787 = float32(d_samples.s1.r$x)

for (projected_coord.s1.r4$x, 0, coordinates.extent.3)
{
projected_coord[0] = (let t5928 = select((((((((t6781 || ((t6542 - d_samples.min.1) <= d_samples.s1.x.min_1.s)) || t6782) || ((t6543 - d_samples.min.2) <= d_samples.s1.y.min_1.s)) || (projected_coord.s1.r4$x < coordinates.min.3)) || ((coordinates.min.3 + coordinates.extent.3) <= projected_coord.s1.r4$x)) || t6783) || ((t6545 - d_samples.min.4) <= d_samples.s1.n.min_1.s)), 0.000000f, coordinates[((((((max(min((d_samples.min.1 + d_samples.s1.x.min_1.s), (t6542 + -1)), coordinates.min.1) * coordinates.stride.1) - t6549) + (max(min((d_samples.min.2 + d_samples.s1.y.min_1.s), (t6543 + -1)), coordinates.min.2) * coordinates.stride.2)) + (max(min((d_samples.min.4 + d_samples.s1.n.min_1.s), (t6545 + -1)), coordinates.min.4) * coordinates.stride.4)) + d_samples.s1.s) + (max(min(projected_coord.s1.r4$x, ((coordinates.min.3 + coordinates.extent.3) + -1)), coordinates.min.3) * coordinates.stride.3))]) in (projected_coord[0] + (projections[(t6716 + projected_coord.s1.r4$x)] * select((projected_coord.s1.r4$x == 0), (((t5928 + t6787) + -0.500000f) / t6551), select((projected_coord.s1.r4$x == 1), (((t5928 + t6777) + -0.500000f) / t6551), t5928)))))
}
}
consume projected_coord
{
d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + d_samples.s1.y.min_1.s) * d_samples.stride.2)) + ((d_samples.min.3 + d_samples.s1.ci.min_1.s) * d_samples.stride.3)) + ((d_samples.min.4 + d_samples.s1.n.min_1.s) * d_samples.stride.4)) + d_samples.s1.s)] = (let t5930 = (t6661 % max((t6580 * d_samples.extent.2), 1)) in (let t5932 = (t5930 / max(t6580, 1)) in (let t5933 = (t5930 % max(t6580, 1)) in (let t5935 = (t5933 % t6539) in (let t5936 = projected_coord[(((t5932 - d_samples.s1.y.min_1.s) + t5935) - d_samples.s1.n.min_1.s)] in (let t5937 = exp_f32(t5936) in (let t5938 = (d_samples.min.3 + (t5933 / t6539)) in (d_samples[(((((((d_samples.min.1 + d_samples.s1.x.min_1.s) * d_samples.stride.1) - t6556) + ((d_samples.min.2 + t5932) * d_samples.stride.2)) + (t5938 * d_samples.stride.3)) + ((d_samples.min.4 + t5935) * d_samples.stride.4)) + d_samples.s1.s)] + ((t6557 * select((0.000000f < t5936), (1.000000f / (exp_f32((0.000000f - t5936)) + 1.000000f)), (t5937 / (t5937 + 1.000000f)))) * select((((((d_samples.s1.x.min_1.s < ((d_output.min.0 - d_samples.min.1) + d_samples.s1.r$x)) || (t5938 < (d_output.min.2 - t6717))) || ((t6554 - t6717) <= t5938)) || (t5935 < (d_output.min.3 - d_samples.min.4))) || ((t6555 - d_samples.min.4) <= t5935)), 0.000000f, d_output[(max(((d_samples.min.1 + d_samples.s1.x.min_1.s) - d_samples.s1.r$x), d_output.min.0) + ((((max(min((d_samples.min.4 + t5935), (t6555 + -1)), d_output.min.3) * d_output.stride.3) - t6561) + (max(min((t5938 + t6717), (t6554 + -1)), d_output.min.2) * d_output.stride.2)) + (((d_samples.min.2 + t5932) - d_samples.s1.r$y) * d_output.stride.1)))]))))))))))
}
free projected_coord
}
}

let t6797 = (samples.extent.3 * d_samples.s1.r$z)

let t6796 = ((d_samples.s1.r$z * projections.stride.1) - t6550)</