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


x86 assembly (clang, -O0):
<gammq>:
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 <gammq+0x53>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1191 <gammq+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    11fd <gammq+0xcd>
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
cvtss2sd %xmm0,%xmm1
movsd  0xe15(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1228 <gammq+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
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammq>:
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 <gammq+0x23>
ucomiss %xmm0,%xmm2
jbe    1177 <gammq+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    11b4 <gammq+0x84>
lea    0xc(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%al
call   1040 <gser@plt>
movss  0xe5f(%rip),%xmm0
subss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%al
call   1050 <gcf@plt>
movss  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Invalid arguments in routine GAMMQ\00"
define float @gammq(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 %35
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
%32 = fpext float %31 to double
%33 = fsub double 1.000000e+00, %32
%34 = fptrunc double %33 to float
store float %34, float* %3
br label %41
35: ; preds = %19
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = load float, float* %5
%39 = fpext float %38 to double
%40 = load float, float* %7
store float %40, float* %3
br label %41
41: ; preds = %35, %26
%42 = load float, float* %3
ret float %42
}

LLVM IR (-O2):
@.str = [35 x i8] c"Invalid arguments in routine GAMMQ\00"
define float @gammq(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 %23
20: ; preds = %16
%21 = load float, float* %3
%22 = fsub float 1.000000e+00, %21
br label %25
23: ; preds = %16
%24 = load float, float* %4
br label %25
25: ; preds = %23, %20
%26 = phi float [ %22, %20 ], [ %24, %23 ]
ret float %26
}