#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_prec_t;
typedef int mpfr_exp_t;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ assert(int);
int mpfr_get_emax();
int mpfr_get_emin();
int mpfr_get_prec(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_neg(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_emax(int);
int /*<<< orphan*/ mpfr_set_emin(int);
int /*<<< orphan*/ mpfr_set_inf(int /*<<< orphan*/, int);
int mpfr_set_z_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int,
                    int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_zero(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_abs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int);
int mpz_get_ui(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_setbit(int /*<<< orphan*/, int);
int mpz_sgn(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_tdiv_q_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_tdiv_r_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int);
void mpfr_from_mpz(mpfr_t r, mpz_t m, mpfr_exp_t emin, mpfr_exp_t emax,
                   int subnormal) {
  int sgn = mpz_sgn(m);
  if (sgn == 0) {
    mpfr_set_zero(r, 1);
    return;
  }
  mpfr_prec_t prec = mpfr_get_prec(r);
  mpfr_exp_t exp;
  mpz_t mz, ez;
  mpz_init(mz);
  mpz_init(ez);
  mpz_abs(mz, m);
  if (!subnormal) {
    mpz_sub_ui(mz, mz, 1);
    mpz_tdiv_q_2exp(ez, mz, prec - 1);
    if (mpz_cmp_ui(ez, emax - emin + 1) >= 0) {
      mpz_clear(ez);
      mpz_clear(mz);
      mpfr_set_inf(r, sgn);
      return;
    }
    exp = mpz_get_ui(ez) + emin;
    mpz_tdiv_r_2exp(mz, mz, prec - 1);
    mpz_setbit(mz, prec - 1);
  } else {
    mpz_tdiv_q_2exp(ez, mz, prec - 1);
    if (mpz_cmp_ui(ez, emax - emin - prec + 3) >= 0) {
      mpz_clear(ez);
      mpz_clear(mz);
      mpfr_set_inf(r, sgn);
      return;
    }
    exp = mpz_get_ui(ez);
    if (exp > 0) {
      exp += emin + prec - 2;
      mpz_tdiv_r_2exp(mz, mz, prec - 1);
      mpz_setbit(mz, prec - 1);
    } else {
      exp = emin + prec - 1;
    }
  }
  mpz_clear(ez);
  mpfr_exp_t saved_emin = mpfr_get_emin();
  mpfr_exp_t saved_emax = mpfr_get_emax();
  mpfr_set_emin(emin);
  mpfr_set_emax(emax);
  int t = mpfr_set_z_2exp(r, mz, exp - prec, MPFR_RNDN);
  assert(t == 0);
  mpz_clear(mz);
  if (sgn < 0) {
    mpfr_neg(r, r, MPFR_RNDN);
  }
  mpfr_set_emin(saved_emin);
  mpfr_set_emax(saved_emax);
}


x86 assembly (clang, -O0):
<mpfr_from_mpz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1160 <mpz_sgn@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    127f <mpfr_from_mpz+0x3f>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <mpfr_set_zero@plt>
jmp    1475 <mpfr_from_mpz+0x235>
mov    -0x4(%rbp),%edi
call   1140 <mpfr_get_prec@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
call   1070 <mpz_init@plt>
mov    -0x28(%rbp),%edi
call   1070 <mpz_init@plt>
mov    -0x24(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1090 <mpz_abs@plt>
cmpl   $0x0,-0x14(%rbp)
jne    133d <mpfr_from_mpz+0xfd>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    $0x1,%edx
call   10e0 <mpz_sub_ui@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1100 <mpz_tdiv_q_2exp@plt>
mov    -0x28(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
call   1110 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jl     130b <mpfr_from_mpz+0xcb>
mov    -0x28(%rbp),%edi
call   1130 <mpz_clear@plt>
mov    -0x24(%rbp),%edi
call   1130 <mpz_clear@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10f0 <mpfr_set_inf@plt>
jmp    1475 <mpfr_from_mpz+0x235>
mov    -0x28(%rbp),%edi
call   10d0 <mpz_get_ui@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1150 <mpz_tdiv_r_2exp@plt>
mov    -0x24(%rbp),%edi
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
call   1030 <mpz_setbit@plt>
jmp    13e5 <mpfr_from_mpz+0x1a5>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1100 <mpz_tdiv_q_2exp@plt>
mov    -0x28(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
sub    -0x1c(%rbp),%esi
add    $0x3,%esi
call   1110 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jl     138c <mpfr_from_mpz+0x14c>
mov    -0x28(%rbp),%edi
call   1130 <mpz_clear@plt>
mov    -0x24(%rbp),%edi
call   1130 <mpz_clear@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10f0 <mpfr_set_inf@plt>
jmp    1475 <mpfr_from_mpz+0x235>
mov    -0x28(%rbp),%edi
call   10d0 <mpz_get_ui@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    13d4 <mpfr_from_mpz+0x194>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    $0x2,%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1150 <mpz_tdiv_r_2exp@plt>
mov    -0x24(%rbp),%edi
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
call   1030 <mpz_setbit@plt>
jmp    13e0 <mpfr_from_mpz+0x1a0>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13e5 <mpfr_from_mpz+0x1a5>
mov    -0x28(%rbp),%edi
call   1130 <mpz_clear@plt>
mov    $0x0,%al
call   10b0 <mpfr_get_emin@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1120 <mpfr_get_emax@plt>
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <mpfr_set_emin@plt>
mov    -0x10(%rbp),%edi
call   10a0 <mpfr_set_emax@plt>
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
sub    -0x1c(%rbp),%edx
mov    0x2bc4(%rip),%rax
mov    (%rax),%ecx
call   10c0 <mpfr_set_z_2exp@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x24(%rbp),%edi
call   1130 <mpz_clear@plt>
cmpl   $0x0,-0x18(%rbp)
jge    1465 <mpfr_from_mpz+0x225>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2b8a(%rip),%rax
mov    (%rax),%edx
call   1040 <mpfr_neg@plt>
mov    -0x2c(%rbp),%edi
call   1050 <mpfr_set_emin@plt>
mov    -0x30(%rbp),%edi
call   10a0 <mpfr_set_emax@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfr_from_mpz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %rdx,0x8(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1160 <mpz_sgn@plt>
test   %eax,%eax
je     12ed <mpfr_from_mpz+0xad>
mov    %eax,%r13d
mov    %ebp,0x4(%rsp)
mov    %ebp,%edi
call   1140 <mpfr_get_prec@plt>
mov    %eax,%r15d
call   1070 <mpz_init@plt>
call   1070 <mpz_init@plt>
mov    %ebx,%esi
call   1090 <mpz_abs@plt>
test   %r14d,%r14d
mov    %r13d,(%rsp)
je     1307 <mpfr_from_mpz+0xc7>
lea    -0x1(%r15),%r14d
mov    %r14d,%edx
call   1100 <mpz_tdiv_q_2exp@plt>
mov    0x8(%rsp),%rax
lea    (%r15,%rax,1),%ebp
mov    %r12d,%ebx
mov    %r12d,%esi
sub    %ebp,%esi
add    $0x3,%esi
call   1110 <mpz_cmp_ui@plt>
test   %rax,%rax
jns    1338 <mpfr_from_mpz+0xf8>
mov    %r15,0x10(%rsp)
call   10d0 <mpz_get_ui@plt>
test   %eax,%eax
jle    137d <mpfr_from_mpz+0x13d>
add    %eax,%ebp
add    $0xfffffffe,%ebp
mov    %r14d,%edx
call   1150 <mpz_tdiv_r_2exp@plt>
mov    %r14d,%esi
call   1030 <mpz_setbit@plt>
jmp    1380 <mpfr_from_mpz+0x140>
mov    %ebp,%edi
mov    $0x1,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <mpfr_set_zero@plt>
mov    $0x1,%edx
call   10e0 <mpz_sub_ui@plt>
lea    -0x1(%r15),%r14d
mov    %r14d,%edx
call   1100 <mpz_tdiv_q_2exp@plt>
mov    %r12d,%ebx
mov    %r12d,%esi
mov    0x8(%rsp),%r13
sub    %r13d,%esi
add    $0x1,%esi
call   1110 <mpz_cmp_ui@plt>
test   %rax,%rax
js     135c <mpfr_from_mpz+0x11c>
call   1130 <mpz_clear@plt>
call   1130 <mpz_clear@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10f0 <mpfr_set_inf@plt>
mov    %r15,0x10(%rsp)
call   10d0 <mpz_get_ui@plt>
mov    %eax,%ebp
add    %r13d,%ebp
mov    %r14d,%edx
call   1150 <mpz_tdiv_r_2exp@plt>
mov    %r14d,%esi
call   1030 <mpz_setbit@plt>
jmp    1385 <mpfr_from_mpz+0x145>
add    $0xffffffff,%ebp
mov    0x8(%rsp),%r13
mov    (%rsp),%r15d
call   1130 <mpz_clear@plt>
xor    %eax,%eax
call   10b0 <mpfr_get_emin@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1120 <mpfr_get_emax@plt>
mov    %eax,%r14d
mov    %r13d,%edi
call   1050 <mpfr_set_emin@plt>
mov    %ebx,%edi
call   10a0 <mpfr_set_emax@plt>
sub    0x10(%rsp),%ebp
mov    0x2c2c(%rip),%r13
mov    0x0(%r13),%ecx
mov    0x4(%rsp),%ebx
mov    %ebx,%edi
mov    %ebp,%edx
call   10c0 <mpfr_set_z_2exp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1080 <assert@plt>
call   1130 <mpz_clear@plt>
test   %r15d,%r15d
jns    13f1 <mpfr_from_mpz+0x1b1>
mov    0x0(%r13),%edx
mov    %ebx,%edi
mov    %ebx,%esi
call   1040 <mpfr_neg@plt>
mov    %r12d,%edi
call   1050 <mpfr_set_emin@plt>
mov    %r14d,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <mpfr_set_emax@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define void @mpfr_from_mpz(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%19 = load i32, i32* %7
%20 = call i32 @mpz_sgn(i32 %19)
store i32 %20, i32* %11
%21 = load i32, i32* %11
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %5
%24 = load i32, i32* %6
%25 = call i32 @mpfr_set_zero(i32 %24, i32 1)
br label %160
26: ; preds = %5
%27 = load i32, i32* %6
%28 = call i32 @mpfr_get_prec(i32 %27)
store i32 %28, i32* %12
%29 = load i32, i32* %14
%30 = call i32 @mpz_init(i32 %29)
%31 = load i32, i32* %15
%32 = call i32 @mpz_init(i32 %31)
%33 = load i32, i32* %14
%34 = load i32, i32* %7
%35 = call i32 @mpz_abs(i32 %33, i32 %34)
%36 = load i32, i32* %10
%37 = icmp ne i32 %36, 0
br i1 %37, label %76, label %38
38: ; preds = %26
%39 = load i32, i32* %14
%40 = load i32, i32* %14
%41 = call i32 @mpz_sub_ui(i32 %39, i32 %40, i32 1)
%42 = load i32, i32* %15
%43 = load i32, i32* %14
%44 = load i32, i32* %12
%45 = sub nsw i32 %44, 1
%46 = call i32 @mpz_tdiv_q_2exp(i32 %42, i32 %43, i32 %45)
%47 = load i32, i32* %15
%48 = load i32, i32* %9
%49 = load i32, i32* %8
%50 = sub nsw i32 %48, %49
%51 = add nsw i32 %50, 1
%52 = call i64 @mpz_cmp_ui(i32 %47, i32 %51)
%53 = icmp sge i64 %52, 0
br i1 %53, label %54, label %62
54: ; preds = %38
%55 = load i32, i32* %15
%56 = call i32 @mpz_clear(i32 %55)
%57 = load i32, i32* %14
%58 = call i32 @mpz_clear(i32 %57)
%59 = load i32, i32* %6
%60 = load i32, i32* %11
%61 = call i32 @mpfr_set_inf(i32 %59, i32 %60)
br label %160
62: ; preds = %38
%63 = load i32, i32* %15
%64 = call i32 @mpz_get_ui(i32 %63)
%65 = load i32, i32* %8
%66 = add nsw i32 %64, %65
store i32 %66, i32* %13
%67 = load i32, i32* %14
%68 = load i32, i32* %14
%69 = load i32, i32* %12
%70 = sub nsw i32 %69, 1
%71 = call i32 @mpz_tdiv_r_2exp(i32 %67, i32 %68, i32 %70)
%72 = load i32, i32* %14
%73 = load i32, i32* %12
%74 = sub nsw i32 %73, 1
%75 = call i32 @mpz_setbit(i32 %72, i32 %74)
br label %126
76: ; preds = %26
%77 = load i32, i32* %15
%78 = load i32, i32* %14
%79 = load i32, i32* %12
%80 = sub nsw i32 %79, 1
%81 = call i32 @mpz_tdiv_q_2exp(i32 %77, i32 %78, i32 %80)
%82 = load i32, i32* %15
%83 = load i32, i32* %9
%84 = load i32, i32* %8
%85 = sub nsw i32 %83, %84
%86 = load i32, i32* %12
%87 = sub nsw i32 %85, %86
%88 = add nsw i32 %87, 3
%89 = call i64 @mpz_cmp_ui(i32 %82, i32 %88)
%90 = icmp sge i64 %89, 0
br i1 %90, label %91, label %99
91: ; preds = %76
%92 = load i32, i32* %15
%93 = call i32 @mpz_clear(i32 %92)
%94 = load i32, i32* %14
%95 = call i32 @mpz_clear(i32 %94)
%96 = load i32, i32* %6
%97 = load i32, i32* %11
%98 = call i32 @mpfr_set_inf(i32 %96, i32 %97)
br label %160
99: ; preds = %76
%100 = load i32, i32* %15
%101 = call i32 @mpz_get_ui(i32 %100)
store i32 %101, i32* %13
%102 = load i32, i32* %13
%103 = icmp sgt i32 %102, 0
br i1 %103, label %104, label %120
104: ; preds = %99
%105 = load i32, i32* %8
%106 = load i32, i32* %12
%107 = add nsw i32 %105, %106
%108 = sub nsw i32 %107, 2
%109 = load i32, i32* %13
%110 = add nsw i32 %109, %108
store i32 %110, i32* %13
%111 = load i32, i32* %14
%112 = load i32, i32* %14
%113 = load i32, i32* %12
%114 = sub nsw i32 %113, 1
%115 = call i32 @mpz_tdiv_r_2exp(i32 %111, i32 %112, i32 %114)
%116 = load i32, i32* %14
%117 = load i32, i32* %12
%118 = sub nsw i32 %117, 1
%119 = call i32 @mpz_setbit(i32 %116, i32 %118)
br label %125
120: ; preds = %99
%121 = load i32, i32* %8
%122 = load i32, i32* %12
%123 = add nsw i32 %121, %122
%124 = sub nsw i32 %123, 1
store i32 %124, i32* %13
br label %125
125: ; preds = %120, %104
br label %126
126: ; preds = %125, %62
%127 = load i32, i32* %15
%128 = call i32 @mpz_clear(i32 %127)
%129 = call i32 (...) @mpfr_get_emin()
store i32 %129, i32* %16
%130 = call i32 (...) @mpfr_get_emax()
store i32 %130, i32* %17
%131 = load i32, i32* %8
%132 = call i32 @mpfr_set_emin(i32 %131)
%133 = load i32, i32* %9
%134 = call i32 @mpfr_set_emax(i32 %133)
%135 = load i32, i32* %6
%136 = load i32, i32* %14
%137 = load i32, i32* %13
%138 = load i32, i32* %12
%139 = sub nsw i32 %137, %138
%140 = load i32, i32* @MPFR_RNDN
%141 = call i32 @mpfr_set_z_2exp(i32 %135, i32 %136, i32 %139, i32 %140)
store i32 %141, i32* %18
%142 = load i32, i32* %18
%143 = icmp eq i32 %142, 0
%144 = zext i1 %143 to i32
%145 = call i32 @assert(i32 %144)
%146 = load i32, i32* %14
%147 = call i32 @mpz_clear(i32 %146)
%148 = load i32, i32* %11
%149 = icmp slt i32 %148, 0
br i1 %149, label %150, label %155
150: ; preds = %126
%151 = load i32, i32* %6
%152 = load i32, i32* %6
%153 = load i32, i32* @MPFR_RNDN
%154 = call i32 @mpfr_neg(i32 %151, i32 %152, i32 %153)
br label %155
155: ; preds = %150, %126
%156 = load i32, i32* %16
%157 = call i32 @mpfr_set_emin(i32 %156)
%158 = load i32, i32* %17
%159 = call i32 @mpfr_set_emax(i32 %158)
br label %160
160: ; preds = %155, %91, %54, %23
ret void
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define void @mpfr_from_mpz(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @mpz_sgn(i32 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @mpfr_set_zero(i32 %0, i32 1)
br label %76
10: ; preds = %5
%11 = tail call i32 @mpfr_get_prec(i32 %0)
%12 = tail call i32 @mpz_init(i32 undef)
%13 = tail call i32 @mpz_init(i32 undef)
%14 = tail call i32 @mpz_abs(i32 undef, i32 %1)
%15 = icmp eq i32 %4, 0
br i1 %15, label %16, label %33
16: ; preds = %10
%17 = tail call i32 @mpz_sub_ui(i32 undef, i32 undef, i32 1)
%18 = add nsw i32 %11, -1
%19 = tail call i32 @mpz_tdiv_q_2exp(i32 undef, i32 undef, i32 %18)
%20 = sub i32 1, %2
%21 = add i32 %20, %3
%22 = tail call i64 @mpz_cmp_ui(i32 undef, i32 %21)
%23 = icmp sgt i64 %22, -1
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = tail call i32 @mpz_clear(i32 undef)
%26 = tail call i32 @mpz_clear(i32 undef)
%27 = tail call i32 @mpfr_set_inf(i32 %0, i32 %6)
br label %76
28: ; preds = %16
%29 = tail call i32 @mpz_get_ui(i32 undef)
%30 = add nsw i32 %29, %2
%31 = tail call i32 @mpz_tdiv_r_2exp(i32 undef, i32 undef, i32 %18)
%32 = tail call i32 @mpz_setbit(i32 undef, i32 %18)
br label %55
33: ; preds = %10
%34 = add nsw i32 %11, -1
%35 = tail call i32 @mpz_tdiv_q_2exp(i32 undef, i32 undef, i32 %34)
%36 = add i32 %11, %2
%37 = add i32 %3, 3
%38 = sub i32 %37, %36
%39 = tail call i64 @mpz_cmp_ui(i32 undef, i32 %38)
%40 = icmp sgt i64 %39, -1
br i1 %40, label %41, label %45
41: ; preds = %33
%42 = tail call i32 @mpz_clear(i32 undef)
%43 = tail call i32 @mpz_clear(i32 undef)
%44 = tail call i32 @mpfr_set_inf(i32 %0, i32 %6)
br label %76
45: ; preds = %33
%46 = tail call i32 @mpz_get_ui(i32 undef)
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %45
%49 = add nsw i32 %36, -2
%50 = add nsw i32 %49, %46
%51 = tail call i32 @mpz_tdiv_r_2exp(i32 undef, i32 undef, i32 %34)
%52 = tail call i32 @mpz_setbit(i32 undef, i32 %34)
br label %55
53: ; preds = %45
%54 = add nsw i32 %36, -1
br label %55
55: ; preds = %48, %53, %28
%56 = phi i32 [ %50, %48 ], [ %54, %53 ], [ %30, %28 ]
%57 = tail call i32 @mpz_clear(i32 undef)
%58 = tail call i32 (...) @mpfr_get_emin()
%59 = tail call i32 (...) @mpfr_get_emax()
%60 = tail call i32 @mpfr_set_emin(i32 %2)
%61 = tail call i32 @mpfr_set_emax(i32 %3)
%62 = sub nsw i32 %56, %11
%63 = load i32, i32* @MPFR_RNDN
%64 = tail call i32 @mpfr_set_z_2exp(i32 %0, i32 undef, i32 %62, i32 %63)
%65 = icmp eq i32 %64, 0
%66 = zext i1 %65 to i32
%67 = tail call i32 @assert(i32 %66)
%68 = tail call i32 @mpz_clear(i32 undef)
%69 = icmp slt i32 %6, 0
br i1 %69, label %70, label %73
70: ; preds = %55
%71 = load i32, i32* @MPFR_RNDN
%72 = tail call i32 @mpfr_neg(i32 %0, i32 %0, i32 %71)
br label %73
73: ; preds = %70, %55
%74 = tail call i32 @mpfr_set_emin(i32 %58)
%75 = tail call i32 @mpfr_set_emax(i32 %59)
br label %76
76: ; preds = %24, %41, %73, %8
ret void
}