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)
    val = Ct_lvl_2_val
    Ct_lvl_2_val = (Finch).moveto(Ct_lvl_2_val, CPU(Threads.nthreads()))
    B_lvl_ptr = (Finch).moveto(B_lvl_ptr, CPU(Threads.nthreads()))
    B_lvl_tbl1 = (Finch).moveto(B_lvl_tbl1, CPU(Threads.nthreads()))
    B_lvl_tbl2 = (Finch).moveto(B_lvl_tbl2, CPU(Threads.nthreads()))
    B_lvl_val = (Finch).moveto(B_lvl_val, CPU(Threads.nthreads()))
    A_lvl_ptr = (Finch).moveto(A_lvl_ptr, CPU(Threads.nthreads()))
    A_lvl_tbl1 = (Finch).moveto(A_lvl_tbl1, CPU(Threads.nthreads()))
    A_lvl_tbl2 = (Finch).moveto(A_lvl_tbl2, CPU(Threads.nthreads()))
    A_lvl_val = (Finch).moveto(A_lvl_val, CPU(Threads.nthreads()))
    Threads.@threads for i_4 = 1:Threads.nthreads()
            Finch.@barrier begin
                    @inbounds @fastmath(begin
                                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_start_2 = max(1, 1 + fld(B_lvl.shape[2] * (i_4 + -1), Threads.nthreads()))
                                phase_stop_2 = min(B_lvl.shape[2], B_lvl_i_stop, fld(B_lvl.shape[2] * i_4, Threads.nthreads()))
                                if phase_stop_2 >= phase_start_2
                                    j = phase_start_2
                                    if B_lvl_tbl2[B_lvl_q] < phase_start_2
                                        B_lvl_q = Finch.scansearch(B_lvl_tbl2, phase_start_2, 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_2
                                            for j_7 = j:-1 + B_lvl_i
                                                Threads.@threads for i_5 = 1:Threads.nthreads()
                                                        Finch.@barrier begin
                                                                @inbounds @fastmath(begin
                                                                            phase_start_5 = max(1, 1 + fld(A_lvl.shape[1] * i_5, Threads.nthreads()))
                                                                            phase_stop_6 = A_lvl.shape[1]
                                                                            if phase_stop_6 >= phase_start_5
                                                                                phase_stop_6 + 1
                                                                            end
                                                                        end)
                                                                nothing
                                                            end
                                                    end
                                            end
                                            Ct_lvl_q = (1 - 1) * B_lvl.shape[2] + B_lvl_i
                                            val_4 = Ct_lvl_2_val
                                            Ct_lvl_2_val = (Finch).moveto(Ct_lvl_2_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_5 = A_lvl_val
                                            A_lvl_val = (Finch).moveto(A_lvl_val, CPU(Threads.nthreads()))
                                            B_lvl_ptr_3 = B_lvl_ptr
                                            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_6 = B_lvl_val
                                            B_lvl_val = (Finch).moveto(B_lvl_val, CPU(Threads.nthreads()))
                                            Threads.@threads for i_10 = 1:Threads.nthreads()
                                                    Finch.@barrier begin
                                                            @inbounds @fastmath(begin
                                                                        phase_start_7 = max(1, 1 + fld(A_lvl.shape[1] * (-1 + i_10), Threads.nthreads()))
                                                                        phase_stop_8 = min(A_lvl.shape[1], fld(A_lvl.shape[1] * i_10, Threads.nthreads()))
                                                                        if phase_stop_8 >= phase_start_7
                                                                            for i_13 = phase_start_7:phase_stop_8
                                                                                Ct_lvl_2_q = (Ct_lvl_q - 1) * A_lvl.shape[1] + i_13
                                                                                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_9 = min(B_lvl.shape[1], A_lvl_i_stop, B_lvl_i_stop_2)
                                                                                if phase_stop_9 >= 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_9
                                                                                        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_10 = min(B_lvl_i_2, phase_stop_9, A_lvl_i)
                                                                                        if A_lvl_i == phase_stop_10 && B_lvl_i_2 == phase_stop_10
                                                                                            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_11 = min(i_13, A_lvl_i_stop_2)
                                                                                            if phase_stop_11 >= i_13
                                                                                                if A_lvl_tbl1[A_lvl_q] < i_13
                                                                                                    A_lvl_q_2 = Finch.scansearch(A_lvl_tbl1, i_13, 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_11
                                                                                                        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_13 = min(phase_stop_11, A_lvl_i_2)
                                                                                                        if A_lvl_i_2 == phase_stop_13
                                                                                                            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_10
                                                                                            B_lvl_q_2 += 1
                                                                                        elseif A_lvl_i == phase_stop_10
                                                                                            A_lvl_q = A_lvl_q_step
                                                                                        end
                                                                                        k = phase_stop_10 + 1
                                                                                    end
                                                                                end
                                                                            end
                                                                        end
                                                                        phase_start_16 = max(1, 1 + fld(A_lvl.shape[1] * i_10, Threads.nthreads()))
                                                                        phase_stop_18 = A_lvl.shape[1]
                                                                        if phase_stop_18 >= phase_start_16
                                                                            phase_stop_18 + 1
                                                                        end
                                                                    end)
                                                            nothing
                                                        end
                                                end
                                            Ct_lvl_2_val = val_4
                                            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_5
                                            B_lvl_ptr = B_lvl_ptr_3
                                            B_lvl_tbl1 = B_lvl_tbl1_3
                                            B_lvl_tbl2 = B_lvl_tbl2_3
                                            B_lvl_val = val_6
                                            B_lvl_q = B_lvl_q_step
                                            j = B_lvl_i + 1
                                        else
                                            phase_stop_19 = min(phase_stop_2, B_lvl_i)
                                            if B_lvl_i == phase_stop_19
                                                for j_9 = j:-1 + phase_stop_19
                                                    Threads.@threads for i_15 = 1:Threads.nthreads()
                                                            Finch.@barrier begin
                                                                    @inbounds @fastmath(begin
                                                                                phase_start_20 = max(1, 1 + fld(A_lvl.shape[1] * i_15, Threads.nthreads()))
                                                                                phase_stop_22 = A_lvl.shape[1]
                                                                                if phase_stop_22 >= phase_start_20
                                                                                    phase_stop_22 + 1
                                                                                end
                                                                            end)
                                                                    nothing
                                                                end
                                                        end
                                                end
                                                Ct_lvl_q = (1 - 1) * B_lvl.shape[2] + phase_stop_19
                                                val_7 = Ct_lvl_2_val
                                                Ct_lvl_2_val = (Finch).moveto(Ct_lvl_2_val, CPU(Threads.nthreads()))
                                                A_lvl_ptr_4 = A_lvl_ptr
                                                A_lvl_ptr = (Finch).moveto(A_lvl_ptr, CPU(Threads.nthreads()))
                                                A_lvl_tbl1_4 = A_lvl_tbl1
                                                A_lvl_tbl1 = (Finch).moveto(A_lvl_tbl1, CPU(Threads.nthreads()))
                                                A_lvl_tbl2_4 = A_lvl_tbl2
                                                A_lvl_tbl2 = (Finch).moveto(A_lvl_tbl2, CPU(Threads.nthreads()))
                                                val_8 = A_lvl_val
                                                A_lvl_val = (Finch).moveto(A_lvl_val, CPU(Threads.nthreads()))
                                                B_lvl_ptr_4 = B_lvl_ptr
                                                B_lvl_tbl1_4 = B_lvl_tbl1
                                                B_lvl_tbl1 = (Finch).moveto(B_lvl_tbl1, CPU(Threads.nthreads()))
                                                B_lvl_tbl2_4 = B_lvl_tbl2
                                                val_9 = B_lvl_val
                                                B_lvl_val = (Finch).moveto(B_lvl_val, CPU(Threads.nthreads()))
                                                Threads.@threads for i_20 = 1:Threads.nthreads()
                                                        Finch.@barrier begin
                                                                @inbounds @fastmath(begin
                                                                            phase_start_22 = max(1, 1 + fld(A_lvl.shape[1] * (-1 + i_20), Threads.nthreads()))
                                                                            phase_stop_24 = min(A_lvl.shape[1], fld(A_lvl.shape[1] * i_20, Threads.nthreads()))
                                                                            if phase_stop_24 >= phase_start_22
                                                                                for i_23 = phase_start_22:phase_stop_24
                                                                                    Ct_lvl_2_q_2 = (Ct_lvl_q - 1) * A_lvl.shape[1] + i_23
                                                                                    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_25 = min(B_lvl.shape[1], A_lvl_i_stop_3, B_lvl_i_stop_3)
                                                                                    if phase_stop_25 >= 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_25
                                                                                            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_26 = min(B_lvl_i_3, phase_stop_25, A_lvl_i_3)
                                                                                            if A_lvl_i_3 == phase_stop_26 && B_lvl_i_3 == phase_stop_26
                                                                                                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_27 = min(i_23, A_lvl_i_stop_4)
                                                                                                if phase_stop_27 >= i_23
                                                                                                    if A_lvl_tbl1[A_lvl_q_3] < i_23
                                                                                                        A_lvl_q_4 = Finch.scansearch(A_lvl_tbl1, i_23, 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_27
                                                                                                            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_29 = min(phase_stop_27, A_lvl_i_4)
                                                                                                            if A_lvl_i_4 == phase_stop_29
                                                                                                                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_26
                                                                                                B_lvl_q_3 += 1
                                                                                            elseif A_lvl_i_3 == phase_stop_26
                                                                                                A_lvl_q_3 = A_lvl_q_step_3
                                                                                            end
                                                                                            k = phase_stop_26 + 1
                                                                                        end
                                                                                    end
                                                                                end
                                                                            end
                                                                            phase_start_31 = max(1, 1 + fld(A_lvl.shape[1] * i_20, Threads.nthreads()))
                                                                            phase_stop_34 = A_lvl.shape[1]
                                                                            if phase_stop_34 >= phase_start_31
                                                                                phase_stop_34 + 1
                                                                            end
                                                                        end)
                                                                nothing
                                                            end
                                                    end
                                                Ct_lvl_2_val = val_7
                                                A_lvl_ptr = A_lvl_ptr_4
                                                A_lvl_tbl1 = A_lvl_tbl1_4
                                                A_lvl_tbl2 = A_lvl_tbl2_4
                                                A_lvl_val = val_8
                                                B_lvl_ptr = B_lvl_ptr_4
                                                B_lvl_tbl1 = B_lvl_tbl1_4
                                                B_lvl_tbl2 = B_lvl_tbl2_4
                                                B_lvl_val = val_9
                                                B_lvl_q = B_lvl_q_step
                                            else
                                                for j_11 = j:phase_stop_19
                                                    Threads.@threads for i_25 = 1:Threads.nthreads()
                                                            Finch.@barrier begin
                                                                    @inbounds @fastmath(begin
                                                                                phase_start_34 = max(1, 1 + fld(A_lvl.shape[1] * i_25, Threads.nthreads()))
                                                                                phase_stop_37 = A_lvl.shape[1]
                                                                                if phase_stop_37 >= phase_start_34
                                                                                    phase_stop_37 + 1
                                                                                end
                                                                            end)
                                                                    nothing
                                                                end
                                                        end
                                                end
                                            end
                                            j = phase_stop_19 + 1
                                            break
                                        end
                                    end
                                end
                                phase_start_37 = max(1, 1 + fld(B_lvl.shape[2] * (i_4 + -1), Threads.nthreads()), 1 + B_lvl_i_stop)
                                phase_stop_40 = min(B_lvl.shape[2], fld(B_lvl.shape[2] * i_4, Threads.nthreads()))
                                if phase_stop_40 >= phase_start_37
                                    for j_15 = phase_start_37:phase_stop_40
                                        Threads.@threads for i_30 = 1:Threads.nthreads()
                                                Finch.@barrier begin
                                                        @inbounds @fastmath(begin
                                                                    phase_start_40 = max(1, 1 + fld(A_lvl.shape[1] * i_30, Threads.nthreads()))
                                                                    phase_stop_43 = A_lvl.shape[1]
                                                                    if phase_stop_43 >= phase_start_40
                                                                        phase_stop_43 + 1
                                                                    end
                                                                end)
                                                        nothing
                                                    end
                                            end
                                    end
                                end
                                phase_start_41 = max(1, 1 + fld(B_lvl.shape[2] * i_4, Threads.nthreads()), 1 + B_lvl_i_stop)
                                phase_stop_44 = B_lvl.shape[2]
                                if phase_stop_44 >= phase_start_41
                                    phase_stop_44 + 1
                                end
                            end)
                    nothing
                end
        end
    resize!(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
