static void gen_sraiq(DisasContext *ctx)

{

    int sh = SH(ctx->opcode);

    int l1 = gen_new_label();

    TCGv t0 = tcg_temp_new();

    TCGv t1 = tcg_temp_new();

    tcg_gen_shri_tl(t0, cpu_gpr[rS(ctx->opcode)], sh);

    tcg_gen_shli_tl(t1, cpu_gpr[rS(ctx->opcode)], 32 - sh);

    tcg_gen_or_tl(t0, t0, t1);

    gen_store_spr(SPR_MQ, t0);

    tcg_gen_movi_tl(cpu_ca, 0);

    tcg_gen_brcondi_tl(TCG_COND_EQ, t1, 0, l1);

    tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(ctx->opcode)], 0, l1);

    tcg_gen_movi_tl(cpu_ca, 1);

    gen_set_label(l1);

    tcg_gen_sari_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)], sh);

    tcg_temp_free(t0);

    tcg_temp_free(t1);

    if (unlikely(Rc(ctx->opcode) != 0))

        gen_set_Rc0(ctx, cpu_gpr[rA(ctx->opcode)]);

}

static void gen_sraiq(DisasContext *ctx)

{

    int sh = SH(ctx->opcode);

    int l1 = gen_new_label();

    TCGv t0 = tcg_temp_new();

    TCGv t1 = tcg_temp_new();

    tcg_gen_shri_tl(t0, cpu_gpr[rS(ctx->opcode)], sh);

    tcg_gen_shli_tl(t1, cpu_gpr[rS(ctx->opcode)], 32 - sh);

    tcg_gen_or_tl(t0, t0, t1);

    gen_store_spr(SPR_MQ, t0);

    tcg_gen_movi_tl(cpu_ca, 0);

    tcg_gen_brcondi_tl(TCG_COND_EQ, t1, 0, l1);

    tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(ctx->opcode)], 0, l1);

    tcg_gen_movi_tl(cpu_ca, 1);

    gen_set_label(l1);

    tcg_gen_sari_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)], sh);

    tcg_temp_free(t0);

    tcg_temp_free(t1);

    if (unlikely(Rc(ctx->opcode) != 0))

        gen_set_Rc0(ctx, cpu_gpr[rA(ctx->opcode)]);

}

static void FUNC_0(DisasContext *VAR_0)

{

    int VAR_1 = SH(VAR_0->opcode);

    int VAR_2 = gen_new_label();

    TCGv t0 = tcg_temp_new();

    TCGv t1 = tcg_temp_new();

    tcg_gen_shri_tl(t0, cpu_gpr[rS(VAR_0->opcode)], VAR_1);

    tcg_gen_shli_tl(t1, cpu_gpr[rS(VAR_0->opcode)], 32 - VAR_1);

    tcg_gen_or_tl(t0, t0, t1);

    gen_store_spr(SPR_MQ, t0);

    tcg_gen_movi_tl(cpu_ca, 0);

    tcg_gen_brcondi_tl(TCG_COND_EQ, t1, 0, VAR_2);

    tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(VAR_0->opcode)], 0, VAR_2);

    tcg_gen_movi_tl(cpu_ca, 1);

    gen_set_label(VAR_2);

    tcg_gen_sari_tl(cpu_gpr[rA(VAR_0->opcode)], cpu_gpr[rS(VAR_0->opcode)], VAR_1);

    tcg_temp_free(t0);

    tcg_temp_free(t1);

    if (unlikely(Rc(VAR_0->opcode) != 0))

        gen_set_Rc0(VAR_0, cpu_gpr[rA(VAR_0->opcode)]);

}

static void FUNC_0(DisasContext *VAR_0)
{ int VAR_1 = SH(VAR_0->opcode); int VAR_2 = gen_new_label(); TCGv t0 = tcg_temp_new(); TCGv t1 = tcg_temp_new(); tcg_gen_shri_tl(t0, cpu_gpr[rS(VAR_0->opcode)], VAR_1); tcg_gen_shli_tl(t1, cpu_gpr[rS(VAR_0->opcode)], 32 - VAR_1); tcg_gen_or_tl(t0, t0, t1); gen_store_spr(SPR_MQ, t0); tcg_gen_movi_tl(cpu_ca, 0); tcg_gen_brcondi_tl(TCG_COND_EQ, t1, 0, VAR_2); tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(VAR_0->opcode)], 0, VAR_2); tcg_gen_movi_tl(cpu_ca, 1); gen_set_label(VAR_2); tcg_gen_sari_tl(cpu_gpr[rA(VAR_0->opcode)], cpu_gpr[rS(VAR_0->opcode)], VAR_1); tcg_temp_free(t0); tcg_temp_free(t1); if (unlikely(Rc(VAR_0->opcode) != 0))
gen_set_Rc0(VAR_0, cpu_gpr[rA(VAR_0->opcode)]); }