static void imx_epit_reload_compare_timer(IMXEPITState *s)

{

    if ((s->cr & (CR_EN | CR_OCIEN)) == (CR_EN | CR_OCIEN))  {

        /* if the compare feature is on and timers are running */

        uint32_t tmp = imx_epit_update_count(s);

        uint64_t next;

        if (tmp > s->cmp) {

            /* It'll fire in this round of the timer */

            next = tmp - s->cmp;

        } else { /* catch it next time around */

            next = tmp - s->cmp + ((s->cr & CR_RLD) ? TIMER_MAX : s->lr);

        }

        ptimer_set_count(s->timer_cmp, next);

    }

}

static void imx_epit_reload_compare_timer(IMXEPITState *s)

{

    if ((s->cr & (CR_EN | CR_OCIEN)) == (CR_EN | CR_OCIEN))  {

        

        uint32_t tmp = imx_epit_update_count(s);

        uint64_t next;

        if (tmp > s->cmp) {

            

            next = tmp - s->cmp;

        } else { 

            next = tmp - s->cmp + ((s->cr & CR_RLD) ? TIMER_MAX : s->lr);

        }

        ptimer_set_count(s->timer_cmp, next);

    }

}

static void FUNC_0(IMXEPITState *VAR_0)

{

    if ((VAR_0->cr & (CR_EN | CR_OCIEN)) == (CR_EN | CR_OCIEN))  {

        

        uint32_t tmp = imx_epit_update_count(VAR_0);

        uint64_t next;

        if (tmp > VAR_0->cmp) {

            

            next = tmp - VAR_0->cmp;

        } else { 

            next = tmp - VAR_0->cmp + ((VAR_0->cr & CR_RLD) ? TIMER_MAX : VAR_0->lr);

        }

        ptimer_set_count(VAR_0->timer_cmp, next);

    }

}

static void FUNC_0(IMXEPITState *VAR_0)
{ if ((VAR_0->cr & (CR_EN | CR_OCIEN)) == (CR_EN | CR_OCIEN))  { uint32_t tmp = imx_epit_update_count(VAR_0); uint64_t next; if (tmp > VAR_0->cmp) { next = tmp - VAR_0->cmp; } else { next = tmp - VAR_0->cmp + ((VAR_0->cr & CR_RLD) ? TIMER_MAX : VAR_0->lr); } ptimer_set_count(VAR_0->timer_cmp, next); } }