#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 gamma_dist_knuth_algA(double, double (*)(unsigned short *),
                             unsigned short *);
double gamma_dist_knuth_algG(double, double (*)(unsigned short *),
                             unsigned short *);
double gamma_dist_knuth_src(double a, double b, double (*src)(unsigned short *),
                            unsigned short *xi) {
  if (a <= 1.0)
    return (b * gamma_dist_knuth_algG(a, src, xi));
  else
    return (b * gamma_dist_knuth_algA(a, src, xi));
}


x86 assembly (clang, -O0):
<gamma_dist_knuth_src>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  0xebe(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117f <gamma_dist_knuth_src+0x5f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <gamma_dist_knuth_algG@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ac <gamma_dist_knuth_src+0x8c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <gamma_dist_knuth_algA@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_dist_knuth_src>:
push   %rax
movsd  %xmm1,(%rsp)
movsd  0xed2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113b <gamma_dist_knuth_src+0x1b>
call   1030 <gamma_dist_knuth_algA@plt>
jmp    1140 <gamma_dist_knuth_src+0x20>
call   1040 <gamma_dist_knuth_algG@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gamma_dist_knuth_src(double %0, double %1, double (i16*)* %2, i16* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double (i16*)*
%9 = alloca i16*
store double %0, double* %6
store double %1, double* %7
store double (i16*)* %2, double (i16*)** %8
store i16* %3, i16** %9
%10 = load double, double* %6
%11 = fcmp ole double %10, 1.000000e+00
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load double, double* %7
%14 = load double, double* %6
%15 = load double (i16*)*, double (i16*)** %8
%16 = load i16*, i16** %9
%17 = call double @gamma_dist_knuth_algG(double %14, double (i16*)* %15, i16* %16)
%18 = fmul double %13, %17
store double %18, double* %5
br label %26
19: ; preds = %4
%20 = load double, double* %7
%21 = load double, double* %6
%22 = load double (i16*)*, double (i16*)** %8
%23 = load i16*, i16** %9
%24 = call double @gamma_dist_knuth_algA(double %21, double (i16*)* %22, i16* %23)
%25 = fmul double %20, %24
store double %25, double* %5
br label %26
26: ; preds = %19, %12
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @gamma_dist_knuth_src(double %0, double %1, double (i16*)* %2, i16* %3) {
%5 = fcmp ugt double %0, 1.000000e+00
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call double @gamma_dist_knuth_algG(double %0, double (i16*)* %2, i16* %3)
br label %10
8: ; preds = %4
%9 = tail call double @gamma_dist_knuth_algA(double %0, double (i16*)* %2, i16* %3)
br label %10
10: ; preds = %8, %6
%11 = phi double [ %7, %6 ], [ %9, %8 ]
%12 = fmul double %11, %1
ret double %12
}