#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*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ GMP_RNDZ;
int /*<<< orphan*/ mpfr_const_log2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_const_pi(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_init2(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ output(int /*<<< orphan*/, char *);
int main(void) {
  mpfr_t f;
  unsigned long bits = 1000000;
  mpfr_init2(f, bits);
  mpfr_const_pi(f, GMP_RNDZ);
  output(f, "pi");
  mpfr_const_log2(f, GMP_RNDZ);
  output(f, "ln2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xf4240,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <mpfr_init2@plt>
mov    -0x8(%rbp),%edi
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
call   1030 <mpfr_const_pi@plt>
mov    -0x8(%rbp),%edi
lea    0xe82(%rip),%rsi
call   1040 <output@plt>
mov    -0x8(%rbp),%edi
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
call   1050 <mpfr_const_log2@plt>
mov    -0x8(%rbp),%edi
lea    0xe65(%rip),%rsi
call   1040 <output@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf4240,%esi
call   1060 <mpfr_init2@plt>
mov    0x2e8e(%rip),%rbx
mov    (%rbx),%esi
call   1030 <mpfr_const_pi@plt>
lea    0xea0(%rip),%rsi
call   1040 <output@plt>
mov    (%rbx),%esi
call   1050 <mpfr_const_log2@plt>
lea    0xe90(%rip),%rsi
call   1040 <output@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@GMP_RNDZ = global i32 0
@.str = [3 x i8] c"pi\00"
@.str.1 = [4 x i8] c"ln2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i64 1000000, i64* %3
%4 = load i32, i32* %2
%5 = load i64, i64* %3
%6 = call i32 @mpfr_init2(i32 %4, i64 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* @GMP_RNDZ
%9 = call i32 @mpfr_const_pi(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @output(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = load i32, i32* @GMP_RNDZ
%14 = call i32 @mpfr_const_log2(i32 %12, i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @output(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@GMP_RNDZ = global i32 0
@.str = [3 x i8] c"pi\00"
@.str.1 = [4 x i8] c"ln2\00"
define i32 @main() {
%1 = tail call i32 @mpfr_init2(i32 undef, i64 1000000)
%2 = load i32, i32* @GMP_RNDZ
%3 = tail call i32 @mpfr_const_pi(i32 undef, i32 %2)
%4 = tail call i32 @output(i32 undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @GMP_RNDZ
%6 = tail call i32 @mpfr_const_log2(i32 undef, i32 %5)
%7 = tail call i32 @output(i32 undef, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}