static void i6300esb_restart_timer(I6300State *d, int stage)

{

    int64_t timeout;



    if (!d->enabled)

        return;



    d->stage = stage;



    if (d->stage <= 1)

        timeout = d->timer1_preload;

    else

        timeout = d->timer2_preload;



    if (d->clock_scale == CLOCK_SCALE_1KHZ)

        timeout <<= 15;

    else

        timeout <<= 5;



    /* Get the timeout in units of ticks_per_sec. */

    timeout = get_ticks_per_sec() * timeout / 33000000;



    i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout);



    timer_mod(d->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + timeout);

}

static void i6300esb_restart_timer(I6300State *d, int stage)

{

    int64_t timeout;



    if (!d->enabled)

        return;



    d->stage = stage;



    if (d->stage <= 1)

        timeout = d->timer1_preload;

    else

        timeout = d->timer2_preload;



    if (d->clock_scale == CLOCK_SCALE_1KHZ)

        timeout <<= 15;

    else

        timeout <<= 5;



    

    timeout = get_ticks_per_sec() * timeout / 33000000;



    i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout);



    timer_mod(d->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + timeout);

}

    timeout = get_ticks_per_sec() * timeout / 33000000;
static void FUNC_0(I6300State *VAR_0, int VAR_1)

{

    int64_t timeout;



    if (!VAR_0->enabled)

        return;



    VAR_0->VAR_1 = VAR_1;



    if (VAR_0->VAR_1 <= 1)

        timeout = VAR_0->timer1_preload;

    else

        timeout = VAR_0->timer2_preload;



    if (VAR_0->clock_scale == CLOCK_SCALE_1KHZ)

        timeout <<= 15;

    else

        timeout <<= 5;



    

    timeout = get_ticks_per_sec() * timeout / 33000000;



    i6300esb_debug("VAR_1 %VAR_0, timeout %" PRIi64 "\n", VAR_0->VAR_1, timeout);



    timer_mod(VAR_0->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + timeout);

}

static void FUNC_0(I6300State *VAR_0, int VAR_1)
{ int64_t timeout; if (!VAR_0->enabled)
return; VAR_0->VAR_1 = VAR_1; if (VAR_0->VAR_1 <= 1)
timeout = VAR_0->timer1_preload; else
timeout = VAR_0->timer2_preload; if (VAR_0->clock_scale == CLOCK_SCALE_1KHZ)
timeout <<= 15; else
timeout <<= 5; timeout = get_ticks_per_sec() * timeout / 33000000; i6300esb_debug("VAR_1 %VAR_0, timeout %" PRIi64 "\n", VAR_0->VAR_1, timeout); timer_mod(VAR_0->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + timeout); }