int init_timer_alarm(void)

{

    struct qemu_alarm_timer *t = NULL;

    int i, err = -1;



    for (i = 0; alarm_timers[i].name; i++) {

        t = &alarm_timers[i];



        err = t->start(t);

        if (!err)

            break;

    }



    if (err) {

        err = -ENOENT;

        goto fail;

    }



    /* first event is at time 0 */

    atexit(quit_timers);

    t->pending = true;

    alarm_timer = t;



    return 0;



fail:

    return err;

}

int init_timer_alarm(void)

{

    struct qemu_alarm_timer *t = NULL;

    int i, err = -1;



    for (i = 0; alarm_timers[i].name; i++) {

        t = &alarm_timers[i];



        err = t->start(t);

        if (!err)

            break;

    }



    if (err) {

        err = -ENOENT;

        goto fail;

    }



    

    atexit(quit_timers);

    t->pending = true;

    alarm_timer = t;



    return 0;



fail:

    return err;

}

int FUNC_0(void)

{

    struct qemu_alarm_timer *VAR_0 = NULL;

    int VAR_1, VAR_2 = -1;



    for (VAR_1 = 0; alarm_timers[VAR_1].name; VAR_1++) {

        VAR_0 = &alarm_timers[VAR_1];



        VAR_2 = VAR_0->start(VAR_0);

        if (!VAR_2)

            break;

    }



    if (VAR_2) {

        VAR_2 = -ENOENT;

        goto fail;

    }



    

    atexit(quit_timers);

    VAR_0->pending = true;

    alarm_timer = VAR_0;



    return 0;



fail:

    return VAR_2;

}

int FUNC_0(void)
{ struct qemu_alarm_timer *VAR_0 = NULL; int VAR_1, VAR_2 = -1; for (VAR_1 = 0; alarm_timers[VAR_1].name; VAR_1++) { VAR_0 = &alarm_timers[VAR_1]; VAR_2 = VAR_0->start(VAR_0); if (!VAR_2)
break; } if (VAR_2) { VAR_2 = -ENOENT; goto fail; } atexit(quit_timers); VAR_0->pending = true; alarm_timer = VAR_0; return 0; fail:
return VAR_2; }