#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) {
  static double gsumln, x, T1, T2;
  x = *a + *b - 2.e0;
  if (x > 0.25e0)
    goto S10;
  T1 = 1.0e0 + x;
  gsumln = gamln1(&T1);
  return gsumln;
S10:
  if (x > 1.25e0)
    goto S20;
  gsumln = gamln1(&x) + alnrel(&x);
  return gsumln;
S20:
  T2 = x - 1.0e0;
  gsumln = gamln1(&T2) + log(x * (1.0e0 + x));
  return gsumln;
}


x86 assembly (clang, -O0):
<gsumln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2ee4(%rip)
movsd  0x2edc(%rip),%xmm0
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1183 <gsumln+0x53>
jmp    11c1 <gsumln+0x91>
movsd  0xe85(%rip),%xmm0
addsd  0x2eb5(%rip),%xmm0
movsd  %xmm0,0x2eb5(%rip)
lea    0x2eae(%rip),%rdi
call   1050 <gamln1@plt>
movsd  %xmm0,0x2e91(%rip)
movsd  0x2e89(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1292 <gsumln+0x162>
movsd  0x2e7f(%rip),%xmm0
movsd  0xe47(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11e0 <gsumln+0xb0>
jmp    1223 <gsumln+0xf3>
lea    0x2e61(%rip),%rdi
call   1050 <gamln1@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0x2e50(%rip),%rdi
call   1030 <alnrel@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2e2f(%rip)
movsd  0x2e27(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1292 <gsumln+0x162>
movsd  0x2e1d(%rip),%xmm0
movsd  0xddd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2e19(%rip)
lea    0x2e12(%rip),%rdi
call   1050 <gamln1@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0x2df0(%rip),%xmm0
movsd  0xdb0(%rip),%xmm1
addsd  0x2de0(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2dbb(%rip)
movsd  0x2db3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsumln>:
push   %rbx
sub    $0x10,%rsp
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
addsd  0xebb(%rip),%xmm0
movsd  %xmm0,0x2ef3(%rip)
ucomisd 0xeb3(%rip),%xmm0
jbe    11a2 <gsumln+0x72>
ucomisd 0xeb9(%rip),%xmm0
jbe    11c3 <gsumln+0x93>
addsd  0xeb7(%rip),%xmm0
movsd  %xmm0,0x2edf(%rip)
lea    0x2ed8(%rip),%rdi
call   1050 <gamln1@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x2eb5(%rip),%xmm1
movsd  0xe7d(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <log@plt>
jmp    11e0 <gsumln+0xb0>
addsd  0xe66(%rip),%xmm0
movsd  %xmm0,0x2e96(%rip)
lea    0x2e8f(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <gamln1@plt>
lea    0x2e76(%rip),%rbx
mov    %rbx,%rdi
call   1050 <gamln1@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <alnrel@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

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