static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,

                                         unsigned long *bitmap)

{

    unsigned int i, j;

    unsigned long page_number, addr, addr1, c;

    unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;



    /*

     * bitmap-traveling is faster than memory-traveling (for addr...)

     * especially when most of the memory is not dirty.

     */

    for (i = 0; i < len; i++) {

        if (bitmap[i] != 0) {

            c = leul_to_cpu(bitmap[i]);

            do {

                j = ffsl(c) - 1;

                c &= ~(1ul << j);

                page_number = i * HOST_LONG_BITS + j;

                addr1 = page_number * TARGET_PAGE_SIZE;

                addr = section->offset_within_region + addr1;

                memory_region_set_dirty(section->mr, addr);

            } while (c != 0);

        }

    }

    return 0;

}

static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,

                                         unsigned long *bitmap)

{

    unsigned int i, j;

    unsigned long page_number, addr, addr1, c;

    unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;



    







    for (i = 0; i < len; i++) {

        if (bitmap[i] != 0) {

            c = leul_to_cpu(bitmap[i]);

            do {

                j = ffsl(c) - 1;

                c &= ~(1ul << j);

                page_number = i * HOST_LONG_BITS + j;

                addr1 = page_number * TARGET_PAGE_SIZE;

                addr = section->offset_within_region + addr1;

                memory_region_set_dirty(section->mr, addr);

            } while (c != 0);

        }

    }

    return 0;

}

    unsigned long page_number, addr, addr1, c;
static int FUNC_0(MemoryRegionSection *VAR_0,

                                         unsigned long *VAR_1)

{

    unsigned int VAR_2, VAR_3;

    unsigned long VAR_4, VAR_5, VAR_6, VAR_7;

    unsigned int VAR_8 = ((VAR_0->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;



    







    for (VAR_2 = 0; VAR_2 < VAR_8; VAR_2++) {

        if (VAR_1[VAR_2] != 0) {

            VAR_7 = leul_to_cpu(VAR_1[VAR_2]);

            do {

                VAR_3 = ffsl(VAR_7) - 1;

                VAR_7 &= ~(1ul << VAR_3);

                VAR_4 = VAR_2 * HOST_LONG_BITS + VAR_3;

                VAR_6 = VAR_4 * TARGET_PAGE_SIZE;

                VAR_5 = VAR_0->offset_within_region + VAR_6;

                memory_region_set_dirty(VAR_0->mr, VAR_5);

            } while (VAR_7 != 0);

        }

    }

    return 0;

}

static int FUNC_0(MemoryRegionSection *VAR_0,
unsigned long *VAR_1)
{ unsigned int VAR_2, VAR_3; unsigned long VAR_4, VAR_5, VAR_6, VAR_7; unsigned int VAR_8 = ((VAR_0->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS; for (VAR_2 = 0; VAR_2 < VAR_8; VAR_2++) { if (VAR_1[VAR_2] != 0) { VAR_7 = leul_to_cpu(VAR_1[VAR_2]); do { VAR_3 = ffsl(VAR_7) - 1; VAR_7 &= ~(1ul << VAR_3); VAR_4 = VAR_2 * HOST_LONG_BITS + VAR_3; VAR_6 = VAR_4 * TARGET_PAGE_SIZE; VAR_5 = VAR_0->offset_within_region + VAR_6; memory_region_set_dirty(VAR_0->mr, VAR_5); } while (VAR_7 != 0); } } return 0; }