#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*/ MPFR_RNDN;
int /*<<< orphan*/ mpfr_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_div(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_div_ui(int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_exp(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_exp2(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
double mpfr_get_d(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_neg(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_default_prec(int);
int /*<<< orphan*/ mpfr_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int /*<<< orphan*/);
double P(mpfr_t n, mpfr_t r) {
  double answer;
  mpfr_t topa;
  mpfr_t bottoma;
  mpfr_t first;
  mpfr_t topb;
  mpfr_t nplusone;
  mpfr_t bottomb;
  mpfr_t nplus2over2;
  mpfr_t second;
  mpfr_t mpfrans;
  mpfr_t mpfans;
  mpfr_set_default_prec(1024);
  mpfr_init(topa);
  mpfr_init(nplusone);
  mpfr_init(bottoma);
  mpfr_init(first);
  mpfr_init(topb);
  mpfr_init(bottomb);
  mpfr_init(nplus2over2);
  mpfr_init(second);
  mpfr_init(mpfans);
  mpfr_add_ui(topa, r, 1, MPFR_RNDN);
  mpfr_add_ui(nplusone, n, 1, MPFR_RNDN);
  mpfr_exp2(bottoma, nplusone, MPFR_RNDN);
  mpfr_sub(bottoma, bottoma, n, MPFR_RNDN);
  mpfr_sub_ui(bottoma, bottoma, 2, MPFR_RNDN);
  mpfr_div(first, topa, bottoma, MPFR_RNDN);
  mpfr_neg(first, first, MPFR_RNDN);
  mpfr_exp(first, first, MPFR_RNDN);
  mpfr_exp2(topb, nplusone, MPFR_RNDN);
  mpfr_sub_ui(topb, topb, 1, MPFR_RNDN);
  mpfr_exp2(bottomb, nplusone, MPFR_RNDN);
  mpfr_add_ui(nplus2over2, n, 2, MPFR_RNDN);
  mpfr_div_ui(nplus2over2, nplus2over2, 2, MPFR_RNDN);
  mpfr_sub(bottomb, bottomb, nplus2over2, MPFR_RNDN);
  mpfr_div(second, topb, bottomb, MPFR_RNDN);
  mpfr_mul(mpfans, first, second, MPFR_RNDN);
  answer = mpfr_get_d(mpfans, MPFR_RNDN);
  return answer;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x400,%edi
call   10c0 <mpfr_set_default_prec@plt>
mov    -0x14(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x24(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x18(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x1c(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x20(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x28(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x2c(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x30(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x38(%rbp),%edi
call   1040 <mpfr_init@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2dbb(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1080 <mpfr_add_ui@plt>
mov    -0x24(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2da2(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1080 <mpfr_add_ui@plt>
mov    -0x18(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    0x2d89(%rip),%rax
mov    (%rax),%edx
call   10e0 <mpfr_exp2@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    0x2d72(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_sub@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x2d5e(%rip),%rax
mov    (%rax),%ecx
mov    $0x2,%edx
call   1090 <mpfr_sub_ui@plt>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    0x2d42(%rip),%rax
mov    (%rax),%ecx
call   10a0 <mpfr_div@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    0x2d2e(%rip),%rax
mov    (%rax),%edx
call   1070 <mpfr_neg@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    0x2d1a(%rip),%rax
mov    (%rax),%edx
call   10b0 <mpfr_exp@plt>
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    0x2d06(%rip),%rax
mov    (%rax),%edx
call   10e0 <mpfr_exp2@plt>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    0x2cf2(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1090 <mpfr_sub_ui@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    0x2cd9(%rip),%rax
mov    (%rax),%edx
call   10e0 <mpfr_exp2@plt>
mov    -0x2c(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2cc5(%rip),%rax
mov    (%rax),%ecx
mov    $0x2,%edx
call   1080 <mpfr_add_ui@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    0x2cac(%rip),%rax
mov    (%rax),%ecx
mov    $0x2,%edx
call   10d0 <mpfr_div_ui@plt>
mov    -0x28(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    0x2c90(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_sub@plt>
mov    -0x30(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x2c79(%rip),%rax
mov    (%rax),%ecx
call   10a0 <mpfr_div@plt>
mov    -0x38(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    0x2c62(%rip),%rax
mov    (%rax),%ecx
call   1060 <mpfr_mul@plt>
mov    -0x38(%rbp),%edi
mov    0x2c51(%rip),%rax
mov    (%rax),%esi
call   1050 <mpfr_get_d@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    $0x400,%edi
call   10c0 <mpfr_set_default_prec@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
call   1040 <mpfr_init@plt>
mov    0x2de1(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    %r14d,%esi
mov    $0x1,%edx
call   1080 <mpfr_add_ui@plt>
mov    0x0(%rbp),%ecx
mov    %ebx,%esi
mov    $0x1,%edx
call   1080 <mpfr_add_ui@plt>
mov    0x0(%rbp),%edx
call   10e0 <mpfr_exp2@plt>
mov    0x0(%rbp),%ecx
mov    %ebx,%edx
call   1030 <mpfr_sub@plt>
mov    0x0(%rbp),%ecx
mov    $0x2,%edx
call   1090 <mpfr_sub_ui@plt>
mov    0x0(%rbp),%ecx
call   10a0 <mpfr_div@plt>
mov    0x0(%rbp),%edx
call   1070 <mpfr_neg@plt>
mov    0x0(%rbp),%edx
call   10b0 <mpfr_exp@plt>
mov    0x0(%rbp),%edx
call   10e0 <mpfr_exp2@plt>
mov    0x0(%rbp),%ecx
mov    $0x1,%edx
call   1090 <mpfr_sub_ui@plt>
mov    0x0(%rbp),%edx
call   10e0 <mpfr_exp2@plt>
mov    0x0(%rbp),%ecx
mov    %ebx,%esi
mov    $0x2,%edx
call   1080 <mpfr_add_ui@plt>
mov    0x0(%rbp),%ecx
mov    $0x2,%edx
call   10d0 <mpfr_div_ui@plt>
mov    0x0(%rbp),%ecx
call   1030 <mpfr_sub@plt>
mov    0x0(%rbp),%ecx
call   10a0 <mpfr_div@plt>
mov    0x0(%rbp),%ecx
call   1060 <mpfr_mul@plt>
mov    0x0(%rbp),%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpfr_get_d@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define double @P(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%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
store i32 %0, i32* %3
store i32 %1, i32* %4
%16 = call i32 @mpfr_set_default_prec(i32 1024)
%17 = load i32, i32* %6
%18 = call i32 @mpfr_init(i32 %17)
%19 = load i32, i32* %10
%20 = call i32 @mpfr_init(i32 %19)
%21 = load i32, i32* %7
%22 = call i32 @mpfr_init(i32 %21)
%23 = load i32, i32* %8
%24 = call i32 @mpfr_init(i32 %23)
%25 = load i32, i32* %9
%26 = call i32 @mpfr_init(i32 %25)
%27 = load i32, i32* %11
%28 = call i32 @mpfr_init(i32 %27)
%29 = load i32, i32* %12
%30 = call i32 @mpfr_init(i32 %29)
%31 = load i32, i32* %13
%32 = call i32 @mpfr_init(i32 %31)
%33 = load i32, i32* %15
%34 = call i32 @mpfr_init(i32 %33)
%35 = load i32, i32* %6
%36 = load i32, i32* %4
%37 = load i32, i32* @MPFR_RNDN
%38 = call i32 @mpfr_add_ui(i32 %35, i32 %36, i32 1, i32 %37)
%39 = load i32, i32* %10
%40 = load i32, i32* %3
%41 = load i32, i32* @MPFR_RNDN
%42 = call i32 @mpfr_add_ui(i32 %39, i32 %40, i32 1, i32 %41)
%43 = load i32, i32* %7
%44 = load i32, i32* %10
%45 = load i32, i32* @MPFR_RNDN
%46 = call i32 @mpfr_exp2(i32 %43, i32 %44, i32 %45)
%47 = load i32, i32* %7
%48 = load i32, i32* %7
%49 = load i32, i32* %3
%50 = load i32, i32* @MPFR_RNDN
%51 = call i32 @mpfr_sub(i32 %47, i32 %48, i32 %49, i32 %50)
%52 = load i32, i32* %7
%53 = load i32, i32* %7
%54 = load i32, i32* @MPFR_RNDN
%55 = call i32 @mpfr_sub_ui(i32 %52, i32 %53, i32 2, i32 %54)
%56 = load i32, i32* %8
%57 = load i32, i32* %6
%58 = load i32, i32* %7
%59 = load i32, i32* @MPFR_RNDN
%60 = call i32 @mpfr_div(i32 %56, i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* %8
%62 = load i32, i32* %8
%63 = load i32, i32* @MPFR_RNDN
%64 = call i32 @mpfr_neg(i32 %61, i32 %62, i32 %63)
%65 = load i32, i32* %8
%66 = load i32, i32* %8
%67 = load i32, i32* @MPFR_RNDN
%68 = call i32 @mpfr_exp(i32 %65, i32 %66, i32 %67)
%69 = load i32, i32* %9
%70 = load i32, i32* %10
%71 = load i32, i32* @MPFR_RNDN
%72 = call i32 @mpfr_exp2(i32 %69, i32 %70, i32 %71)
%73 = load i32, i32* %9
%74 = load i32, i32* %9
%75 = load i32, i32* @MPFR_RNDN
%76 = call i32 @mpfr_sub_ui(i32 %73, i32 %74, i32 1, i32 %75)
%77 = load i32, i32* %11
%78 = load i32, i32* %10
%79 = load i32, i32* @MPFR_RNDN
%80 = call i32 @mpfr_exp2(i32 %77, i32 %78, i32 %79)
%81 = load i32, i32* %12
%82 = load i32, i32* %3
%83 = load i32, i32* @MPFR_RNDN
%84 = call i32 @mpfr_add_ui(i32 %81, i32 %82, i32 2, i32 %83)
%85 = load i32, i32* %12
%86 = load i32, i32* %12
%87 = load i32, i32* @MPFR_RNDN
%88 = call i32 @mpfr_div_ui(i32 %85, i32 %86, i32 2, i32 %87)
%89 = load i32, i32* %11
%90 = load i32, i32* %11
%91 = load i32, i32* %12
%92 = load i32, i32* @MPFR_RNDN
%93 = call i32 @mpfr_sub(i32 %89, i32 %90, i32 %91, i32 %92)
%94 = load i32, i32* %13
%95 = load i32, i32* %9
%96 = load i32, i32* %11
%97 = load i32, i32* @MPFR_RNDN
%98 = call i32 @mpfr_div(i32 %94, i32 %95, i32 %96, i32 %97)
%99 = load i32, i32* %15
%100 = load i32, i32* %8
%101 = load i32, i32* %13
%102 = load i32, i32* @MPFR_RNDN
%103 = call i32 @mpfr_mul(i32 %99, i32 %100, i32 %101, i32 %102)
%104 = load i32, i32* %15
%105 = load i32, i32* @MPFR_RNDN
%106 = call double @mpfr_get_d(i32 %104, i32 %105)
store double %106, double* %5
%107 = load double, double* %5
ret double %107
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define double @P(i32 %0, i32 %1) {
%3 = tail call i32 @mpfr_set_default_prec(i32 1024)
%4 = tail call i32 @mpfr_init(i32 undef)
%5 = tail call i32 @mpfr_init(i32 undef)
%6 = tail call i32 @mpfr_init(i32 undef)
%7 = tail call i32 @mpfr_init(i32 undef)
%8 = tail call i32 @mpfr_init(i32 undef)
%9 = tail call i32 @mpfr_init(i32 undef)
%10 = tail call i32 @mpfr_init(i32 undef)
%11 = tail call i32 @mpfr_init(i32 undef)
%12 = tail call i32 @mpfr_init(i32 undef)
%13 = load i32, i32* @MPFR_RNDN
%14 = tail call i32 @mpfr_add_ui(i32 undef, i32 %1, i32 1, i32 %13)
%15 = load i32, i32* @MPFR_RNDN
%16 = tail call i32 @mpfr_add_ui(i32 undef, i32 %0, i32 1, i32 %15)
%17 = load i32, i32* @MPFR_RNDN
%18 = tail call i32 @mpfr_exp2(i32 undef, i32 undef, i32 %17)
%19 = load i32, i32* @MPFR_RNDN
%20 = tail call i32 @mpfr_sub(i32 undef, i32 undef, i32 %0, i32 %19)
%21 = load i32, i32* @MPFR_RNDN
%22 = tail call i32 @mpfr_sub_ui(i32 undef, i32 undef, i32 2, i32 %21)
%23 = load i32, i32* @MPFR_RNDN
%24 = tail call i32 @mpfr_div(i32 undef, i32 undef, i32 undef, i32 %23)
%25 = load i32, i32* @MPFR_RNDN
%26 = tail call i32 @mpfr_neg(i32 undef, i32 undef, i32 %25)
%27 = load i32, i32* @MPFR_RNDN
%28 = tail call i32 @mpfr_exp(i32 undef, i32 undef, i32 %27)
%29 = load i32, i32* @MPFR_RNDN
%30 = tail call i32 @mpfr_exp2(i32 undef, i32 undef, i32 %29)
%31 = load i32, i32* @MPFR_RNDN
%32 = tail call i32 @mpfr_sub_ui(i32 undef, i32 undef, i32 1, i32 %31)
%33 = load i32, i32* @MPFR_RNDN
%34 = tail call i32 @mpfr_exp2(i32 undef, i32 undef, i32 %33)
%35 = load i32, i32* @MPFR_RNDN
%36 = tail call i32 @mpfr_add_ui(i32 undef, i32 %0, i32 2, i32 %35)
%37 = load i32, i32* @MPFR_RNDN
%38 = tail call i32 @mpfr_div_ui(i32 undef, i32 undef, i32 2, i32 %37)
%39 = load i32, i32* @MPFR_RNDN
%40 = tail call i32 @mpfr_sub(i32 undef, i32 undef, i32 undef, i32 %39)
%41 = load i32, i32* @MPFR_RNDN
%42 = tail call i32 @mpfr_div(i32 undef, i32 undef, i32 undef, i32 %41)
%43 = load i32, i32* @MPFR_RNDN
%44 = tail call i32 @mpfr_mul(i32 undef, i32 undef, i32 undef, i32 %43)
%45 = load i32, i32* @MPFR_RNDN
%46 = tail call double @mpfr_get_d(i32 undef, i32 %45)
ret double %46
}