void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp)

{

    trace_spapr_drc_detach(spapr_drc_index(drc));



    if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {

        trace_spapr_drc_awaiting_isolated(spapr_drc_index(drc));

        drc->awaiting_release = true;

        return;

    }



    if (spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PCI &&

        drc->allocation_state != SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {

        trace_spapr_drc_awaiting_unusable(spapr_drc_index(drc));

        drc->awaiting_release = true;

        return;

    }



    if (drc->awaiting_allocation) {

        drc->awaiting_release = true;

        trace_spapr_drc_awaiting_allocation(spapr_drc_index(drc));

        return;

    }



    spapr_drc_release(drc);

}

void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp)

{

    trace_spapr_drc_detach(spapr_drc_index(drc));



    if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {

        trace_spapr_drc_awaiting_isolated(spapr_drc_index(drc));

        drc->awaiting_release = true;

        return;

    }



    if (spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PCI &&

        drc->allocation_state != SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {

        trace_spapr_drc_awaiting_unusable(spapr_drc_index(drc));

        drc->awaiting_release = true;

        return;

    }



    if (drc->awaiting_allocation) {

        drc->awaiting_release = true;

        trace_spapr_drc_awaiting_allocation(spapr_drc_index(drc));

        return;

    }



    spapr_drc_release(drc);

}

    if (drc->awaiting_allocation) {         drc->awaiting_release = true;         trace_spapr_drc_awaiting_allocation(spapr_drc_index(drc));
void FUNC_0(sPAPRDRConnector *VAR_0, DeviceState *VAR_1, Error **VAR_2)

{

    trace_spapr_drc_detach(spapr_drc_index(VAR_0));



    if (VAR_0->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {

        trace_spapr_drc_awaiting_isolated(spapr_drc_index(VAR_0));

        VAR_0->awaiting_release = true;

        return;

    }



    if (spapr_drc_type(VAR_0) != SPAPR_DR_CONNECTOR_TYPE_PCI &&

        VAR_0->allocation_state != SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {

        trace_spapr_drc_awaiting_unusable(spapr_drc_index(VAR_0));

        VAR_0->awaiting_release = true;

        return;

    }



    if (VAR_0->awaiting_allocation) {

        VAR_0->awaiting_release = true;

        trace_spapr_drc_awaiting_allocation(spapr_drc_index(VAR_0));

        return;

    }



    spapr_drc_release(VAR_0);

}

void FUNC_0(sPAPRDRConnector *VAR_0, DeviceState *VAR_1, Error **VAR_2)
{ trace_spapr_drc_detach(spapr_drc_index(VAR_0)); if (VAR_0->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) { trace_spapr_drc_awaiting_isolated(spapr_drc_index(VAR_0)); VAR_0->awaiting_release = true; return; } if (spapr_drc_type(VAR_0) != SPAPR_DR_CONNECTOR_TYPE_PCI &&
VAR_0->allocation_state != SPAPR_DR_ALLOCATION_STATE_UNUSABLE) { trace_spapr_drc_awaiting_unusable(spapr_drc_index(VAR_0)); VAR_0->awaiting_release = true; return; } if (VAR_0->awaiting_allocation) { VAR_0->awaiting_release = true; trace_spapr_drc_awaiting_allocation(spapr_drc_index(VAR_0)); return; } spapr_drc_release(VAR_0); }