static int load_option_rom(const char *oprom, target_phys_addr_t start,

                           target_phys_addr_t end)

{

    int size;

    char *filename;



    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, oprom);

    if (filename) {

        size = get_image_size(filename);

        if (size > 0 && start + size > end) {

            fprintf(stderr, "Not enough space to load option rom '%s'\n",

                    oprom);

            exit(1);

        }

        size = load_image_targphys(filename, start, end - start);

        qemu_free(filename);

    } else {

        size = -1;

    }

    if (size < 0) {

        fprintf(stderr, "Could not load option rom '%s'\n", oprom);

        exit(1);

    }

    /* Round up optiom rom size to the next 2k boundary */

    size = (size + 2047) & ~2047;

    option_rom_setup_reset(start, size);

    return size;

}

static int load_option_rom(const char *oprom, target_phys_addr_t start,

                           target_phys_addr_t end)

{

    int size;

    char *filename;



    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, oprom);

    if (filename) {

        size = get_image_size(filename);

        if (size > 0 && start + size > end) {

            fprintf(stderr, "Not enough space to load option rom '%s'\n",

                    oprom);

            exit(1);

        }

        size = load_image_targphys(filename, start, end - start);

        qemu_free(filename);

    } else {

        size = -1;

    }

    if (size < 0) {

        fprintf(stderr, "Could not load option rom '%s'\n", oprom);

        exit(1);

    }

    

    size = (size + 2047) & ~2047;

    option_rom_setup_reset(start, size);

    return size;

}

static int FUNC_0(const char *VAR_0, target_phys_addr_t VAR_1,

                           target_phys_addr_t VAR_2)

{

    int VAR_3;

    char *VAR_4;



    VAR_4 = qemu_find_file(QEMU_FILE_TYPE_BIOS, VAR_0);

    if (VAR_4) {

        VAR_3 = get_image_size(VAR_4);

        if (VAR_3 > 0 && VAR_1 + VAR_3 > VAR_2) {

            fprintf(stderr, "Not enough space to load option rom '%s'\n",

                    VAR_0);

            exit(1);

        }

        VAR_3 = load_image_targphys(VAR_4, VAR_1, VAR_2 - VAR_1);

        qemu_free(VAR_4);

    } else {

        VAR_3 = -1;

    }

    if (VAR_3 < 0) {

        fprintf(stderr, "Could not load option rom '%s'\n", VAR_0);

        exit(1);

    }

    

    VAR_3 = (VAR_3 + 2047) & ~2047;

    option_rom_setup_reset(VAR_1, VAR_3);

    return VAR_3;

}

static int FUNC_0(const char *VAR_0, target_phys_addr_t VAR_1,
target_phys_addr_t VAR_2)
{ int VAR_3; char *VAR_4; VAR_4 = qemu_find_file(QEMU_FILE_TYPE_BIOS, VAR_0); if (VAR_4) { VAR_3 = get_image_size(VAR_4); if (VAR_3 > 0 && VAR_1 + VAR_3 > VAR_2) { fprintf(stderr, "Not enough space to load option rom '%s'\n",
VAR_0); exit(1); } VAR_3 = load_image_targphys(VAR_4, VAR_1, VAR_2 - VAR_1); qemu_free(VAR_4); } else { VAR_3 = -1; } if (VAR_3 < 0) { fprintf(stderr, "Could not load option rom '%s'\n", VAR_0); exit(1); } VAR_3 = (VAR_3 + 2047) & ~2047; option_rom_setup_reset(VAR_1, VAR_3); return VAR_3; }