module name=learnable_demosaick_backward_cuda, target=x86-64-linux-avx-cuda-cuda_capability_35-f16c-profile-sse41 {
func learnable_demosaick_backward_cuda(mosaick, selection_filters, green_filters, d_output, d_mosaick, d_selection_filters, d_green_filters)
{
register_destructor("halide_profiler_pipeline_end", halide_profiler_get_state())
allocate profiling_func_names[(void *) * 26]
profiling_func_names[14] = "weights_0_d_def__"
profiling_func_names[6] = "v_interp_0_d_def__"
profiling_func_names[17] = "selection_1_d_def__"
profiling_func_names[10] = "selection"
profiling_func_names[3] = "red_0_d_def__"
profiling_func_names[5] = "q_interp_0_d_def__"
profiling_func_names[0] = "overhead"
profiling_func_names[15] = "normalizer_1_d_def__"
profiling_func_names[11] = "normalizer"
profiling_func_names[9] = "interpolated_green_1_d_def__"
profiling_func_names[12] = "interp_g_1_d_def__"
profiling_func_names[13] = "interp_g"
profiling_func_names[4] = "h_interp_0_d_def__"
profiling_func_names[8] = "green_0_d_def__"
profiling_func_names[21] = "f_sel_filts_0_d_def___intm_intm"
profiling_func_names[20] = "f_sel_filts_0_d_def___intm"
profiling_func_names[22] = "f_sel_filts_0_d_def__"
profiling_func_names[1] = "f_output_0_d_def__"
profiling_func_names[18] = "f_mosaick_0_d_def__"
profiling_func_names[24] = "f_green_filts_0_d_def__"
profiling_func_names[16] = "exp_selection_0_d_def__"
profiling_func_names[23] = "d_selection_filters"
profiling_func_names[19] = "d_mosaick"
profiling_func_names[25] = "d_green_filters"
profiling_func_names[7] = "chroma_0_d_def__"
profiling_func_names[2] = "blue_0_d_def__"

let profiler_token = halide_profiler_pipeline_start("learnable_demosaick_backward_cuda", 26, 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("learnable_demosaick_backward_cuda")

halide_profiler_incr_active_threads(profiler_state)
assert((reinterpret(selection_filters.buffer) != (uint64)0), halide_error_buffer_argument_is_null("selection_filters"))
assert((reinterpret(mosaick.buffer) != (uint64)0), halide_error_buffer_argument_is_null("mosaick"))
assert((reinterpret(green_filters.buffer) != (uint64)0), halide_error_buffer_argument_is_null("green_filters"))
assert((reinterpret(d_selection_filters.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_selection_filters"))
assert((reinterpret(d_output.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_output"))
assert((reinterpret(d_mosaick.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_mosaick"))
assert((reinterpret(d_green_filters.buffer) != (uint64)0), halide_error_buffer_argument_is_null("d_green_filters"))

let d_green_filters = _halide_buffer_get_host(d_green_filters.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

let d_mosaick = _halide_buffer_get_host(d_mosaick.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

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_selection_filters = _halide_buffer_get_host(d_selection_filters.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

let green_filters = _halide_buffer_get_host(green_filters.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

let mosaick = _halide_buffer_get_host(mosaick.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

let selection_filters = _halide_buffer_get_host(selection_filters.buffer)

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

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

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

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

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

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

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

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

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

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

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

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

let f_green_filts_0_d_def__.s1.k.max.s = min((d_green_filters.min.2 + d_green_filters.extent.2), green_filters.extent.2)

let f_green_filts_0_d_def__.s1.k.min.s = min(d_green_filters.min.2, (green_filters.extent.2 + -1))

let f_green_filts_0_d_def__.s1.y.max.s = min((d_green_filters.min.1 + d_green_filters.extent.1), green_filters.extent.1)

let f_green_filts_0_d_def__.s1.y.min.s = min(d_green_filters.min.1, (green_filters.extent.1 + -1))

let f_green_filts_0_d_def__.s1.x.max.s = min((d_green_filters.min.0 + d_green_filters.extent.0), green_filters.extent.0)

let f_green_filts_0_d_def__.s1.x.min.s = min(d_green_filters.min.0, (green_filters.extent.0 + -1))

let f_sel_filts_0_d_def__.s1.k.max.s = min((d_selection_filters.min.2 + d_selection_filters.extent.2), green_filters.extent.2)

let f_sel_filts_0_d_def__.s1.k.min.s = min(d_selection_filters.min.2, (green_filters.extent.2 + -1))

let f_sel_filts_0_d_def__.s1.y.max.s = min((d_selection_filters.min.1 + d_selection_filters.extent.1), selection_filters.extent.1)

let f_sel_filts_0_d_def__.s1.y.min.s = min(d_selection_filters.min.1, (selection_filters.extent.1 + -1))

let f_sel_filts_0_d_def__.s1.x.max.s = min((d_selection_filters.min.0 + d_selection_filters.extent.0), selection_filters.extent.0)

let f_sel_filts_0_d_def__.s1.x.min.s = min(d_selection_filters.min.0, (selection_filters.extent.0 + -1))

let f_mosaick_0_d_def__.s6.n.max = max((min((d_mosaick.min.2 + d_mosaick.extent.2), (d_output.min.3 + d_output.extent.3)) + -1), d_output.min.3)

let f_mosaick_0_d_def__.s6.n.min = max(min(d_mosaick.min.2, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let f_mosaick_0_d_def__.s6.y.max.s = max(min(max(max(((d_output.min.1 + d_output.extent.1) + 1), (((d_output.min.1 + d_output.extent.1) + selection_filters.extent.1) - (selection_filters.extent.1 / 2))), (((d_output.min.1 + d_output.extent.1) + green_filters.extent.1) - (green_filters.extent.1 / 2))), (d_mosaick.min.1 + d_mosaick.extent.1)), min(min(d_output.min.1, (d_output.min.1 - (selection_filters.extent.1 / 2))), (d_output.min.1 - (green_filters.extent.1 / 2))))

let f_mosaick_0_d_def__.s6.y.min = max(min(d_mosaick.min.1, (max(max(((d_output.min.1 + d_output.extent.1) + 1), (((d_output.min.1 + d_output.extent.1) + selection_filters.extent.1) - (selection_filters.extent.1 / 2))), (((d_output.min.1 + d_output.extent.1) + green_filters.extent.1) - (green_filters.extent.1 / 2))) + -1)), (min(min(d_output.min.1, (d_output.min.1 - (selection_filters.extent.1 / 2))), (d_output.min.1 - (green_filters.extent.1 / 2))) + -1))

let f_mosaick_0_d_def__.s6.x.max.s = max(min(max(max(((d_output.min.0 + d_output.extent.0) + 1), (((d_output.min.0 + d_output.extent.0) + selection_filters.extent.0) - (selection_filters.extent.0 / 2))), (((d_output.min.0 + d_output.extent.0) + green_filters.extent.0) - (green_filters.extent.0 / 2))), (d_mosaick.min.0 + d_mosaick.extent.0)), min(min(d_output.min.0, (d_output.min.0 - (selection_filters.extent.0 / 2))), (d_output.min.0 - (green_filters.extent.0 / 2))))

let f_mosaick_0_d_def__.s6.x.min = max(min(d_mosaick.min.0, (max(max(((d_output.min.0 + d_output.extent.0) + 1), (((d_output.min.0 + d_output.extent.0) + selection_filters.extent.0) - (selection_filters.extent.0 / 2))), (((d_output.min.0 + d_output.extent.0) + green_filters.extent.0) - (green_filters.extent.0 / 2))) + -1)), (min(min(d_output.min.0, (d_output.min.0 - (selection_filters.extent.0 / 2))), (d_output.min.0 - (green_filters.extent.0 / 2))) + -1))

let selection_1_d_def__.s1.n.max = max(min(max(f_mosaick_0_d_def__.s6.n.max, ((d_output.extent.3 + d_output.min.3) + -1)), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let selection_1_d_def__.s1.n.min = max(min(min(f_mosaick_0_d_def__.s6.n.min, d_output.min.3), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let selection_1_d_def__.s1.y.max = max(min(max(((f_mosaick_0_d_def__.s6.y.max.s + (selection_filters.extent.1 / 2)) + -1), (d_output.extent.1 + d_output.min.1)), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let selection_1_d_def__.s1.y.min = max(min(min((((f_mosaick_0_d_def__.s6.y.min + (selection_filters.extent.1 / 2)) - selection_filters.extent.1) + 1), (d_output.min.1 + -1)), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let selection_1_d_def__.s1.x.max = max(min(max(((f_mosaick_0_d_def__.s6.x.max.s + (selection_filters.extent.0 / 2)) + -1), (d_output.extent.0 + d_output.min.0)), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let selection_1_d_def__.s1.x.min = max(min(min((((f_mosaick_0_d_def__.s6.x.min + (selection_filters.extent.0 / 2)) - selection_filters.extent.0) + 1), (d_output.min.0 + -1)), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let exp_selection_0_d_def__.s2.n.max = max(min(selection_1_d_def__.s1.n.max, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let exp_selection_0_d_def__.s2.n.min = max(min(selection_1_d_def__.s1.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let exp_selection_0_d_def__.s2.y.max = max(min(selection_1_d_def__.s1.y.max, (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let exp_selection_0_d_def__.s2.y.min = max(min(selection_1_d_def__.s1.y.min, (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let exp_selection_0_d_def__.s2.x.max = max(min(selection_1_d_def__.s1.x.max, (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let exp_selection_0_d_def__.s2.x.min = max(min(selection_1_d_def__.s1.x.min, (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let normalizer_1_d_def__.s1.n.max = max(min(exp_selection_0_d_def__.s2.n.max, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let normalizer_1_d_def__.s1.n.min = max(min(exp_selection_0_d_def__.s2.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let normalizer_1_d_def__.s1.y.max = max(min(exp_selection_0_d_def__.s2.y.max, (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let normalizer_1_d_def__.s1.y.min = max(min(exp_selection_0_d_def__.s2.y.min, (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let normalizer_1_d_def__.s1.x.max = max(min(exp_selection_0_d_def__.s2.x.max, (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let normalizer_1_d_def__.s1.x.min = max(min(exp_selection_0_d_def__.s2.x.min, (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let weights_0_d_def__.s1.n.max = max(min(max(exp_selection_0_d_def__.s2.n.max, normalizer_1_d_def__.s1.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let weights_0_d_def__.s1.n.min = max(min(min(exp_selection_0_d_def__.s2.n.min, normalizer_1_d_def__.s1.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let weights_0_d_def__.s1.y.max = max(min(max(exp_selection_0_d_def__.s2.y.max, normalizer_1_d_def__.s1.y.max), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let weights_0_d_def__.s1.y.min = max(min(min(exp_selection_0_d_def__.s2.y.min, normalizer_1_d_def__.s1.y.min), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let weights_0_d_def__.s1.x.max = max(min(max(exp_selection_0_d_def__.s2.x.max, normalizer_1_d_def__.s1.x.max), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let weights_0_d_def__.s1.x.min = max(min(min(exp_selection_0_d_def__.s2.x.min, normalizer_1_d_def__.s1.x.min), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let interp_g_1_d_def__.s1.n.max = max(min(max(((d_output.extent.3 + d_output.min.3) + -1), f_mosaick_0_d_def__.s6.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let interp_g_1_d_def__.s1.n.min = max(min(min(d_output.min.3, f_mosaick_0_d_def__.s6.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let interp_g_1_d_def__.s1.y.max = max(min(max((d_output.extent.1 + d_output.min.1), ((f_mosaick_0_d_def__.s6.y.max.s + (green_filters.extent.1 / 2)) + -1)), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let interp_g_1_d_def__.s1.y.min = max(min(min((d_output.min.1 + -1), (((f_mosaick_0_d_def__.s6.y.min + (green_filters.extent.1 / 2)) - green_filters.extent.1) + 1)), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let interp_g_1_d_def__.s1.x.max = max(min(max((d_output.extent.0 + d_output.min.0), ((f_mosaick_0_d_def__.s6.x.max.s + (green_filters.extent.0 / 2)) + -1)), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let interp_g_1_d_def__.s1.x.min = max(min(min((d_output.min.0 + -1), (((f_mosaick_0_d_def__.s6.x.min + (green_filters.extent.0 / 2)) - green_filters.extent.0) + 1)), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let normalizer.s1.n.max = max(max(exp_selection_0_d_def__.s2.n.max, interp_g_1_d_def__.s1.n.max), normalizer_1_d_def__.s1.n.max)

let normalizer.s1.n.min = min(min(exp_selection_0_d_def__.s2.n.min, interp_g_1_d_def__.s1.n.min), normalizer_1_d_def__.s1.n.min)

let normalizer.s1.y.max = max(max(exp_selection_0_d_def__.s2.y.max, interp_g_1_d_def__.s1.y.max), normalizer_1_d_def__.s1.y.max)

let normalizer.s1.y.min = min(min(exp_selection_0_d_def__.s2.y.min, interp_g_1_d_def__.s1.y.min), normalizer_1_d_def__.s1.y.min)

let normalizer.s1.x.max = max(max(exp_selection_0_d_def__.s2.x.max, interp_g_1_d_def__.s1.x.max), normalizer_1_d_def__.s1.x.max)

let normalizer.s1.x.min = min(min(exp_selection_0_d_def__.s2.x.min, interp_g_1_d_def__.s1.x.min), normalizer_1_d_def__.s1.x.min)

let selection.s1.n.max = max(max(max(interp_g_1_d_def__.s1.n.max, normalizer.s1.n.max), normalizer_1_d_def__.s1.n.max), selection_1_d_def__.s1.n.max)

let selection.s1.n.min = min(min(min(interp_g_1_d_def__.s1.n.min, normalizer.s1.n.min), normalizer_1_d_def__.s1.n.min), selection_1_d_def__.s1.n.min)

let selection.s1.y.max = max(max(max(interp_g_1_d_def__.s1.y.max, normalizer.s1.y.max), normalizer_1_d_def__.s1.y.max), selection_1_d_def__.s1.y.max)

let selection.s1.y.min = min(min(min(interp_g_1_d_def__.s1.y.min, normalizer.s1.y.min), normalizer_1_d_def__.s1.y.min), selection_1_d_def__.s1.y.min)

let selection.s1.x.max = max(max(max(interp_g_1_d_def__.s1.x.max, normalizer.s1.x.max), normalizer_1_d_def__.s1.x.max), selection_1_d_def__.s1.x.max)

let selection.s1.x.min = min(min(min(interp_g_1_d_def__.s1.x.min, normalizer.s1.x.min), normalizer_1_d_def__.s1.x.min), selection_1_d_def__.s1.x.min)

let interpolated_green_1_d_def__.s1.n.max = max(min(max(interp_g_1_d_def__.s1.n.max, weights_0_d_def__.s1.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let interpolated_green_1_d_def__.s1.n.min = max(min(min(interp_g_1_d_def__.s1.n.min, weights_0_d_def__.s1.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let interpolated_green_1_d_def__.s1.y.max = max(min(max(interp_g_1_d_def__.s1.y.max, weights_0_d_def__.s1.y.max), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let interpolated_green_1_d_def__.s1.y.min = max(min(min(interp_g_1_d_def__.s1.y.min, weights_0_d_def__.s1.y.min), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let interpolated_green_1_d_def__.s1.x.max = max(min(max(interp_g_1_d_def__.s1.x.max, weights_0_d_def__.s1.x.max), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let interpolated_green_1_d_def__.s1.x.min = max(min(min(interp_g_1_d_def__.s1.x.min, weights_0_d_def__.s1.x.min), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let green_0_d_def__.s5.n.max = max(min(max(f_mosaick_0_d_def__.s6.n.max, interpolated_green_1_d_def__.s1.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let green_0_d_def__.s5.n.min = max(min(min(f_mosaick_0_d_def__.s6.n.min, interpolated_green_1_d_def__.s1.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let green_0_d_def__.s5.y.max = max(min(max((f_mosaick_0_d_def__.s6.y.max.s + -1), interpolated_green_1_d_def__.s1.y.max), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let green_0_d_def__.s5.y.min = max(min(min(f_mosaick_0_d_def__.s6.y.min, interpolated_green_1_d_def__.s1.y.min), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let green_0_d_def__.s5.x.max = max(min(max((f_mosaick_0_d_def__.s6.x.max.s + -1), interpolated_green_1_d_def__.s1.x.max), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let green_0_d_def__.s5.x.min = max(min(min(f_mosaick_0_d_def__.s6.x.min, interpolated_green_1_d_def__.s1.x.min), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let chroma_0_d_def__.s8.n.max = max(min(max(f_mosaick_0_d_def__.s6.n.max, green_0_d_def__.s5.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let chroma_0_d_def__.s8.n.min = max(min(min(f_mosaick_0_d_def__.s6.n.min, green_0_d_def__.s5.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let chroma_0_d_def__.s8.y.max = max(min(max((f_mosaick_0_d_def__.s6.y.max.s + -1), green_0_d_def__.s5.y.max), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let chroma_0_d_def__.s8.y.min = max(min(min(f_mosaick_0_d_def__.s6.y.min, green_0_d_def__.s5.y.min), (d_output.min.1 + d_output.extent.1)), (d_output.min.1 + -1))

let chroma_0_d_def__.s8.x.max = max(min(max((f_mosaick_0_d_def__.s6.x.max.s + -1), green_0_d_def__.s5.x.max), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let chroma_0_d_def__.s8.x.min = max(min(min(f_mosaick_0_d_def__.s6.x.min, green_0_d_def__.s5.x.min), (d_output.min.0 + d_output.extent.0)), (d_output.min.0 + -1))

let v_interp_0_d_def__.s2.n.max = max(min(max(chroma_0_d_def__.s8.n.max, green_0_d_def__.s5.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let v_interp_0_d_def__.s2.n.min = max(min(min(chroma_0_d_def__.s8.n.min, green_0_d_def__.s5.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let v_interp_0_d_def__.s2.y.max = max(max(min(green_0_d_def__.s5.y.max, ((d_output.min.1 + d_output.extent.1) + -1)), max(min((chroma_0_d_def__.s8.y.max + 1), ((d_output.min.1 + d_output.extent.1) + -1)), (min(chroma_0_d_def__.s8.y.max, (d_output.min.1 + d_output.extent.1)) + -1))), d_output.min.1)

let v_interp_0_d_def__.s2.y.min = max(min(min((min(chroma_0_d_def__.s8.y.min, (d_output.min.1 + d_output.extent.1)) + -1), min((chroma_0_d_def__.s8.y.min + 1), ((d_output.min.1 + d_output.extent.1) + -1))), min(green_0_d_def__.s5.y.min, ((d_output.min.1 + d_output.extent.1) + -1))), d_output.min.1)

let v_interp_0_d_def__.s2.x.max = max(min(max(chroma_0_d_def__.s8.x.max, green_0_d_def__.s5.x.max), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let v_interp_0_d_def__.s2.x.min = max(min(min(chroma_0_d_def__.s8.x.min, green_0_d_def__.s5.x.min), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let q_interp_0_d_def__.s2.x.max = max(max(min(green_0_d_def__.s5.x.max, ((d_output.min.0 + d_output.extent.0) + -1)), max(min((chroma_0_d_def__.s8.x.max + 1), ((d_output.min.0 + d_output.extent.0) + -1)), (min(chroma_0_d_def__.s8.x.max, (d_output.min.0 + d_output.extent.0)) + -1))), d_output.min.0)

let q_interp_0_d_def__.s2.x.min = max(min(min((min(chroma_0_d_def__.s8.x.min, (d_output.min.0 + d_output.extent.0)) + -1), min((chroma_0_d_def__.s8.x.min + 1), ((d_output.min.0 + d_output.extent.0) + -1))), min(green_0_d_def__.s5.x.min, ((d_output.min.0 + d_output.extent.0) + -1))), d_output.min.0)

let h_interp_0_d_def__.s2.y.max = max(min(max(chroma_0_d_def__.s8.y.max, green_0_d_def__.s5.y.max), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let h_interp_0_d_def__.s2.y.min = max(min(min(chroma_0_d_def__.s8.y.min, green_0_d_def__.s5.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let red_0_d_def__.s1.n.max = max(min(max(f_mosaick_0_d_def__.s6.n.max, v_interp_0_d_def__.s2.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let red_0_d_def__.s1.n.min = max(min(min(f_mosaick_0_d_def__.s6.n.min, v_interp_0_d_def__.s2.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let red_0_d_def__.s1.y.max = max(min(max(max((f_mosaick_0_d_def__.s6.y.max.s + -1), h_interp_0_d_def__.s2.y.max), v_interp_0_d_def__.s2.y.max), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let red_0_d_def__.s1.y.min = max(min(min(min(f_mosaick_0_d_def__.s6.y.min, h_interp_0_d_def__.s2.y.min), v_interp_0_d_def__.s2.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let red_0_d_def__.s1.x.max = max(min(max(max((f_mosaick_0_d_def__.s6.x.max.s + -1), q_interp_0_d_def__.s2.x.max), v_interp_0_d_def__.s2.x.max), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let red_0_d_def__.s1.x.min = max(min(min(min(f_mosaick_0_d_def__.s6.x.min, q_interp_0_d_def__.s2.x.min), v_interp_0_d_def__.s2.x.min), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let f_output_0_d_def__.s0.n.max = max(min(max(red_0_d_def__.s1.n.max, green_0_d_def__.s5.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let f_output_0_d_def__.s0.n.min = max(min(min(red_0_d_def__.s1.n.min, green_0_d_def__.s5.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3)

let f_output_0_d_def__.s0.c.max = max(((d_output.min.2 + d_output.extent.2) + -1), d_output.min.2)

let f_output_0_d_def__.s0.y.max = max(min(max(red_0_d_def__.s1.y.max, green_0_d_def__.s5.y.max), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let f_output_0_d_def__.s0.y.min = max(min(min(red_0_d_def__.s1.y.min, green_0_d_def__.s5.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)

let f_output_0_d_def__.s0.x.max = max(min(max(red_0_d_def__.s1.x.max, green_0_d_def__.s5.x.max), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let f_output_0_d_def__.s0.x.min = max(min(min(red_0_d_def__.s1.x.min, green_0_d_def__.s5.x.min), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)

let d_output.stride.2.required = (((f_output_0_d_def__.s0.x.max - f_output_0_d_def__.s0.x.min) + 1) * ((f_output_0_d_def__.s0.y.max - f_output_0_d_def__.s0.y.min) + 1))

let d_output.stride.3.required = (d_output.stride.2.required * ((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1))

let mosaick.extent.0.required.s = (max(max(min((((max((f_green_filts_0_d_def__.s1.x.max.s + -1), 0) + d_output.extent.0) + d_output.min.0) - (green_filters.extent.0 / 2)), ((mosaick.min.0 + mosaick.extent.0) + -1)), max(min((((max((f_sel_filts_0_d_def__.s1.x.max.s + -1), 0) + d_output.extent.0) + d_output.min.0) - (selection_filters.extent.0 / 2)), ((mosaick.min.0 + mosaick.extent.0) + -1)), (min((max((((int32(abs(max(((selection.s1.x.max - selection.s1.x.min) + 1), 1))) + selection.s1.x.min) + selection_filters.extent.0) - (selection_filters.extent.0 / 2)), (((int32(abs(max(((weights_0_d_def__.s1.x.max - weights_0_d_def__.s1.x.min) + 1), 1))) + weights_0_d_def__.s1.x.min) + green_filters.extent.0) - (green_filters.extent.0 / 2))) + -1), (mosaick.min.0 + mosaick.extent.0)) + -1))), mosaick.min.0) - max(min(min(min(min((selection.s1.x.min - (selection_filters.extent.0 / 2)), (weights_0_d_def__.s1.x.min - (green_filters.extent.0 / 2))), (((max(f_sel_filts_0_d_def__.s1.x.min.s, 0) + d_output.min.0) - (selection_filters.extent.0 / 2)) + -1)), (((max(f_green_filts_0_d_def__.s1.x.min.s, 0) + d_output.min.0) - (green_filters.extent.0 / 2)) + -1)), ((mosaick.min.0 + mosaick.extent.0) + -1)), mosaick.min.0))

let mosaick.min.0.required = max(min(min(min(min((selection.s1.x.min - (selection_filters.extent.0 / 2)), (weights_0_d_def__.s1.x.min - (green_filters.extent.0 / 2))), (((max(f_sel_filts_0_d_def__.s1.x.min.s, 0) + d_output.min.0) - (selection_filters.extent.0 / 2)) + -1)), (((max(f_green_filts_0_d_def__.s1.x.min.s, 0) + d_output.min.0) - (green_filters.extent.0 / 2)) + -1)), ((mosaick.min.0 + mosaick.extent.0) + -1)), mosaick.min.0)

let mosaick.extent.1.required.s = (max(min(max(max((max((((((int32(abs(max((((selection.s1.x.max - selection.s1.x.min) + 1) * ((selection.s1.y.max - selection.s1.y.min) + 1)), 1))) + -1) / max(((selection.s1.x.max - selection.s1.x.min) + 1), 1)) + selection.s1.y.min) + selection_filters.extent.1) - (selection_filters.extent.1 / 2)), (((((int32(abs(max((((weights_0_d_def__.s1.x.max - weights_0_d_def__.s1.x.min) + 1) * ((weights_0_d_def__.s1.y.max - weights_0_d_def__.s1.y.min) + 1)), 1))) + -1) / max(((weights_0_d_def__.s1.x.max - weights_0_d_def__.s1.x.min) + 1), 1)) + weights_0_d_def__.s1.y.min) + green_filters.extent.1) - (green_filters.extent.1 / 2))) + -1), (((max((f_sel_filts_0_d_def__.s1.y.max.s + -1), 0) + d_output.extent.1) + d_output.min.1) - (selection_filters.extent.1 / 2))), (((max((f_green_filts_0_d_def__.s1.y.max.s + -1), 0) + d_output.extent.1) + d_output.min.1) - (green_filters.extent.1 / 2))), ((mosaick.min.1 + mosaick.extent.1) + -1)), mosaick.min.1) - max(min(min(min(min((selection.s1.y.min - (selection_filters.extent.1 / 2)), (weights_0_d_def__.s1.y.min - (green_filters.extent.1 / 2))), (((max(f_sel_filts_0_d_def__.s1.y.min.s, 0) + d_output.min.1) - (selection_filters.extent.1 / 2)) + -1)), (((max(f_green_filts_0_d_def__.s1.y.min.s, 0) + d_output.min.1) - (green_filters.extent.1 / 2)) + -1)), ((mosaick.min.1 + mosaick.extent.1) + -1)), mosaick.min.1))

let mosaick.min.1.required = max(min(min(min(min((selection.s1.y.min - (selection_filters.extent.1 / 2)), (weights_0_d_def__.s1.y.min - (green_filters.extent.1 / 2))), (((max(f_sel_filts_0_d_def__.s1.y.min.s, 0) + d_output.min.1) - (selection_filters.extent.1 / 2)) + -1)), (((max(f_green_filts_0_d_def__.s1.y.min.s, 0) + d_output.min.1) - (green_filters.extent.1 / 2)) + -1)), ((mosaick.min.1 + mosaick.extent.1) + -1)), mosaick.min.1)

let mosaick.extent.2.required.s = (let t10472 = (((weights_0_d_def__.s1.x.max - weights_0_d_def__.s1.x.min) + 1) * ((weights_0_d_def__.s1.y.max - weights_0_d_def__.s1.y.min) + 1)) in (let t10473 = (((selection.s1.x.max - selection.s1.x.min) + 1) * ((selection.s1.y.max - selection.s1.y.min) + 1)) in (max(max(min(max((((((d_output.extent.3 + -1) / 8) * 8) + d_output.min.3) + 7), max((((((((t10472 * ((weights_0_d_def__.s1.n.max - weights_0_d_def__.s1.n.min) + 1)) + -1) / 8) * 8) + 7) / max(t10472, 1)) + weights_0_d_def__.s1.n.min), (((((((t10473 * ((selection.s1.n.max - selection.s1.n.min) + 1)) + -1) / 8) * 8) + 7) / max(t10473, 1)) + selection.s1.n.min))), ((mosaick.min.2 + mosaick.extent.2) + -1)), (min((d_output.extent.3 + d_output.min.3), (mosaick.min.2 + mosaick.extent.2)) + -1)), mosaick.min.2) - max(min(min(min(selection.s1.n.min, weights_0_d_def__.s1.n.min), d_output.min.3), ((mosaick.min.2 + mosaick.extent.2) + -1)), mosaick.min.2))))

let mosaick.min.2.required = max(min(min(min(selection.s1.n.min, weights_0_d_def__.s1.n.min), d_output.min.3), ((mosaick.min.2 + mosaick.extent.2) + -1)), mosaick.min.2)

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

if (_halide_buffer_is_bounds_query(d_green_filters.buffer))
{
_halide_buffer_init(d_green_filters.buffer, _halide_buffer_get_shape(d_green_filters.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(d_green_filters.min.0, d_green_filters.extent.0, 1, 0, d_green_filters.min.1, d_green_filters.extent.1, d_green_filters.extent.0, 0, d_green_filters.min.2, d_green_filters.extent.2, (d_green_filters.extent.0 * d_green_filters.extent.1), 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_mosaick.buffer))
{
_halide_buffer_init(d_mosaick.buffer, _halide_buffer_get_shape(d_mosaick.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(d_mosaick.min.0, d_mosaick.extent.0, 1, 0, d_mosaick.min.1, d_mosaick.extent.1, d_mosaick.extent.0, 0, d_mosaick.min.2, d_mosaick.extent.2, (d_mosaick.extent.0 * d_mosaick.extent.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(f_output_0_d_def__.s0.x.min, ((f_output_0_d_def__.s0.x.max - f_output_0_d_def__.s0.x.min) + 1), 1, 0, f_output_0_d_def__.s0.y.min, ((f_output_0_d_def__.s0.y.max - f_output_0_d_def__.s0.y.min) + 1), ((f_output_0_d_def__.s0.x.max - f_output_0_d_def__.s0.x.min) + 1), 0, d_output.min.2, ((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1), d_output.stride.2.required, 0, f_output_0_d_def__.s0.n.min, ((f_output_0_d_def__.s0.n.max - f_output_0_d_def__.s0.n.min) + 1), d_output.stride.3.required, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(d_selection_filters.buffer))
{
_halide_buffer_init(d_selection_filters.buffer, _halide_buffer_get_shape(d_selection_filters.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(d_selection_filters.min.0, d_selection_filters.extent.0, 1, 0, d_selection_filters.min.1, d_selection_filters.extent.1, d_selection_filters.extent.0, 0, d_selection_filters.min.2, d_selection_filters.extent.2, (d_selection_filters.extent.0 * d_selection_filters.extent.1), 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(green_filters.buffer))
{
_halide_buffer_init(green_filters.buffer, _halide_buffer_get_shape(green_filters.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(0, green_filters.extent.0, 1, 0, 0, green_filters.extent.1, green_filters.extent.0, 0, 0, max(green_filters.extent.2, 1), (green_filters.extent.0 * green_filters.extent.1), 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(mosaick.buffer))
{
_halide_buffer_init(mosaick.buffer, _halide_buffer_get_shape(mosaick.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(mosaick.min.0.required, (mosaick.extent.0.required.s + 1), 1, 0, mosaick.min.1.required, (mosaick.extent.1.required.s + 1), (mosaick.extent.0.required.s + 1), 0, mosaick.min.2.required, (mosaick.extent.2.required.s + 1), mosaick.stride.2.required, 0), (uint64)0)
}
if (_halide_buffer_is_bounds_query(selection_filters.buffer))
{
_halide_buffer_init(selection_filters.buffer, _halide_buffer_get_shape(selection_filters.buffer), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(0, selection_filters.extent.0, 1, 0, 0, selection_filters.extent.1, selection_filters.extent.0, 0, 0, max(green_filters.extent.2, 1), (selection_filters.extent.0 * selection_filters.extent.1), 0), (uint64)0)
}
if (!((((((_halide_buffer_is_bounds_query(d_green_filters.buffer) || _halide_buffer_is_bounds_query(d_mosaick.buffer)) || _halide_buffer_is_bounds_query(d_output.buffer)) || _halide_buffer_is_bounds_query(d_selection_filters.buffer)) || _halide_buffer_is_bounds_query(green_filters.buffer)) || _halide_buffer_is_bounds_query(mosaick.buffer)) || _halide_buffer_is_bounds_query(selection_filters.buffer)))
{
assert((((d_green_filters.type.code == (uint8)2) && (d_green_filters.type.bits == (uint8)32)) && (d_green_filters.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_green_filters", d_green_filters.type.code, (uint8)2, d_green_filters.type.bits, (uint8)32, d_green_filters.type.lanes, (uint16)1))
assert((((d_mosaick.type.code == (uint8)2) && (d_mosaick.type.bits == (uint8)32)) && (d_mosaick.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_mosaick", d_mosaick.type.code, (uint8)2, d_mosaick.type.bits, (uint8)32, d_mosaick.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_selection_filters.type.code == (uint8)2) && (d_selection_filters.type.bits == (uint8)32)) && (d_selection_filters.type.lanes == (uint16)1)), halide_error_bad_type("Output buffer d_selection_filters", d_selection_filters.type.code, (uint8)2, d_selection_filters.type.bits, (uint8)32, d_selection_filters.type.lanes, (uint16)1))
assert((((green_filters.type.code == (uint8)2) && (green_filters.type.bits == (uint8)32)) && (green_filters.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer green_filters", green_filters.type.code, (uint8)2, green_filters.type.bits, (uint8)32, green_filters.type.lanes, (uint16)1))
assert((((mosaick.type.code == (uint8)2) && (mosaick.type.bits == (uint8)32)) && (mosaick.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer mosaick", mosaick.type.code, (uint8)2, mosaick.type.bits, (uint8)32, mosaick.type.lanes, (uint16)1))
assert((((selection_filters.type.code == (uint8)2) && (selection_filters.type.bits == (uint8)32)) && (selection_filters.type.lanes == (uint16)1)), halide_error_bad_type("Input buffer selection_filters", selection_filters.type.code, (uint8)2, selection_filters.type.bits, (uint8)32, selection_filters.type.lanes, (uint16)1))
assert((0 <= d_green_filters.extent.0), halide_error_buffer_extents_negative("Output buffer d_green_filters", 0, d_green_filters.extent.0))
assert((0 <= d_green_filters.extent.1), halide_error_buffer_extents_negative("Output buffer d_green_filters", 1, d_green_filters.extent.1))
assert((0 <= d_green_filters.extent.2), halide_error_buffer_extents_negative("Output buffer d_green_filters", 2, d_green_filters.extent.2))
assert((0 <= d_mosaick.extent.0), halide_error_buffer_extents_negative("Output buffer d_mosaick", 0, d_mosaick.extent.0))
assert((0 <= d_mosaick.extent.1), halide_error_buffer_extents_negative("Output buffer d_mosaick", 1, d_mosaick.extent.1))
assert((0 <= d_mosaick.extent.2), halide_error_buffer_extents_negative("Output buffer d_mosaick", 2, d_mosaick.extent.2))
assert(((d_output.min.0 <= f_output_0_d_def__.s0.x.min) && (((f_output_0_d_def__.s0.x.max - d_output.extent.0) + 1) <= d_output.min.0)), halide_error_access_out_of_bounds("Input buffer d_output", 0, f_output_0_d_def__.s0.x.min, f_output_0_d_def__.s0.x.max, 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 <= f_output_0_d_def__.s0.y.min) && (((f_output_0_d_def__.s0.y.max - d_output.extent.1) + 1) <= d_output.min.1)), halide_error_access_out_of_bounds("Input buffer d_output", 1, f_output_0_d_def__.s0.y.min, f_output_0_d_def__.s0.y.max, 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((((f_output_0_d_def__.s0.c.max - d_output.extent.2) + 1) <= d_output.min.2), halide_error_access_out_of_bounds("Input buffer d_output", 2, d_output.min.2, f_output_0_d_def__.s0.c.max, 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 <= f_output_0_d_def__.s0.n.min) && (((f_output_0_d_def__.s0.n.max - d_output.extent.3) + 1) <= d_output.min.3)), halide_error_access_out_of_bounds("Input buffer d_output", 3, f_output_0_d_def__.s0.n.min, f_output_0_d_def__.s0.n.max, 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_selection_filters.extent.0), halide_error_buffer_extents_negative("Output buffer d_selection_filters", 0, d_selection_filters.extent.0))
assert((0 <= d_selection_filters.extent.1), halide_error_buffer_extents_negative("Output buffer d_selection_filters", 1, d_selection_filters.extent.1))
assert((0 <= d_selection_filters.extent.2), halide_error_buffer_extents_negative("Output buffer d_selection_filters", 2, d_selection_filters.extent.2))
assert(((green_filters.min.0 <= 0) && (0 <= green_filters.min.0)), halide_error_access_out_of_bounds("Input buffer green_filters", 0, 0, (green_filters.extent.0 + -1), green_filters.min.0, ((green_filters.min.0 + green_filters.extent.0) + -1)))
assert((0 <= green_filters.extent.0), halide_error_buffer_extents_negative("Input buffer green_filters", 0, green_filters.extent.0))
assert(((green_filters.min.1 <= 0) && (0 <= green_filters.min.1)), halide_error_access_out_of_bounds("Input buffer green_filters", 1, 0, (green_filters.extent.1 + -1), green_filters.min.1, ((green_filters.min.1 + green_filters.extent.1) + -1)))
assert((0 <= green_filters.extent.1), halide_error_buffer_extents_negative("Input buffer green_filters", 1, green_filters.extent.1))
assert(((green_filters.min.2 <= 0) && ((1 - min(green_filters.extent.2, 1)) <= green_filters.min.2)), halide_error_access_out_of_bounds("Input buffer green_filters", 2, 0, (max(green_filters.extent.2, 1) + -1), green_filters.min.2, ((green_filters.min.2 + green_filters.extent.2) + -1)))
assert((0 <= green_filters.extent.2), halide_error_buffer_extents_negative("Input buffer green_filters", 2, green_filters.extent.2))
assert(((mosaick.min.0 <= mosaick.min.0.required) && ((((mosaick.min.0.required + mosaick.extent.0.required.s) - mosaick.extent.0) + 1) <= mosaick.min.0)), halide_error_access_out_of_bounds("Input buffer mosaick", 0, mosaick.min.0.required, (mosaick.min.0.required + mosaick.extent.0.required.s), mosaick.min.0, ((mosaick.min.0 + mosaick.extent.0) + -1)))
assert((0 <= mosaick.extent.0), halide_error_buffer_extents_negative("Input buffer mosaick", 0, mosaick.extent.0))
assert(((mosaick.min.1 <= mosaick.min.1.required) && ((((mosaick.min.1.required + mosaick.extent.1.required.s) - mosaick.extent.1) + 1) <= mosaick.min.1)), halide_error_access_out_of_bounds("Input buffer mosaick", 1, mosaick.min.1.required, (mosaick.min.1.required + mosaick.extent.1.required.s), mosaick.min.1, ((mosaick.min.1 + mosaick.extent.1) + -1)))
assert((0 <= mosaick.extent.1), halide_error_buffer_extents_negative("Input buffer mosaick", 1, mosaick.extent.1))
assert(((mosaick.min.2 <= mosaick.min.2.required) && ((((mosaick.min.2.required + mosaick.extent.2.required.s) - mosaick.extent.2) + 1) <= mosaick.min.2)), halide_error_access_out_of_bounds("Input buffer mosaick", 2, mosaick.min.2.required, (mosaick.min.2.required + mosaick.extent.2.required.s), mosaick.min.2, ((mosaick.min.2 + mosaick.extent.2) + -1)))
assert((0 <= mosaick.extent.2), halide_error_buffer_extents_negative("Input buffer mosaick", 2, mosaick.extent.2))
assert(((selection_filters.min.0 <= 0) && (0 <= selection_filters.min.0)), halide_error_access_out_of_bounds("Input buffer selection_filters", 0, 0, (selection_filters.extent.0 + -1), selection_filters.min.0, ((selection_filters.min.0 + selection_filters.extent.0) + -1)))
assert((0 <= selection_filters.extent.0), halide_error_buffer_extents_negative("Input buffer selection_filters", 0, selection_filters.extent.0))
assert(((selection_filters.min.1 <= 0) && (0 <= selection_filters.min.1)), halide_error_access_out_of_bounds("Input buffer selection_filters", 1, 0, (selection_filters.extent.1 + -1), selection_filters.min.1, ((selection_filters.min.1 + selection_filters.extent.1) + -1)))
assert((0 <= selection_filters.extent.1), halide_error_buffer_extents_negative("Input buffer selection_filters", 1, selection_filters.extent.1))
assert(((selection_filters.min.2 <= 0) && ((max(green_filters.extent.2, 1) - selection_filters.extent.2) <= selection_filters.min.2)), halide_error_access_out_of_bounds("Input buffer selection_filters", 2, 0, (max(green_filters.extent.2, 1) + -1), selection_filters.min.2, ((selection_filters.min.2 + selection_filters.extent.2) + -1)))
assert((0 <= selection_filters.extent.2), halide_error_buffer_extents_negative("Input buffer selection_filters", 2, selection_filters.extent.2))
assert((d_green_filters.stride.0 == 1), halide_error_constraint_violated("d_green_filters.stride.0", d_green_filters.stride.0, "1", 1))
assert((d_mosaick.stride.0 == 1), halide_error_constraint_violated("d_mosaick.stride.0", d_mosaick.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_selection_filters.stride.0 == 1), halide_error_constraint_violated("d_selection_filters.stride.0", d_selection_filters.stride.0, "1", 1))
assert((green_filters.stride.0 == 1), halide_error_constraint_violated("green_filters.stride.0", green_filters.stride.0, "1", 1))
assert((mosaick.stride.0 == 1), halide_error_constraint_violated("mosaick.stride.0", mosaick.stride.0, "1", 1))
assert((selection_filters.stride.0 == 1), halide_error_constraint_violated("selection_filters.stride.0", selection_filters.stride.0, "1", 1))

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

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

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_selection_filters.total_extent.1 = (int64(d_selection_filters.extent.1) * int64(d_selection_filters.extent.0))

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

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

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

assert((abs(int64(d_green_filters.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_green_filters", abs(int64(d_green_filters.extent.0)), (uint64)2147483647))
assert((abs((int64(d_green_filters.extent.1) * int64(d_green_filters.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_green_filters", abs((int64(d_green_filters.extent.1) * int64(d_green_filters.stride.1))), (uint64)2147483647))
assert((d_green_filters.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_green_filters", d_green_filters.total_extent.1, (int64)2147483647))
assert((abs((int64(d_green_filters.extent.2) * int64(d_green_filters.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_green_filters", abs((int64(d_green_filters.extent.2) * int64(d_green_filters.stride.2))), (uint64)2147483647))
assert(((int64(d_green_filters.extent.2) * d_green_filters.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_green_filters", (int64(d_green_filters.extent.2) * d_green_filters.total_extent.1), (int64)2147483647))
assert((abs(int64(d_mosaick.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_mosaick", abs(int64(d_mosaick.extent.0)), (uint64)2147483647))
assert((abs((int64(d_mosaick.extent.1) * int64(d_mosaick.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_mosaick", abs((int64(d_mosaick.extent.1) * int64(d_mosaick.stride.1))), (uint64)2147483647))
assert((d_mosaick.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_mosaick", d_mosaick.total_extent.1, (int64)2147483647))
assert((abs((int64(d_mosaick.extent.2) * int64(d_mosaick.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_mosaick", abs((int64(d_mosaick.extent.2) * int64(d_mosaick.stride.2))), (uint64)2147483647))
assert(((int64(d_mosaick.extent.2) * d_mosaick.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_mosaick", (int64(d_mosaick.extent.2) * d_mosaick.total_extent.1), (int64)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_selection_filters.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_selection_filters", abs(int64(d_selection_filters.extent.0)), (uint64)2147483647))
assert((abs((int64(d_selection_filters.extent.1) * int64(d_selection_filters.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_selection_filters", abs((int64(d_selection_filters.extent.1) * int64(d_selection_filters.stride.1))), (uint64)2147483647))
assert((d_selection_filters.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("d_selection_filters", d_selection_filters.total_extent.1, (int64)2147483647))
assert((abs((int64(d_selection_filters.extent.2) * int64(d_selection_filters.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("d_selection_filters", abs((int64(d_selection_filters.extent.2) * int64(d_selection_filters.stride.2))), (uint64)2147483647))
assert(((int64(d_selection_filters.extent.2) * d_selection_filters.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("d_selection_filters", (int64(d_selection_filters.extent.2) * d_selection_filters.total_extent.1), (int64)2147483647))
assert((abs(int64(green_filters.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("green_filters", abs(int64(green_filters.extent.0)), (uint64)2147483647))
assert((abs((int64(green_filters.extent.1) * int64(green_filters.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("green_filters", abs((int64(green_filters.extent.1) * int64(green_filters.stride.1))), (uint64)2147483647))
assert((green_filters.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("green_filters", green_filters.total_extent.1, (int64)2147483647))
assert((abs((int64(green_filters.extent.2) * int64(green_filters.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("green_filters", abs((int64(green_filters.extent.2) * int64(green_filters.stride.2))), (uint64)2147483647))
assert(((int64(green_filters.extent.2) * green_filters.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("green_filters", (int64(green_filters.extent.2) * green_filters.total_extent.1), (int64)2147483647))
assert((abs(int64(mosaick.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("mosaick", abs(int64(mosaick.extent.0)), (uint64)2147483647))
assert((abs((int64(mosaick.extent.1) * int64(mosaick.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("mosaick", abs((int64(mosaick.extent.1) * int64(mosaick.stride.1))), (uint64)2147483647))
assert((mosaick.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("mosaick", mosaick.total_extent.1, (int64)2147483647))
assert((abs((int64(mosaick.extent.2) * int64(mosaick.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("mosaick", abs((int64(mosaick.extent.2) * int64(mosaick.stride.2))), (uint64)2147483647))
assert(((int64(mosaick.extent.2) * mosaick.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("mosaick", (int64(mosaick.extent.2) * mosaick.total_extent.1), (int64)2147483647))
assert((abs(int64(selection_filters.extent.0)) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("selection_filters", abs(int64(selection_filters.extent.0)), (uint64)2147483647))
assert((abs((int64(selection_filters.extent.1) * int64(selection_filters.stride.1))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("selection_filters", abs((int64(selection_filters.extent.1) * int64(selection_filters.stride.1))), (uint64)2147483647))
assert((selection_filters.total_extent.1 <= (int64)2147483647), halide_error_buffer_extents_too_large("selection_filters", selection_filters.total_extent.1, (int64)2147483647))
assert((abs((int64(selection_filters.extent.2) * int64(selection_filters.stride.2))) <= (uint64)2147483647), halide_error_buffer_allocation_too_large("selection_filters", abs((int64(selection_filters.extent.2) * int64(selection_filters.stride.2))), (uint64)2147483647))
assert(((int64(selection_filters.extent.2) * selection_filters.total_extent.1) <= (int64)2147483647), halide_error_buffer_extents_too_large("selection_filters", (int64(selection_filters.extent.2) * selection_filters.total_extent.1), (int64)2147483647))
assert((d_green_filters != reinterpret((uint64)0)), halide_error_host_is_null("Output buffer d_green_filters"))
assert((d_mosaick != reinterpret((uint64)0)), halide_error_host_is_null("Output buffer d_mosaick"))
assert((d_output != reinterpret((uint64)0)), halide_error_host_is_null("Input buffer d_output"))
assert((d_selection_filters != reinterpret((uint64)0)), halide_error_host_is_null("Output buffer d_selection_filters"))
assert((mosaick != reinterpret((uint64)0)), halide_error_host_is_null("Input buffer mosaick"))

let f_output_0_d_def__.n.min_realized = min(max(min(min(red_0_d_def__.s1.n.min, green_0_d_def__.s5.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), f_output_0_d_def__.s0.n.min)

let f_output_0_d_def__.n.extent_realized.s = (max(max(min(max(red_0_d_def__.s1.n.max, green_0_d_def__.s5.n.max), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), f_output_0_d_def__.s0.n.max) - min(max(min(min(red_0_d_def__.s1.n.min, green_0_d_def__.s5.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), f_output_0_d_def__.s0.n.min))

let f_output_0_d_def__.y.min_realized = min(max(min(min(red_0_d_def__.s1.y.min, green_0_d_def__.s5.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), f_output_0_d_def__.s0.y.min)

let f_output_0_d_def__.y.extent_realized.s = (max(max(min(max(red_0_d_def__.s1.y.max, green_0_d_def__.s5.y.max), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), f_output_0_d_def__.s0.y.max) - min(max(min(min(red_0_d_def__.s1.y.min, green_0_d_def__.s5.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), f_output_0_d_def__.s0.y.min))

let f_output_0_d_def__.x.min_realized = min(max(min(min(red_0_d_def__.s1.x.min, green_0_d_def__.s5.x.min), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), f_output_0_d_def__.s0.x.min)

let f_output_0_d_def__.x.extent_realized.s = (max(max(min(max(red_0_d_def__.s1.x.max, green_0_d_def__.s5.x.max), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), f_output_0_d_def__.s0.x.max) - min(max(min(min(red_0_d_def__.s1.x.min, green_0_d_def__.s5.x.min), ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), f_output_0_d_def__.s0.x.min))

let f_output_0_d_def__.stride.2 = ((f_output_0_d_def__.x.extent_realized.s + 1) * (f_output_0_d_def__.y.extent_realized.s + 1))

let f_output_0_d_def__.stride.3 = (f_output_0_d_def__.stride.2 * ((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1))

halide_profiler_memory_allocate(profiler_pipeline_state, 1, ((((uint64((f_output_0_d_def__.x.extent_realized.s + 1)) * uint64((f_output_0_d_def__.y.extent_realized.s + 1))) * uint64(((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1))) * uint64((f_output_0_d_def__.n.extent_realized.s + 1))) * (uint64)4))
allocate f_output_0_d_def__[float32 * (f_output_0_d_def__.x.extent_realized.s + 1) * (f_output_0_d_def__.y.extent_realized.s + 1) * ((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1) * (f_output_0_d_def__.n.extent_realized.s + 1)]
produce f_output_0_d_def__
{
halide_profiler_set_current_func(profiler_state, profiler_token, 1)

let halide_copy_to_host_result$5 = halide_copy_to_host(d_output.buffer)

assert((halide_copy_to_host_result$5 == 0), halide_copy_to_host_result$5)

let t11381 = ((f_output_0_d_def__.s0.y.max - f_output_0_d_def__.s0.y.min) + 1)

let t11382 = ((f_output_0_d_def__.s0.x.max - f_output_0_d_def__.s0.x.min) + 1)

let t11379 = ((f_output_0_d_def__.s0.n.max - f_output_0_d_def__.s0.n.min) + 1)

let t11380 = ((f_output_0_d_def__.s0.c.max - d_output.min.2) + 1)

let t11383 = (((d_output.min.0 + (d_output.min.1 * d_output.stride.1)) + (d_output.min.2 * d_output.stride.2)) + (d_output.min.3 * d_output.stride.3))

let t11384 = (f_output_0_d_def__.x.extent_realized.s + 1)

for (f_output_0_d_def__.s0.n, f_output_0_d_def__.s0.n.min, t11379)
{

let t11386 = (((f_output_0_d_def__.s0.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11385 = ((f_output_0_d_def__.s0.n * d_output.stride.3) - t11383)

for (f_output_0_d_def__.s0.c, d_output.min.2, t11380)
{

let t11388 = (t11386 + ((f_output_0_d_def__.s0.c - d_output.min.2) * f_output_0_d_def__.stride.2))

let t11387 = (t11385 + (f_output_0_d_def__.s0.c * d_output.stride.2))

for (f_output_0_d_def__.s0.y, f_output_0_d_def__.s0.y.min, t11381)
{

let t11390 = (t11388 + ((f_output_0_d_def__.s0.y - f_output_0_d_def__.y.min_realized) * t11384))

let t11389 = (t11387 + (f_output_0_d_def__.s0.y * d_output.stride.1))

for (f_output_0_d_def__.s0.x, f_output_0_d_def__.s0.x.min, t11382)
{
f_output_0_d_def__[(t11390 + f_output_0_d_def__.s0.x)] = d_output[(t11389 + f_output_0_d_def__.s0.x)]
}
}
}
}
}
consume f_output_0_d_def__
{
halide_profiler_set_current_func(profiler_state, profiler_token, 0)

let blue_0_d_def__.n.min_realized = min(red_0_d_def__.s1.n.min, min(max(min(f_mosaick_0_d_def__.s6.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), min(max(min(v_interp_0_d_def__.s2.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), red_0_d_def__.s1.n.min)))

let blue_0_d_def__.n.extent_realized.s = (let t10480 = ((f_mosaick_0_d_def__.s6.x.max.s - f_mosaick_0_d_def__.s6.x.min) * (f_mosaick_0_d_def__.s6.y.max.s - f_mosaick_0_d_def__.s6.y.min)) in (max(red_0_d_def__.s1.n.max, max(max(max(min(v_interp_0_d_def__.s2.n.max, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), red_0_d_def__.s1.n.max), max(min((((((((t10480 * ((f_mosaick_0_d_def__.s6.n.max - f_mosaick_0_d_def__.s6.n.min) + 1)) + -1) / 8) * 8) + 7) / max(t10480, 1)) + f_mosaick_0_d_def__.s6.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3))) - min(red_0_d_def__.s1.n.min, min(max(min(f_mosaick_0_d_def__.s6.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), min(max(min(v_interp_0_d_def__.s2.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), red_0_d_def__.s1.n.min)))))

let blue_0_d_def__.y.min_realized = min(min(max(min(f_mosaick_0_d_def__.s6.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), min(max(min(v_interp_0_d_def__.s2.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), min(max(min(h_interp_0_d_def__.s2.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), red_0_d_def__.s1.y.min))), red_0_d_def__.s1.y.min)

let blue_0_d_def__.y.extent_realized.s = (max(max(max(max(min(h_interp_0_d_def__.s2.y.max, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), red_0_d_def__.s1.y.max), max(min(v_interp_0_d_def__.s2.y.max, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)), max(min((((int32(abs(max(((f_mosaick_0_d_def__.s6.x.max.s - f_mosaick_0_d_def__.s6.x.min) * (f_mosaick_0_d_def__.s6.y.max.s - f_mosaick_0_d_def__.s6.y.min)), 1))) + -1) / max((f_mosaick_0_d_def__.s6.x.max.s - f_mosaick_0_d_def__.s6.x.min), 1)) + f_mosaick_0_d_def__.s6.y.min), ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1)) - min(min(max(min(f_mosaick_0_d_def__.s6.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), min(max(min(v_interp_0_d_def__.s2.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), min(max(min(h_interp_0_d_def__.s2.y.min, ((d_output.min.1 + d_output.extent.1) + -1)), d_output.min.1), red_0_d_def__.s1.y.min))), red_0_d_def__.s1.y.min))

let blue_0_d_def__.x.min_realized = min(min(max(min(f_mosaick_0_d_def__.s6.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), min(max(min(v_interp_0_d_def__.s2.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), min(max(min(q_interp_0_d_def__.s2.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), red_0_d_def__.s1.x.min))), red_0_d_def__.s1.x.min)

let blue_0_d_def__.x.extent_realized.s = (max(max(max(max(min(q_interp_0_d_def__.s2.x.max, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), red_0_d_def__.s1.x.max), max(min(v_interp_0_d_def__.s2.x.max, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0)), max((min((int32(abs(max((f_mosaick_0_d_def__.s6.x.max.s - f_mosaick_0_d_def__.s6.x.min), 1))) + f_mosaick_0_d_def__.s6.x.min), (d_output.min.0 + d_output.extent.0)) + -1), d_output.min.0)) - min(min(max(min(f_mosaick_0_d_def__.s6.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), min(max(min(v_interp_0_d_def__.s2.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), min(max(min(q_interp_0_d_def__.s2.x.min, ((d_output.min.0 + d_output.extent.0) + -1)), d_output.min.0), red_0_d_def__.s1.x.min))), red_0_d_def__.s1.x.min))

let blue_0_d_def__.stride.2 = ((blue_0_d_def__.x.extent_realized.s + 1) * (blue_0_d_def__.y.extent_realized.s + 1))

let blue_0_d_def__.buffer = _halide_buffer_init(alloca(size_of_halide_buffer_t()), make_struct(blue_0_d_def__.x.min_realized, (blue_0_d_def__.x.extent_realized.s + 1), 1, 0, blue_0_d_def__.y.min_realized, (blue_0_d_def__.y.extent_realized.s + 1), (blue_0_d_def__.x.extent_realized.s + 1), 0, blue_0_d_def__.n.min_realized, (blue_0_d_def__.n.extent_realized.s + 1), blue_0_d_def__.stride.2, 0), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(blue_0_d_def__.x.min_realized, (blue_0_d_def__.x.extent_realized.s + 1), 1, 0, blue_0_d_def__.y.min_realized, (blue_0_d_def__.y.extent_realized.s + 1), (blue_0_d_def__.x.extent_realized.s + 1), 0, blue_0_d_def__.n.min_realized, (blue_0_d_def__.n.extent_realized.s + 1), blue_0_d_def__.stride.2, 0), (uint64)0)

let halide_device_and_host_malloc_result$7 = halide_device_and_host_malloc(blue_0_d_def__.buffer, halide_cuda_device_interface())

assert((halide_device_and_host_malloc_result$7 == 0), halide_device_and_host_malloc_result$7)
register_destructor("halide_device_and_host_free_as_destructor", blue_0_d_def__.buffer)
halide_profiler_memory_allocate(profiler_pipeline_state, 2, (((uint64((blue_0_d_def__.x.extent_realized.s + 1)) * uint64((blue_0_d_def__.y.extent_realized.s + 1))) * uint64((blue_0_d_def__.n.extent_realized.s + 1))) * (uint64)4))
allocate blue_0_d_def__[float32 * (blue_0_d_def__.x.extent_realized.s + 1) * (blue_0_d_def__.y.extent_realized.s + 1) * (blue_0_d_def__.n.extent_realized.s + 1)]custom_new{_halide_buffer_get_host(blue_0_d_def__.buffer)}custom_delete{ halide_device_host_nop_free(); }
produce blue_0_d_def__
{
halide_profiler_set_current_func(profiler_state, profiler_token, 2)

let t11392 = ((red_0_d_def__.s1.y.max - red_0_d_def__.s1.y.min) + 1)

let t11393 = ((red_0_d_def__.s1.x.max - red_0_d_def__.s1.x.min) + 1)

let t11391 = ((red_0_d_def__.s1.n.max - red_0_d_def__.s1.n.min) + 1)

let t11394 = (blue_0_d_def__.x.extent_realized.s + 1)

for (blue_0_d_def__.s0.n, red_0_d_def__.s1.n.min, t11391)
{

let t11395 = (((blue_0_d_def__.s0.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

for (blue_0_d_def__.s0.y, red_0_d_def__.s1.y.min, t11392)
{

let t11396 = (t11395 + ((blue_0_d_def__.s0.y - blue_0_d_def__.y.min_realized) * t11394))

for (blue_0_d_def__.s0.x, red_0_d_def__.s1.x.min, t11393)
{
blue_0_d_def__[(t11396 + blue_0_d_def__.s0.x)] = 0.000000f
}
}
}
_halide_buffer_set_host_dirty(blue_0_d_def__.buffer, (uint1)1)

let blue_0_d_def__.s1.n.prologue = min(max(d_output.min.3, red_0_d_def__.s1.n.min), (red_0_d_def__.s1.n.max + 1))

let blue_0_d_def__.s1.n.epilogue = min(max((d_output.min.3 + d_output.extent.3), max(d_output.min.3, red_0_d_def__.s1.n.min)), (red_0_d_def__.s1.n.max + 1))

let blue_0_d_def__.s1.n.new_min = max(min(d_output.min.3, blue_0_d_def__.s1.n.prologue), red_0_d_def__.s1.n.min)

let blue_0_d_def__.s1.n.new_max = max(min((d_output.min.3 + d_output.extent.3), blue_0_d_def__.s1.n.prologue), blue_0_d_def__.s1.n.new_min)

let t11405 = (red_0_d_def__.s1.x.max + 1)

let t11406 = (red_0_d_def__.s1.y.max + 1)

let t11398 = max(min(d_output.min.1, t11406), red_0_d_def__.s1.y.min)

let t11400 = max(min(d_output.min.0, t11405), red_0_d_def__.s1.x.min)

let t11402 = max((d_output.min.2 + d_output.extent.2), d_output.min.2)

let t11399 = min((d_output.min.1 + d_output.extent.1), t11406)

let t11401 = min((d_output.min.0 + d_output.extent.0), t11405)

let t11397 = (blue_0_d_def__.s1.n.new_max - blue_0_d_def__.s1.n.new_min)

let t11404 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11403 = (blue_0_d_def__.x.extent_realized.s + 1)

for (blue_0_d_def__.s1.n, blue_0_d_def__.s1.n.new_min, t11397)
{

let blue_0_d_def__.s1.y.new_min = t11398

let blue_0_d_def__.s1.y.new_max = max(t11399, blue_0_d_def__.s1.y.new_min)

let t11409 = (((blue_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11408 = (((blue_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11407 = (blue_0_d_def__.s1.y.new_max - blue_0_d_def__.s1.y.new_min)

for (blue_0_d_def__.s1.y, blue_0_d_def__.s1.y.new_min, t11407)
{

let blue_0_d_def__.s1.x.new_min = t11400

let blue_0_d_def__.s1.x.new_max = max(t11401, blue_0_d_def__.s1.x.new_min)

let t11410 = (blue_0_d_def__.s1.x.new_max - blue_0_d_def__.s1.x.new_min)

let t11412 = (t11409 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11404))

let t11411 = (t11408 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11403))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.new_min, t11410)
{

let blue_0_d_def__.s1.r29$x.new_max = t11402

let t11413 = (blue_0_d_def__.s1.r29$x.new_max - d_output.min.2)

let t11415 = (t11412 + blue_0_d_def__.s1.x)

let t11414 = (t11411 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11413)
{
blue_0_d_def__[t11414] = (blue_0_d_def__[t11414] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11415 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}
}
}

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

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

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

let t11435 = (red_0_d_def__.s1.x.max + 1)

let t11436 = (red_0_d_def__.s1.y.max + 1)

let t11437 = max(d_output.min.0, red_0_d_def__.s1.x.min)

let t11438 = max(d_output.min.1, red_0_d_def__.s1.y.min)

let t11439 = min(max(d_output.min.2, 2), (d_output.extent.2 + d_output.min.2))

let t11429 = max(t11439, t11434)

let t11420 = max(min(d_output.min.0, t11435), red_0_d_def__.s1.x.min)

let t11422 = max(t11434, d_output.min.2)

let t11418 = min(max(t11433, t11438), t11436)

let t11426 = min(max(t11432, t11437), t11435)

let t11417 = min(t11438, t11436)

let t11425 = min(t11437, t11435)

let t11431 = min(t11433, t11436)

let t11421 = min(t11432, t11435)

let t11416 = (blue_0_d_def__.s1.n.epilogue - blue_0_d_def__.s1.n.prologue)

let t11424 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11423 = (blue_0_d_def__.x.extent_realized.s + 1)

for (blue_0_d_def__.s1.n, blue_0_d_def__.s1.n.prologue, t11416)
{

let blue_0_d_def__.s1.y.prologue = t11417

let blue_0_d_def__.s1.y.epilogue = t11418

let blue_0_d_def__.s1.y.new_min$1 = max(min(d_output.min.1, blue_0_d_def__.s1.y.prologue), red_0_d_def__.s1.y.min)

let blue_0_d_def__.s1.y.new_max$1 = max(min(t11433, blue_0_d_def__.s1.y.prologue), blue_0_d_def__.s1.y.new_min$1)

let t11442 = (((blue_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11441 = (((blue_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11440 = (blue_0_d_def__.s1.y.new_max$1 - blue_0_d_def__.s1.y.new_min$1)

for (blue_0_d_def__.s1.y, blue_0_d_def__.s1.y.new_min$1, t11440)
{

let blue_0_d_def__.s1.x.new_min$1 = t11420

let blue_0_d_def__.s1.x.new_max$1 = max(t11421, blue_0_d_def__.s1.x.new_min$1)

let t11443 = (blue_0_d_def__.s1.x.new_max$1 - blue_0_d_def__.s1.x.new_min$1)

let t11445 = (t11442 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11424))

let t11444 = (t11441 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11423))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.new_min$1, t11443)
{

let blue_0_d_def__.s1.r29_x.new_max$1 = t11422

let t11446 = (blue_0_d_def__.s1.r29_x.new_max$1 - d_output.min.2)

let t11448 = (t11445 + blue_0_d_def__.s1.x)

let t11447 = (t11444 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11446)
{
blue_0_d_def__[t11447] = (blue_0_d_def__[t11447] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11448 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}
}

let t11451 = (((blue_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11450 = (((blue_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11449 = (blue_0_d_def__.s1.y.epilogue - blue_0_d_def__.s1.y.prologue)

for (blue_0_d_def__.s1.y, blue_0_d_def__.s1.y.prologue, t11449)
{

let blue_0_d_def__.s1.x.prologue = t11425

let blue_0_d_def__.s1.x.epilogue = t11426

let blue_0_d_def__.s1.x.new_min$2 = max(min(d_output.min.0, blue_0_d_def__.s1.x.prologue), red_0_d_def__.s1.x.min)

let blue_0_d_def__.s1.x.new_max$2 = max(min(t11432, blue_0_d_def__.s1.x.prologue), blue_0_d_def__.s1.x.new_min$2)

let t11452 = (blue_0_d_def__.s1.x.new_max$2 - blue_0_d_def__.s1.x.new_min$2)

let t11454 = (t11451 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11424))

let t11453 = (t11450 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11423))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.new_min$2, t11452)
{

let blue_0_d_def__.s1.r29_x.new_max$2 = t11422

let t11455 = (blue_0_d_def__.s1.r29_x.new_max$2 - d_output.min.2)

let t11457 = (t11454 + blue_0_d_def__.s1.x)

let t11456 = (t11453 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11455)
{
blue_0_d_def__[t11456] = (blue_0_d_def__[t11456] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11457 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}

let t11458 = (blue_0_d_def__.s1.x.epilogue - blue_0_d_def__.s1.x.prologue)

let t11460 = (t11451 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11424))

let t11459 = (t11450 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11423))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.prologue, t11458)
{

let blue_0_d_def__.s1.r29$x.prologue = t11439

let blue_0_d_def__.s1.r29$x.epilogue = t11429

let blue_0_d_def__.s1.r29_x.new_max$3 = max(min(t11434, blue_0_d_def__.s1.r29$x.prologue), d_output.min.2)

let t11461 = (blue_0_d_def__.s1.r29_x.new_max$3 - d_output.min.2)

let t11463 = (t11460 + blue_0_d_def__.s1.x)

let t11462 = (t11459 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11461)
{
blue_0_d_def__[t11462] = (blue_0_d_def__[t11462] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11463 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}

let t11464 = (blue_0_d_def__.s1.r29$x.epilogue - blue_0_d_def__.s1.r29$x.prologue)

let t11466 = (t11460 + blue_0_d_def__.s1.x)

let t11465 = (t11459 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, blue_0_d_def__.s1.r29$x.prologue, t11464)
{
blue_0_d_def__[t11465] = (blue_0_d_def__[t11465] + f_output_0_d_def__[(t11466 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))])
}

let blue_0_d_def__.s1.r29_x.new_max$4 = max(t11434, blue_0_d_def__.s1.r29$x.epilogue)

let t11467 = (blue_0_d_def__.s1.r29_x.new_max$4 - blue_0_d_def__.s1.r29$x.epilogue)

let t11469 = (t11460 + blue_0_d_def__.s1.x)

let t11468 = (t11459 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, blue_0_d_def__.s1.r29$x.epilogue, t11467)
{
blue_0_d_def__[t11468] = (blue_0_d_def__[t11468] + f_output_0_d_def__[(t11469 + (max((blue_0_d_def__.s1.r29$x - d_output.min.2), 0) * f_output_0_d_def__.stride.2))])
}
}

let blue_0_d_def__.s1.x.new_max$3 = max(t11421, blue_0_d_def__.s1.x.epilogue)

let t11470 = (blue_0_d_def__.s1.x.new_max$3 - blue_0_d_def__.s1.x.epilogue)

let t11472 = (t11451 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11424))

let t11471 = (t11450 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11423))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.epilogue, t11470)
{

let blue_0_d_def__.s1.r29_x.new_max$5 = t11422

let t11473 = (blue_0_d_def__.s1.r29_x.new_max$5 - d_output.min.2)

let t11475 = (max(blue_0_d_def__.s1.x, d_output.min.0) + t11472)

let t11474 = (t11471 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11473)
{
blue_0_d_def__[t11474] = (blue_0_d_def__[t11474] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11475 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}
}

let blue_0_d_def__.s1.y.new_max$2 = max(t11431, blue_0_d_def__.s1.y.epilogue)

let t11478 = (((blue_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11477 = (((blue_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11476 = (blue_0_d_def__.s1.y.new_max$2 - blue_0_d_def__.s1.y.epilogue)

for (blue_0_d_def__.s1.y, blue_0_d_def__.s1.y.epilogue, t11476)
{

let blue_0_d_def__.s1.x.new_min$4 = t11420

let blue_0_d_def__.s1.x.new_max$4 = max(t11421, blue_0_d_def__.s1.x.new_min$4)

let t11479 = (blue_0_d_def__.s1.x.new_max$4 - blue_0_d_def__.s1.x.new_min$4)

let t11481 = (t11478 + ((max(blue_0_d_def__.s1.y, d_output.min.1) - f_output_0_d_def__.y.min_realized) * t11424))

let t11480 = (t11477 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11423))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.new_min$4, t11479)
{

let blue_0_d_def__.s1.r29_x.new_max$6 = t11422

let t11482 = (blue_0_d_def__.s1.r29_x.new_max$6 - d_output.min.2)

let t11484 = (t11481 + blue_0_d_def__.s1.x)

let t11483 = (t11480 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11482)
{
blue_0_d_def__[t11483] = (blue_0_d_def__[t11483] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11484 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}
}
}

let blue_0_d_def__.s1.n.new_max$1 = max(min((d_output.min.3 + d_output.extent.3), (red_0_d_def__.s1.n.max + 1)), blue_0_d_def__.s1.n.epilogue)

let t11493 = (red_0_d_def__.s1.x.max + 1)

let t11494 = (red_0_d_def__.s1.y.max + 1)

let t11486 = max(min(d_output.min.1, t11494), red_0_d_def__.s1.y.min)

let t11488 = max(min(d_output.min.0, t11493), red_0_d_def__.s1.x.min)

let t11490 = max((d_output.min.2 + d_output.extent.2), d_output.min.2)

let t11487 = min((d_output.min.1 + d_output.extent.1), t11494)

let t11489 = min((d_output.min.0 + d_output.extent.0), t11493)

let t11485 = (blue_0_d_def__.s1.n.new_max$1 - blue_0_d_def__.s1.n.epilogue)

let t11492 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11491 = (blue_0_d_def__.x.extent_realized.s + 1)

for (blue_0_d_def__.s1.n, blue_0_d_def__.s1.n.epilogue, t11485)
{

let blue_0_d_def__.s1.y.new_min$3 = t11486

let blue_0_d_def__.s1.y.new_max$3 = max(t11487, blue_0_d_def__.s1.y.new_min$3)

let t11497 = (((max(blue_0_d_def__.s1.n, d_output.min.3) - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11496 = (((blue_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11495 = (blue_0_d_def__.s1.y.new_max$3 - blue_0_d_def__.s1.y.new_min$3)

for (blue_0_d_def__.s1.y, blue_0_d_def__.s1.y.new_min$3, t11495)
{

let blue_0_d_def__.s1.x.new_min$5 = t11488

let blue_0_d_def__.s1.x.new_max$5 = max(t11489, blue_0_d_def__.s1.x.new_min$5)

let t11498 = (blue_0_d_def__.s1.x.new_max$5 - blue_0_d_def__.s1.x.new_min$5)

let t11500 = (t11497 + ((blue_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11492))

let t11499 = (t11496 + ((blue_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11491))

for (blue_0_d_def__.s1.x, blue_0_d_def__.s1.x.new_min$5, t11498)
{

let blue_0_d_def__.s1.r29_x.new_max$7 = t11490

let t11501 = (blue_0_d_def__.s1.r29_x.new_max$7 - d_output.min.2)

let t11503 = (t11500 + blue_0_d_def__.s1.x)

let t11502 = (t11499 + blue_0_d_def__.s1.x)

for (blue_0_d_def__.s1.r29$x, d_output.min.2, t11501)
{
blue_0_d_def__[t11502] = (blue_0_d_def__[t11502] + select(((blue_0_d_def__.s1.r29$x == 1) || (blue_0_d_def__.s1.r29$x == 0)), 0.000000f, f_output_0_d_def__[(t11503 + ((blue_0_d_def__.s1.r29$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}
}
}
}
}
consume blue_0_d_def__
{
halide_profiler_set_current_func(profiler_state, profiler_token, 0)

let red_0_d_def__.n.extent_realized.s = (let t10487 = ((f_mosaick_0_d_def__.s6.x.max.s - f_mosaick_0_d_def__.s6.x.min) * (f_mosaick_0_d_def__.s6.y.max.s - f_mosaick_0_d_def__.s6.y.min)) in (max(red_0_d_def__.s1.n.max, max(max(max(min(v_interp_0_d_def__.s2.n.max, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), red_0_d_def__.s1.n.max), max(min((((((((t10487 * ((f_mosaick_0_d_def__.s6.n.max - f_mosaick_0_d_def__.s6.n.min) + 1)) + -1) / 8) * 8) + 7) / max(t10487, 1)) + f_mosaick_0_d_def__.s6.n.min), ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3))) - min(red_0_d_def__.s1.n.min, min(max(min(f_mosaick_0_d_def__.s6.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), min(max(min(v_interp_0_d_def__.s2.n.min, ((d_output.min.3 + d_output.extent.3) + -1)), d_output.min.3), red_0_d_def__.s1.n.min)))))

let red_0_d_def__.buffer = _halide_buffer_init(alloca(size_of_halide_buffer_t()), make_struct(blue_0_d_def__.x.min_realized, (blue_0_d_def__.x.extent_realized.s + 1), 1, 0, blue_0_d_def__.y.min_realized, (blue_0_d_def__.y.extent_realized.s + 1), (blue_0_d_def__.x.extent_realized.s + 1), 0, blue_0_d_def__.n.min_realized, (red_0_d_def__.n.extent_realized.s + 1), blue_0_d_def__.stride.2, 0), reinterpret((uint64)0), (uint64)0, reinterpret((uint64)0), 2, 32, 3, make_struct(blue_0_d_def__.x.min_realized, (blue_0_d_def__.x.extent_realized.s + 1), 1, 0, blue_0_d_def__.y.min_realized, (blue_0_d_def__.y.extent_realized.s + 1), (blue_0_d_def__.x.extent_realized.s + 1), 0, blue_0_d_def__.n.min_realized, (red_0_d_def__.n.extent_realized.s + 1), blue_0_d_def__.stride.2, 0), (uint64)0)

let halide_device_and_host_malloc_result$6 = halide_device_and_host_malloc(red_0_d_def__.buffer, halide_cuda_device_interface())

assert((halide_device_and_host_malloc_result$6 == 0), halide_device_and_host_malloc_result$6)
register_destructor("halide_device_and_host_free_as_destructor", red_0_d_def__.buffer)
halide_profiler_memory_allocate(profiler_pipeline_state, 3, (((uint64((blue_0_d_def__.x.extent_realized.s + 1)) * uint64((blue_0_d_def__.y.extent_realized.s + 1))) * uint64((red_0_d_def__.n.extent_realized.s + 1))) * (uint64)4))
allocate red_0_d_def__[float32 * (blue_0_d_def__.x.extent_realized.s + 1) * (blue_0_d_def__.y.extent_realized.s + 1) * (red_0_d_def__.n.extent_realized.s + 1)]custom_new{_halide_buffer_get_host(red_0_d_def__.buffer)}custom_delete{ halide_device_host_nop_free(); }
produce red_0_d_def__
{
halide_profiler_set_current_func(profiler_state, profiler_token, 3)

let t11505 = ((red_0_d_def__.s1.y.max - red_0_d_def__.s1.y.min) + 1)

let t11506 = ((red_0_d_def__.s1.x.max - red_0_d_def__.s1.x.min) + 1)

let t11504 = ((red_0_d_def__.s1.n.max - red_0_d_def__.s1.n.min) + 1)

let t11507 = (blue_0_d_def__.x.extent_realized.s + 1)

for (red_0_d_def__.s0.n, red_0_d_def__.s1.n.min, t11504)
{

let t11508 = (((red_0_d_def__.s0.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

for (red_0_d_def__.s0.y, red_0_d_def__.s1.y.min, t11505)
{

let t11509 = (t11508 + ((red_0_d_def__.s0.y - blue_0_d_def__.y.min_realized) * t11507))

for (red_0_d_def__.s0.x, red_0_d_def__.s1.x.min, t11506)
{
red_0_d_def__[(t11509 + red_0_d_def__.s0.x)] = 0.000000f
}
}
}
_halide_buffer_set_host_dirty(red_0_d_def__.buffer, (uint1)1)

let red_0_d_def__.s1.n.prologue = min(max(d_output.min.3, red_0_d_def__.s1.n.min), (red_0_d_def__.s1.n.max + 1))

let red_0_d_def__.s1.n.epilogue = min(max((d_output.min.3 + d_output.extent.3), max(d_output.min.3, red_0_d_def__.s1.n.min)), (red_0_d_def__.s1.n.max + 1))

let red_0_d_def__.s1.n.new_min$1 = max(min(d_output.min.3, red_0_d_def__.s1.n.prologue), red_0_d_def__.s1.n.min)

let red_0_d_def__.s1.n.new_max = max(min((d_output.min.3 + d_output.extent.3), red_0_d_def__.s1.n.prologue), red_0_d_def__.s1.n.new_min$1)

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

let t11522 = (red_0_d_def__.s1.x.max + 1)

let t11523 = (red_0_d_def__.s1.y.max + 1)

let t11519 = (0 < d_output.min.2)

let t11515 = max(min(t11521, 0), d_output.min.2)

let t11511 = max(min(d_output.min.1, t11523), red_0_d_def__.s1.y.min)

let t11513 = max(min(d_output.min.0, t11522), red_0_d_def__.s1.x.min)

let t11516 = min(t11521, 1)

let t11512 = min((d_output.min.1 + d_output.extent.1), t11523)

let t11514 = min((d_output.min.0 + d_output.extent.0), t11522)

let t11510 = (red_0_d_def__.s1.n.new_max - red_0_d_def__.s1.n.new_min$1)

let t11520 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11518 = (blue_0_d_def__.x.extent_realized.s + 1)

for (red_0_d_def__.s1.n, red_0_d_def__.s1.n.new_min$1, t11510)
{

let red_0_d_def__.s1.y.new_min = t11511

let red_0_d_def__.s1.y.new_max = max(t11512, red_0_d_def__.s1.y.new_min)

let t11526 = (((red_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11525 = (((red_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11524 = (red_0_d_def__.s1.y.new_max - red_0_d_def__.s1.y.new_min)

for (red_0_d_def__.s1.y, red_0_d_def__.s1.y.new_min, t11524)
{

let red_0_d_def__.s1.x.new_min = t11513

let red_0_d_def__.s1.x.new_max = max(t11514, red_0_d_def__.s1.x.new_min)

let t11527 = (red_0_d_def__.s1.x.new_max - red_0_d_def__.s1.x.new_min)

let t11529 = (t11526 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11520))

let t11528 = (t11525 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11518))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.new_min, t11527)
{

let red_0_d_def__.s1.r67$x.new_min = t11515

let red_0_d_def__.s1.r67$x.new_max = max(t11516, red_0_d_def__.s1.r67$x.new_min)

let t11530 = (red_0_d_def__.s1.r67$x.new_max - red_0_d_def__.s1.r67$x.new_min)

let t11532 = (t11529 + red_0_d_def__.s1.x)

let t11531 = (t11528 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67$x.new_min, t11530)
{
red_0_d_def__[t11531] = (red_0_d_def__[t11531] + select(!(t11519 || (t11521 <= 0)), f_output_0_d_def__[(t11532 + (max((min(red_0_d_def__.s1.r67$x, (t11521 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}
}
}

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

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

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

let t11556 = (red_0_d_def__.s1.x.max + 1)

let t11557 = (red_0_d_def__.s1.y.max + 1)

let t11558 = min(t11555, 0)

let t11559 = min(t11555, 1)

let t11560 = max(d_output.min.0, red_0_d_def__.s1.x.min)

let t11561 = max(d_output.min.1, red_0_d_def__.s1.y.min)

let t11562 = min(max(d_output.min.2, 0), (d_output.extent.2 + d_output.min.2))

let t11563 = (0 < d_output.min.2)

let t11550 = (t11563 || (t11555 <= 0))

let t11549 = max(t11559, t11562)

let t11539 = max(t11558, d_output.min.2)

let t11537 = max(min(d_output.min.0, t11556), red_0_d_def__.s1.x.min)

let t11535 = min(max(t11554, t11561), t11557)

let t11546 = min(max(t11553, t11560), t11556)

let t11534 = min(t11561, t11557)

let t11545 = min(t11560, t11556)

let t11552 = min(t11554, t11557)

let t11538 = min(t11553, t11556)

let t11533 = (red_0_d_def__.s1.n.epilogue - red_0_d_def__.s1.n.prologue)

let t11544 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11542 = (blue_0_d_def__.x.extent_realized.s + 1)

for (red_0_d_def__.s1.n, red_0_d_def__.s1.n.prologue, t11533)
{

let red_0_d_def__.s1.y.prologue = t11534

let red_0_d_def__.s1.y.epilogue = t11535

let red_0_d_def__.s1.y.new_min$1 = max(min(d_output.min.1, red_0_d_def__.s1.y.prologue), red_0_d_def__.s1.y.min)

let red_0_d_def__.s1.y.new_max$1 = max(min(t11554, red_0_d_def__.s1.y.prologue), red_0_d_def__.s1.y.new_min$1)

let t11566 = (((red_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11565 = (((red_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11564 = (red_0_d_def__.s1.y.new_max$1 - red_0_d_def__.s1.y.new_min$1)

for (red_0_d_def__.s1.y, red_0_d_def__.s1.y.new_min$1, t11564)
{

let red_0_d_def__.s1.x.new_min$1 = t11537

let red_0_d_def__.s1.x.new_max$1 = max(t11538, red_0_d_def__.s1.x.new_min$1)

let t11567 = (red_0_d_def__.s1.x.new_max$1 - red_0_d_def__.s1.x.new_min$1)

let t11569 = (t11566 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11544))

let t11568 = (t11565 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11542))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.new_min$1, t11567)
{

let red_0_d_def__.s1.r67_x.new_min$1 = t11539

let red_0_d_def__.s1.r67_x.new_max$1 = max(t11559, red_0_d_def__.s1.r67_x.new_min$1)

let t11570 = (red_0_d_def__.s1.r67_x.new_max$1 - red_0_d_def__.s1.r67_x.new_min$1)

let t11572 = (t11569 + red_0_d_def__.s1.x)

let t11571 = (t11568 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$1, t11570)
{
red_0_d_def__[t11571] = (red_0_d_def__[t11571] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11572 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}
}

let t11575 = (((red_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11574 = (((red_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11573 = (red_0_d_def__.s1.y.epilogue - red_0_d_def__.s1.y.prologue)

for (red_0_d_def__.s1.y, red_0_d_def__.s1.y.prologue, t11573)
{

let red_0_d_def__.s1.x.prologue = t11545

let red_0_d_def__.s1.x.epilogue = t11546

let red_0_d_def__.s1.x.new_min$2 = max(min(d_output.min.0, red_0_d_def__.s1.x.prologue), red_0_d_def__.s1.x.min)

let red_0_d_def__.s1.x.new_max$2 = max(min(t11553, red_0_d_def__.s1.x.prologue), red_0_d_def__.s1.x.new_min$2)

let t11576 = (red_0_d_def__.s1.x.new_max$2 - red_0_d_def__.s1.x.new_min$2)

let t11578 = (t11575 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11544))

let t11577 = (t11574 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11542))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.new_min$2, t11576)
{

let red_0_d_def__.s1.r67_x.new_min$2 = t11539

let red_0_d_def__.s1.r67_x.new_max$2 = max(t11559, red_0_d_def__.s1.r67_x.new_min$2)

let t11579 = (red_0_d_def__.s1.r67_x.new_max$2 - red_0_d_def__.s1.r67_x.new_min$2)

let t11581 = (t11578 + red_0_d_def__.s1.x)

let t11580 = (t11577 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$2, t11579)
{
red_0_d_def__[t11580] = (red_0_d_def__[t11580] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11581 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}

let t11582 = (red_0_d_def__.s1.x.epilogue - red_0_d_def__.s1.x.prologue)

let t11584 = (t11575 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11544))

let t11583 = (t11574 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11542))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.prologue, t11582)
{

let red_0_d_def__.s1.r67$x.prologue = t11562

let red_0_d_def__.s1.r67$x.epilogue = t11549

let red_0_d_def__.s1.r67_x.new_min$3 = max(min(red_0_d_def__.s1.r67$x.prologue, 0), d_output.min.2)

let red_0_d_def__.s1.r67_x.new_max$3 = max(min(red_0_d_def__.s1.r67$x.prologue, 1), red_0_d_def__.s1.r67_x.new_min$3)

let t11585 = (red_0_d_def__.s1.r67_x.new_max$3 - red_0_d_def__.s1.r67_x.new_min$3)

let t11587 = (t11584 + red_0_d_def__.s1.x)

let t11586 = (t11583 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$3, t11585)
{
red_0_d_def__[t11586] = (red_0_d_def__[t11586] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11587 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}

let t11588 = (red_0_d_def__.s1.r67$x.epilogue - red_0_d_def__.s1.r67$x.prologue)

let t11590 = (t11584 + red_0_d_def__.s1.x)

let t11589 = (t11583 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67$x.prologue, t11588)
{
red_0_d_def__[t11589] = (red_0_d_def__[t11589] + select(t11550, 0.000000f, f_output_0_d_def__[(t11590 + ((red_0_d_def__.s1.r67$x - d_output.min.2) * f_output_0_d_def__.stride.2))]))
}

let red_0_d_def__.s1.r67_x.new_min$4 = max(t11558, red_0_d_def__.s1.r67$x.epilogue)

let red_0_d_def__.s1.r67_x.new_max$4 = max(t11559, red_0_d_def__.s1.r67_x.new_min$4)

let t11591 = (red_0_d_def__.s1.r67_x.new_max$4 - red_0_d_def__.s1.r67_x.new_min$4)

let t11593 = (t11584 + red_0_d_def__.s1.x)

let t11592 = (t11583 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$4, t11591)
{
red_0_d_def__[t11592] = (red_0_d_def__[t11592] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11593 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}

let red_0_d_def__.s1.x.new_max$3 = max(t11538, red_0_d_def__.s1.x.epilogue)

let t11594 = (red_0_d_def__.s1.x.new_max$3 - red_0_d_def__.s1.x.epilogue)

let t11596 = (t11575 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11544))

let t11595 = (t11574 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11542))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.epilogue, t11594)
{

let red_0_d_def__.s1.r67_x.new_min$5 = t11539

let red_0_d_def__.s1.r67_x.new_max$5 = max(t11559, red_0_d_def__.s1.r67_x.new_min$5)

let t11597 = (red_0_d_def__.s1.r67_x.new_max$5 - red_0_d_def__.s1.r67_x.new_min$5)

let t11599 = (max(red_0_d_def__.s1.x, d_output.min.0) + t11596)

let t11598 = (t11595 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$5, t11597)
{
red_0_d_def__[t11598] = (red_0_d_def__[t11598] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11599 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}
}

let red_0_d_def__.s1.y.new_max$2 = max(t11552, red_0_d_def__.s1.y.epilogue)

let t11602 = (((red_0_d_def__.s1.n - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11601 = (((red_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11600 = (red_0_d_def__.s1.y.new_max$2 - red_0_d_def__.s1.y.epilogue)

for (red_0_d_def__.s1.y, red_0_d_def__.s1.y.epilogue, t11600)
{

let red_0_d_def__.s1.x.new_min$4 = t11537

let red_0_d_def__.s1.x.new_max$4 = max(t11538, red_0_d_def__.s1.x.new_min$4)

let t11603 = (red_0_d_def__.s1.x.new_max$4 - red_0_d_def__.s1.x.new_min$4)

let t11605 = (t11602 + ((max(red_0_d_def__.s1.y, d_output.min.1) - f_output_0_d_def__.y.min_realized) * t11544))

let t11604 = (t11601 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11542))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.new_min$4, t11603)
{

let red_0_d_def__.s1.r67_x.new_min$6 = t11539

let red_0_d_def__.s1.r67_x.new_max$6 = max(t11559, red_0_d_def__.s1.r67_x.new_min$6)

let t11606 = (red_0_d_def__.s1.r67_x.new_max$6 - red_0_d_def__.s1.r67_x.new_min$6)

let t11608 = (t11605 + red_0_d_def__.s1.x)

let t11607 = (t11604 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$6, t11606)
{
red_0_d_def__[t11607] = (red_0_d_def__[t11607] + select(!(t11563 || (t11555 <= 0)), f_output_0_d_def__[(t11608 + (max((min(red_0_d_def__.s1.r67$x, (t11555 + -1)) - d_output.min.2), 0) * f_output_0_d_def__.stride.2))], 0.000000f))
}
}
}
}

let red_0_d_def__.s1.n.new_max$1 = max(min((d_output.min.3 + d_output.extent.3), (red_0_d_def__.s1.n.max + 1)), red_0_d_def__.s1.n.epilogue)

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

let t11621 = (red_0_d_def__.s1.x.max + 1)

let t11622 = (red_0_d_def__.s1.y.max + 1)

let t11618 = (0 < d_output.min.2)

let t11614 = max(min(t11620, 0), d_output.min.2)

let t11610 = max(min(d_output.min.1, t11622), red_0_d_def__.s1.y.min)

let t11612 = max(min(d_output.min.0, t11621), red_0_d_def__.s1.x.min)

let t11615 = min(t11620, 1)

let t11611 = min((d_output.min.1 + d_output.extent.1), t11622)

let t11613 = min((d_output.min.0 + d_output.extent.0), t11621)

let t11609 = (red_0_d_def__.s1.n.new_max$1 - red_0_d_def__.s1.n.epilogue)

let t11619 = (f_output_0_d_def__.x.extent_realized.s + 1)

let t11617 = (blue_0_d_def__.x.extent_realized.s + 1)

for (red_0_d_def__.s1.n, red_0_d_def__.s1.n.epilogue, t11609)
{

let red_0_d_def__.s1.y.new_min$3 = t11610

let red_0_d_def__.s1.y.new_max$3 = max(t11611, red_0_d_def__.s1.y.new_min$3)

let t11625 = (((max(red_0_d_def__.s1.n, d_output.min.3) - f_output_0_d_def__.n.min_realized) * f_output_0_d_def__.stride.3) - f_output_0_d_def__.x.min_realized)

let t11624 = (((red_0_d_def__.s1.n - blue_0_d_def__.n.min_realized) * blue_0_d_def__.stride.2) - blue_0_d_def__.x.min_realized)

let t11623 = (red_0_d_def__.s1.y.new_max$3 - red_0_d_def__.s1.y.new_min$3)

for (red_0_d_def__.s1.y, red_0_d_def__.s1.y.new_min$3, t11623)
{

let red_0_d_def__.s1.x.new_min$5 = t11612

let red_0_d_def__.s1.x.new_max$5 = max(t11613, red_0_d_def__.s1.x.new_min$5)

let t11626 = (red_0_d_def__.s1.x.new_max$5 - red_0_d_def__.s1.x.new_min$5)

let t11628 = (t11625 + ((red_0_d_def__.s1.y - f_output_0_d_def__.y.min_realized) * t11619))

let t11627 = (t11624 + ((red_0_d_def__.s1.y - blue_0_d_def__.y.min_realized) * t11617))

for (red_0_d_def__.s1.x, red_0_d_def__.s1.x.new_min$5, t11626)
{

let red_0_d_def__.s1.r67_x.new_min$7 = t11614

let red_0_d_def__.s1.r67_x.new_max$7 = max(t11615, red_0_d_def__.s1.r67_x.new_min$7)

let t11629 = (red_0_d_def__.s1.r67_x.new_max$7 - red_0_d_def__.s1.r67_x.new_min$7)

let t11631 = (t11628 + red_0_d_def__.s1.x)

let t11630 = (t11627 + red_0_d_def__.s1.x)

for (red_0_d_def__.s1.r67$x, red_0_d_def__.s1.r67_x.new_min$7, t11629)
{
red_0_d_def__[t11630] = (red_0_d_def__[t11630] + select(!(t11618 || (t11620 <= 0)), f_output_0_d_def__[