static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)

{

    int next, i;

    int priority;



    next = -1;

    priority = -1;



    if (!q->pending) {

        /* IRQ bitmap is empty */

        goto out;

    }



    for (i = 0; i < opp->max_irq; i++) {

        if (IRQ_testbit(q, i)) {

            DPRINTF("IRQ_check: irq %d set ipvp_pr=%d pr=%d\n",

                    i, IPVP_PRIORITY(opp->src[i].ipvp), priority);

            if (IPVP_PRIORITY(opp->src[i].ipvp) > priority) {

                next = i;

                priority = IPVP_PRIORITY(opp->src[i].ipvp);

            }

        }

    }



out:

    q->next = next;

    q->priority = priority;

}

static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)

{

    int next, i;

    int priority;



    next = -1;

    priority = -1;



    if (!q->pending) {

        

        goto out;

    }



    for (i = 0; i < opp->max_irq; i++) {

        if (IRQ_testbit(q, i)) {

            DPRINTF("IRQ_check: irq %d set ipvp_pr=%d pr=%d\n",

                    i, IPVP_PRIORITY(opp->src[i].ipvp), priority);

            if (IPVP_PRIORITY(opp->src[i].ipvp) > priority) {

                next = i;

                priority = IPVP_PRIORITY(opp->src[i].ipvp);

            }

        }

    }



out:

    q->next = next;

    q->priority = priority;

}

static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)
static void FUNC_0(OpenPICState *VAR_0, IRQ_queue_t *VAR_1)

{

    int VAR_2, VAR_3;

    int VAR_4;



    VAR_2 = -1;

    VAR_4 = -1;



    if (!VAR_1->pending) {

        

        goto out;

    }



    for (VAR_3 = 0; VAR_3 < VAR_0->max_irq; VAR_3++) {

        if (IRQ_testbit(VAR_1, VAR_3)) {

            DPRINTF("FUNC_0: irq %d set ipvp_pr=%d pr=%d\n",

                    VAR_3, IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp), VAR_4);

            if (IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp) > VAR_4) {

                VAR_2 = VAR_3;

                VAR_4 = IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp);

            }

        }

    }



out:

    VAR_1->VAR_2 = VAR_2;

    VAR_1->VAR_4 = VAR_4;

}

static void FUNC_0(OpenPICState *VAR_0, IRQ_queue_t *VAR_1)
{ int VAR_2, VAR_3; int VAR_4; VAR_2 = -1; VAR_4 = -1; if (!VAR_1->pending) { goto out; } for (VAR_3 = 0; VAR_3 < VAR_0->max_irq; VAR_3++) { if (IRQ_testbit(VAR_1, VAR_3)) { DPRINTF("FUNC_0: irq %d set ipvp_pr=%d pr=%d\n",
VAR_3, IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp), VAR_4); if (IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp) > VAR_4) { VAR_2 = VAR_3; VAR_4 = IPVP_PRIORITY(VAR_0->src[VAR_3].ipvp); } } } out:
VAR_1->VAR_2 = VAR_2; VAR_1->VAR_4 = VAR_4; }