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

/* Variables and functions */
long double Gamma_Function_Max_Arg();
long double expl(long double);
long double logl(long double);
long double powl(long double, long double);
long double xGamma_Function(long double);
long double xLn_Gamma_Function(long double);
long double xMedium_x(long double, long double);
long double xLarge_x(long double x, long double nu) {
  long double temp = 1.0L / nu;
  long double sum = temp;
  long double coef;
  int i = 0;
  int n;
  n = (int)(x - nu - 1.0L) + 1;
  for (i = 1; i < n; i++) {
    temp *= x / (nu + i);
    sum += temp;
  }
  if (nu <= Gamma_Function_Max_Arg()) {
    coef = powl(x, nu) * expl(-x) / xGamma_Function(nu);
    return xMedium_x(x, nu + n) + coef * sum;
  } else {
    return expl(logl(sum) + nu * logl(x) - x - xLn_Gamma_Function(nu)) +
           xMedium_x(x, nu + n);
  }
}


x86 assembly (clang, -O0):
<xLarge_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fld1
fdiv   %st,%st(1)
fxch   %st(1)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fstpt  -0x50(%rbp)
movl   $0x0,-0x64(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fsubrp %st,%st(1)
fsubp  %st,%st(1)
fnstcw -0x7a(%rbp)
movzwl -0x7a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x7c(%rbp)
fldcw  -0x7c(%rbp)
fistpl -0x6c(%rbp)
fldcw  -0x7a(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    1213 <xLarge_x+0xa3>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x78(%rbp)
fildl  -0x78(%rbp)
faddp  %st,%st(1)
fdivrp %st,%st(1)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11d3 <xLarge_x+0x63>
fldt   -0x30(%rbp)
fstpt  -0x88(%rbp)
xor    %eax,%eax
call   1050 <Gamma_Function_Max_Arg@plt>
fldt   -0x88(%rbp)
fld    %st(1)
fstp   %st(0)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     12be <xLarge_x+0x14e>
jmp    123e <xLarge_x+0xce>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <powl@plt>
fstpt  -0xa0(%rbp)
fldt   -0x20(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <expl@plt>
fldt   -0xa0(%rbp)
fmulp  %st,%st(1)
fstpt  -0x94(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1080 <xGamma_Function@plt>
fldt   -0x94(%rbp)
fdivp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x74(%rbp)
fildl  -0x74(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fxch   %st(1)
fstpt  (%rax)
fstpt  0x10(%rax)
call   1070 <xMedium_x@plt>
fldt   -0x60(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x10(%rbp)
jmp    1352 <xLarge_x+0x1e2>
fldt   -0x50(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <logl@plt>
fstpt  -0xd0(%rbp)
fldt   -0x30(%rbp)
fstpt  -0xc4(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <logl@plt>
fldt   -0xd0(%rbp)
fldt   -0xc4(%rbp)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fldt   -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0xb8(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1090 <xLn_Gamma_Function@plt>
fldt   -0xb8(%rbp)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <expl@plt>
fstpt  -0xac(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x70(%rbp)
fildl  -0x70(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fxch   %st(1)
fstpt  (%rax)
fstpt  0x10(%rax)
call   1070 <xMedium_x@plt>
fldt   -0xac(%rbp)
faddp  %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xLarge_x>:
push   %rbx
sub    $0x70,%rsp
fldt   0x90(%rsp)
fldt   0x80(%rsp)
fld1
fld    %st(0)
fdiv   %st(3),%st
fld    %st(2)
fsub   %st(4),%st
fxch   %st(2)
fchs
faddp  %st,%st(2)
fnstcw 0x24(%rsp)
movzwl 0x24(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x26(%rsp)
fldcw  0x26(%rsp)
fxch   %st(1)
fistpl 0x6c(%rsp)
fldcw  0x24(%rsp)
mov    0x6c(%rsp),%ebx
test   %ebx,%ebx
jle    11c9 <xLarge_x+0x59>
fld1
fldz
cmp    $0x1,%ebx
jne    11cb <xLarge_x+0x5b>
fld    %st(2)
jmp    121a <xLarge_x+0xaa>
jmp    1231 <xLarge_x+0xc1>
fstp   %st(1)
fstp   %st(0)
mov    %ebx,%ecx
and    $0xfffffffe,%ecx
mov    $0x1,%eax
fld    %st(0)
nopl   0x0(%rax,%rax,1)
mov    %eax,0x64(%rsp)
fld    %st(3)
fiaddl 0x64(%rsp)
fdivr  %st(3),%st
fmulp  %st,%st(2)
fadd   %st(1),%st
lea    0x1(%rax),%edx
mov    %edx,0x68(%rsp)
fld    %st(3)
fiaddl 0x68(%rsp)
fdivr  %st(3),%st
fmulp  %st,%st(2)
fadd   %st(1),%st
add    $0x2,%eax
cmp    %ecx,%edx
jne    11e0 <xLarge_x+0x70>
mov    %eax,0x60(%rsp)
fildl  0x60(%rsp)
fld    %st(1)
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
test   $0x1,%bl
fxch   %st(1)
fxch   %st(3)
fxch   %st(2)
fxch   %st(1)
je     1237 <xLarge_x+0xc7>
fstp   %st(3)
fadd   %st(4),%st
fdivr  %st(3),%st
fmulp  %st,%st(1)
faddp  %st,%st(1)
fldz
fldz
fldz
fstp   %st(2)
fstp   %st(0)
fstp   %st(0)
fstpt  0x28(%rsp)
fstpt  0x34(%rsp)
add    $0x1,%ebx
xor    %eax,%eax
fstpt  0x4c(%rsp)
call   1050 <Gamma_Function_Max_Arg@plt>
fldt   0x4c(%rsp)
fxch   %st(1)
fucomip %st(1),%st
jae    12cf <xLarge_x+0x15f>
fstp   %st(0)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1040 <logl@plt>
fstpt  0x28(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1040 <logl@plt>
fldt   0x4c(%rsp)
fmul   %st,%st(1)
fldt   0x28(%rsp)
faddp  %st,%st(2)
fldt   0x34(%rsp)
fsubrp %st,%st(2)
fxch   %st(1)
fstpt  0x28(%rsp)
fstpt  (%rsp)
call   1090 <xLn_Gamma_Function@plt>
fldt   0x28(%rsp)
fsubp  %st,%st(1)
fstpt  (%rsp)
call   1060 <expl@plt>
fstpt  0x28(%rsp)
mov    %ebx,0x58(%rsp)
fldt   0x4c(%rsp)
fiaddl 0x58(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1070 <xMedium_x@plt>
fldt   0x28(%rsp)
jmp    1337 <xLarge_x+0x1c7>
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <powl@plt>
fstpt  0x40(%rsp)
fldt   0x34(%rsp)
fchs
fstpt  (%rsp)
call   1060 <expl@plt>
fldt   0x40(%rsp)
fmulp  %st,%st(1)
fstpt  0x40(%rsp)
fldt   0x4c(%rsp)
fstpt  (%rsp)
call   1080 <xGamma_Function@plt>
fldt   0x40(%rsp)
fdivp  %st,%st(1)
fstpt  0x40(%rsp)
mov    %ebx,0x5c(%rsp)
fldt   0x4c(%rsp)
fiaddl 0x5c(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1070 <xMedium_x@plt>
fldt   0x28(%rsp)
fldt   0x40(%rsp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @xLarge_x(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca i32
%10 = alloca i32
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%11 = load x86_fp80, x86_fp80* %5
%12 = fdiv x86_fp80 0xK3FFF8000000000000000, %11
store x86_fp80 %12, x86_fp80* %6
%13 = load x86_fp80, x86_fp80* %6
store x86_fp80 %13, x86_fp80* %7
store i32 0, i32* %9
%14 = load x86_fp80, x86_fp80* %4
%15 = load x86_fp80, x86_fp80* %5
%16 = fsub x86_fp80 %14, %15
%17 = fsub x86_fp80 %16, 0xK3FFF8000000000000000
%18 = fptosi x86_fp80 %17 to i32
%19 = add nsw i32 %18, 1
store i32 %19, i32* %10
store i32 1, i32* %9
br label %20
20: ; preds = %36, %2
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %39
24: ; preds = %20
%25 = load x86_fp80, x86_fp80* %4
%26 = load x86_fp80, x86_fp80* %5
%27 = load i32, i32* %9
%28 = sitofp i32 %27 to x86_fp80
%29 = fadd x86_fp80 %26, %28
%30 = fdiv x86_fp80 %25, %29
%31 = load x86_fp80, x86_fp80* %6
%32 = fmul x86_fp80 %31, %30
store x86_fp80 %32, x86_fp80* %6
%33 = load x86_fp80, x86_fp80* %6
%34 = load x86_fp80, x86_fp80* %7
%35 = fadd x86_fp80 %34, %33
store x86_fp80 %35, x86_fp80* %7
br label %36
36: ; preds = %24
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %20
39: ; preds = %20
%40 = load x86_fp80, x86_fp80* %5
%41 = call x86_fp80 (...) @Gamma_Function_Max_Arg()
%42 = fcmp ole x86_fp80 %40, %41
br i1 %42, label %43, label %63
43: ; preds = %39
%44 = load x86_fp80, x86_fp80* %4
%45 = load x86_fp80, x86_fp80* %5
%46 = call x86_fp80 @powl(x86_fp80 %44, x86_fp80 %45)
%47 = load x86_fp80, x86_fp80* %4
%48 = fneg x86_fp80 %47
%49 = call x86_fp80 @expl(x86_fp80 %48)
%50 = fmul x86_fp80 %46, %49
%51 = load x86_fp80, x86_fp80* %5
%52 = call x86_fp80 @xGamma_Function(x86_fp80 %51)
%53 = fdiv x86_fp80 %50, %52
store x86_fp80 %53, x86_fp80* %8
%54 = load x86_fp80, x86_fp80* %4
%55 = load x86_fp80, x86_fp80* %5
%56 = load i32, i32* %10
%57 = sitofp i32 %56 to x86_fp80
%58 = fadd x86_fp80 %55, %57
%59 = call x86_fp80 @xMedium_x(x86_fp80 %54, x86_fp80 %58)
%60 = load x86_fp80, x86_fp80* %8
%61 = load x86_fp80, x86_fp80* %7
%62 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %60, x86_fp80 %61, x86_fp80 %59)
store x86_fp80 %62, x86_fp80* %3
br label %83
63: ; preds = %39
%64 = load x86_fp80, x86_fp80* %7
%65 = call x86_fp80 @logl(x86_fp80 %64)
%66 = load x86_fp80, x86_fp80* %5
%67 = load x86_fp80, x86_fp80* %4
%68 = call x86_fp80 @logl(x86_fp80 %67)
%69 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %66, x86_fp80 %68, x86_fp80 %65)
%70 = load x86_fp80, x86_fp80* %4
%71 = fsub x86_fp80 %69, %70
%72 = load x86_fp80, x86_fp80* %5
%73 = call x86_fp80 @xLn_Gamma_Function(x86_fp80 %72)
%74 = fsub x86_fp80 %71, %73
%75 = call x86_fp80 @expl(x86_fp80 %74)
%76 = load x86_fp80, x86_fp80* %4
%77 = load x86_fp80, x86_fp80* %5
%78 = load i32, i32* %10
%79 = sitofp i32 %78 to x86_fp80
%80 = fadd x86_fp80 %77, %79
%81 = call x86_fp80 @xMedium_x(x86_fp80 %76, x86_fp80 %80)
%82 = fadd x86_fp80 %75, %81
store x86_fp80 %82, x86_fp80* %3
br label %83
83: ; preds = %63, %43
%84 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %84
}

LLVM IR (-O2):
define x86_fp80 @xLarge_x(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 0xK3FFF8000000000000000, %1
%4 = fsub x86_fp80 %0, %1
%5 = fadd x86_fp80 %4, 0xKBFFF8000000000000000
%6 = fptosi x86_fp80 %5 to i32
%7 = add i32 %6, 1
%8 = icmp slt i32 %6, 1
br i1 %8, label %46, label %9
9: ; preds = %2
%10 = and i32 %6, 1
%11 = icmp eq i32 %6, 1
br i1 %11, label %35, label %12
12: ; preds = %9
%13 = and i32 %6, -2
br label %14
14: ; preds = %14, %12
%15 = phi i32 [ 1, %12 ], [ %30, %14 ]
%16 = phi x86_fp80 [ %3, %12 ], [ %28, %14 ]
%17 = phi x86_fp80 [ %3, %12 ], [ %29, %14 ]
%18 = phi i32 [ 0, %12 ], [ %31, %14 ]
%19 = sitofp i32 %15 to x86_fp80
%20 = fadd x86_fp80 %19, %1
%21 = fdiv x86_fp80 %0, %20
%22 = fmul x86_fp80 %16, %21
%23 = fadd x86_fp80 %17, %22
%24 = add nuw i32 %15, 1
%25 = sitofp i32 %24 to x86_fp80
%26 = fadd x86_fp80 %25, %1
%27 = fdiv x86_fp80 %0, %26
%28 = fmul x86_fp80 %22, %27
%29 = fadd x86_fp80 %23, %28
%30 = add nuw i32 %15, 2
%31 = add i32 %18, 2
%32 = icmp eq i32 %31, %13
br i1 %32, label %33, label %14
33: ; preds = %14
%34 = sitofp i32 %30 to x86_fp80
br label %35
35: ; preds = %33, %9
%36 = phi x86_fp80 [ undef, %9 ], [ %29, %33 ]
%37 = phi x86_fp80 [ 0xK3FFF8000000000000000, %9 ], [ %34, %33 ]
%38 = phi x86_fp80 [ %3, %9 ], [ %28, %33 ]
%39 = phi x86_fp80 [ %3, %9 ], [ %29, %33 ]
%40 = icmp eq i32 %10, 0
br i1 %40, label %46, label %41
41: ; preds = %35
%42 = fadd x86_fp80 %37, %1
%43 = fdiv x86_fp80 %0, %42
%44 = fmul x86_fp80 %38, %43
%45 = fadd x86_fp80 %39, %44
br label %46
46: ; preds = %41, %35, %2
%47 = phi x86_fp80 [ %3, %2 ], [ %36, %35 ], [ %45, %41 ]
%48 = tail call x86_fp80 (...) @Gamma_Function_Max_Arg()
%49 = fcmp ult x86_fp80 %48, %1
br i1 %49, label %61, label %50
50: ; preds = %46
%51 = tail call x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1)
%52 = fneg x86_fp80 %0
%53 = tail call x86_fp80 @expl(x86_fp80 %52)
%54 = fmul x86_fp80 %51, %53
%55 = tail call x86_fp80 @xGamma_Function(x86_fp80 %1)
%56 = fdiv x86_fp80 %54, %55
%57 = sitofp i32 %7 to x86_fp80
%58 = fadd x86_fp80 %57, %1
%59 = tail call x86_fp80 @xMedium_x(x86_fp80 %0, x86_fp80 %58)
%60 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %56, x86_fp80 %47, x86_fp80 %59)
br label %73
61: ; preds = %46
%62 = tail call x86_fp80 @logl(x86_fp80 %47)
%63 = tail call x86_fp80 @logl(x86_fp80 %0)
%64 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %1, x86_fp80 %63, x86_fp80 %62)
%65 = fsub x86_fp80 %64, %0
%66 = tail call x86_fp80 @xLn_Gamma_Function(x86_fp80 %1)
%67 = fsub x86_fp80 %65, %66
%68 = tail call x86_fp80 @expl(x86_fp80 %67)
%69 = sitofp i32 %7 to x86_fp80
%70 = fadd x86_fp80 %69, %1
%71 = tail call x86_fp80 @xMedium_x(x86_fp80 %0, x86_fp80 %70)
%72 = fadd x86_fp80 %68, %71
br label %73
73: ; preds = %61, %50
%74 = phi x86_fp80 [ %60, %50 ], [ %72, %61 ]
ret x86_fp80 %74
}