#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 /*<<< orphan*/ mpfr_srcptr;
typedef scalar_t__ mpfr_rnd_t;
typedef int /*<<< orphan*/ mpfr_ptr;
typedef int mpfr_prec_t;
typedef int /*<<< orphan*/ mpfr_exp_t;

/* Variables and functions */
scalar_t__ MPFR_RNDD;
scalar_t__ MPFR_RNDU;
scalar_t__ assert(int);
int /*<<< orphan*/ mpfr_add(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, scalar_t__);
int mpfr_check_range(int /*<<< orphan*/, int, scalar_t__);
int /*<<< orphan*/ mpfr_clear(int /*<<< orphan*/);
scalar_t__ mpfr_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_const_pi(int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ mpfr_get_emax();
int /*<<< orphan*/ mpfr_get_emax_max();
int /*<<< orphan*/ mpfr_get_emin();
int /*<<< orphan*/ mpfr_get_emin_min();
int mpfr_get_prec(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_init2(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpfr_mul_z(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ mpfr_neg(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ mpfr_prec_round(int /*<<< orphan*/, int, scalar_t__);
int /*<<< orphan*/ mpfr_set(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ mpfr_set_emax(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_emin(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, scalar_t__);
scalar_t__ mpz_sgn(int /*<<< orphan*/);
int stub1(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int stub2(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int stub3(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int stub4(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int stub5(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int stub6(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int mpfr_atrig(mpfr_ptr rop, mpfr_srcptr op,
               int (*fun)(mpfr_ptr rop, mpfr_srcptr op, mpfr_rnd_t rnd),
               int sub, mpz_t npi, mpfr_rnd_t rnd) {
  assert(rnd == MPFR_RNDU || rnd == MPFR_RNDD);
  int t;
  if (mpz_sgn(npi) == 0) {
    if (sub) {
      mpfr_rnd_t rnd1 =
          rnd == MPFR_RNDU ? MPFR_RNDD : (assert(rnd == MPFR_RNDD), MPFR_RNDU);
      t = -(*fun)(rop, op, rnd1);
      mpfr_neg(rop, rop, rnd);
    } else {
      t = (*fun)(rop, op, rnd);
    }
    return t;
  }
  mpfr_exp_t emin_rop = mpfr_get_emin();
  mpfr_exp_t emax_rop = mpfr_get_emax();
  mpfr_set_emin(mpfr_get_emin_min());
  mpfr_set_emax(mpfr_get_emax_max());
  mpfr_prec_t prec = mpfr_get_prec(rop) * 2;
  for (;;) {
    mpfr_t pi, inf, sup;
    mpfr_init2(pi, prec);
    mpfr_init2(inf, prec);
    mpfr_init2(sup, prec);
    mpfr_const_pi(pi, MPFR_RNDD);
    mpfr_mul_z(pi, pi, npi, MPFR_RNDD);
    if (sub) {
      (*fun)(sup, op, MPFR_RNDU);
      mpfr_sub(sup, pi, sup, MPFR_RNDD);
    } else {
      (*fun)(inf, op, MPFR_RNDD);
      mpfr_add(inf, pi, inf, MPFR_RNDD);
    }
    mpfr_const_pi(pi, MPFR_RNDU);
    mpfr_mul_z(pi, pi, npi, MPFR_RNDU);
    if (sub) {
      (*fun)(inf, op, MPFR_RNDD);
      mpfr_sub(inf, pi, inf, MPFR_RNDU);
    } else {
      (*fun)(sup, op, MPFR_RNDU);
      mpfr_add(sup, pi, sup, MPFR_RNDU);
    }
    mpfr_clear(pi);
    mpfr_prec_round(inf, mpfr_get_prec(rop), rnd);
    mpfr_prec_round(sup, mpfr_get_prec(rop), rnd);
    if (mpfr_cmp(inf, sup) == 0) {
      mpfr_set(rop, inf, rnd);
      mpfr_clear(inf);
      mpfr_clear(sup);
      mpfr_set_emin(emin_rop);
      mpfr_set_emax(emax_rop);
      return mpfr_check_range(rop, rnd == MPFR_RNDU ? 1 : -1, rnd);
    }
    mpfr_clear(inf);
    mpfr_clear(sup);
    prec += mpfr_get_prec(rop);
  }
}


x86 assembly (clang, -O0):
<mpfr_atrig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    $0x1,%al
mov    0x2d6e(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x51(%rbp)
je     128a <mpfr_atrig+0x4a>
mov    -0x28(%rbp),%rax
mov    0x2d67(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    -0x20(%rbp),%edi
call   1150 <mpz_sgn@plt>
cmp    $0x0,%rax
jne    1356 <mpfr_atrig+0x116>
cmpl   $0x0,-0x1c(%rbp)
je     1338 <mpfr_atrig+0xf8>
mov    -0x28(%rbp),%rax
mov    0x2d1a(%rip),%rcx
cmp    (%rcx),%rax
jne    12da <mpfr_atrig+0x9a>
mov    0x2d1a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
jmp    1303 <mpfr_atrig+0xc3>
mov    -0x28(%rbp),%rax
mov    0x2d03(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   *%rax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1050 <mpfr_neg@plt>
jmp    134b <mpfr_atrig+0x10b>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   *%rax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15b8 <mpfr_atrig+0x378>
mov    $0x0,%al
call   10c0 <mpfr_get_emin@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   10e0 <mpfr_get_emax@plt>
mov    %eax,-0x40(%rbp)
mov    $0x0,%al
call   1160 <mpfr_get_emin_min@plt>
mov    %eax,%edi
call   1060 <mpfr_set_emin@plt>
mov    $0x0,%al
call   10f0 <mpfr_get_emax_max@plt>
mov    %eax,%edi
call   10b0 <mpfr_set_emax@plt>
mov    -0x8(%rbp),%edi
call   1120 <mpfr_get_prec@plt>
shl    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x44(%rbp),%esi
call   1130 <mpfr_init2@plt>
mov    -0x4c(%rbp),%edi
mov    -0x44(%rbp),%esi
call   1130 <mpfr_init2@plt>
mov    -0x50(%rbp),%edi
mov    -0x44(%rbp),%esi
call   1130 <mpfr_init2@plt>
mov    -0x48(%rbp),%edi
mov    0x2c29(%rip),%rax
mov    (%rax),%rsi
call   1040 <mpfr_const_pi@plt>
mov    -0x48(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    0x2c11(%rip),%rax
mov    (%rax),%rcx
call   10d0 <mpfr_mul_z@plt>
cmpl   $0x0,-0x1c(%rbp)
je     141c <mpfr_atrig+0x1dc>
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2bde(%rip),%rcx
mov    (%rcx),%rdx
call   *%rax
mov    -0x50(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    0x2bd9(%rip),%rax
mov    (%rax),%rcx
call   1030 <mpfr_sub@plt>
jmp    144a <mpfr_atrig+0x20a>
mov    -0x18(%rbp),%rax
mov    -0x4c(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2bbb(%rip),%rcx
mov    (%rcx),%rdx
call   *%rax
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    0x2ba6(%rip),%rax
mov    (%rax),%rcx
call   1080 <mpfr_add@plt>
mov    -0x48(%rbp),%edi
mov    0x2b84(%rip),%rax
mov    (%rax),%rsi
call   1040 <mpfr_const_pi@plt>
mov    -0x48(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    0x2b6c(%rip),%rax
mov    (%rax),%rcx
call   10d0 <mpfr_mul_z@plt>
cmpl   $0x0,-0x1c(%rbp)
je     14b1 <mpfr_atrig+0x271>
mov    -0x18(%rbp),%rax
mov    -0x4c(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2b59(%rip),%rcx
mov    (%rcx),%rdx
call   *%rax
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    0x2b34(%rip),%rax
mov    (%rax),%rcx
call   1030 <mpfr_sub@plt>
jmp    14df <mpfr_atrig+0x29f>
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2b16(%rip),%rcx
mov    (%rcx),%rdx
call   *%rax
mov    -0x50(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    0x2b01(%rip),%rax
mov    (%rax),%rcx
call   1080 <mpfr_add@plt>
mov    -0x48(%rbp),%edi
call   1070 <mpfr_clear@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x8(%rbp),%edi
call   1120 <mpfr_get_prec@plt>
mov    -0x68(%rbp),%edi
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
call   1100 <mpfr_prec_round@plt>
mov    -0x50(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%edi
call   1120 <mpfr_get_prec@plt>
mov    -0x64(%rbp),%edi
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
call   1100 <mpfr_prec_round@plt>
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
call   1110 <mpfr_cmp@plt>
cmp    $0x0,%rax
jne    1595 <mpfr_atrig+0x355>
mov    -0x8(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1090 <mpfr_set@plt>
mov    -0x4c(%rbp),%edi
call   1070 <mpfr_clear@plt>
mov    -0x50(%rbp),%edi
call   1070 <mpfr_clear@plt>
mov    -0x3c(%rbp),%edi
call   1060 <mpfr_set_emin@plt>
mov    -0x40(%rbp),%edi
call   10b0 <mpfr_set_emax@plt>
mov    -0x8(%rbp),%edi
mov    -0x28(%rbp),%rcx
mov    0x2a67(%rip),%rax
mov    (%rax),%rdx
mov    $0xffffffff,%esi
mov    $0x1,%eax
cmp    %rdx,%rcx
cmove  %eax,%esi
mov    -0x28(%rbp),%rdx
call   1140 <mpfr_check_range@plt>
mov    %eax,-0x4(%rbp)
jmp    15b8 <mpfr_atrig+0x378>
mov    -0x4c(%rbp),%edi
call   1070 <mpfr_clear@plt>
mov    -0x50(%rbp),%edi
call   1070 <mpfr_clear@plt>
mov    -0x8(%rbp),%edi
call   1120 <mpfr_get_prec@plt>
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1394 <mpfr_atrig+0x154>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfr_atrig>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2d83(%rip),%rbx
cmp    %r9,(%rbx)
sete   %al
mov    0x2d86(%rip),%r14
mov    %r9,0x10(%rsp)
cmp    %r9,(%r14)
mov    %r8d,%r13d
mov    %ecx,%ebp
mov    %rdx,(%rsp)
mov    %esi,%r15d
mov    %edi,%r12d
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   10a0 <assert@plt>
mov    %r13d,0xc(%rsp)
mov    %r13d,%edi
call   1150 <mpz_sgn@plt>
test   %rax,%rax
je     144d <mpfr_atrig+0x20d>
xor    %eax,%eax
call   10c0 <mpfr_get_emin@plt>
mov    %eax,0x1c(%rsp)
xor    %eax,%eax
call   10e0 <mpfr_get_emax@plt>
mov    %eax,0x18(%rsp)
xor    %eax,%eax
call   1160 <mpfr_get_emin_min@plt>
mov    %eax,%edi
call   1060 <mpfr_set_emin@plt>
xor    %eax,%eax
call   10f0 <mpfr_get_emax_max@plt>
mov    %eax,%edi
call   10b0 <mpfr_set_emax@plt>
mov    %r12d,%edi
call   1120 <mpfr_get_prec@plt>
mov    %eax,%r13d
add    %eax,%r13d
mov    %r15d,0x24(%rsp)
mov    %ebp,0x20(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13d,%esi
call   1130 <mpfr_init2@plt>
mov    %r13d,%esi
call   1130 <mpfr_init2@plt>
mov    %r13d,%esi
call   1130 <mpfr_init2@plt>
mov    (%r14),%rsi
call   1040 <mpfr_const_pi@plt>
mov    (%r14),%rcx
mov    0xc(%rsp),%edx
call   10d0 <mpfr_mul_z@plt>
test   %ebp,%ebp
je     1340 <mpfr_atrig+0x100>
mov    (%rbx),%rdx
mov    %r15d,%esi
call   *(%rsp)
mov    (%r14),%rcx
call   1030 <mpfr_sub@plt>
jmp    1351 <mpfr_atrig+0x111>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%rdx
mov    %r15d,%esi
call   *(%rsp)
mov    (%r14),%rcx
call   1080 <mpfr_add@plt>
mov    (%rbx),%rsi
call   1040 <mpfr_const_pi@plt>
mov    (%rbx),%rcx
mov    0xc(%rsp),%edx
call   10d0 <mpfr_mul_z@plt>
test   %ebp,%ebp
je     1380 <mpfr_atrig+0x140>
mov    (%r14),%rdx
mov    %r15d,%esi
call   *(%rsp)
mov    (%rbx),%rcx
call   1030 <mpfr_sub@plt>
jmp    1391 <mpfr_atrig+0x151>
nopl   0x0(%rax)
mov    (%rbx),%rdx
mov    %r15d,%esi
call   *(%rsp)
mov    (%rbx),%rcx
call   1080 <mpfr_add@plt>
call   1070 <mpfr_clear@plt>
mov    %r12d,%edi
call   1120 <mpfr_get_prec@plt>
mov    %eax,%esi
mov    0x10(%rsp),%r15
mov    %r15,%rdx
call   1100 <mpfr_prec_round@plt>
mov    %r12d,%edi
call   1120 <mpfr_get_prec@plt>
mov    %eax,%esi
mov    %r15,%rdx
call   1100 <mpfr_prec_round@plt>
call   1110 <mpfr_cmp@plt>
test   %rax,%rax
je     13f3 <mpfr_atrig+0x1b3>
call   1070 <mpfr_clear@plt>
call   1070 <mpfr_clear@plt>
mov    %r12d,%edi
call   1120 <mpfr_get_prec@plt>
add    %eax,%r13d
mov    0x2bf3(%rip),%rbx
mov    0x24(%rsp),%r15d
mov    0x20(%rsp),%ebp
jmp    12f0 <mpfr_atrig+0xb0>
mov    %r12d,%edi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdx
call   1090 <mpfr_set@plt>
call   1070 <mpfr_clear@plt>
call   1070 <mpfr_clear@plt>
mov    0x1c(%rsp),%edi
call   1060 <mpfr_set_emin@plt>
mov    0x18(%rsp),%edi
call   10b0 <mpfr_set_emax@plt>
xor    %eax,%eax
mov    0x2bb0(%rip),%rcx
cmp    %rbx,(%rcx)
sete   %al
lea    (%rax,%rax,1),%esi
add    $0xffffffff,%esi
mov    %r12d,%edi
mov    %rbx,%rdx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1140 <mpfr_check_range@plt>
mov    0x10(%rsp),%rdx
test   %ebp,%ebp
je     14a5 <mpfr_atrig+0x265>
mov    %rdx,%rbp
cmp    %rdx,(%rbx)
je     1476 <mpfr_atrig+0x236>
mov    0x2b83(%rip),%rax
xor    %edi,%edi
cmp    %rbp,(%rax)
sete   %dil
call   10a0 <assert@plt>
mov    %rbx,%r14
mov    (%r14),%rdx
mov    %r12d,%edi
mov    %r15d,%esi
call   *(%rsp)
mov    %eax,%ebx
neg    %ebx
mov    %r12d,%edi
mov    %r12d,%esi
mov    %rbp,%rdx
call   1050 <mpfr_neg@plt>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,%edi
mov    %r15d,%esi
mov    (%rsp),%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax

LLVM IR (-O0):
@MPFR_RNDU = global i64 0
@MPFR_RNDD = global i64 0
define i32 @mpfr_atrig(i32 %0, i32 %1, i32 (i32, i32, i64)* %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32 (i32, i32, i64)*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 (i32, i32, i64)* %2, i32 (i32, i32, i64)** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i64 %5, i64* %13
%22 = load i64, i64* %13
%23 = load i64, i64* @MPFR_RNDU
%24 = icmp eq i64 %22, %23
br i1 %24, label %29, label %25
25: ; preds = %6
%26 = load i64, i64* %13
%27 = load i64, i64* @MPFR_RNDD
%28 = icmp eq i64 %26, %27
br label %29
29: ; preds = %25, %6
%30 = phi i1 [ true, %6 ], [ %28, %25 ]
%31 = zext i1 %30 to i32
%32 = call i64 @assert(i32 %31)
%33 = load i32, i32* %12
%34 = call i64 @mpz_sgn(i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %72
36: ; preds = %29
%37 = load i32, i32* %11
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %64
39: ; preds = %36
%40 = load i64, i64* %13
%41 = load i64, i64* @MPFR_RNDU
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i64, i64* @MPFR_RNDD
br label %52
45: ; preds = %39
%46 = load i64, i64* %13
%47 = load i64, i64* @MPFR_RNDD
%48 = icmp eq i64 %46, %47
%49 = zext i1 %48 to i32
%50 = call i64 @assert(i32 %49)
%51 = load i64, i64* @MPFR_RNDU
br label %52
52: ; preds = %45, %43
%53 = phi i64 [ %44, %43 ], [ %51, %45 ]
store i64 %53, i64* %15
%54 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%55 = load i32, i32* %8
%56 = load i32, i32* %9
%57 = load i64, i64* %15
%58 = call i32 %54(i32 %55, i32 %56, i64 %57)
%59 = sub nsw i32 0, %58
store i32 %59, i32* %14
%60 = load i32, i32* %8
%61 = load i32, i32* %8
%62 = load i64, i64* %13
%63 = call i32 @mpfr_neg(i32 %60, i32 %61, i64 %62)
br label %70
64: ; preds = %36
%65 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%66 = load i32, i32* %8
%67 = load i32, i32* %9
%68 = load i64, i64* %13
%69 = call i32 %65(i32 %66, i32 %67, i64 %68)
store i32 %69, i32* %14
br label %70
70: ; preds = %64, %52
%71 = load i32, i32* %14
store i32 %71, i32* %7
br label %204
72: ; preds = %29
%73 = call i32 (...) @mpfr_get_emin()
store i32 %73, i32* %16
%74 = call i32 (...) @mpfr_get_emax()
store i32 %74, i32* %17
%75 = call i32 (...) @mpfr_get_emin_min()
%76 = call i32 @mpfr_set_emin(i32 %75)
%77 = call i32 (...) @mpfr_get_emax_max()
%78 = call i32 @mpfr_set_emax(i32 %77)
%79 = load i32, i32* %8
%80 = call i32 @mpfr_get_prec(i32 %79)
%81 = mul nsw i32 %80, 2
store i32 %81, i32* %18
br label %82
82: ; preds = %195, %72
%83 = load i32, i32* %19
%84 = load i32, i32* %18
%85 = call i32 @mpfr_init2(i32 %83, i32 %84)
%86 = load i32, i32* %20
%87 = load i32, i32* %18
%88 = call i32 @mpfr_init2(i32 %86, i32 %87)
%89 = load i32, i32* %21
%90 = load i32, i32* %18
%91 = call i32 @mpfr_init2(i32 %89, i32 %90)
%92 = load i32, i32* %19
%93 = load i64, i64* @MPFR_RNDD
%94 = call i32 @mpfr_const_pi(i32 %92, i64 %93)
%95 = load i32, i32* %19
%96 = load i32, i32* %19
%97 = load i32, i32* %12
%98 = load i64, i64* @MPFR_RNDD
%99 = call i32 @mpfr_mul_z(i32 %95, i32 %96, i32 %97, i64 %98)
%100 = load i32, i32* %11
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %113
102: ; preds = %82
%103 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%104 = load i32, i32* %21
%105 = load i32, i32* %9
%106 = load i64, i64* @MPFR_RNDU
%107 = call i32 %103(i32 %104, i32 %105, i64 %106)
%108 = load i32, i32* %21
%109 = load i32, i32* %19
%110 = load i32, i32* %21
%111 = load i64, i64* @MPFR_RNDD
%112 = call i32 @mpfr_sub(i32 %108, i32 %109, i32 %110, i64 %111)
br label %124
113: ; preds = %82
%114 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%115 = load i32, i32* %20
%116 = load i32, i32* %9
%117 = load i64, i64* @MPFR_RNDD
%118 = call i32 %114(i32 %115, i32 %116, i64 %117)
%119 = load i32, i32* %20
%120 = load i32, i32* %19
%121 = load i32, i32* %20
%122 = load i64, i64* @MPFR_RNDD
%123 = call i32 @mpfr_add(i32 %119, i32 %120, i32 %121, i64 %122)
br label %124
124: ; preds = %113, %102
%125 = load i32, i32* %19
%126 = load i64, i64* @MPFR_RNDU
%127 = call i32 @mpfr_const_pi(i32 %125, i64 %126)
%128 = load i32, i32* %19
%129 = load i32, i32* %19
%130 = load i32, i32* %12
%131 = load i64, i64* @MPFR_RNDU
%132 = call i32 @mpfr_mul_z(i32 %128, i32 %129, i32 %130, i64 %131)
%133 = load i32, i32* %11
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %146
135: ; preds = %124
%136 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%137 = load i32, i32* %20
%138 = load i32, i32* %9
%139 = load i64, i64* @MPFR_RNDD
%140 = call i32 %136(i32 %137, i32 %138, i64 %139)
%141 = load i32, i32* %20
%142 = load i32, i32* %19
%143 = load i32, i32* %20
%144 = load i64, i64* @MPFR_RNDU
%145 = call i32 @mpfr_sub(i32 %141, i32 %142, i32 %143, i64 %144)
br label %157
146: ; preds = %124
%147 = load i32 (i32, i32, i64)*, i32 (i32, i32, i64)** %10
%148 = load i32, i32* %21
%149 = load i32, i32* %9
%150 = load i64, i64* @MPFR_RNDU
%151 = call i32 %147(i32 %148, i32 %149, i64 %150)
%152 = load i32, i32* %21
%153 = load i32, i32* %19
%154 = load i32, i32* %21
%155 = load i64, i64* @MPFR_RNDU
%156 = call i32 @mpfr_add(i32 %152, i32 %153, i32 %154, i64 %155)
br label %157
157: ; preds = %146, %135
%158 = load i32, i32* %19
%159 = call i32 @mpfr_clear(i32 %158)
%160 = load i32, i32* %20
%161 = load i32, i32* %8
%162 = call i32 @mpfr_get_prec(i32 %161)
%163 = load i64, i64* %13
%164 = call i32 @mpfr_prec_round(i32 %160, i32 %162, i64 %163)
%165 = load i32, i32* %21
%166 = load i32, i32* %8
%167 = call i32 @mpfr_get_prec(i32 %166)
%168 = load i64, i64* %13
%169 = call i32 @mpfr_prec_round(i32 %165, i32 %167, i64 %168)
%170 = load i32, i32* %20
%171 = load i32, i32* %21
%172 = call i64 @mpfr_cmp(i32 %170, i32 %171)
%173 = icmp eq i64 %172, 0
br i1 %173, label %174, label %195
174: ; preds = %157
%175 = load i32, i32* %8
%176 = load i32, i32* %20
%177 = load i64, i64* %13
%178 = call i32 @mpfr_set(i32 %175, i32 %176, i64 %177)
%179 = load i32, i32* %20
%180 = call i32 @mpfr_clear(i32 %179)
%181 = load i32, i32* %21
%182 = call i32 @mpfr_clear(i32 %181)
%183 = load i32, i32* %16
%184 = call i32 @mpfr_set_emin(i32 %183)
%185 = load i32, i32* %17
%186 = call i32 @mpfr_set_emax(i32 %185)
%187 = load i32, i32* %8
%188 = load i64, i64* %13
%189 = load i64, i64* @MPFR_RNDU
%190 = icmp eq i64 %188, %189
%191 = zext i1 %190 to i64
%192 = select i1 %190, i32 1, i32 -1
%193 = load i64, i64* %13
%194 = call i32 @mpfr_check_range(i32 %187, i32 %192, i64 %193)
store i32 %194, i32* %7
br label %204
195: ; preds = %157
%196 = load i32, i32* %20
%197 = call i32 @mpfr_clear(i32 %196)
%198 = load i32, i32* %21
%199 = call i32 @mpfr_clear(i32 %198)
%200 = load i32, i32* %8
%201 = call i32 @mpfr_get_prec(i32 %200)
%202 = load i32, i32* %18
%203 = add nsw i32 %202, %201
store i32 %203, i32* %18
br label %82
204: ; preds = %174, %70
%205 = load i32, i32* %7
ret i32 %205
}

LLVM IR (-O2):
@MPFR_RNDU = global i64 0
@MPFR_RNDD = global i64 0
define i32 @mpfr_atrig(i32 %0, i32 %1, i32 (i32, i32, i64)* nocapture %2, i32 %3, i32 %4, i64 %5) {
%7 = load i64, i64* @MPFR_RNDU
%8 = icmp eq i64 %7, %5
%9 = load i64, i64* @MPFR_RNDD
%10 = icmp eq i64 %9, %5
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
%13 = tail call i64 @assert(i32 %12)
%14 = tail call i64 @mpz_sgn(i32 %4)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %34
16: ; preds = %6
%17 = icmp eq i32 %3, 0
br i1 %17, label %32, label %18
18: ; preds = %16
%19 = load i64, i64* @MPFR_RNDU
%20 = icmp eq i64 %19, %5
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = load i64, i64* @MPFR_RNDD
%23 = icmp eq i64 %22, %5
%24 = zext i1 %23 to i32
%25 = tail call i64 @assert(i32 %24)
br label %26
26: ; preds = %18, %21
%27 = phi i64* [ @MPFR_RNDU, %21 ], [ @MPFR_RNDD, %18 ]
%28 = load i64, i64* %27
%29 = tail call i32 %2(i32 %0, i32 %1, i64 %28)
%30 = sub nsw i32 0, %29
%31 = tail call i32 @mpfr_neg(i32 %0, i32 %0, i64 %5)
br label %101
32: ; preds = %16
%33 = tail call i32 %2(i32 %0, i32 %1, i64 %5)
br label %101
34: ; preds = %6
%35 = tail call i32 (...) @mpfr_get_emin()
%36 = tail call i32 (...) @mpfr_get_emax()
%37 = tail call i32 (...) @mpfr_get_emin_min()
%38 = tail call i32 @mpfr_set_emin(i32 %37)
%39 = tail call i32 (...) @mpfr_get_emax_max()
%40 = tail call i32 @mpfr_set_emax(i32 %39)
%41 = tail call i32 @mpfr_get_prec(i32 %0)
%42 = shl nsw i32 %41, 1
%43 = icmp eq i32 %3, 0
br label %44
44: ; preds = %96, %34
%45 = phi i32 [ %42, %34 ], [ %100, %96 ]
%46 = tail call i32 @mpfr_init2(i32 undef, i32 %45)
%47 = tail call i32 @mpfr_init2(i32 undef, i32 %45)
%48 = tail call i32 @mpfr_init2(i32 undef, i32 %45)
%49 = load i64, i64* @MPFR_RNDD
%50 = tail call i32 @mpfr_const_pi(i32 undef, i64 %49)
%51 = load i64, i64* @MPFR_RNDD
%52 = tail call i32 @mpfr_mul_z(i32 undef, i32 undef, i32 %4, i64 %51)
br i1 %43, label %58, label %53
53: ; preds = %44
%54 = load i64, i64* @MPFR_RNDU
%55 = tail call i32 %2(i32 undef, i32 %1, i64 %54)
%56 = load i64, i64* @MPFR_RNDD
%57 = tail call i32 @mpfr_sub(i32 undef, i32 undef, i32 undef, i64 %56)
br label %63
58: ; preds = %44
%59 = load i64, i64* @MPFR_RNDD
%60 = tail call i32 %2(i32 undef, i32 %1, i64 %59)
%61 = load i64, i64* @MPFR_RNDD
%62 = tail call i32 @mpfr_add(i32 undef, i32 undef, i32 undef, i64 %61)
br label %63
63: ; preds = %58, %53
%64 = load i64, i64* @MPFR_RNDU
%65 = tail call i32 @mpfr_const_pi(i32 undef, i64 %64)
%66 = load i64, i64* @MPFR_RNDU
%67 = tail call i32 @mpfr_mul_z(i32 undef, i32 undef, i32 %4, i64 %66)
br i1 %43, label %73, label %68
68: ; preds = %63
%69 = load i64, i64* @MPFR_RNDD
%70 = tail call i32 %2(i32 undef, i32 %1, i64 %69)
%71 = load i64, i64* @MPFR_RNDU
%72 = tail call i32 @mpfr_sub(i32 undef, i32 undef, i32 undef, i64 %71)
br label %78
73: ; preds = %63
%74 = load i64, i64* @MPFR_RNDU
%75 = tail call i32 %2(i32 undef, i32 %1, i64 %74)
%76 = load i64, i64* @MPFR_RNDU
%77 = tail call i32 @mpfr_add(i32 undef, i32 undef, i32 undef, i64 %76)
br label %78
78: ; preds = %73, %68
%79 = tail call i32 @mpfr_clear(i32 undef)
%80 = tail call i32 @mpfr_get_prec(i32 %0)
%81 = tail call i32 @mpfr_prec_round(i32 undef, i32 %80, i64 %5)
%82 = tail call i32 @mpfr_get_prec(i32 %0)
%83 = tail call i32 @mpfr_prec_round(i32 undef, i32 %82, i64 %5)
%84 = tail call i64 @mpfr_cmp(i32 undef, i32 undef)
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %96
86: ; preds = %78
%87 = tail call i32 @mpfr_set(i32 %0, i32 undef, i64 %5)
%88 = tail call i32 @mpfr_clear(i32 undef)
%89 = tail call i32 @mpfr_clear(i32 undef)
%90 = tail call i32 @mpfr_set_emin(i32 %35)
%91 = tail call i32 @mpfr_set_emax(i32 %36)
%92 = load i64, i64* @MPFR_RNDU
%93 = icmp eq i64 %92, %5
%94 = select i1 %93, i32 1, i32 -1
%95 = tail call i32 @mpfr_check_range(i32 %0, i32 %94, i64 %5)
br label %101
96: ; preds = %78
%97 = tail call i32 @mpfr_clear(i32 undef)
%98 = tail call i32 @mpfr_clear(i32 undef)
%99 = tail call i32 @mpfr_get_prec(i32 %0)
%100 = add nsw i32 %99, %45
br label %44
101: ; preds = %86, %26, %32
%102 = phi i32 [ %30, %26 ], [ %33, %32 ], [ %95, %86 ]
ret i32 %102
}