#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 cephes_igamcf(float, float);
float cephes_igamf(float, float);
float gammaincf(float a, float x) {
  if ((x <= 0) || (a <= 0))
    return 0.0;
  if ((x > 1.0) && (x > a))
    return 1.0 - cephes_igamcf(a, x);
  return cephes_igamf(a, x);
}


x86 assembly (clang, -O0):
<gammaincf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jae    114c <gammaincf+0x2c>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1159 <gammaincf+0x39>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11c4 <gammaincf+0xa4>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11b0 <gammaincf+0x90>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11b0 <gammaincf+0x90>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <cephes_igamcf@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11c4 <gammaincf+0xa4>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <cephes_igamf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammaincf>:
push   %rax
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jae    1150 <gammaincf+0x30>
xorps  %xmm3,%xmm3
ucomiss %xmm1,%xmm3
jae    1150 <gammaincf+0x30>
ucomiss 0xec8(%rip),%xmm1
jbe    1155 <gammaincf+0x35>
ucomiss %xmm0,%xmm1
jbe    1155 <gammaincf+0x35>
call   1040 <cephes_igamcf@plt>
movss  0xeb4(%rip),%xmm2
subss  %xmm0,%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret
pop    %rax
jmp    1030 <cephes_igamf@plt>

LLVM IR (-O0):
define float @gammaincf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp ole float %6, 0.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp ole float %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store float 0.000000e+00, float* %3
br label %31
12: ; preds = %8
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = fcmp ogt double %14, 1.000000e+00
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = load float, float* %5
%18 = load float, float* %4
%19 = fcmp ogt float %17, %18
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load float, float* %4
%22 = load float, float* %5
%23 = call float @cephes_igamcf(float %21, float %22)
%24 = fpext float %23 to double
%25 = fsub double 1.000000e+00, %24
%26 = fptrunc double %25 to float
store float %26, float* %3
br label %31
27: ; preds = %16, %12
%28 = load float, float* %4
%29 = load float, float* %5
%30 = call float @cephes_igamf(float %28, float %29)
store float %30, float* %3
br label %31
31: ; preds = %27, %20, %11
%32 = load float, float* %3
ret float %32
}

LLVM IR (-O2):
define float @gammaincf(float %0, float %1) {
%3 = fcmp ole float %1, 0.000000e+00
%4 = fcmp ole float %0, 0.000000e+00
%5 = or i1 %4, %3
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = fcmp ogt float %1, 1.000000e+00
%8 = fcmp ogt float %1, %0
%9 = and i1 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call float @cephes_igamcf(float %0, float %1)
%12 = fsub float 1.000000e+00, %11
br label %15
13: ; preds = %6
%14 = tail call float @cephes_igamf(float %0, float %1)
br label %15
15: ; preds = %2, %13, %10
%16 = phi float [ %12, %10 ], [ %14, %13 ], [ 0.000000e+00, %2 ]
ret float %16
}