static void gt_ctl_write(CPUARMState *env, const ARMCPRegInfo *ri,

                         uint64_t value)

{

    ARMCPU *cpu = arm_env_get_cpu(env);

    int timeridx = ri->crm & 1;

    uint32_t oldval = env->cp15.c14_timer[timeridx].ctl;



    env->cp15.c14_timer[timeridx].ctl = value & 3;

    if ((oldval ^ value) & 1) {

        /* Enable toggled */

        gt_recalc_timer(cpu, timeridx);

    } else if ((oldval & value) & 2) {

        /* IMASK toggled: don't need to recalculate,

         * just set the interrupt line based on ISTATUS

         */

        qemu_set_irq(cpu->gt_timer_outputs[timeridx],

                     (oldval & 4) && (value & 2));

    }

}

static void gt_ctl_write(CPUARMState *env, const ARMCPRegInfo *ri,

                         uint64_t value)

{

    ARMCPU *cpu = arm_env_get_cpu(env);

    int timeridx = ri->crm & 1;

    uint32_t oldval = env->cp15.c14_timer[timeridx].ctl;



    env->cp15.c14_timer[timeridx].ctl = value & 3;

    if ((oldval ^ value) & 1) {

        

        gt_recalc_timer(cpu, timeridx);

    } else if ((oldval & value) & 2) {

        





        qemu_set_irq(cpu->gt_timer_outputs[timeridx],

                     (oldval & 4) && (value & 2));

    }

}

    env->cp15.c14_timer[timeridx].ctl = value & 3;     } else if ((oldval & value) & 2) {                      (oldval & 4) && (value & 2));
static void FUNC_0(CPUARMState *VAR_0, const ARMCPRegInfo *VAR_1,

                         uint64_t VAR_2)

{

    ARMCPU *cpu = arm_env_get_cpu(VAR_0);

    int VAR_3 = VAR_1->crm & 1;

    uint32_t oldval = VAR_0->cp15.c14_timer[VAR_3].ctl;



    VAR_0->cp15.c14_timer[VAR_3].ctl = VAR_2 & 3;

    if ((oldval ^ VAR_2) & 1) {

        

        gt_recalc_timer(cpu, VAR_3);

    } else if ((oldval & VAR_2) & 2) {

        





        qemu_set_irq(cpu->gt_timer_outputs[VAR_3],

                     (oldval & 4) && (VAR_2 & 2));

    }

}

static void FUNC_0(CPUARMState *VAR_0, const ARMCPRegInfo *VAR_1,
uint64_t VAR_2)
{ ARMCPU *cpu = arm_env_get_cpu(VAR_0); int VAR_3 = VAR_1->crm & 1; uint32_t oldval = VAR_0->cp15.c14_timer[VAR_3].ctl; VAR_0->cp15.c14_timer[VAR_3].ctl = VAR_2 & 3; if ((oldval ^ VAR_2) & 1) { gt_recalc_timer(cpu, VAR_3); } else if ((oldval & VAR_2) & 2) { qemu_set_irq(cpu->gt_timer_outputs[VAR_3],
(oldval & 4) && (VAR_2 & 2)); } }