julia> @finch_code begin
        s .= 0
        for i = _, j = _
            s[] += x[j, i] + y[j, i]
        end
    end
quote
    s = (ex.bodies[1]).tns.bind
    x_lvl = ((ex.bodies[2]).body.body.rhs.args[1]).tns.bind.lvl
    x_lvl_2 = x_lvl.lvl
    x_lvl_3 = x_lvl_2.lvl
    y_lvl = ((ex.bodies[2]).body.body.rhs.args[2]).tns.bind.lvl
    y_lvl_2 = y_lvl.lvl
    y_lvl_3 = y_lvl_2.lvl
    y_lvl_2.shape == x_lvl_2.shape || throw(DimensionMismatch("mismatched dimension limits ($(y_lvl_2.shape) != $(x_lvl_2.shape))"))
    y_lvl.shape == x_lvl.shape || throw(DimensionMismatch("mismatched dimension limits ($(y_lvl.shape) != $(x_lvl.shape))"))
    s_val = 0
    y_lvl_q = y_lvl.ptr[1]
    y_lvl_q_stop = y_lvl.ptr[1 + 1]
    if y_lvl_q < y_lvl_q_stop
        y_lvl_i_end = y_lvl.right[y_lvl_q_stop - 1]
    else
        y_lvl_i_end = 0.0f0
    end
    x_lvl_q = x_lvl.ptr[1]
    x_lvl_q_stop = x_lvl.ptr[1 + 1]
    if x_lvl_q < x_lvl_q_stop
        x_lvl_i_end = x_lvl.right[x_lvl_q_stop - 1]
    else
        x_lvl_i_end = 0.0f0
    end
    phase_stop = min(y_lvl.shape, y_lvl_i_end, x_lvl_i_end)
    if phase_stop >= limit(1.0)
        i = limit(1.0)
        if y_lvl.right[y_lvl_q] < limit(1.0)
            y_lvl_q = Finch.scansearch(y_lvl.right, limit(1.0), y_lvl_q, y_lvl_q_stop - 1)
        end
        if x_lvl.right[x_lvl_q] < limit(1.0)
            x_lvl_q = Finch.scansearch(x_lvl.right, limit(1.0), x_lvl_q, x_lvl_q_stop - 1)
        end
        while i <= phase_stop
            y_lvl_i_start = y_lvl.left[y_lvl_q]
            y_lvl_i_stop = y_lvl.right[y_lvl_q]
            x_lvl_i_start = x_lvl.left[x_lvl_q]
            x_lvl_i_stop = x_lvl.right[x_lvl_q]
            phase_start_2 = i
            phase_stop_2 = min(x_lvl_i_stop, phase_stop, y_lvl_i_stop)
            phase_start_4 = max(phase_start_2, y_lvl_i_start)
            phase_stop_4 = min(phase_stop_2, limit(0-ϵ) + x_lvl_i_start)
            if phase_stop_4 >= phase_start_4
                cond_3 = -phase_start_4 + phase_stop_4 == 0
                if cond_3
                    y_lvl_2_q = y_lvl_2.ptr[y_lvl_q]
                    y_lvl_2_q_stop = y_lvl_2.ptr[y_lvl_q + 1]
                    if y_lvl_2_q < y_lvl_2_q_stop
                        y_lvl_2_i_end = y_lvl_2.right[y_lvl_2_q_stop - 1]
                    else
                        y_lvl_2_i_end = 0.0f0
                    end
                    phase_stop_5 = min(y_lvl_2.shape, y_lvl_2_i_end)
                    if phase_stop_5 >= limit(1.0)
                        j = limit(1.0)
                        if y_lvl_2.right[y_lvl_2_q] < limit(1.0)
                            y_lvl_2_q = Finch.scansearch(y_lvl_2.right, limit(1.0), y_lvl_2_q, y_lvl_2_q_stop - 1)
                        end
                        while j <= phase_stop_5
                            y_lvl_2_i_start = y_lvl_2.left[y_lvl_2_q]
                            y_lvl_2_i_stop = y_lvl_2.right[y_lvl_2_q]
                            phase_start_6 = j
                            phase_stop_6 = min(phase_stop_5, y_lvl_2_i_stop)
                            phase_start_8 = max(phase_start_6, y_lvl_2_i_start)
                            if phase_stop_6 >= phase_start_8
                                y_lvl_3_val_2 = y_lvl_3.val[y_lvl_2_q]
                                cond_5 = -phase_start_8 + phase_stop_6 == 0
                                if cond_5
                                    s_val = y_lvl_3_val_2 + s_val
                                end
                            end
                            y_lvl_2_q += phase_stop_6 == y_lvl_2_i_stop
                            j = phase_stop_6 + limit(0+ϵ)
                        end
                    end
                end
            end
            phase_start_10 = max(phase_start_2, x_lvl_i_start)
            phase_stop_10 = min(phase_stop_2, limit(0-ϵ) + y_lvl_i_start)
            if phase_stop_10 >= phase_start_10
                cond_7 = -phase_start_10 + phase_stop_10 == 0
                if cond_7
                    x_lvl_2_q = x_lvl_2.ptr[x_lvl_q]
                    x_lvl_2_q_stop = x_lvl_2.ptr[x_lvl_q + 1]
                    if x_lvl_2_q < x_lvl_2_q_stop
                        x_lvl_2_i_end = x_lvl_2.right[x_lvl_2_q_stop - 1]
                    else
                        x_lvl_2_i_end = 0.0f0
                    end
                    phase_stop_11 = min(y_lvl_2.shape, x_lvl_2_i_end)
                    if phase_stop_11 >= limit(1.0)
                        j = limit(1.0)
                        if x_lvl_2.right[x_lvl_2_q] < limit(1.0)
                            x_lvl_2_q = Finch.scansearch(x_lvl_2.right, limit(1.0), x_lvl_2_q, x_lvl_2_q_stop - 1)
                        end
                        while j <= phase_stop_11
                            x_lvl_2_i_start = x_lvl_2.left[x_lvl_2_q]
                            x_lvl_2_i_stop = x_lvl_2.right[x_lvl_2_q]
                            phase_start_12 = j
                            phase_stop_12 = min(phase_stop_11, x_lvl_2_i_stop)
                            phase_start_14 = max(phase_start_12, x_lvl_2_i_start)
                            if phase_stop_12 >= phase_start_14
                                x_lvl_3_val_2 = x_lvl_3.val[x_lvl_2_q]
                                cond_9 = -phase_start_14 + phase_stop_12 == 0
                                if cond_9
                                    s_val = s_val + x_lvl_3_val_2
                                end
                            end
                            x_lvl_2_q += phase_stop_12 == x_lvl_2_i_stop
                            j = phase_stop_12 + limit(0+ϵ)
                        end
                    end
                end
            end
            phase_start_16 = max(phase_start_2, y_lvl_i_start, x_lvl_i_start)
            if phase_stop_2 >= phase_start_16
                cond_11 = -phase_start_16 + phase_stop_2 == 0
                if cond_11
                    x_lvl_2_q_2 = x_lvl_2.ptr[x_lvl_q]
                    x_lvl_2_q_stop_2 = x_lvl_2.ptr[x_lvl_q + 1]
                    if x_lvl_2_q_2 < x_lvl_2_q_stop_2
                        x_lvl_2_i_end_2 = x_lvl_2.right[x_lvl_2_q_stop_2 - 1]
                    else
                        x_lvl_2_i_end_2 = 0.0f0
                    end
                    y_lvl_2_q_2 = y_lvl_2.ptr[y_lvl_q]
                    y_lvl_2_q_stop_2 = y_lvl_2.ptr[y_lvl_q + 1]
                    if y_lvl_2_q_2 < y_lvl_2_q_stop_2
                        y_lvl_2_i_end_2 = y_lvl_2.right[y_lvl_2_q_stop_2 - 1]
                    else
                        y_lvl_2_i_end_2 = 0.0f0
                    end
                    phase_stop_17 = min(y_lvl_2.shape, x_lvl_2_i_end_2, y_lvl_2_i_end_2)
                    if phase_stop_17 >= limit(1.0)
                        j = limit(1.0)
                        if x_lvl_2.right[x_lvl_2_q_2] < limit(1.0)
                            x_lvl_2_q_2 = Finch.scansearch(x_lvl_2.right, limit(1.0), x_lvl_2_q_2, x_lvl_2_q_stop_2 - 1)
                        end
                        if y_lvl_2.right[y_lvl_2_q_2] < limit(1.0)
                            y_lvl_2_q_2 = Finch.scansearch(y_lvl_2.right, limit(1.0), y_lvl_2_q_2, y_lvl_2_q_stop_2 - 1)
                        end
                        while j <= phase_stop_17
                            x_lvl_2_i_start_2 = x_lvl_2.left[x_lvl_2_q_2]
                            x_lvl_2_i_stop_2 = x_lvl_2.right[x_lvl_2_q_2]
                            y_lvl_2_i_start_2 = y_lvl_2.left[y_lvl_2_q_2]
                            y_lvl_2_i_stop_2 = y_lvl_2.right[y_lvl_2_q_2]
                            phase_start_18 = j
                            phase_stop_18 = min(y_lvl_2_i_stop_2, phase_stop_17, x_lvl_2_i_stop_2)
                            phase_start_20 = max(phase_start_18, x_lvl_2_i_start_2)
                            phase_stop_20 = min(phase_stop_18, limit(0-ϵ) + y_lvl_2_i_start_2)
                            if phase_stop_20 >= phase_start_20
                                x_lvl_3_val_3 = x_lvl_3.val[x_lvl_2_q_2]
                                cond_13 = -phase_start_20 + phase_stop_20 == 0
                                if cond_13
                                    s_val = s_val + x_lvl_3_val_3
                                end
                            end
                            phase_start_21 = max(phase_start_18, y_lvl_2_i_start_2)
                            phase_stop_21 = min(phase_stop_18, limit(0-ϵ) + x_lvl_2_i_start_2)
                            if phase_stop_21 >= phase_start_21
                                y_lvl_3_val_3 = y_lvl_3.val[y_lvl_2_q_2]
                                cond_14 = -phase_start_21 + phase_stop_21 == 0
                                if cond_14
                                    s_val = s_val + y_lvl_3_val_3
                                end
                            end
                            phase_start_22 = max(phase_start_18, x_lvl_2_i_start_2, y_lvl_2_i_start_2)
                            if phase_stop_18 >= phase_start_22
                                y_lvl_3_val_4 = y_lvl_3.val[y_lvl_2_q_2]
                                x_lvl_3_val_4 = x_lvl_3.val[x_lvl_2_q_2]
                                cond_15 = -phase_start_22 + phase_stop_18 == 0
                                if cond_15
                                    s_val = s_val + y_lvl_3_val_4 + x_lvl_3_val_4
                                end
                            end
                            x_lvl_2_q_2 += phase_stop_18 == x_lvl_2_i_stop_2
                            y_lvl_2_q_2 += phase_stop_18 == y_lvl_2_i_stop_2
                            j = phase_stop_18 + limit(0+ϵ)
                        end
                    end
                    phase_start_23 = max(limit(1.0), limit(0+ϵ) + x_lvl_2_i_end_2)
                    phase_stop_23 = min(y_lvl_2.shape, y_lvl_2_i_end_2)
                    if phase_stop_23 >= phase_start_23
                        j = phase_start_23
                        if y_lvl_2.right[y_lvl_2_q_2] < phase_start_23
                            y_lvl_2_q_2 = Finch.scansearch(y_lvl_2.right, phase_start_23, y_lvl_2_q_2, y_lvl_2_q_stop_2 - 1)
                        end
                        while j <= phase_stop_23
                            y_lvl_2_i_start_2 = y_lvl_2.left[y_lvl_2_q_2]
                            y_lvl_2_i_stop_2 = y_lvl_2.right[y_lvl_2_q_2]
                            phase_start_24 = j
                            phase_stop_24 = min(y_lvl_2_i_stop_2, phase_stop_23)
                            phase_start_26 = max(y_lvl_2_i_start_2, phase_start_24)
                            if phase_stop_24 >= phase_start_26
                                y_lvl_3_val_5 = y_lvl_3.val[y_lvl_2_q_2]
                                cond_17 = -phase_start_26 + phase_stop_24 == 0
                                if cond_17
                                    s_val = s_val + y_lvl_3_val_5
                                end
                            end
                            y_lvl_2_q_2 += phase_stop_24 == y_lvl_2_i_stop_2
                            j = phase_stop_24 + limit(0+ϵ)
                        end
                    end
                    phase_start_27 = max(limit(1.0), limit(0+ϵ) + y_lvl_2_i_end_2)
                    phase_stop_27 = min(y_lvl_2.shape, x_lvl_2_i_end_2)
                    if phase_stop_27 >= phase_start_27
                        j = phase_start_27
                        if x_lvl_2.right[x_lvl_2_q_2] < phase_start_27
                            x_lvl_2_q_2 = Finch.scansearch(x_lvl_2.right, phase_start_27, x_lvl_2_q_2, x_lvl_2_q_stop_2 - 1)
                        end
                        while j <= phase_stop_27
                            x_lvl_2_i_start_2 = x_lvl_2.left[x_lvl_2_q_2]
                            x_lvl_2_i_stop_2 = x_lvl_2.right[x_lvl_2_q_2]
                            phase_start_28 = j
                            phase_stop_28 = min(x_lvl_2_i_stop_2, phase_stop_27)
                            phase_start_30 = max(x_lvl_2_i_start_2, phase_start_28)
                            if phase_stop_28 >= phase_start_30
                                x_lvl_3_val_5 = x_lvl_3.val[x_lvl_2_q_2]
                                cond_19 = -phase_start_30 + phase_stop_28 == 0
                                if cond_19
                                    s_val = s_val + x_lvl_3_val_5
                                end
                            end
                            x_lvl_2_q_2 += phase_stop_28 == x_lvl_2_i_stop_2
                            j = phase_stop_28 + limit(0+ϵ)
                        end
                    end
                end
            end
            y_lvl_q += phase_stop_2 == y_lvl_i_stop
            x_lvl_q += phase_stop_2 == x_lvl_i_stop
            i = phase_stop_2 + limit(0+ϵ)
        end
    end
    phase_start_32 = max(limit(1.0), limit(0+ϵ) + y_lvl_i_end)
    phase_stop_32 = min(y_lvl.shape, x_lvl_i_end)
    if phase_stop_32 >= phase_start_32
        i = phase_start_32
        if x_lvl.right[x_lvl_q] < phase_start_32
            x_lvl_q = Finch.scansearch(x_lvl.right, phase_start_32, x_lvl_q, x_lvl_q_stop - 1)
        end
        while i <= phase_stop_32
            x_lvl_i_start = x_lvl.left[x_lvl_q]
            x_lvl_i_stop = x_lvl.right[x_lvl_q]
            phase_start_33 = i
            phase_stop_33 = min(x_lvl_i_stop, phase_stop_32)
            phase_start_35 = max(x_lvl_i_start, phase_start_33)
            if phase_stop_33 >= phase_start_35
                cond_23 = -phase_start_35 + phase_stop_33 == 0
                if cond_23
                    x_lvl_2_q_3 = x_lvl_2.ptr[x_lvl_q]
                    x_lvl_2_q_stop_3 = x_lvl_2.ptr[x_lvl_q + 1]
                    if x_lvl_2_q_3 < x_lvl_2_q_stop_3
                        x_lvl_2_i_end_3 = x_lvl_2.right[x_lvl_2_q_stop_3 - 1]
                    else
                        x_lvl_2_i_end_3 = 0.0f0
                    end
                    phase_stop_36 = min(y_lvl_2.shape, x_lvl_2_i_end_3)
                    if phase_stop_36 >= limit(1.0)
                        j = limit(1.0)
                        if x_lvl_2.right[x_lvl_2_q_3] < limit(1.0)
                            x_lvl_2_q_3 = Finch.scansearch(x_lvl_2.right, limit(1.0), x_lvl_2_q_3, x_lvl_2_q_stop_3 - 1)
                        end
                        while j <= phase_stop_36
                            x_lvl_2_i_start_3 = x_lvl_2.left[x_lvl_2_q_3]
                            x_lvl_2_i_stop_3 = x_lvl_2.right[x_lvl_2_q_3]
                            phase_start_37 = j
                            phase_stop_37 = min(phase_stop_36, x_lvl_2_i_stop_3)
                            phase_start_39 = max(phase_start_37, x_lvl_2_i_start_3)
                            if phase_stop_37 >= phase_start_39
                                x_lvl_3_val_6 = x_lvl_3.val[x_lvl_2_q_3]
                                cond_25 = -phase_start_39 + phase_stop_37 == 0
                                if cond_25
                                    s_val = s_val + x_lvl_3_val_6
                                end
                            end
                            x_lvl_2_q_3 += phase_stop_37 == x_lvl_2_i_stop_3
                            j = phase_stop_37 + limit(0+ϵ)
                        end
                    end
                end
            end
            x_lvl_q += phase_stop_33 == x_lvl_i_stop
            i = phase_stop_33 + limit(0+ϵ)
        end
    end
    phase_start_41 = max(limit(1.0), limit(0+ϵ) + x_lvl_i_end)
    phase_stop_41 = min(y_lvl.shape, y_lvl_i_end)
    if phase_stop_41 >= phase_start_41
        i = phase_start_41
        if y_lvl.right[y_lvl_q] < phase_start_41
            y_lvl_q = Finch.scansearch(y_lvl.right, phase_start_41, y_lvl_q, y_lvl_q_stop - 1)
        end
        while i <= phase_stop_41
            y_lvl_i_start = y_lvl.left[y_lvl_q]
            y_lvl_i_stop = y_lvl.right[y_lvl_q]
            phase_start_42 = i
            phase_stop_42 = min(y_lvl_i_stop, phase_stop_41)
            phase_start_44 = max(y_lvl_i_start, phase_start_42)
            if phase_stop_42 >= phase_start_44
                cond_29 = -phase_start_44 + phase_stop_42 == 0
                if cond_29
                    y_lvl_2_q_3 = y_lvl_2.ptr[y_lvl_q]
                    y_lvl_2_q_stop_3 = y_lvl_2.ptr[y_lvl_q + 1]
                    if y_lvl_2_q_3 < y_lvl_2_q_stop_3
                        y_lvl_2_i_end_3 = y_lvl_2.right[y_lvl_2_q_stop_3 - 1]
                    else
                        y_lvl_2_i_end_3 = 0.0f0
                    end
                    phase_stop_45 = min(y_lvl_2.shape, y_lvl_2_i_end_3)
                    if phase_stop_45 >= limit(1.0)
                        j = limit(1.0)
                        if y_lvl_2.right[y_lvl_2_q_3] < limit(1.0)
                            y_lvl_2_q_3 = Finch.scansearch(y_lvl_2.right, limit(1.0), y_lvl_2_q_3, y_lvl_2_q_stop_3 - 1)
                        end
                        while j <= phase_stop_45
                            y_lvl_2_i_start_3 = y_lvl_2.left[y_lvl_2_q_3]
                            y_lvl_2_i_stop_3 = y_lvl_2.right[y_lvl_2_q_3]
                            phase_start_46 = j
                            phase_stop_46 = min(phase_stop_45, y_lvl_2_i_stop_3)
                            phase_start_48 = max(phase_start_46, y_lvl_2_i_start_3)
                            if phase_stop_46 >= phase_start_48
                                y_lvl_3_val_6 = y_lvl_3.val[y_lvl_2_q_3]
                                cond_31 = -phase_start_48 + phase_stop_46 == 0
                                if cond_31
                                    s_val = s_val + y_lvl_3_val_6
                                end
                            end
                            y_lvl_2_q_3 += phase_stop_46 == y_lvl_2_i_stop_3
                            j = phase_stop_46 + limit(0+ϵ)
                        end
                    end
                end
            end
            y_lvl_q += phase_stop_42 == y_lvl_i_stop
            i = phase_stop_42 + limit(0+ϵ)
        end
    end
    (s = (Scalar){0, Int32}(s_val),)
end
julia> @finch begin
        s .= 0
        for i = _, j = _
            s[] += x[j, i] + y[j, i]
        end
    end
(s = Scalar{0, Int32}(4),)

