static int get_fw_cfg_order(FWCfgState *s, const char *name)

{

    int i;



    if (s->fw_cfg_order_override > 0) {

        return s->fw_cfg_order_override;

    }



    for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {

        if (fw_cfg_order[i].name == NULL) {

            continue;

        }



        if (strcmp(name, fw_cfg_order[i].name) == 0) {

            return fw_cfg_order[i].order;

        }

    }



    /* Stick unknown stuff at the end. */

    error_report("warning: Unknown firmware file in legacy mode: %s", name);

    return FW_CFG_ORDER_OVERRIDE_LAST;

}

static int get_fw_cfg_order(FWCfgState *s, const char *name)

{

    int i;



    if (s->fw_cfg_order_override > 0) {

        return s->fw_cfg_order_override;

    }



    for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {

        if (fw_cfg_order[i].name == NULL) {

            continue;

        }



        if (strcmp(name, fw_cfg_order[i].name) == 0) {

            return fw_cfg_order[i].order;

        }

    }



    

    error_report("warning: Unknown firmware file in legacy mode: %s", name);

    return FW_CFG_ORDER_OVERRIDE_LAST;

}

static int FUNC_0(FWCfgState *VAR_0, const char *VAR_1)

{

    int VAR_2;



    if (VAR_0->fw_cfg_order_override > 0) {

        return VAR_0->fw_cfg_order_override;

    }



    for (VAR_2 = 0; VAR_2 < ARRAY_SIZE(fw_cfg_order); VAR_2++) {

        if (fw_cfg_order[VAR_2].VAR_1 == NULL) {

            continue;

        }



        if (strcmp(VAR_1, fw_cfg_order[VAR_2].VAR_1) == 0) {

            return fw_cfg_order[VAR_2].order;

        }

    }



    

    error_report("warning: Unknown firmware file in legacy mode: %VAR_0", VAR_1);

    return FW_CFG_ORDER_OVERRIDE_LAST;

}

static int FUNC_0(FWCfgState *VAR_0, const char *VAR_1)
{ int VAR_2; if (VAR_0->fw_cfg_order_override > 0) { return VAR_0->fw_cfg_order_override; } for (VAR_2 = 0; VAR_2 < ARRAY_SIZE(fw_cfg_order); VAR_2++) { if (fw_cfg_order[VAR_2].VAR_1 == NULL) { continue; } if (strcmp(VAR_1, fw_cfg_order[VAR_2].VAR_1) == 0) { return fw_cfg_order[VAR_2].order; } } error_report("warning: Unknown firmware file in legacy mode: %VAR_0", VAR_1); return FW_CFG_ORDER_OVERRIDE_LAST; }