static void mm_rearm_timer(struct qemu_alarm_timer *t, int64_t delta)

{

    int nearest_delta_ms = (delta + 999999) / 1000000;

    if (nearest_delta_ms < 1) {

        nearest_delta_ms = 1;

    }



    timeKillEvent(mm_timer);

    mm_timer = timeSetEvent(nearest_delta_ms,

                            mm_period,

                            mm_alarm_handler,

                            (DWORD_PTR)t,

                            TIME_ONESHOT | TIME_CALLBACK_FUNCTION);



    if (!mm_timer) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(mm_period);

        exit(1);

    }

}

static void mm_rearm_timer(struct qemu_alarm_timer *t, int64_t delta)

{

    int nearest_delta_ms = (delta + 999999) / 1000000;

    if (nearest_delta_ms < 1) {

        nearest_delta_ms = 1;

    }



    timeKillEvent(mm_timer);

    mm_timer = timeSetEvent(nearest_delta_ms,

                            mm_period,

                            mm_alarm_handler,

                            (DWORD_PTR)t,

                            TIME_ONESHOT | TIME_CALLBACK_FUNCTION);



    if (!mm_timer) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(mm_period);

        exit(1);

    }

}

    int nearest_delta_ms = (delta + 999999) / 1000000;     mm_timer = timeSetEvent(nearest_delta_ms,
static void FUNC_0(struct qemu_alarm_timer *VAR_0, int64_t VAR_1)

{

    int VAR_2 = (VAR_1 + 999999) / 1000000;

    if (VAR_2 < 1) {

        VAR_2 = 1;

    }



    timeKillEvent(mm_timer);

    mm_timer = timeSetEvent(VAR_2,

                            mm_period,

                            mm_alarm_handler,

                            (DWORD_PTR)VAR_0,

                            TIME_ONESHOT | TIME_CALLBACK_FUNCTION);



    if (!mm_timer) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(mm_period);

        exit(1);

    }

}

static void FUNC_0(struct qemu_alarm_timer *VAR_0, int64_t VAR_1)
{ int VAR_2 = (VAR_1 + 999999) / 1000000; if (VAR_2 < 1) { VAR_2 = 1; } timeKillEvent(mm_timer); mm_timer = timeSetEvent(VAR_2,
mm_period,
mm_alarm_handler,
(DWORD_PTR)VAR_0,
TIME_ONESHOT | TIME_CALLBACK_FUNCTION); if (!mm_timer) { fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",
GetLastError()); timeEndPeriod(mm_period); exit(1); } }