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


x86 assembly (clang, -O0):
<cdflib_gsumln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <cdflib_gsumln+0x4d>
jmp    11ac <cdflib_gsumln+0x7c>
movsd  0xe8b(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <cdflib_gamma_ln1@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1259 <cdflib_gsumln+0x129>
movsd  -0x28(%rbp),%xmm0
movsd  0xe5f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c8 <cdflib_gsumln+0x98>
jmp    11ff <cdflib_gsumln+0xcf>
lea    -0x28(%rbp),%rdi
call   1040 <cdflib_gamma_ln1@plt>
movsd  %xmm0,-0x40(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <cdflib_alnrel@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1259 <cdflib_gsumln+0x129>
movsd  -0x28(%rbp),%xmm0
movsd  0xe04(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
call   1040 <cdflib_gamma_ln1@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xde0(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_gsumln>:
push   %rbx
sub    $0x20,%rsp
movsd  (%rdi),%xmm1
addsd  (%rsi),%xmm1
addsd  0xebb(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
ucomisd 0xeb5(%rip),%xmm1
jbe    11a3 <cdflib_gsumln+0x73>
ucomisd 0xebb(%rip),%xmm1
jbe    11bd <cdflib_gsumln+0x8d>
movsd  0xeb9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
movsd  %xmm1,0x10(%rsp)
call   1040 <cdflib_gamma_ln1@plt>
movsd  %xmm0,(%rsp)
movsd  0xe82(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1050 <log@plt>
jmp    11d7 <cdflib_gsumln+0xa7>
addsd  0xe65(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <cdflib_gamma_ln1@plt>
jmp    11dc <cdflib_gsumln+0xac>
lea    0x18(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <cdflib_gamma_ln1@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1030 <cdflib_alnrel@plt>
addsd  (%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @cdflib_gsumln(double* nocapture %0, double* nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = load double, double* %0
%10 = load double, double* %1
%11 = fadd double %9, %10
%12 = fadd double %11, -2.000000e+00
store double %12, double* %3
%13 = fcmp ogt double %12, 2.500000e-01
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = fadd double %12, 1.000000e+00
store double %15, double* %4
%16 = call double @cdflib_gamma_ln1(double* %4)
br label %30
17: ; preds = %2
%18 = fcmp ogt double %12, 1.250000e+00
br i1 %18, label %23, label %19
19: ; preds = %17
%20 = call double @cdflib_gamma_ln1(double* %3)
%21 = call double @cdflib_alnrel(double* %3)
%22 = fadd double %20, %21
br label %30
23: ; preds = %17
%24 = fadd double %12, -1.000000e+00
store double %24, double* %5
%25 = call double @cdflib_gamma_ln1(double* %5)
%26 = fadd double %12, 1.000000e+00
%27 = fmul double %12, %26
%28 = call double @log(double %27)
%29 = fadd double %25, %28
br label %30
30: ; preds = %23, %19, %14
%31 = phi double [ %29, %23 ], [ %22, %19 ], [ %16, %14 ]
ret double %31
}