void *qemu_vmalloc(size_t size)

{

    void *p;

    unsigned long addr;

    mmap_lock();

    /* Use map and mark the pages as used.  */

    p = mmap(NULL, size, PROT_READ | PROT_WRITE,

             MAP_PRIVATE | MAP_ANON, -1, 0);



    addr = (unsigned long)p;

    if (addr == (target_ulong) addr) {

        /* Allocated region overlaps guest address space.

           This may recurse.  */

        page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),

                       PAGE_RESERVED);

    }



    mmap_unlock();

    return p;

}

void *qemu_vmalloc(size_t size)

{

    void *p;

    unsigned long addr;

    mmap_lock();

    

    p = mmap(NULL, size, PROT_READ | PROT_WRITE,

             MAP_PRIVATE | MAP_ANON, -1, 0);



    addr = (unsigned long)p;

    if (addr == (target_ulong) addr) {

        



        page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),

                       PAGE_RESERVED);

    }



    mmap_unlock();

    return p;

}

void *FUNC_0(size_t VAR_0)

{

    void *VAR_1;

    unsigned long VAR_2;

    mmap_lock();

    

    VAR_1 = mmap(NULL, VAR_0, PROT_READ | PROT_WRITE,

             MAP_PRIVATE | MAP_ANON, -1, 0);



    VAR_2 = (unsigned long)VAR_1;

    if (VAR_2 == (target_ulong) VAR_2) {

        



        page_set_flags(VAR_2 & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(VAR_2 + VAR_0),

                       PAGE_RESERVED);

    }



    mmap_unlock();

    return VAR_1;

}

void *FUNC_0(size_t VAR_0)
{ void *VAR_1; unsigned long VAR_2; mmap_lock(); VAR_1 = mmap(NULL, VAR_0, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0); VAR_2 = (unsigned long)VAR_1; if (VAR_2 == (target_ulong) VAR_2) { page_set_flags(VAR_2 & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(VAR_2 + VAR_0),
PAGE_RESERVED); } mmap_unlock(); return VAR_1; }