#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;
typedef int /*<<< orphan*/ mpfr_prec_t;

/* Variables and functions */
int /*<<< orphan*/ const MPFR_PREC_MIN;
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ m_clear(int /*<<< orphan*/);
int /*<<< orphan*/ m_init2(int /*<<< orphan*/, int /*<<< orphan*/ const);
int /*<<< orphan*/ mpfr_exp2(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ const mpfr_get_default_prec();
int /*<<< orphan*/ mpfr_set_si(int /*<<< orphan*/, int /*<<< orphan*/ const,
                               int /*<<< orphan*/);
void getMaxValue(mpfr_t *maxValue, const mpfr_prec_t precision) {
  mpfr_t mPrec;
  m_init2(mPrec, mpfr_get_default_prec());
  mpfr_set_si(mPrec, precision, MPFR_RNDN);
  m_init2(*maxValue, precision > MPFR_PREC_MIN ? precision : MPFR_PREC_MIN);
  mpfr_exp2(*maxValue, mPrec, MPFR_RNDN);
  m_clear(mPrec);
}


x86 assembly (clang, -O0):
<getMaxValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <mpfr_get_default_prec@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1060 <m_init2@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
call   1040 <mpfr_set_si@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e33(%rip),%rcx
cmp    (%rcx),%eax
jle    11b0 <getMaxValue+0x60>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11bc <getMaxValue+0x6c>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1060 <m_init2@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%esi
mov    0x2e11(%rip),%rax
mov    (%rax),%edx
call   1070 <mpfr_exp2@plt>
mov    -0x10(%rbp),%edi
call   1050 <m_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxValue>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <mpfr_get_default_prec@plt>
mov    %eax,%esi
call   1060 <m_init2@plt>
mov    0x2e75(%rip),%r15
mov    (%r15),%edx
mov    %ebx,%esi
call   1040 <mpfr_set_si@plt>
mov    (%r14),%edi
test   %ebx,%ebx
cmovns %ebx,%ebp
mov    %ebp,%esi
call   1060 <m_init2@plt>
mov    (%r14),%edi
mov    (%r15),%edx
call   1070 <mpfr_exp2@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <m_clear@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
@MPFR_PREC_MIN = constant i32 0
define void @getMaxValue(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 (...) @mpfr_get_default_prec()
%8 = call i32 @m_init2(i32 %6, i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* @MPFR_RNDN
%12 = call i32 @mpfr_set_si(i32 %9, i32 %10, i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = load i32, i32* @MPFR_PREC_MIN
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = load i32, i32* %4
br label %22
20: ; preds = %2
%21 = load i32, i32* @MPFR_PREC_MIN
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
%24 = call i32 @m_init2(i32 %14, i32 %23)
%25 = load i32*, i32** %3
%26 = load i32, i32* %25
%27 = load i32, i32* %5
%28 = load i32, i32* @MPFR_RNDN
%29 = call i32 @mpfr_exp2(i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* %5
%31 = call i32 @m_clear(i32 %30)
ret void
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
@MPFR_PREC_MIN = constant i32 0
define void @getMaxValue(i32* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @mpfr_get_default_prec()
%4 = tail call i32 @m_init2(i32 undef, i32 %3)
%5 = load i32, i32* @MPFR_RNDN
%6 = tail call i32 @mpfr_set_si(i32 undef, i32 %1, i32 %5)
%7 = load i32, i32* %0
%8 = icmp sgt i32 %1, 0
%9 = select i1 %8, i32 %1, i32 0
%10 = tail call i32 @m_init2(i32 %7, i32 %9)
%11 = load i32, i32* %0
%12 = load i32, i32* @MPFR_RNDN
%13 = tail call i32 @mpfr_exp2(i32 %11, i32 undef, i32 %12)
%14 = tail call i32 @m_clear(i32 undef)
ret void
}