static void m5206_mbar_update(m5206_mbar_state *s)

{

    int irq;

    int vector;

    int level;



    irq = m5206_find_pending_irq(s);

    if (irq) {

        int tmp;

        tmp = s->icr[irq];

        level = (tmp >> 2) & 7;

        if (tmp & 0x80) {

            /* Autovector.  */

            vector = 24 + level;

        } else {

            switch (irq) {

            case 8: /* SWT */

                vector = s->swivr;

                break;

            case 12: /* UART1 */

                vector = s->uivr[0];

                break;

            case 13: /* UART2 */

                vector = s->uivr[1];

                break;

            default:

                /* Unknown vector.  */

                fprintf(stderr, "Unhandled vector for IRQ %d\n", irq);

                vector = 0xf;

                break;

            }

        }

    } else {

        level = 0;

        vector = 0;

    }

    m68k_set_irq_level(s->cpu, level, vector);

}

static void m5206_mbar_update(m5206_mbar_state *s)

{

    int irq;

    int vector;

    int level;



    irq = m5206_find_pending_irq(s);

    if (irq) {

        int tmp;

        tmp = s->icr[irq];

        level = (tmp >> 2) & 7;

        if (tmp & 0x80) {

            

            vector = 24 + level;

        } else {

            switch (irq) {

            case 8: 

                vector = s->swivr;

                break;

            case 12: 

                vector = s->uivr[0];

                break;

            case 13: 

                vector = s->uivr[1];

                break;

            default:

                

                fprintf(stderr, "Unhandled vector for IRQ %d\n", irq);

                vector = 0xf;

                break;

            }

        }

    } else {

        level = 0;

        vector = 0;

    }

    m68k_set_irq_level(s->cpu, level, vector);

}

static void FUNC_0(m5206_mbar_state *VAR_0)

{

    int VAR_1;

    int VAR_2;

    int VAR_3;



    VAR_1 = m5206_find_pending_irq(VAR_0);

    if (VAR_1) {

        int VAR_4;

        VAR_4 = VAR_0->icr[VAR_1];

        VAR_3 = (VAR_4 >> 2) & 7;

        if (VAR_4 & 0x80) {

            

            VAR_2 = 24 + VAR_3;

        } else {

            switch (VAR_1) {

            case 8: 

                VAR_2 = VAR_0->swivr;

                break;

            case 12: 

                VAR_2 = VAR_0->uivr[0];

                break;

            case 13: 

                VAR_2 = VAR_0->uivr[1];

                break;

            default:

                

                fprintf(stderr, "Unhandled VAR_2 for IRQ %d\n", VAR_1);

                VAR_2 = 0xf;

                break;

            }

        }

    } else {

        VAR_3 = 0;

        VAR_2 = 0;

    }

    m68k_set_irq_level(VAR_0->cpu, VAR_3, VAR_2);

}

static void FUNC_0(m5206_mbar_state *VAR_0)
{ int VAR_1; int VAR_2; int VAR_3; VAR_1 = m5206_find_pending_irq(VAR_0); if (VAR_1) { int VAR_4; VAR_4 = VAR_0->icr[VAR_1]; VAR_3 = (VAR_4 >> 2) & 7; if (VAR_4 & 0x80) { VAR_2 = 24 + VAR_3; } else { switch (VAR_1) { case 8:
VAR_2 = VAR_0->swivr; break; case 12:
VAR_2 = VAR_0->uivr[0]; break; case 13:
VAR_2 = VAR_0->uivr[1]; break; default:
fprintf(stderr, "Unhandled VAR_2 for IRQ %d\n", VAR_1); VAR_2 = 0xf; break; } } } else { VAR_3 = 0; VAR_2 = 0; } m68k_set_irq_level(VAR_0->cpu, VAR_3, VAR_2); }