static void qemu_rdma_signal_unregister(RDMAContext *rdma, uint64_t index,

                                        uint64_t chunk, uint64_t wr_id)

{

    if (rdma->unregistrations[rdma->unregister_next] != 0) {

        fprintf(stderr, "rdma migration: queue is full!\n");

    } else {

        RDMALocalBlock *block = &(rdma->local_ram_blocks.block[index]);



        if (!test_and_set_bit(chunk, block->unregister_bitmap)) {

            DDPRINTF("Appending unregister chunk %" PRIu64

                    " at position %d\n", chunk, rdma->unregister_next);



            rdma->unregistrations[rdma->unregister_next++] =

                    qemu_rdma_make_wrid(wr_id, index, chunk);



            if (rdma->unregister_next == RDMA_SIGNALED_SEND_MAX) {

                rdma->unregister_next = 0;

            }

        } else {

            DDPRINTF("Unregister chunk %" PRIu64 " already in queue.\n",

                    chunk);

        }

    }

}

static void qemu_rdma_signal_unregister(RDMAContext *rdma, uint64_t index,

                                        uint64_t chunk, uint64_t wr_id)

{

    if (rdma->unregistrations[rdma->unregister_next] != 0) {

        fprintf(stderr, "rdma migration: queue is full!\n");

    } else {

        RDMALocalBlock *block = &(rdma->local_ram_blocks.block[index]);



        if (!test_and_set_bit(chunk, block->unregister_bitmap)) {

            DDPRINTF("Appending unregister chunk %" PRIu64

                    " at position %d\n", chunk, rdma->unregister_next);



            rdma->unregistrations[rdma->unregister_next++] =

                    qemu_rdma_make_wrid(wr_id, index, chunk);



            if (rdma->unregister_next == RDMA_SIGNALED_SEND_MAX) {

                rdma->unregister_next = 0;

            }

        } else {

            DDPRINTF("Unregister chunk %" PRIu64 " already in queue.\n",

                    chunk);

        }

    }

}

static void FUNC_0(RDMAContext *VAR_0, uint64_t VAR_1,

                                        uint64_t VAR_2, uint64_t VAR_3)

{

    if (VAR_0->unregistrations[VAR_0->unregister_next] != 0) {

        fprintf(stderr, "VAR_0 migration: queue is full!\n");

    } else {

        RDMALocalBlock *block = &(VAR_0->local_ram_blocks.block[VAR_1]);



        if (!test_and_set_bit(VAR_2, block->unregister_bitmap)) {

            DDPRINTF("Appending unregister VAR_2 %" PRIu64

                    " at position %d\n", VAR_2, VAR_0->unregister_next);



            VAR_0->unregistrations[VAR_0->unregister_next++] =

                    qemu_rdma_make_wrid(VAR_3, VAR_1, VAR_2);



            if (VAR_0->unregister_next == RDMA_SIGNALED_SEND_MAX) {

                VAR_0->unregister_next = 0;

            }

        } else {

            DDPRINTF("Unregister VAR_2 %" PRIu64 " already in queue.\n",

                    VAR_2);

        }

    }

}

static void FUNC_0(RDMAContext *VAR_0, uint64_t VAR_1,
uint64_t VAR_2, uint64_t VAR_3)
{ if (VAR_0->unregistrations[VAR_0->unregister_next] != 0) { fprintf(stderr, "VAR_0 migration: queue is full!\n"); } else { RDMALocalBlock *block = &(VAR_0->local_ram_blocks.block[VAR_1]); if (!test_and_set_bit(VAR_2, block->unregister_bitmap)) { DDPRINTF("Appending unregister VAR_2 %" PRIu64
" at position %d\n", VAR_2, VAR_0->unregister_next); VAR_0->unregistrations[VAR_0->unregister_next++] =
qemu_rdma_make_wrid(VAR_3, VAR_1, VAR_2); if (VAR_0->unregister_next == RDMA_SIGNALED_SEND_MAX) { VAR_0->unregister_next = 0; } } else { DDPRINTF("Unregister VAR_2 %" PRIu64 " already in queue.\n",
VAR_2); } } }