void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,

                         int is_write, hwaddr access_len)

{

    if (buffer != bounce.buffer) {

        MemoryRegion *mr;

        ram_addr_t addr1;



        mr = qemu_ram_addr_from_host(buffer, &addr1);

        assert(mr != NULL);

        if (is_write) {

            while (access_len) {

                unsigned l;

                l = TARGET_PAGE_SIZE;

                if (l > access_len)

                    l = access_len;

                invalidate_and_set_dirty(addr1, l);

                addr1 += l;

                access_len -= l;

            }

        }

        if (xen_enabled()) {

            xen_invalidate_map_cache_entry(buffer);

        }

        memory_region_unref(mr);

        return;

    }

    if (is_write) {

        address_space_write(as, bounce.addr, bounce.buffer, access_len);

    }

    qemu_vfree(bounce.buffer);

    bounce.buffer = NULL;

    memory_region_unref(bounce.mr);

    cpu_notify_map_clients();

}

void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,

                         int is_write, hwaddr access_len)

{

    if (buffer != bounce.buffer) {

        MemoryRegion *mr;

        ram_addr_t addr1;



        mr = qemu_ram_addr_from_host(buffer, &addr1);

        assert(mr != NULL);

        if (is_write) {

            while (access_len) {

                unsigned l;

                l = TARGET_PAGE_SIZE;

                if (l > access_len)

                    l = access_len;

                invalidate_and_set_dirty(addr1, l);

                addr1 += l;

                access_len -= l;

            }

        }

        if (xen_enabled()) {

            xen_invalidate_map_cache_entry(buffer);

        }

        memory_region_unref(mr);

        return;

    }

    if (is_write) {

        address_space_write(as, bounce.addr, bounce.buffer, access_len);

    }

    qemu_vfree(bounce.buffer);

    bounce.buffer = NULL;

    memory_region_unref(bounce.mr);

    cpu_notify_map_clients();

}

void FUNC_0(AddressSpace *VAR_0, void *VAR_1, hwaddr VAR_2,

                         int VAR_3, hwaddr VAR_4)

{

    if (VAR_1 != bounce.VAR_1) {

        MemoryRegion *mr;

        ram_addr_t addr1;



        mr = qemu_ram_addr_from_host(VAR_1, &addr1);

        assert(mr != NULL);

        if (VAR_3) {

            while (VAR_4) {

                unsigned VAR_5;

                VAR_5 = TARGET_PAGE_SIZE;

                if (VAR_5 > VAR_4)

                    VAR_5 = VAR_4;

                invalidate_and_set_dirty(addr1, VAR_5);

                addr1 += VAR_5;

                VAR_4 -= VAR_5;

            }

        }

        if (xen_enabled()) {

            xen_invalidate_map_cache_entry(VAR_1);

        }

        memory_region_unref(mr);

        return;

    }

    if (VAR_3) {

        address_space_write(VAR_0, bounce.addr, bounce.VAR_1, VAR_4);

    }

    qemu_vfree(bounce.VAR_1);

    bounce.VAR_1 = NULL;

    memory_region_unref(bounce.mr);

    cpu_notify_map_clients();

}

void FUNC_0(AddressSpace *VAR_0, void *VAR_1, hwaddr VAR_2,
int VAR_3, hwaddr VAR_4)
{ if (VAR_1 != bounce.VAR_1) { MemoryRegion *mr; ram_addr_t addr1; mr = qemu_ram_addr_from_host(VAR_1, &addr1); assert(mr != NULL); if (VAR_3) { while (VAR_4) { unsigned VAR_5; VAR_5 = TARGET_PAGE_SIZE; if (VAR_5 > VAR_4)
VAR_5 = VAR_4; invalidate_and_set_dirty(addr1, VAR_5); addr1 += VAR_5; VAR_4 -= VAR_5; } } if (xen_enabled()) { xen_invalidate_map_cache_entry(VAR_1); } memory_region_unref(mr); return; } if (VAR_3) { address_space_write(VAR_0, bounce.addr, bounce.VAR_1, VAR_4); } qemu_vfree(bounce.VAR_1); bounce.VAR_1 = NULL; memory_region_unref(bounce.mr); cpu_notify_map_clients(); }