void gser(gamser, a, x, gln) float a, x, *gamser, *gln;
{
  int n;
  float sum, del, ap;
  float gammln();
  void nrerror();
  *gln = gammln(a);
  if (x <= 0.0) {
    if (x < 0.0)
      nrerror("x less than 0 in routine GSER");
    *gamser = 0.0;
    return;
  } else {
    ap = a;
    del = sum = 1.0 / a;
    for (n = 1; n <= 100; n++) {
      ap += 1.0;
      del *= x / ap;
      sum += del;
      if (fabs(del) < fabs(sum) * 3.0e-7) {
        *gamser = sum * exp(-x + a * log(x) - (*gln));
        return;
      }
    }
    nrerror("a too large, ITMAX too small in routine GSER");
    return;
  }
}


x86 assembly (clang, -O0):
<gser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1060 <gammln@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     11d1 <gser+0x91>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11c1 <gser+0x81>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    133b <gser+0x1fb>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe14(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jg     132d <gser+0x1ed>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movaps 0xdb0(%rip),%xmm0
pand   %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xd9c(%rip),%xmm2
pand   %xmm2,%xmm0
movsd  0xd88(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    131a <gser+0x1da>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <log@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
jmp    133b <gser+0x1fb>
jmp    131f <gser+0x1df>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1205 <gser+0xc5>
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gser>:
push   %r14
push   %rbx
sub    $0x28,%rsp
cvtsd2ss %xmm0,%xmm0
mov    %rsi,%rbx
mov    %rdi,%r14
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%al
call   1060 <gammln@plt>
movss  0x10(%rsp),%xmm2
movss  %xmm0,(%rbx)
xorps  %xmm0,%xmm0
ucomiss %xmm2,%xmm0
jae    1225 <gser+0xe5>
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movss  0xe68(%rip),%xmm9
movaps %xmm9,%xmm4
movss  0x8(%rsp),%xmm1
divss  %xmm1,%xmm4
mov    $0x64,%eax
movaps 0xe5d(%rip),%xmm8
movaps 0xe65(%rip),%xmm10
movsd  0xe6c(%rip),%xmm11
movaps %xmm4,%xmm5
nopw   0x0(%rax,%rax,1)
movaps %xmm4,%xmm6
addss  %xmm9,%xmm1
movaps %xmm2,%xmm4
divss  %xmm1,%xmm4
mulss  %xmm6,%xmm4
addss  %xmm4,%xmm5
movaps %xmm4,%xmm6
andps  %xmm8,%xmm6
cvtss2sd %xmm6,%xmm6
xorps  %xmm3,%xmm3
cvtss2sd %xmm5,%xmm3
movaps %xmm3,%xmm7
andps  %xmm10,%xmm7
mulsd  %xmm11,%xmm7
ucomisd %xmm6,%xmm7
ja     123e <gser+0xfe>
add    $0xffffffff,%eax
jne    11d0 <gser+0x90>
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
jmp    1030 <nrerror@plt>
jbe    1235 <gser+0xf5>
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
movl   $0x0,(%r14)
jmp    127a <gser+0x13a>
movsd  %xmm0,0x8(%rsp)
movaps %xmm3,0x10(%rsp)
call   1050 <log@plt>
mulsd  0x20(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
movss  (%rbx),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"x less than 0 in routine GSER\00"
@.str.1 = [45 x i8] c"a too large, ITMAX too small in routine GSER\00"
define void @gser(float* %0, double %1, double %2, float* %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float*
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = fptrunc double %1 to float
%14 = fptrunc double %2 to float
store float* %0, float** %5
store float %13, float* %6
store float %14, float* %7
store float* %3, float** %8
%15 = load float, float* %6
%16 = fpext float %15 to double
%17 = call float (double, ...) bitcast (float (...)* @gammln to float (double, ...)*)(double %16)
%18 = load float*, float** %8
store float %17, float* %18
%19 = load float, float* %7
%20 = fpext float %19 to double
%21 = fcmp ole double %20, 0.000000e+00
br i1 %21, label %22, label %29
22: ; preds = %4
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = fcmp olt double %24, 0.000000e+00
br i1 %25, label %26, label %27
26: ; preds = %22
br label %27
27: ; preds = %26, %22
%28 = load float*, float** %5
store float 0.000000e+00, float* %28
br label %84
29: ; preds = %4
%30 = load float, float* %6
store float %30, float* %12
%31 = load float, float* %6
%32 = fpext float %31 to double
%33 = fdiv double 1.000000e+00, %32
%34 = fptrunc double %33 to float
store float %34, float* %10
store float %34, float* %11
store i32 1, i32* %9
br label %35
35: ; preds = %80, %29
%36 = load i32, i32* %9
%37 = icmp sle i32 %36, 100
br i1 %37, label %38, label %83
38: ; preds = %35
%39 = load float, float* %12
%40 = fpext float %39 to double
%41 = fadd double %40, 1.000000e+00
%42 = fptrunc double %41 to float
store float %42, float* %12
%43 = load float, float* %7
%44 = load float, float* %12
%45 = fdiv float %43, %44
%46 = load float, float* %11
%47 = fmul float %46, %45
store float %47, float* %11
%48 = load float, float* %11
%49 = load float, float* %10
%50 = fadd float %49, %48
store float %50, float* %10
%51 = load float, float* %11
%52 = fpext float %51 to double
%53 = call double @llvm.fabs.f64(double %52)
%54 = load float, float* %10
%55 = fpext float %54 to double
%56 = call double @llvm.fabs.f64(double %55)
%57 = fmul double %56, 3.000000e-07
%58 = fcmp olt double %53, %57
br i1 %58, label %59, label %79
59: ; preds = %38
%60 = load float, float* %10
%61 = fpext float %60 to double
%62 = load float, float* %7
%63 = fneg float %62
%64 = fpext float %63 to double
%65 = load float, float* %6
%66 = fpext float %65 to double
%67 = load float, float* %7
%68 = fpext float %67 to double
%69 = call double @log(double %68)
%70 = call double @llvm.fmuladd.f64(double %66, double %69, double %64)
%71 = load float*, float** %8
%72 = load float, float* %71
%73 = fpext float %72 to double
%74 = fsub double %70, %73
%75 = call double @exp(double %74)
%76 = fmul double %61, %75
%77 = fptrunc double %76 to float
%78 = load float*, float** %5
store float %77, float* %78
br label %84
79: ; preds = %38
br label %80
80: ; preds = %79
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 1
store i32 %82, i32* %9
br label %35
83: ; preds = %35
br label %84
84: ; preds = %83, %59, %27
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"x less than 0 in routine GSER\00"
@.str.1 = [45 x i8] c"a too large, ITMAX too small in routine GSER\00"
define void @gser(float* nocapture writeonly %0, double %1, double %2, float* nocapture %3) {
%5 = fptrunc double %1 to float
%6 = fptrunc double %2 to float
%7 = fpext float %5 to double
%8 = tail call float (double, ...) bitcast (float (...)* @gammln to float (double, ...)*)(double %7)
store float %8, float* %3
%9 = fpext float %6 to double
%10 = fcmp ugt float %6, 0.000000e+00
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = fcmp olt float %6, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %11
tail call void (i8*, ...) bitcast (void (...)* @nrerror to void (i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %13, %11
store float 0.000000e+00, float* %0
br label %47
15: ; preds = %4
%16 = fdiv float 1.000000e+00, %5
br label %20
17: ; preds = %20
%18 = add nuw nsw i32 %24, 1
%19 = icmp eq i32 %18, 101
br i1 %19, label %46, label %20
20: ; preds = %15, %17
%21 = phi float [ %5, %15 ], [ %25, %17 ]
%22 = phi float [ %16, %15 ], [ %27, %17 ]
%23 = phi float [ %16, %15 ], [ %28, %17 ]
%24 = phi i32 [ 1, %15 ], [ %18, %17 ]
%25 = fadd float %21, 1.000000e+00
%26 = fdiv float %6, %25
%27 = fmul float %22, %26
%28 = fadd float %23, %27
%29 = tail call float @llvm.fabs.f32(float %27)
%30 = fpext float %29 to double
%31 = fpext float %28 to double
%32 = tail call double @llvm.fabs.f64(double %31)
%33 = fmul double %32, 3.000000e-07
%34 = fcmp ogt double %33, %30
br i1 %34, label %35, label %17
35: ; preds = %20
%36 = fneg float %6
%37 = fpext float %36 to double
%38 = tail call double @log(double %9)
%39 = tail call double @llvm.fmuladd.f64(double %7, double %38, double %37)
%40 = load float, float* %3
%41 = fpext float %40 to double
%42 = fsub double %39, %41
%43 = tail call double @exp(double %42)
%44 = fmul double %43, %31
%45 = fptrunc double %44 to float
store float %45, float* %0
br label %47
46: ; preds = %17
tail call void (i8*, ...) bitcast (void (...)* @nrerror to void (i8*, ...)*)(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %46, %35, %14
ret void
}