static void gic_set_irq(void *opaque, int irq, int level)

{

    /* Meaning of the 'irq' parameter:

     *  [0..N-1] : external interrupts

     *  [N..N+31] : PPI (internal) interrupts for CPU 0

     *  [N+32..N+63] : PPI (internal interrupts for CPU 1

     *  ...

     */

    GICState *s = (GICState *)opaque;

    int cm, target;

    if (irq < (s->num_irq - GIC_INTERNAL)) {

        /* The first external input line is internal interrupt 32.  */

        cm = ALL_CPU_MASK;

        irq += GIC_INTERNAL;

        target = GIC_TARGET(irq);

    } else {

        int cpu;

        irq -= (s->num_irq - GIC_INTERNAL);

        cpu = irq / GIC_INTERNAL;

        irq %= GIC_INTERNAL;

        cm = 1 << cpu;

        target = cm;

    }



    assert(irq >= GIC_NR_SGIS);



    if (level == GIC_TEST_LEVEL(irq, cm)) {

        return;

    }



    if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {

        gic_set_irq_11mpcore(s, irq, level, cm, target);

    } else {

        gic_set_irq_generic(s, irq, level, cm, target);

    }




    gic_update(s);

}
static void gic_set_irq(void *opaque, int irq, int level)

{

    











    GICState *s = (GICState *)opaque;

    int cm, target;

    if (irq < (s->num_irq - GIC_INTERNAL)) {

        

        cm = ALL_CPU_MASK;

        irq += GIC_INTERNAL;

        target = GIC_TARGET(irq);

    } else {

        int cpu;

        irq -= (s->num_irq - GIC_INTERNAL);

        cpu = irq / GIC_INTERNAL;

        irq %= GIC_INTERNAL;

        cm = 1 << cpu;

        target = cm;

    }



    assert(irq >= GIC_NR_SGIS);



    if (level == GIC_TEST_LEVEL(irq, cm)) {

        return;

    }



    if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {

        gic_set_irq_11mpcore(s, irq, level, cm, target);

    } else {

        gic_set_irq_generic(s, irq, level, cm, target);

    }




    gic_update(s);

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

{

    











    GICState *s = (GICState *)VAR_0;

    int VAR_3, VAR_4;

    if (VAR_1 < (s->num_irq - GIC_INTERNAL)) {

        

        VAR_3 = ALL_CPU_MASK;

        VAR_1 += GIC_INTERNAL;

        VAR_4 = GIC_TARGET(VAR_1);

    } else {

        int VAR_5;

        VAR_1 -= (s->num_irq - GIC_INTERNAL);

        VAR_5 = VAR_1 / GIC_INTERNAL;

        VAR_1 %= GIC_INTERNAL;

        VAR_3 = 1 << VAR_5;

        VAR_4 = VAR_3;

    }



    assert(VAR_1 >= GIC_NR_SGIS);



    if (VAR_2 == GIC_TEST_LEVEL(VAR_1, VAR_3)) {

        return;

    }



    if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {

        gic_set_irq_11mpcore(s, VAR_1, VAR_2, VAR_3, VAR_4);

    } else {

        gic_set_irq_generic(s, VAR_1, VAR_2, VAR_3, VAR_4);

    }




    gic_update(s);

}
static void FUNC_0(void *VAR_0, int VAR_1, int VAR_2)
{ GICState *s = (GICState *)VAR_0; int VAR_3, VAR_4; if (VAR_1 < (s->num_irq - GIC_INTERNAL)) { VAR_3 = ALL_CPU_MASK; VAR_1 += GIC_INTERNAL; VAR_4 = GIC_TARGET(VAR_1); } else { int VAR_5; VAR_1 -= (s->num_irq - GIC_INTERNAL); VAR_5 = VAR_1 / GIC_INTERNAL; VAR_1 %= GIC_INTERNAL; VAR_3 = 1 << VAR_5; VAR_4 = VAR_3; } assert(VAR_1 >= GIC_NR_SGIS); if (VAR_2 == GIC_TEST_LEVEL(VAR_1, VAR_3)) { return; } if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) { gic_set_irq_11mpcore(s, VAR_1, VAR_2, VAR_3, VAR_4); } else { gic_set_irq_generic(s, VAR_1, VAR_2, VAR_3, VAR_4); } gic_update(s); }