#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 gammaCF(double, double);
double gammaSeries(double, double);
double gammacdf(double x, double a) {
  if (x <= 0)
    return 0;
  else if (x < a + 1)
    return gammaSeries(x, a);
  else
    return 1 - gammaCF(x, a);
}


x86 assembly (clang, -O0):
<gammacdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     114d <gammacdf+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <gammacdf+0x85>
movsd  -0x10(%rbp),%xmm1
movsd  0xea6(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1182 <gammacdf+0x62>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <gammaSeries@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <gammacdf+0x85>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <gammaCF@plt>
movaps %xmm0,%xmm1
movsd  0xe64(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammacdf>:
push   %rax
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    1154 <gammacdf+0x34>
movsd  0xecd(%rip),%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm0,%xmm2
jbe    1143 <gammacdf+0x23>
pop    %rax
jmp    1030 <gammaSeries@plt>
call   1040 <gammaCF@plt>
movsd  0xeb0(%rip),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gammacdf(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 = fcmp ole double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fadd double %11, 1.000000e+00
%13 = fcmp olt double %10, %12
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = call double @gammaSeries(double %15, double %16)
store double %17, double* %3
br label %23
18: ; preds = %9
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call double @gammaCF(double %19, double %20)
%22 = fsub double 1.000000e+00, %21
store double %22, double* %3
br label %23
23: ; preds = %18, %14, %8
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @gammacdf(double %0, double %1) {
%3 = fcmp ugt double %0, 0.000000e+00
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = fadd double %1, 1.000000e+00
%6 = fcmp ogt double %5, %0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call double @gammaSeries(double %0, double %1)
br label %12
9: ; preds = %4
%10 = tail call double @gammaCF(double %0, double %1)
%11 = fsub double 1.000000e+00, %10
br label %12
12: ; preds = %2, %9, %7
%13 = phi double [ %8, %7 ], [ %11, %9 ], [ 0.000000e+00, %2 ]
ret double %13
}