static void smbios_build_type_0_fields(QemuOpts *opts)

{

    const char *val;

    unsigned char major, minor;



    val = qemu_opt_get(opts, "vendor");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "version");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0, bios_version_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "date");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     bios_release_date_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "release");

    if (val) {

        if (sscanf(val, "%hhu.%hhu", &major, &minor) != 2) {

            error_report("Invalid release");

            exit(1);

        }

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_major_release),

                         &major, 1);

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_minor_release),

                         &minor, 1);

    }

}

static void smbios_build_type_0_fields(QemuOpts *opts)

{

    const char *val;

    unsigned char major, minor;



    val = qemu_opt_get(opts, "vendor");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "version");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0, bios_version_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "date");

    if (val) {

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     bios_release_date_str),

                         val, strlen(val) + 1);

    }

    val = qemu_opt_get(opts, "release");

    if (val) {

        if (sscanf(val, "%hhu.%hhu", &major, &minor) != 2) {

            error_report("Invalid release");

            exit(1);

        }

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_major_release),

                         &major, 1);

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_minor_release),

                         &minor, 1);

    }

}

static void FUNC_0(QemuOpts *VAR_0)

{

    const char *VAR_1;

    unsigned char VAR_2, VAR_3;



    VAR_1 = qemu_opt_get(VAR_0, "vendor");

    if (VAR_1) {

        smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str),

                         VAR_1, strlen(VAR_1) + 1);

    }

    VAR_1 = qemu_opt_get(VAR_0, "version");

    if (VAR_1) {

        smbios_add_field(0, offsetof(struct smbios_type_0, bios_version_str),

                         VAR_1, strlen(VAR_1) + 1);

    }

    VAR_1 = qemu_opt_get(VAR_0, "date");

    if (VAR_1) {

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     bios_release_date_str),

                         VAR_1, strlen(VAR_1) + 1);

    }

    VAR_1 = qemu_opt_get(VAR_0, "release");

    if (VAR_1) {

        if (sscanf(VAR_1, "%hhu.%hhu", &VAR_2, &VAR_3) != 2) {

            error_report("Invalid release");

            exit(1);

        }

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_major_release),

                         &VAR_2, 1);

        smbios_add_field(0, offsetof(struct smbios_type_0,

                                     system_bios_minor_release),

                         &VAR_3, 1);

    }

}

static void FUNC_0(QemuOpts *VAR_0)
{ const char *VAR_1; unsigned char VAR_2, VAR_3; VAR_1 = qemu_opt_get(VAR_0, "vendor"); if (VAR_1) { smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str),
VAR_1, strlen(VAR_1) + 1); } VAR_1 = qemu_opt_get(VAR_0, "version"); if (VAR_1) { smbios_add_field(0, offsetof(struct smbios_type_0, bios_version_str),
VAR_1, strlen(VAR_1) + 1); } VAR_1 = qemu_opt_get(VAR_0, "date"); if (VAR_1) { smbios_add_field(0, offsetof(struct smbios_type_0,
bios_release_date_str),
VAR_1, strlen(VAR_1) + 1); } VAR_1 = qemu_opt_get(VAR_0, "release"); if (VAR_1) { if (sscanf(VAR_1, "%hhu.%hhu", &VAR_2, &VAR_3) != 2) { error_report("Invalid release"); exit(1); } smbios_add_field(0, offsetof(struct smbios_type_0,
system_bios_major_release),
&VAR_2, 1); smbios_add_field(0, offsetof(struct smbios_type_0,
system_bios_minor_release),
&VAR_3, 1); } }