static void icp_set_cppr(struct icp_state *icp, int server, uint8_t cppr)

{

    struct icp_server_state *ss = icp->ss + server;

    uint8_t old_cppr;

    uint32_t old_xisr;



    old_cppr = CPPR(ss);

    ss->xirr = (ss->xirr & ~CPPR_MASK) | (cppr << 24);



    if (cppr < old_cppr) {

        if (XISR(ss) && (cppr <= ss->pending_priority)) {

            old_xisr = XISR(ss);

            ss->xirr &= ~XISR_MASK; /* Clear XISR */


            qemu_irq_lower(ss->output);

            ics_reject(icp->ics, old_xisr);

        }

    } else {

        if (!XISR(ss)) {

            icp_resend(icp, server);

        }

    }

}
static void icp_set_cppr(struct icp_state *icp, int server, uint8_t cppr)

{

    struct icp_server_state *ss = icp->ss + server;

    uint8_t old_cppr;

    uint32_t old_xisr;



    old_cppr = CPPR(ss);

    ss->xirr = (ss->xirr & ~CPPR_MASK) | (cppr << 24);



    if (cppr < old_cppr) {

        if (XISR(ss) && (cppr <= ss->pending_priority)) {

            old_xisr = XISR(ss);

            ss->xirr &= ~XISR_MASK; 


            qemu_irq_lower(ss->output);

            ics_reject(icp->ics, old_xisr);

        }

    } else {

        if (!XISR(ss)) {

            icp_resend(icp, server);

        }

    }

}
static void FUNC_0(struct icp_state *VAR_0, int VAR_1, uint8_t VAR_2)

{

    struct icp_server_state *VAR_3 = VAR_0->VAR_3 + VAR_1;

    uint8_t old_cppr;

    uint32_t old_xisr;



    old_cppr = CPPR(VAR_3);

    VAR_3->xirr = (VAR_3->xirr & ~CPPR_MASK) | (VAR_2 << 24);



    if (VAR_2 < old_cppr) {

        if (XISR(VAR_3) && (VAR_2 <= VAR_3->pending_priority)) {

            old_xisr = XISR(VAR_3);

            VAR_3->xirr &= ~XISR_MASK; 


            qemu_irq_lower(VAR_3->output);

            ics_reject(VAR_0->ics, old_xisr);

        }

    } else {

        if (!XISR(VAR_3)) {

            icp_resend(VAR_0, VAR_1);

        }

    }

}
static void FUNC_0(struct icp_state *VAR_0, int VAR_1, uint8_t VAR_2)
{ struct icp_server_state *VAR_3 = VAR_0->VAR_3 + VAR_1; uint8_t old_cppr; uint32_t old_xisr; old_cppr = CPPR(VAR_3); VAR_3->xirr = (VAR_3->xirr & ~CPPR_MASK) | (VAR_2 << 24); if (VAR_2 < old_cppr) { if (XISR(VAR_3) && (VAR_2 <= VAR_3->pending_priority)) { old_xisr = XISR(VAR_3); VAR_3->xirr &= ~XISR_MASK; qemu_irq_lower(VAR_3->output); ics_reject(VAR_0->ics, old_xisr); } } else { if (!XISR(VAR_3)) { icp_resend(VAR_0, VAR_1); } } }