void add_boot_device_path(int32_t bootindex, DeviceState *dev,

                          const char *suffix)

{

    FWBootEntry *node, *i;



    if (bootindex < 0) {

        return;

    }



    assert(dev != NULL || suffix != NULL);



    node = g_malloc0(sizeof(FWBootEntry));

    node->bootindex = bootindex;

    node->suffix = suffix ? g_strdup(suffix) : NULL;

    node->dev = dev;



    QTAILQ_FOREACH(i, &fw_boot_order, link) {

        if (i->bootindex == bootindex) {

            fprintf(stderr, "Two devices with same boot index %d\n", bootindex);

            exit(1);

        } else if (i->bootindex < bootindex) {

            continue;

        }

        QTAILQ_INSERT_BEFORE(i, node, link);

        return;

    }

    QTAILQ_INSERT_TAIL(&fw_boot_order, node, link);

}

void add_boot_device_path(int32_t bootindex, DeviceState *dev,

                          const char *suffix)

{

    FWBootEntry *node, *i;



    if (bootindex < 0) {

        return;

    }



    assert(dev != NULL || suffix != NULL);



    node = g_malloc0(sizeof(FWBootEntry));

    node->bootindex = bootindex;

    node->suffix = suffix ? g_strdup(suffix) : NULL;

    node->dev = dev;



    QTAILQ_FOREACH(i, &fw_boot_order, link) {

        if (i->bootindex == bootindex) {

            fprintf(stderr, "Two devices with same boot index %d\n", bootindex);

            exit(1);

        } else if (i->bootindex < bootindex) {

            continue;

        }

        QTAILQ_INSERT_BEFORE(i, node, link);

        return;

    }

    QTAILQ_INSERT_TAIL(&fw_boot_order, node, link);

}

void FUNC_0(int32_t VAR_0, DeviceState *VAR_1,

                          const char *VAR_2)

{

    FWBootEntry *node, *i;



    if (VAR_0 < 0) {

        return;

    }



    assert(VAR_1 != NULL || VAR_2 != NULL);



    node = g_malloc0(sizeof(FWBootEntry));

    node->VAR_0 = VAR_0;

    node->VAR_2 = VAR_2 ? g_strdup(VAR_2) : NULL;

    node->VAR_1 = VAR_1;



    QTAILQ_FOREACH(i, &fw_boot_order, link) {

        if (i->VAR_0 == VAR_0) {

            fprintf(stderr, "Two devices with same boot index %d\n", VAR_0);

            exit(1);

        } else if (i->VAR_0 < VAR_0) {

            continue;

        }

        QTAILQ_INSERT_BEFORE(i, node, link);

        return;

    }

    QTAILQ_INSERT_TAIL(&fw_boot_order, node, link);

}

void FUNC_0(int32_t VAR_0, DeviceState *VAR_1,
const char *VAR_2)
{ FWBootEntry *node, *i; if (VAR_0 < 0) { return; } assert(VAR_1 != NULL || VAR_2 != NULL); node = g_malloc0(sizeof(FWBootEntry)); node->VAR_0 = VAR_0; node->VAR_2 = VAR_2 ? g_strdup(VAR_2) : NULL; node->VAR_1 = VAR_1; QTAILQ_FOREACH(i, &fw_boot_order, link) { if (i->VAR_0 == VAR_0) { fprintf(stderr, "Two devices with same boot index %d\n", VAR_0); exit(1); } else if (i->VAR_0 < VAR_0) { continue; } QTAILQ_INSERT_BEFORE(i, node, link); return; } QTAILQ_INSERT_TAIL(&fw_boot_order, node, link); }