#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 */
float sqrt(double);
float gam(float x) {
  if (x <= 0)
    return -666;
  if (x == .5)
    return sqrt(3.141592653589793238462643);
  if (x == 1)
    return 1;
  return (x - 1) * gam(x - 1);
}


x86 assembly (clang, -O0):
<gam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     114c <gam+0x2c>
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11ef <gam+0xcf>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1184 <gam+0x64>
jp     1184 <gam+0x64>
movsd  0xe93(%rip),%xmm0
call   1040 <sqrt@plt>
movss  %xmm0,-0x4(%rbp)
jmp    11ef <gam+0xcf>
movss  -0x8(%rbp),%xmm0
movss  0xe7f(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11b2 <gam+0x92>
jp     11b2 <gam+0x92>
movss  0xe68(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11ef <gam+0xcf>
movss  -0x8(%rbp),%xmm0
movss  0xe51(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe3b(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <gam@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gam>:
push   %rax
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jae    1145 <gam+0x25>
ucomiss 0xed1(%rip),%xmm1
jne    114f <gam+0x2f>
jp     114f <gam+0x2f>
movsd  0xed1(%rip),%xmm0
pop    %rax
jmp    1040 <sqrt@plt>
movss  0xeb3(%rip),%xmm0
pop    %rax
ret
movss  0xeb1(%rip),%xmm0
ucomiss %xmm0,%xmm1
jne    1160 <gam+0x40>
jp     1160 <gam+0x40>
pop    %rax
ret
addss  0xea4(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
movaps %xmm1,%xmm0
call   1030 <gam@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gam(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float -6.660000e+02, float* %2
br label %24
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 5.000000e-01
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call float @sqrt(double 0x400921FB54442D18)
store float %12, float* %2
br label %24
13: ; preds = %7
%14 = load float, float* %3
%15 = fcmp oeq float %14, 1.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store float 1.000000e+00, float* %2
br label %24
17: ; preds = %13
%18 = load float, float* %3
%19 = fsub float %18, 1.000000e+00
%20 = load float, float* %3
%21 = fsub float %20, 1.000000e+00
%22 = call float @gam(float %21)
%23 = fmul float %19, %22
store float %23, float* %2
br label %24
24: ; preds = %17, %16, %11, %6
%25 = load float, float* %2
ret float %25
}

LLVM IR (-O2):
define float @gam(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fcmp oeq float %0, 5.000000e-01
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call float @sqrt(double 0x400921FB54442D18)
br label %9
7: ; preds = %3
%8 = fcmp oeq float %0, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %5, %1, %7, %11
%10 = phi float [ %14, %11 ], [ %6, %5 ], [ -6.660000e+02, %1 ], [ 1.000000e+00, %7 ]
ret float %10
11: ; preds = %7
%12 = fadd float %0, -1.000000e+00
%13 = tail call float @gam(float %12)
%14 = fmul float %12, %13
br label %9
}