julia> @finch_code begin
        z .= 0
        for i = _
            z[i] = x[gallop(i)] + y[i]
        end
    end
quote
    z_lvl = ((ex.bodies[1]).bodies[1]).tns.bind.lvl
    z_lvl_ptr = z_lvl.ptr
    z_lvl_idx = z_lvl.idx
    z_lvl_2 = z_lvl.lvl
    z_lvl_val = z_lvl.lvl.val
    x_lvl = (((ex.bodies[1]).bodies[2]).body.rhs.args[1]).tns.bind.lvl
    x_lvl_ptr = x_lvl.ptr
    x_lvl_idx = x_lvl.idx
    x_lvl_val = x_lvl.lvl.val
    y_lvl = (((ex.bodies[1]).bodies[2]).body.rhs.args[2]).tns.bind.lvl
    y_lvl_ptr = y_lvl.ptr
    y_lvl_idx = y_lvl.idx
    y_lvl_val = y_lvl.lvl.val
    y_lvl.shape == x_lvl.shape || throw(DimensionMismatch("mismatched dimension limits ($(y_lvl.shape) != $(x_lvl.shape))"))
    z_lvl_qos_stop = 0
    Finch.resize_if_smaller!(z_lvl_ptr, 1 + 1)
    Finch.fill_range!(z_lvl_ptr, 0, 1 + 1, 1 + 1)
    z_lvl_qos = 0 + 1
    0 < 1 || throw(FinchProtocolError("SparseListLevels cannot be updated multiple times"))
    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_i1 = y_lvl_idx[y_lvl_q_stop - 1]
    else
        y_lvl_i1 = 0
    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_i1 = x_lvl_idx[x_lvl_q_stop - 1]
    else
        x_lvl_i1 = 0
    end
    phase_stop = min(y_lvl.shape, y_lvl_i1, x_lvl_i1)
    if phase_stop >= 1
        i = 1
        while i <= phase_stop
            if x_lvl_idx[x_lvl_q] < i
                x_lvl_q = Finch.scansearch(x_lvl_idx, i, x_lvl_q, x_lvl_q_stop - 1)
            end
            x_lvl_i2 = x_lvl_idx[x_lvl_q]
            phase_stop_2 = min(phase_stop, x_lvl_i2)
            if x_lvl_i2 == phase_stop_2
                if y_lvl_idx[y_lvl_q] < i
                    y_lvl_q = Finch.scansearch(y_lvl_idx, i, y_lvl_q, y_lvl_q_stop - 1)
                end
                while true
                    y_lvl_i = y_lvl_idx[y_lvl_q]
                    if y_lvl_i < -1 + phase_stop_2
                        y_lvl_2_val = y_lvl_val[y_lvl_q]
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = y_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = y_lvl_i
                        z_lvl_qos += 1
                        y_lvl_q += 1
                    else
                        phase_stop_4 = min(y_lvl_i, -1 + phase_stop_2)
                        if y_lvl_i == phase_stop_4
                            y_lvl_2_val = y_lvl_val[y_lvl_q]
                            if z_lvl_qos > z_lvl_qos_stop
                                z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                                Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                                Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                                Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                            end
                            z_lvl_val[z_lvl_qos] = y_lvl_2_val
                            z_lvl_idx[z_lvl_qos] = phase_stop_4
                            z_lvl_qos += 1
                            y_lvl_q += 1
                        end
                        break
                    end
                end
                x_lvl_2_val = x_lvl_val[x_lvl_q]
                if y_lvl_idx[y_lvl_q] < phase_stop_2
                    y_lvl_q = Finch.scansearch(y_lvl_idx, phase_stop_2, y_lvl_q, y_lvl_q_stop - 1)
                end
                y_lvl_i = y_lvl_idx[y_lvl_q]
                phase_stop_5 = min(phase_stop_2, y_lvl_i)
                if y_lvl_i == phase_stop_5
                    for i_11 = phase_stop_2:-1 + phase_stop_5
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = x_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = i_11
                        z_lvl_qos += 1
                    end
                    y_lvl_2_val = y_lvl_val[y_lvl_q]
                    if z_lvl_qos > z_lvl_qos_stop
                        z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                        Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                        Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                        Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                    end
                    z_lvl_val[z_lvl_qos] = x_lvl_2_val + y_lvl_2_val
                    z_lvl_idx[z_lvl_qos] = phase_stop_5
                    z_lvl_qos += 1
                    y_lvl_q += 1
                else
                    for i_13 = phase_stop_2:phase_stop_5
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = x_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = i_13
                        z_lvl_qos += 1
                    end
                end
                x_lvl_q += 1
            else
                if y_lvl_idx[y_lvl_q] < i
                    y_lvl_q = Finch.scansearch(y_lvl_idx, i, y_lvl_q, y_lvl_q_stop - 1)
                end
                if x_lvl_idx[x_lvl_q] < i
                    x_lvl_q = Finch.scansearch(x_lvl_idx, i, x_lvl_q, x_lvl_q_stop - 1)
                end
                while i <= phase_stop_2
                    y_lvl_i = y_lvl_idx[y_lvl_q]
                    x_lvl_i2 = x_lvl_idx[x_lvl_q]
                    phase_stop_6 = min(x_lvl_i2, phase_stop_2, y_lvl_i)
                    if y_lvl_i == phase_stop_6 && x_lvl_i2 == phase_stop_6
                        x_lvl_2_val = x_lvl_val[x_lvl_q]
                        y_lvl_2_val = y_lvl_val[y_lvl_q]
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = x_lvl_2_val + y_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = phase_stop_6
                        z_lvl_qos += 1
                        y_lvl_q += 1
                        x_lvl_q += 1
                    elseif x_lvl_i2 == phase_stop_6
                        x_lvl_2_val = x_lvl_val[x_lvl_q]
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = x_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = phase_stop_6
                        z_lvl_qos += 1
                        x_lvl_q += 1
                    elseif y_lvl_i == phase_stop_6
                        y_lvl_2_val = y_lvl_val[y_lvl_q]
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = y_lvl_2_val
                        z_lvl_idx[z_lvl_qos] = phase_stop_6
                        z_lvl_qos += 1
                        y_lvl_q += 1
                    end
                    i = phase_stop_6 + 1
                end
            end
            i = phase_stop_2 + 1
        end
    end
    phase_start_6 = max(1, 1 + y_lvl_i1)
    phase_stop_7 = min(y_lvl.shape, x_lvl_i1)
    if phase_stop_7 >= phase_start_6
        i = phase_start_6
        while i <= phase_stop_7
            if x_lvl_idx[x_lvl_q] < i
                x_lvl_q = Finch.scansearch(x_lvl_idx, i, x_lvl_q, x_lvl_q_stop - 1)
            end
            x_lvl_i2 = x_lvl_idx[x_lvl_q]
            phase_stop_8 = min(x_lvl_i2, phase_stop_7)
            if x_lvl_i2 == phase_stop_8
                x_lvl_2_val_2 = x_lvl_val[x_lvl_q]
                if z_lvl_qos > z_lvl_qos_stop
                    z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                    Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                    Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                    Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                end
                z_lvl_val[z_lvl_qos] = x_lvl_2_val_2
                z_lvl_idx[z_lvl_qos] = phase_stop_8
                z_lvl_qos += 1
                x_lvl_q += 1
            else
                if x_lvl_idx[x_lvl_q] < i
                    x_lvl_q = Finch.scansearch(x_lvl_idx, i, x_lvl_q, x_lvl_q_stop - 1)
                end
                while true
                    x_lvl_i2 = x_lvl_idx[x_lvl_q]
                    if x_lvl_i2 < phase_stop_8
                        x_lvl_2_val_2 = x_lvl_val[x_lvl_q]
                        if z_lvl_qos > z_lvl_qos_stop
                            z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                            Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                            Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                            Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                        end
                        z_lvl_val[z_lvl_qos] = x_lvl_2_val_2
                        z_lvl_idx[z_lvl_qos] = x_lvl_i2
                        z_lvl_qos += 1
                        x_lvl_q += 1
                    else
                        phase_stop_10 = min(x_lvl_i2, phase_stop_8)
                        if x_lvl_i2 == phase_stop_10
                            x_lvl_2_val_2 = x_lvl_val[x_lvl_q]
                            if z_lvl_qos > z_lvl_qos_stop
                                z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                                Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                                Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                                Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                            end
                            z_lvl_val[z_lvl_qos] = x_lvl_2_val_2
                            z_lvl_idx[z_lvl_qos] = phase_stop_10
                            z_lvl_qos += 1
                            x_lvl_q += 1
                        end
                        break
                    end
                end
            end
            i = phase_stop_8 + 1
        end
    end
    phase_start_9 = max(1, 1 + x_lvl_i1)
    phase_stop_11 = min(y_lvl.shape, y_lvl_i1)
    if phase_stop_11 >= phase_start_9
        if y_lvl_idx[y_lvl_q] < phase_start_9
            y_lvl_q = Finch.scansearch(y_lvl_idx, phase_start_9, y_lvl_q, y_lvl_q_stop - 1)
        end
        while true
            y_lvl_i = y_lvl_idx[y_lvl_q]
            if y_lvl_i < phase_stop_11
                y_lvl_2_val_2 = y_lvl_val[y_lvl_q]
                if z_lvl_qos > z_lvl_qos_stop
                    z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                    Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                    Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                    Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                end
                z_lvl_val[z_lvl_qos] = y_lvl_2_val_2
                z_lvl_idx[z_lvl_qos] = y_lvl_i
                z_lvl_qos += 1
                y_lvl_q += 1
            else
                phase_stop_13 = min(y_lvl_i, phase_stop_11)
                if y_lvl_i == phase_stop_13
                    y_lvl_2_val_2 = y_lvl_val[y_lvl_q]
                    if z_lvl_qos > z_lvl_qos_stop
                        z_lvl_qos_stop = max(z_lvl_qos_stop << 1, 1)
                        Finch.resize_if_smaller!(z_lvl_idx, z_lvl_qos_stop)
                        Finch.resize_if_smaller!(z_lvl_val, z_lvl_qos_stop)
                        Finch.fill_range!(z_lvl_val, 0.0, z_lvl_qos, z_lvl_qos_stop)
                    end
                    z_lvl_val[z_lvl_qos] = y_lvl_2_val_2
                    z_lvl_idx[z_lvl_qos] = phase_stop_13
                    z_lvl_qos += 1
                    y_lvl_q += 1
                end
                break
            end
        end
    end
    z_lvl_ptr[1 + 1] += (z_lvl_qos - 0) - 1
    resize!(z_lvl_ptr, 1 + 1)
    for p = 1:1
        z_lvl_ptr[p + 1] += z_lvl_ptr[p]
    end
    qos_stop = z_lvl_ptr[1 + 1] - 1
    resize!(z_lvl_idx, qos_stop)
    resize!(z_lvl_val, qos_stop)
    (z = Tensor((SparseListLevel){Int32}(z_lvl_2, y_lvl.shape, z_lvl_ptr, z_lvl_idx)),)
end
julia> @finch begin
        z .= 0
        for i = _
            z[i] = x[gallop(i)] + y[i]
        end
    end
(z = Tensor(SparseList{Int32}(Element{0.0, Float64, Int32}([2.0, 1.0, 3.0, 5.0, 5.0, 1.0, 6.0]), 10, [1, 8], [1, 2, 3, 5, 7, 8, 9])),)

