void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb, uintptr_t ra)

{

    CRW crw;

    uint64_t addr;

    int cc;

    CPUS390XState *env = &cpu->env;

    uint8_t ar;



    addr = decode_basedisp_s(env, ipb, &ar);

    if (addr & 3) {

        s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra);

        return;

    }



    cc = css_do_stcrw(&crw);

    /* 0 - crw stored, 1 - zeroes stored */



    if (s390_cpu_virt_mem_write(cpu, addr, ar, &crw, sizeof(crw)) == 0) {

        setcc(cpu, cc);

    } else if (cc == 0) {

        /* Write failed: requeue CRW since STCRW is a suppressing instruction */

        css_undo_stcrw(&crw);

    }

}

void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb, uintptr_t ra)

{

    CRW crw;

    uint64_t addr;

    int cc;

    CPUS390XState *env = &cpu->env;

    uint8_t ar;



    addr = decode_basedisp_s(env, ipb, &ar);

    if (addr & 3) {

        s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra);

        return;

    }



    cc = css_do_stcrw(&crw);

    



    if (s390_cpu_virt_mem_write(cpu, addr, ar, &crw, sizeof(crw)) == 0) {

        setcc(cpu, cc);

    } else if (cc == 0) {

        

        css_undo_stcrw(&crw);

    }

}

void FUNC_0(S390CPU *VAR_0, uint32_t VAR_1, uintptr_t VAR_2)

{

    CRW crw;

    uint64_t addr;

    int VAR_3;

    CPUS390XState *env = &VAR_0->env;

    uint8_t ar;



    addr = decode_basedisp_s(env, VAR_1, &ar);

    if (addr & 3) {

        s390_program_interrupt(env, PGM_SPECIFICATION, 4, VAR_2);

        return;

    }



    VAR_3 = css_do_stcrw(&crw);

    



    if (s390_cpu_virt_mem_write(VAR_0, addr, ar, &crw, sizeof(crw)) == 0) {

        setcc(VAR_0, VAR_3);

    } else if (VAR_3 == 0) {

        

        css_undo_stcrw(&crw);

    }

}

void FUNC_0(S390CPU *VAR_0, uint32_t VAR_1, uintptr_t VAR_2)
{ CRW crw; uint64_t addr; int VAR_3; CPUS390XState *env = &VAR_0->env; uint8_t ar; addr = decode_basedisp_s(env, VAR_1, &ar); if (addr & 3) { s390_program_interrupt(env, PGM_SPECIFICATION, 4, VAR_2); return; } VAR_3 = css_do_stcrw(&crw); if (s390_cpu_virt_mem_write(VAR_0, addr, ar, &crw, sizeof(crw)) == 0) { setcc(VAR_0, VAR_3); } else if (VAR_3 == 0) { css_undo_stcrw(&crw); } }