begin
    Ct_lvl = ((ex.bodies[1]).bodies[1]).tns.bind.lvl
    Ct_lvl_2 = Ct_lvl.lvl
    Ct_lvl_3 = Ct_lvl_2.lvl
    Ct_lvl_2_val = Ct_lvl_2.lvl.val
    A_lvl = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[1]).tns.bind.lvl
    A_lvl_ptr = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[1]).tns.bind.lvl.ptr
    A_lvl_tbl1 = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[1]).tns.bind.lvl.tbl[1]
    A_lvl_tbl2 = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[1]).tns.bind.lvl.tbl[2]
    A_lvl_val = A_lvl.lvl.val
    B_lvl = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[2]).tns.bind.lvl
    B_lvl_ptr = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[2]).tns.bind.lvl.ptr
    B_lvl_tbl1 = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[2]).tns.bind.lvl.tbl[1]
    B_lvl_tbl2 = (((ex.bodies[1]).bodies[2]).body.body.body.rhs.args[2]).tns.bind.lvl.tbl[2]
    B_lvl_val = B_lvl.lvl.val
    B_lvl.shape[1] == A_lvl.shape[2] || throw(DimensionMismatch("mismatched dimension limits ($(B_lvl.shape[1]) != $(A_lvl.shape[2]))"))
    @warn "Performance Warning: non-concordant traversal of A[i, k] (hint: most arrays prefer column major or first index fast, run in fast mode to ignore this warning)"
    pos_stop = A_lvl.shape[1] * B_lvl.shape[2]
    Finch.resize_if_smaller!(Ct_lvl_2_val, pos_stop)
    Finch.fill_range!(Ct_lvl_2_val, 0x0000000000000000, 1, pos_stop)
    B_lvl_q = B_lvl_ptr[1]
    B_lvl_q_stop = B_lvl_ptr[1 + 1]
    if B_lvl_q < B_lvl_q_stop
        B_lvl_i_stop = B_lvl_tbl2[B_lvl_q_stop - 1]
    else
        B_lvl_i_stop = 0
    end
    phase_stop = min(B_lvl.shape[2], B_lvl_i_stop)
    if phase_stop >= 1
        j = 1
        if B_lvl_tbl2[B_lvl_q] < 1
            B_lvl_q = Finch.scansearch(B_lvl_tbl2, 1, B_lvl_q, B_lvl_q_stop - 1)
        end
        while true
            B_lvl_i = B_lvl_tbl2[B_lvl_q]
            B_lvl_q_step = B_lvl_q
            if B_lvl_tbl2[B_lvl_q] == B_lvl_i
                B_lvl_q_step = Finch.scansearch(B_lvl_tbl2, B_lvl_i + 1, B_lvl_q, B_lvl_q_stop - 1)
            end
            if B_lvl_i < phase_stop
                for j_6 = j:-1 + B_lvl_i
                    Threads.@threads for i_4 = 1:Threads.nthreads()
                            Finch.@barrier begin
                                    @inbounds @fastmath(begin
                                                phase_start_4 = max(1, 1 + fld(A_lvl.shape[1] * i_4, Threads.nthreads()))
                                                phase_stop_5 = A_lvl.shape[1]
                                                if phase_stop_5 >= phase_start_4
                                                    phase_stop_5 + 1
                                                end
                                            end)
                                    nothing
                                end
                        end
                end
                Ct_lvl_q = (1 - 1) * B_lvl.shape[2] + B_lvl_i
                val = Ct_lvl_2_val
                Ct_lvl_2_val = (Finch).moveto(Ct_lvl_2_val, CPU(Threads.nthreads()))
                B_lvl_tbl1_2 = B_lvl_tbl1
                B_lvl_tbl1 = (Finch).moveto(B_lvl_tbl1, CPU(Threads.nthreads()))
                B_lvl_tbl2_2 = B_lvl_tbl2
                val_2 = B_lvl_val
                B_lvl_val = (Finch).moveto(B_lvl_val, CPU(Threads.nthreads()))
                A_lvl_ptr_2 = A_lvl_ptr
                A_lvl_ptr = (Finch).moveto(A_lvl_ptr, CPU(Threads.nthreads()))
                A_lvl_tbl1_2 = A_lvl_tbl1
                A_lvl_tbl1 = (Finch).moveto(A_lvl_tbl1, CPU(Threads.nthreads()))
                A_lvl_tbl2_2 = A_lvl_tbl2
                A_lvl_tbl2 = (Finch).moveto(A_lvl_tbl2, CPU(Threads.nthreads()))
                val_3 = A_lvl_val
                A_lvl_val = (Finch).moveto(A_lvl_val, CPU(Threads.nthreads()))
                Threads.@threads for i_9 = 1:Threads.nthreads()
                        Finch.@barrier begin
                                @inbounds @fastmath(begin
                                            phase_start_6 = max(1, 1 + fld(A_lvl.shape[1] * (-1 + i_9), Threads.nthreads()))
                                            phase_stop_7 = min(A_lvl.shape[1], fld(A_lvl.shape[1] * i_9, Threads.nthreads()))
                                            if phase_stop_7 >= phase_start_6
                                                for i_12 = phase_start_6:phase_stop_7
                                                    Ct_lvl_2_q = (Ct_lvl_q - 1) * A_lvl.shape[1] + i_12
                                                    A_lvl_q = A_lvl_ptr[1]
                                                    A_lvl_q_stop = A_lvl_ptr[1 + 1]
                                                    if A_lvl_q < A_lvl_q_stop
                                                        A_lvl_i_stop = A_lvl_tbl2[A_lvl_q_stop - 1]
                                                    else
                                                        A_lvl_i_stop = 0
                                                    end
                                                    B_lvl_q_2 = B_lvl_q
                                                    if B_lvl_q < B_lvl_q_step
                                                        B_lvl_i_stop_2 = B_lvl_tbl1[B_lvl_q_step - 1]
                                                    else
                                                        B_lvl_i_stop_2 = 0
                                                    end
                                                    phase_stop_8 = min(B_lvl.shape[1], A_lvl_i_stop, B_lvl_i_stop_2)
                                                    if phase_stop_8 >= 1
                                                        k = 1
                                                        if A_lvl_tbl2[A_lvl_q] < 1
                                                            A_lvl_q = Finch.scansearch(A_lvl_tbl2, 1, A_lvl_q, A_lvl_q_stop - 1)
                                                        end
                                                        if B_lvl_tbl1[B_lvl_q] < 1
                                                            B_lvl_q_2 = Finch.scansearch(B_lvl_tbl1, 1, B_lvl_q, B_lvl_q_step - 1)
                                                        end
                                                        while k <= phase_stop_8
                                                            A_lvl_i = A_lvl_tbl2[A_lvl_q]
                                                            A_lvl_q_step = A_lvl_q
                                                            if A_lvl_tbl2[A_lvl_q] == A_lvl_i
                                                                A_lvl_q_step = Finch.scansearch(A_lvl_tbl2, A_lvl_i + 1, A_lvl_q, A_lvl_q_stop - 1)
                                                            end
                                                            B_lvl_i_2 = B_lvl_tbl1[B_lvl_q_2]
                                                            phase_stop_9 = min(B_lvl_i_2, phase_stop_8, A_lvl_i)
                                                            if A_lvl_i == phase_stop_9 && B_lvl_i_2 == phase_stop_9
                                                                B_lvl_2_val = B_lvl_val[B_lvl_q_2]
                                                                A_lvl_q_2 = A_lvl_q
                                                                if A_lvl_q < A_lvl_q_step
                                                                    A_lvl_i_stop_2 = A_lvl_tbl1[A_lvl_q_step - 1]
                                                                else
                                                                    A_lvl_i_stop_2 = 0
                                                                end
                                                                phase_stop_10 = min(i_12, A_lvl_i_stop_2)
                                                                if phase_stop_10 >= i_12
                                                                    if A_lvl_tbl1[A_lvl_q] < i_12
                                                                        A_lvl_q_2 = Finch.scansearch(A_lvl_tbl1, i_12, A_lvl_q, A_lvl_q_step - 1)
                                                                    end
                                                                    while true
                                                                        A_lvl_i_2 = A_lvl_tbl1[A_lvl_q_2]
                                                                        if A_lvl_i_2 < phase_stop_10
                                                                            A_lvl_2_val = A_lvl_val[A_lvl_q_2]
                                                                            Ct_lvl_2_val[Ct_lvl_2_q] = B_lvl_2_val * A_lvl_2_val + Ct_lvl_2_val[Ct_lvl_2_q]
                                                                            A_lvl_q_2 += 1
                                                                        else
                                                                            phase_stop_12 = min(phase_stop_10, A_lvl_i_2)
                                                                            if A_lvl_i_2 == phase_stop_12
                                                                                A_lvl_2_val = A_lvl_val[A_lvl_q_2]
                                                                                Ct_lvl_2_val[Ct_lvl_2_q] += B_lvl_2_val * A_lvl_2_val
                                                                                A_lvl_q_2 += 1
                                                                            end
                                                                            break
                                                                        end
                                                                    end
                                                                end
                                                                A_lvl_q = A_lvl_q_step
                                                                B_lvl_q_2 += 1
                                                            elseif B_lvl_i_2 == phase_stop_9
                                                                B_lvl_q_2 += 1
                                                            elseif A_lvl_i == phase_stop_9
                                                                A_lvl_q = A_lvl_q_step
                                                            end
                                                            k = phase_stop_9 + 1
                                                        end
                                                    end
                                                end
                                            end
                                            phase_start_15 = max(1, 1 + fld(A_lvl.shape[1] * i_9, Threads.nthreads()))
                                            phase_stop_17 = A_lvl.shape[1]
                                            if phase_stop_17 >= phase_start_15
                                                phase_stop_17 + 1
                                            end
                                        end)
                                nothing
                            end
                    end
                Ct_lvl_2_val = val
                B_lvl_tbl1 = B_lvl_tbl1_2
                B_lvl_tbl2 = B_lvl_tbl2_2
                B_lvl_val = val_2
                A_lvl_ptr = A_lvl_ptr_2
                A_lvl_tbl1 = A_lvl_tbl1_2
                A_lvl_tbl2 = A_lvl_tbl2_2
                A_lvl_val = val_3
                B_lvl_q = B_lvl_q_step
                j = B_lvl_i + 1
            else
                phase_stop_18 = min(phase_stop, B_lvl_i)
                if B_lvl_i == phase_stop_18
                    for j_8 = j:-1 + phase_stop_18
                        Threads.@threads for i_14 = 1:Threads.nthreads()
                                Finch.@barrier begin
                                        @inbounds @fastmath(begin
                                                    phase_start_19 = max(1, 1 + fld(A_lvl.shape[1] * i_14, Threads.nthreads()))
                                                    phase_stop_21 = A_lvl.shape[1]
                                                    if phase_stop_21 >= phase_start_19
                                                        phase_stop_21 + 1
                                                    end
                                                end)
                                        nothing
                                    end
                            end
                    end
                    Ct_lvl_q = (1 - 1) * B_lvl.shape[2] + phase_stop_18
                    val_4 = Ct_lvl_2_val
                    Ct_lvl_2_val = (Finch).moveto(Ct_lvl_2_val, CPU(Threads.nthreads()))
                    B_lvl_tbl1_3 = B_lvl_tbl1
                    B_lvl_tbl1 = (Finch).moveto(B_lvl_tbl1, CPU(Threads.nthreads()))
                    B_lvl_tbl2_3 = B_lvl_tbl2
                    val_5 = B_lvl_val
                    B_lvl_val = (Finch).moveto(B_lvl_val, CPU(Threads.nthreads()))
                    A_lvl_ptr_3 = A_lvl_ptr
                    A_lvl_ptr = (Finch).moveto(A_lvl_ptr, CPU(Threads.nthreads()))
                    A_lvl_tbl1_3 = A_lvl_tbl1
                    A_lvl_tbl1 = (Finch).moveto(A_lvl_tbl1, CPU(Threads.nthreads()))
                    A_lvl_tbl2_3 = A_lvl_tbl2
                    A_lvl_tbl2 = (Finch).moveto(A_lvl_tbl2, CPU(Threads.nthreads()))
                    val_6 = A_lvl_val
                    A_lvl_val = (Finch).moveto(A_lvl_val, CPU(Threads.nthreads()))
                    Threads.@threads for i_19 = 1:Threads.nthreads()
                            Finch.@barrier begin
                                    @inbounds @fastmath(begin
                                                phase_start_21 = max(1, 1 + fld(A_lvl.shape[1] * (-1 + i_19), Threads.nthreads()))
                                                phase_stop_23 = min(A_lvl.shape[1], fld(A_lvl.shape[1] * i_19, Threads.nthreads()))
                                                if phase_stop_23 >= phase_start_21
                                                    for i_22 = phase_start_21:phase_stop_23
                                                        Ct_lvl_2_q_2 = (Ct_lvl_q - 1) * A_lvl.shape[1] + i_22
                                                        A_lvl_q_3 = A_lvl_ptr[1]
                                                        A_lvl_q_stop_3 = A_lvl_ptr[1 + 1]
                                                        if A_lvl_q_3 < A_lvl_q_stop_3
                                                            A_lvl_i_stop_3 = A_lvl_tbl2[A_lvl_q_stop_3 - 1]
                                                        else
                                                            A_lvl_i_stop_3 = 0
                                                        end
                                                        B_lvl_q_3 = B_lvl_q
                                                        if B_lvl_q < B_lvl_q_step
                                                            B_lvl_i_stop_3 = B_lvl_tbl1[B_lvl_q_step - 1]
                                                        else
                                                            B_lvl_i_stop_3 = 0
                                                        end
                                                        phase_stop_24 = min(B_lvl.shape[1], A_lvl_i_stop_3, B_lvl_i_stop_3)
                                                        if phase_stop_24 >= 1
                                                            k = 1
                                                            if A_lvl_tbl2[A_lvl_q_3] < 1
                                                                A_lvl_q_3 = Finch.scansearch(A_lvl_tbl2, 1, A_lvl_q_3, A_lvl_q_stop_3 - 1)
                                                            end
                                                            if B_lvl_tbl1[B_lvl_q] < 1
                                                                B_lvl_q_3 = Finch.scansearch(B_lvl_tbl1, 1, B_lvl_q, B_lvl_q_step - 1)
                                                            end
                                                            while k <= phase_stop_24
                                                                A_lvl_i_3 = A_lvl_tbl2[A_lvl_q_3]
                                                                A_lvl_q_step_3 = A_lvl_q_3
                                                                if A_lvl_tbl2[A_lvl_q_3] == A_lvl_i_3
                                                                    A_lvl_q_step_3 = Finch.scansearch(A_lvl_tbl2, A_lvl_i_3 + 1, A_lvl_q_3, A_lvl_q_stop_3 - 1)
                                                                end
                                                                B_lvl_i_3 = B_lvl_tbl1[B_lvl_q_3]
                                                                phase_stop_25 = min(B_lvl_i_3, phase_stop_24, A_lvl_i_3)
                                                                if A_lvl_i_3 == phase_stop_25 && B_lvl_i_3 == phase_stop_25
                                                                    B_lvl_2_val_3 = B_lvl_val[B_lvl_q_3]
                                                                    A_lvl_q_4 = A_lvl_q_3
                                                                    if A_lvl_q_3 < A_lvl_q_step_3
                                                                        A_lvl_i_stop_4 = A_lvl_tbl1[A_lvl_q_step_3 - 1]
                                                                    else
                                                                        A_lvl_i_stop_4 = 0
                                                                    end
                                                                    phase_stop_26 = min(i_22, A_lvl_i_stop_4)
                                                                    if phase_stop_26 >= i_22
                                                                        if A_lvl_tbl1[A_lvl_q_3] < i_22
                                                                            A_lvl_q_4 = Finch.scansearch(A_lvl_tbl1, i_22, A_lvl_q_3, A_lvl_q_step_3 - 1)
                                                                        end
                                                                        while true
                                                                            A_lvl_i_4 = A_lvl_tbl1[A_lvl_q_4]
                                                                            if A_lvl_i_4 < phase_stop_26
                                                                                A_lvl_2_val_2 = A_lvl_val[A_lvl_q_4]
                                                                                Ct_lvl_2_val[Ct_lvl_2_q_2] = B_lvl_2_val_3 * A_lvl_2_val_2 + Ct_lvl_2_val[Ct_lvl_2_q_2]
                                                                                A_lvl_q_4 += 1
                                                                            else
                                                                                phase_stop_28 = min(phase_stop_26, A_lvl_i_4)
                                                                                if A_lvl_i_4 == phase_stop_28
                                                                                    A_lvl_2_val_2 = A_lvl_val[A_lvl_q_4]
                                                                                    Ct_lvl_2_val[Ct_lvl_2_q_2] += B_lvl_2_val_3 * A_lvl_2_val_2
                                                                                    A_lvl_q_4 += 1
                                                                                end
                                                                                break
                                                                            end
                                                                        end
                                                                    end
                                                                    A_lvl_q_3 = A_lvl_q_step_3
                                                                    B_lvl_q_3 += 1
                                                                elseif B_lvl_i_3 == phase_stop_25
                                                                    B_lvl_q_3 += 1
                                                                elseif A_lvl_i_3 == phase_stop_25
                                                                    A_lvl_q_3 = A_lvl_q_step_3
                                                                end
                                                                k = phase_stop_25 + 1
                                                            end
                                                        end
                                                    end
                                                end
                                                phase_start_30 = max(1, 1 + fld(A_lvl.shape[1] * i_19, Threads.nthreads()))
                                                phase_stop_33 = A_lvl.shape[1]
                                                if phase_stop_33 >= phase_start_30
                                                    phase_stop_33 + 1
                                                end
                                            end)
                                    nothing
                                end
                        end
                    Ct_lvl_2_val = val_4
                    B_lvl_tbl1 = B_lvl_tbl1_3
                    B_lvl_tbl2 = B_lvl_tbl2_3
                    B_lvl_val = val_5
                    A_lvl_ptr = A_lvl_ptr_3
                    A_lvl_tbl1 = A_lvl_tbl1_3
                    A_lvl_tbl2 = A_lvl_tbl2_3
                    A_lvl_val = val_6
                    B_lvl_q = B_lvl_q_step
                else
                    for j_10 = j:phase_stop_18
                        Threads.@threads for i_24 = 1:Threads.nthreads()
                                Finch.@barrier begin
                                        @inbounds @fastmath(begin
                                                    phase_start_33 = max(1, 1 + fld(A_lvl.shape[1] * i_24, Threads.nthreads()))
                                                    phase_stop_36 = A_lvl.shape[1]
                                                    if phase_stop_36 >= phase_start_33
                                                        phase_stop_36 + 1
                                                    end
                                                end)
                                        nothing
                                    end
                            end
                    end
                end
                j = phase_stop_18 + 1
                break
            end
        end
    end
    phase_start_34 = max(1, 1 + B_lvl_i_stop)
    phase_stop_37 = B_lvl.shape[2]
    if phase_stop_37 >= phase_start_34
        for j_12 = phase_start_34:phase_stop_37
            Threads.@threads for i_29 = 1:Threads.nthreads()
                    Finch.@barrier begin
                            @inbounds @fastmath(begin
                                        phase_start_37 = max(1, 1 + fld(A_lvl.shape[1] * i_29, Threads.nthreads()))
                                        phase_stop_40 = A_lvl.shape[1]
                                        if phase_stop_40 >= phase_start_37
                                            phase_stop_40 + 1
                                        end
                                    end)
                            nothing
                        end
                end
        end
    end
    resize!(Ct_lvl_2_val, A_lvl.shape[1] * B_lvl.shape[2])
    (Ct = Tensor((DenseLevel){Int64}((DenseLevel){Int64}(Ct_lvl_3, A_lvl.shape[1]), B_lvl.shape[2])),)
end
