double plnkin(double lambda, double T) {
  double c2 = 1.43879;
  double y = 0.01 / (lambda * T);
  double z = c2 * y;
  double a2 = exp(z);
  double s = 0;
  int x = 0;
  if (y >= 7.4)
    x = 4;
  else if (y >= 4.2)
    x = 2;
  else if (y >= 0.45)
    x = (unsigned)(-2.3 * y + 12.96);
  else
    x = (unsigned)(-46.66 * y + 33.);
  double a1 = exp(-x * z);
  while (--x > 0) {
    a1 *= a2;
    double arg = x * z;
    s += a1 * (6. + arg * (6. + arg * (3. + arg))) /
         ((((x) * (x))) * (((x) * (x))));
  }
  return 0.15399 * s;
}


x86 assembly (clang, -O0):
<plnkin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     119a <plnkin+0x8a>
movl   $0x4,-0x3c(%rbp)
jmp    122d <plnkin+0x11d>
movsd  -0x20(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11bd <plnkin+0xad>
movl   $0x2,-0x3c(%rbp)
jmp    1228 <plnkin+0x118>
movsd  -0x20(%rbp),%xmm0
movsd  0xe56(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11fe <plnkin+0xee>
movsd  -0x20(%rbp),%xmm0
movsd  0xe57(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x3c(%rbp)
jmp    1223 <plnkin+0x113>
movsd  -0x20(%rbp),%xmm0
movsd  0xe1d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe19(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x3c(%rbp)
jmp    1228 <plnkin+0x118>
jmp    122d <plnkin+0x11d>
xor    %eax,%eax
sub    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jle    12dd <plnkin+0x1cd>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0xdcc(%rip),%xmm3
addsd  -0x50(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xdb3(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xda3(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
imul   -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1245 <plnkin+0x135>
movsd  0xd63(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plnkin>:
push   %rbx
sub    $0x10,%rsp
mulsd  %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mov    $0x4,%ebx
ucomisd 0xebd(%rip),%xmm1
jae    1195 <plnkin+0x85>
mov    $0x2,%ebx
ucomisd 0xeb6(%rip),%xmm1
jae    1195 <plnkin+0x85>
ucomisd 0xeb4(%rip),%xmm1
jae    1180 <plnkin+0x70>
mulsd  0xec2(%rip),%xmm1
addsd  0xec2(%rip),%xmm1
jmp    1190 <plnkin+0x80>
mulsd  0xea0(%rip),%xmm1
addsd  0xea0(%rip),%xmm1
cvttsd2si %xmm1,%rbx
movsd  %xmm0,(%rsp)
mov    %ebx,%eax
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
cmp    $0x2,%ebx
jl     1233 <plnkin+0x123>
add    $0x1,%ebx
xorpd  %xmm0,%xmm0
movsd  0xe7c(%rip),%xmm2
movsd  0xe7c(%rip),%xmm3
movsd  0x8(%rsp),%xmm6
movsd  (%rsp),%xmm7
nop
lea    -0x2(%rbx),%eax
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
mulsd  %xmm6,%xmm4
movapd %xmm4,%xmm5
addsd  %xmm2,%xmm5
mulsd  %xmm4,%xmm5
mulsd  %xmm7,%xmm1
addsd  %xmm3,%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm1,%xmm5
imul   %eax,%eax
imul   %eax,%eax
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
divsd  %xmm4,%xmm5
addsd  %xmm5,%xmm0
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     11e0 <plnkin+0xd0>
mulsd  0xe25(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @plnkin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.438790e+00, double* %5
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = fdiv double 1.000000e-02, %15
store double %16, double* %6
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fmul double %17, %18
store double %19, double* %7
%20 = load double, double* %7
%21 = call double @exp(double %20)
store double %21, double* %8
store double 0.000000e+00, double* %9
store i32 0, i32* %10
%22 = load double, double* %6
%23 = fcmp oge double %22, 7.400000e+00
br i1 %23, label %24, label %25
24: ; preds = %2
store i32 4, i32* %10
br label %42
25: ; preds = %2
%26 = load double, double* %6
%27 = fcmp oge double %26, 4.200000e+00
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 2, i32* %10
br label %41
29: ; preds = %25
%30 = load double, double* %6
%31 = fcmp oge double %30, 4.500000e-01
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load double, double* %6
%34 = call double @llvm.fmuladd.f64(double -2.300000e+00, double %33, double 1.296000e+01)
%35 = fptoui double %34 to i32
store i32 %35, i32* %10
br label %40
36: ; preds = %29
%37 = load double, double* %6
%38 = call double @llvm.fmuladd.f64(double -4.666000e+01, double %37, double 3.300000e+01)
%39 = fptoui double %38 to i32
store i32 %39, i32* %10
br label %40
40: ; preds = %36, %32
br label %41
41: ; preds = %40, %28
br label %42
42: ; preds = %41, %24
%43 = load i32, i32* %10
%44 = sub nsw i32 0, %43
%45 = sitofp i32 %44 to double
%46 = load double, double* %7
%47 = fmul double %45, %46
%48 = call double @exp(double %47)
store double %48, double* %11
br label %49
49: ; preds = %53, %42
%50 = load i32, i32* %10
%51 = add nsw i32 %50, -1
store i32 %51, i32* %10
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %80
53: ; preds = %49
%54 = load double, double* %8
%55 = load double, double* %11
%56 = fmul double %55, %54
store double %56, double* %11
%57 = load i32, i32* %10
%58 = sitofp i32 %57 to double
%59 = load double, double* %7
%60 = fmul double %58, %59
store double %60, double* %12
%61 = load double, double* %11
%62 = load double, double* %12
%63 = load double, double* %12
%64 = load double, double* %12
%65 = fadd double 3.000000e+00, %64
%66 = call double @llvm.fmuladd.f64(double %63, double %65, double 6.000000e+00)
%67 = call double @llvm.fmuladd.f64(double %62, double %66, double 6.000000e+00)
%68 = fmul double %61, %67
%69 = load i32, i32* %10
%70 = load i32, i32* %10
%71 = mul nsw i32 %69, %70
%72 = load i32, i32* %10
%73 = load i32, i32* %10
%74 = mul nsw i32 %72, %73
%75 = mul nsw i32 %71, %74
%76 = sitofp i32 %75 to double
%77 = fdiv double %68, %76
%78 = load double, double* %9
%79 = fadd double %78, %77
store double %79, double* %9
br label %49
80: ; preds = %49
%81 = load double, double* %9
%82 = fmul double 1.539900e-01, %81
ret double %82
}

LLVM IR (-O2):
define double @plnkin(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fdiv double 1.000000e-02, %3
%5 = fmul double %4, 1.438790e+00
%6 = tail call double @exp(double %5)
%7 = fcmp ult double %4, 7.400000e+00
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = fcmp ult double %4, 4.200000e+00
br i1 %9, label %10, label %18
10: ; preds = %8
%11 = fcmp ult double %4, 4.500000e-01
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = tail call double @llvm.fmuladd.f64(double %4, double -2.300000e+00, double 1.296000e+01)
%14 = fptoui double %13 to i32
br label %18
15: ; preds = %10
%16 = tail call double @llvm.fmuladd.f64(double %4, double -4.666000e+01, double 3.300000e+01)
%17 = fptoui double %16 to i32
br label %18
18: ; preds = %8, %2, %15, %12
%19 = phi i32 [ %14, %12 ], [ %17, %15 ], [ 4, %2 ], [ 2, %8 ]
%20 = sub nsw i32 0, %19
%21 = sitofp i32 %20 to double
%22 = fmul double %5, %21
%23 = tail call double @exp(double %22)
%24 = icmp sgt i32 %19, 1
br i1 %24, label %25, label %45
25: ; preds = %18, %25
%26 = phi i32 [ %29, %25 ], [ %19, %18 ]
%27 = phi double [ %41, %25 ], [ 0.000000e+00, %18 ]
%28 = phi double [ %30, %25 ], [ %23, %18 ]
%29 = add nsw i32 %26, -1
%30 = fmul double %6, %28
%31 = sitofp i32 %29 to double
%32 = fmul double %5, %31
%33 = fadd double %32, 3.000000e+00
%34 = tail call double @llvm.fmuladd.f64(double %32, double %33, double 6.000000e+00)
%35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double 6.000000e+00)
%36 = fmul double %30, %35
%37 = mul nsw i32 %29, %29
%38 = mul nsw i32 %37, %37
%39 = sitofp i32 %38 to double
%40 = fdiv double %36, %39
%41 = fadd double %27, %40
%42 = icmp ugt i32 %26, 2
br i1 %42, label %25, label %43
43: ; preds = %25
%44 = fmul double %41, 1.539900e-01
br label %45
45: ; preds = %43, %18
%46 = phi double [ 0.000000e+00, %18 ], [ %44, %43 ]
ret double %46
}