float gammp(a, x)
float a, x;
{
  float gamser, gammcf, gln;
  void gser(), gcf(), nrerror();
  if (x < 0.0 || a <= 0.0)
    nrerror("Invalid arguments in routine GAMMP");
  if (x < (a + 1.0)) {
    gser(&gamser, a, x, &gln);
    return gamser;
  } else {
    gcf(&gammcf, a, x, &gln);
    return 1.0 - gammcf;
  }
}


x86 assembly (clang, -O0):
<gammp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm1,-0x20(%rbp)
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1183 <gammp+0x53>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1191 <gammp+0x61>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe55(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    11e9 <gammp+0xb9>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%al
call   1040 <gser@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1228 <gammp+0xf8>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%al
call   1050 <gcf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xde5(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammp>:
sub    $0x18,%rsp
cvtsd2ss %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm3,%xmm2
jae    1153 <gammp+0x23>
ucomiss %xmm0,%xmm2
jbe    1177 <gammp+0x47>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
movss  %xmm3,(%rsp)
call   1030 <nrerror@plt>
movss  (%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
movsd  0xe7a(%rip),%xmm2
addsd  %xmm0,%xmm2
ucomisd %xmm1,%xmm2
jbe    11ac <gammp+0x7c>
lea    0xc(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%al
call   1040 <gser@plt>
movss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%al
call   1050 <gcf@plt>
movss  0xe43(%rip),%xmm0
subss  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Invalid arguments in routine GAMMP\00"
define float @gammp(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = fptrunc double %0 to float
%10 = fptrunc double %1 to float
store float %9, float* %4
store float %10, float* %5
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fcmp ole double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %14, %2
br label %19
19: ; preds = %18, %14
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = load float, float* %4
%23 = fpext float %22 to double
%24 = fadd double %23, 1.000000e+00
%25 = fcmp olt double %21, %24
br i1 %25, label %26, label %32
26: ; preds = %19
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = load float, float* %6
store float %31, float* %3
br label %41
32: ; preds = %19
%33 = load float, float* %4
%34 = fpext float %33 to double
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = load float, float* %7
%38 = fpext float %37 to double
%39 = fsub double 1.000000e+00, %38
%40 = fptrunc double %39 to float
store float %40, float* %3
br label %41
41: ; preds = %32, %26
%42 = load float, float* %3
ret float %42
}

LLVM IR (-O2):
@.str = [35 x i8] c"Invalid arguments in routine GAMMP\00"
define float @gammp(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = fptrunc double %0 to float
%7 = fptrunc double %1 to float
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = fpext float %7 to double
%12 = fcmp uge float %7, 0.000000e+00
%13 = fcmp ugt float %6, 0.000000e+00
%14 = and i1 %13, %12
br i1 %14, label %16, label %15
15: ; preds = %2
tail call void (i8*, ...) bitcast (void (...)* @nrerror to void (i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %2, %15
%17 = fpext float %6 to double
%18 = fadd double %17, 1.000000e+00
%19 = fcmp ogt double %18, %11
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load float, float* %3
br label %25
22: ; preds = %16
%23 = load float, float* %4
%24 = fsub float 1.000000e+00, %23
br label %25
25: ; preds = %22, %20
%26 = phi float [ %21, %20 ], [ %24, %22 ]
ret float %26
}