#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_srcptr;
typedef int /*<<< orphan*/ mpfr_rnd_t;
typedef int /*<<< orphan*/ mpfr_ptr;

/* Variables and functions */
int /*<<< orphan*/ mpfr_acos;
int mpfr_atrig(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/, int,
               int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int mpz_tstbit(int /*<<< orphan*/, int /*<<< orphan*/);
int mpfr_acos_npi(mpfr_ptr rop, mpfr_srcptr op, mpz_t npi, mpfr_rnd_t rnd) {
  int sub = mpz_tstbit(npi, 0);
  int t;
  if (sub) {
    mpz_t npi1;
    mpz_init(npi1);
    mpz_add_ui(npi1, npi, 1);
    t = mpfr_atrig(rop, op, mpfr_acos, sub, npi1, rnd);
    mpz_clear(npi1);
  } else {
    t = mpfr_atrig(rop, op, mpfr_acos, sub, npi, rnd);
  }
  return t;
}


x86 assembly (clang, -O0):
<mpfr_acos_npi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <mpz_tstbit@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11c2 <mpfr_acos_npi+0x72>
mov    -0x1c(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x1c(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e48(%rip),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9d
call   1070 <mpfr_atrig@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <mpz_clear@plt>
jmp    11e4 <mpfr_acos_npi+0x94>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e19(%rip),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
call   1070 <mpfr_atrig@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfr_acos_npi>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%r12d
mov    %edx,%edi
xor    %esi,%esi
call   1030 <mpz_tstbit@plt>
test   %eax,%eax
je     11ae <mpfr_acos_npi+0x5e>
mov    %eax,%ebx
call   1050 <mpz_init@plt>
mov    %ebp,%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebx,%ecx
mov    %r14d,%r9d
call   1070 <mpfr_atrig@plt>
mov    %eax,%ebx
call   1060 <mpz_clear@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e33(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
mov    %r15d,%esi
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <mpfr_atrig@plt>

LLVM IR (-O0):
@mpfr_acos = global i32 0
define i32 @mpfr_acos_npi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = call i32 @mpz_tstbit(i32 %12, i32 0)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %4
%17 = load i32, i32* %11
%18 = call i32 @mpz_init(i32 %17)
%19 = load i32, i32* %11
%20 = load i32, i32* %7
%21 = call i32 @mpz_add_ui(i32 %19, i32 %20, i32 1)
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = load i32, i32* @mpfr_acos
%25 = load i32, i32* %9
%26 = load i32, i32* %11
%27 = load i32, i32* %8
%28 = call i32 @mpfr_atrig(i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
store i32 %28, i32* %10
%29 = load i32, i32* %11
%30 = call i32 @mpz_clear(i32 %29)
br label %39
31: ; preds = %4
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = load i32, i32* @mpfr_acos
%35 = load i32, i32* %9
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = call i32 @mpfr_atrig(i32 %32, i32 %33, i32 %34, i32 %35, i32 %36, i32 %37)
store i32 %38, i32* %10
br label %39
39: ; preds = %31, %16
%40 = load i32, i32* %10
ret i32 %40
}

LLVM IR (-O2):
@mpfr_acos = global i32 0
define i32 @mpfr_acos_npi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mpz_tstbit(i32 %2, i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = tail call i32 @mpz_init(i32 undef)
%9 = tail call i32 @mpz_add_ui(i32 undef, i32 %2, i32 1)
%10 = load i32, i32* @mpfr_acos
%11 = tail call i32 @mpfr_atrig(i32 %0, i32 %1, i32 %10, i32 %5, i32 undef, i32 %3)
%12 = tail call i32 @mpz_clear(i32 undef)
br label %16
13: ; preds = %4
%14 = load i32, i32* @mpfr_acos
%15 = tail call i32 @mpfr_atrig(i32 %0, i32 %1, i32 %14, i32 0, i32 %2, i32 %3)
br label %16
16: ; preds = %13, %7
%17 = phi i32 [ %11, %7 ], [ %15, %13 ]
ret i32 %17
}