static void pc_isa_bios_init(MemoryRegion *rom_memory,

                             MemoryRegion *flash_mem,

                             int ram_size)

{

    int isa_bios_size;

    MemoryRegion *isa_bios;

    uint64_t flash_size;

    void *flash_ptr, *isa_bios_ptr;



    flash_size = memory_region_size(flash_mem);



    /* map the last 128KB of the BIOS in ISA space */

    isa_bios_size = flash_size;

    if (isa_bios_size > (128 * 1024)) {

        isa_bios_size = 128 * 1024;

    }

    isa_bios = g_malloc(sizeof(*isa_bios));

    memory_region_init_ram(isa_bios, NULL, "isa-bios", isa_bios_size);

    vmstate_register_ram_global(isa_bios);

    memory_region_add_subregion_overlap(rom_memory,

                                        0x100000 - isa_bios_size,

                                        isa_bios,

                                        1);



    /* copy ISA rom image from top of flash memory */

    flash_ptr = memory_region_get_ram_ptr(flash_mem);

    isa_bios_ptr = memory_region_get_ram_ptr(isa_bios);

    memcpy(isa_bios_ptr,

           ((uint8_t*)flash_ptr) + (flash_size - isa_bios_size),

           isa_bios_size);



    memory_region_set_readonly(isa_bios, true);

}

static void pc_isa_bios_init(MemoryRegion *rom_memory,

                             MemoryRegion *flash_mem,

                             int ram_size)

{

    int isa_bios_size;

    MemoryRegion *isa_bios;

    uint64_t flash_size;

    void *flash_ptr, *isa_bios_ptr;



    flash_size = memory_region_size(flash_mem);



    

    isa_bios_size = flash_size;

    if (isa_bios_size > (128 * 1024)) {

        isa_bios_size = 128 * 1024;

    }

    isa_bios = g_malloc(sizeof(*isa_bios));

    memory_region_init_ram(isa_bios, NULL, "isa-bios", isa_bios_size);

    vmstate_register_ram_global(isa_bios);

    memory_region_add_subregion_overlap(rom_memory,

                                        0x100000 - isa_bios_size,

                                        isa_bios,

                                        1);



    

    flash_ptr = memory_region_get_ram_ptr(flash_mem);

    isa_bios_ptr = memory_region_get_ram_ptr(isa_bios);

    memcpy(isa_bios_ptr,

           ((uint8_t*)flash_ptr) + (flash_size - isa_bios_size),

           isa_bios_size);



    memory_region_set_readonly(isa_bios, true);

}

    isa_bios_size = flash_size;     if (isa_bios_size > (128 * 1024)) {         isa_bios_size = 128 * 1024;
static void FUNC_0(MemoryRegion *VAR_0,

                             MemoryRegion *VAR_1,

                             int VAR_2)

{

    int VAR_3;

    MemoryRegion *isa_bios;

    uint64_t flash_size;

    void *VAR_4, *VAR_5;



    flash_size = memory_region_size(VAR_1);



    

    VAR_3 = flash_size;

    if (VAR_3 > (128 * 1024)) {

        VAR_3 = 128 * 1024;

    }

    isa_bios = g_malloc(sizeof(*isa_bios));

    memory_region_init_ram(isa_bios, NULL, "isa-bios", VAR_3);

    vmstate_register_ram_global(isa_bios);

    memory_region_add_subregion_overlap(VAR_0,

                                        0x100000 - VAR_3,

                                        isa_bios,

                                        1);



    

    VAR_4 = memory_region_get_ram_ptr(VAR_1);

    VAR_5 = memory_region_get_ram_ptr(isa_bios);

    memcpy(VAR_5,

           ((uint8_t*)VAR_4) + (flash_size - VAR_3),

           VAR_3);



    memory_region_set_readonly(isa_bios, true);

}

static void FUNC_0(MemoryRegion *VAR_0,
MemoryRegion *VAR_1,
int VAR_2)
{ int VAR_3; MemoryRegion *isa_bios; uint64_t flash_size; void *VAR_4, *VAR_5; flash_size = memory_region_size(VAR_1); VAR_3 = flash_size; if (VAR_3 > (128 * 1024)) { VAR_3 = 128 * 1024; } isa_bios = g_malloc(sizeof(*isa_bios)); memory_region_init_ram(isa_bios, NULL, "isa-bios", VAR_3); vmstate_register_ram_global(isa_bios); memory_region_add_subregion_overlap(VAR_0,
0x100000 - VAR_3,
isa_bios,
1); VAR_4 = memory_region_get_ram_ptr(VAR_1); VAR_5 = memory_region_get_ram_ptr(isa_bios); memcpy(VAR_5,
((uint8_t*)VAR_4) + (flash_size - VAR_3),
VAR_3); memory_region_set_readonly(isa_bios, true); }