#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 */
double alnrel(double);
double gamln1(double);
double log(double);
double gsumln(double a, double b) {
  double ret_val;
  double x;
  x = a + b - 2.;
  if (x > 0.25) {
    goto L10;
  }
  ret_val = gamln1(x + 1.0);
  return ret_val;
L10:
  if (x > 1.25) {
    goto L20;
  }
  ret_val = gamln1(x) + alnrel(x);
  return ret_val;
L20:
  ret_val = gamln1(x - 1.0) + log(x * (x + 1.0));
  return ret_val;
}


x86 assembly (clang, -O0):
<gsumln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1179 <gsumln+0x49>
jmp    119f <gsumln+0x6f>
movsd  0xe8f(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1050 <gamln1@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1245 <gsumln+0x115>
movsd  -0x28(%rbp),%xmm0
movsd  0xe6c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11bb <gsumln+0x8b>
jmp    11f4 <gsumln+0xc4>
movsd  -0x28(%rbp),%xmm0
call   1050 <gamln1@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <alnrel@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1245 <gsumln+0x115>
movsd  -0x28(%rbp),%xmm0
movsd  0xe0f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1050 <gamln1@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xdf4(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsumln>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  0xebc(%rip),%xmm2
ucomisd 0xebc(%rip),%xmm2
jbe    1192 <gsumln+0x62>
ucomisd 0xec2(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
jbe    11a7 <gsumln+0x77>
movsd  0xeba(%rip),%xmm0
addsd  %xmm2,%xmm0
call   1050 <gamln1@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe93(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
jmp    11c1 <gsumln+0x91>
addsd  0xe76(%rip),%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
jmp    1050 <gamln1@plt>
movapd %xmm2,%xmm0
call   1050 <gamln1@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <alnrel@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gsumln(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fadd double %8, %9
%11 = fsub double %10, 2.000000e+00
store double %11, double* %7
%12 = load double, double* %7
%13 = fcmp ogt double %12, 2.500000e-01
br i1 %13, label %14, label %15
14: ; preds = %2
br label %20
15: ; preds = %2
%16 = load double, double* %7
%17 = fadd double %16, 1.000000e+00
%18 = call double @gamln1(double %17)
store double %18, double* %6
%19 = load double, double* %6
store double %19, double* %3
br label %42
20: ; preds = %14
%21 = load double, double* %7
%22 = fcmp ogt double %21, 1.250000e+00
br i1 %22, label %23, label %24
23: ; preds = %20
br label %31
24: ; preds = %20
%25 = load double, double* %7
%26 = call double @gamln1(double %25)
%27 = load double, double* %7
%28 = call double @alnrel(double %27)
%29 = fadd double %26, %28
store double %29, double* %6
%30 = load double, double* %6
store double %30, double* %3
br label %42
31: ; preds = %23
%32 = load double, double* %7
%33 = fsub double %32, 1.000000e+00
%34 = call double @gamln1(double %33)
%35 = load double, double* %7
%36 = load double, double* %7
%37 = fadd double %36, 1.000000e+00
%38 = fmul double %35, %37
%39 = call double @log(double %38)
%40 = fadd double %34, %39
store double %40, double* %6
%41 = load double, double* %6
store double %41, double* %3
br label %42
42: ; preds = %31, %24, %15
%43 = load double, double* %3
ret double %43
}

LLVM IR (-O2):
define double @gsumln(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fadd double %3, -2.000000e+00
%5 = fcmp ogt double %4, 2.500000e-01
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = fadd double %4, 1.000000e+00
%8 = tail call double @gamln1(double %7)
br label %22
9: ; preds = %2
%10 = fcmp ogt double %4, 1.250000e+00
br i1 %10, label %15, label %11
11: ; preds = %9
%12 = tail call double @gamln1(double %4)
%13 = tail call double @alnrel(double %4)
%14 = fadd double %12, %13
br label %22
15: ; preds = %9
%16 = fadd double %4, -1.000000e+00
%17 = tail call double @gamln1(double %16)
%18 = fadd double %4, 1.000000e+00
%19 = fmul double %4, %18
%20 = tail call double @log(double %19)
%21 = fadd double %17, %20
br label %22
22: ; preds = %15, %11, %6
%23 = phi double [ %21, %15 ], [ %14, %11 ], [ %8, %6 ]
ret double %23
}