double long_seq_tm(s, pick, len, salt_conc, divalent_conc, dntp_conc) const
    char *s;
int pick, len;
double salt_conc;
double divalent_conc;
double dntp_conc;
{
  int GC_count = 0;
  const char *p, *end;
  if (divalent_to_monovalent(divalent_conc, dntp_conc) == -999999.9999)
    return -999999.9999;
  salt_conc = salt_conc + divalent_to_monovalent(divalent_conc, dntp_conc);
  if (pick + len > strlen(s) || pick < 0 || len <= 0)
    return -999999.9999;
  end = &s[pick + len];
  for (p = &s[pick]; p < end; p++) {
    if ('G' == *p || 'C' == *p)
      GC_count++;
  }
  return 81.5 + (16.6 * log10(salt_conc / 1000.0)) +
         (41.0 * (((double)GC_count) / len)) - (600.0 / len);
}


x86 assembly (clang, -O0):
<long_seq_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1030 <divalent_to_monovalent@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe8b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1197 <long_seq_tm+0x67>
jp     1197 <long_seq_tm+0x67>
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12f0 <long_seq_tm+0x1c0>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1030 <divalent_to_monovalent@plt>
movsd  -0x58(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
cmp    %rcx,%rax
ja     11fd <long_seq_tm+0xcd>
cmpl   $0x0,-0x14(%rbp)
jl     11fd <long_seq_tm+0xcd>
cmpl   $0x0,-0x18(%rbp)
jg     120f <long_seq_tm+0xdf>
movsd  0xdfb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12f0 <long_seq_tm+0x1c0>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    1287 <long_seq_tm+0x157>
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x47,%eax
cmp    %ecx,%eax
je     1268 <long_seq_tm+0x138>
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x43,%eax
cmp    %ecx,%eax
jne    1271 <long_seq_tm+0x141>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1276 <long_seq_tm+0x146>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1232 <long_seq_tm+0x102>
movsd  -0x20(%rbp),%xmm0
movsd  0xd94(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xd70(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd6c(%rip),%xmm0
addsd  %xmm0,%xmm1
cvtsi2sdl -0x34(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm2
divsd  %xmm2,%xmm0
movsd  0xd42(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm2
movsd  0xd25(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_seq_tm>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
movaps %xmm1,%xmm0
movapd %xmm2,%xmm1
mov    $0x2,%al
call   1030 <divalent_to_monovalent@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <divalent_to_monovalent@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1040 <strlen@plt>
movsd  0xe7a(%rip),%xmm0
test   %r14d,%r14d
jle    1235 <long_seq_tm+0x105>
test   %ebx,%ebx
js     1235 <long_seq_tm+0x105>
lea    (%r14,%rbx,1),%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jb     1235 <long_seq_tm+0x105>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  (%rsp),%xmm0
mov    %ebx,%eax
xor    %ebx,%ebx
cmp    %rcx,%rax
jge    11e9 <long_seq_tm+0xb9>
add    %r15,%rcx
add    %r15,%rax
xor    %ebx,%ebx
jmp    11d9 <long_seq_tm+0xa9>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rcx,%rax
jae    11e9 <long_seq_tm+0xb9>
movzbl (%rax),%edx
or     $0x4,%dl
cmp    $0x47,%dl
jne    11d0 <long_seq_tm+0xa0>
add    $0x1,%ebx
jmp    11d0 <long_seq_tm+0xa0>
divsd  0xe17(%rip),%xmm0
call   1050 <log10@plt>
mulsd  0xe12(%rip),%xmm0
addsd  0xe12(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %r14d,%xmm2
divsd  %xmm2,%xmm1
mulsd  0xdff(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xdfb(%rip),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @long_seq_tm(i8* %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store i32 0, i32* %14
%17 = load double, double* %12
%18 = load double, double* %13
%19 = call i32 (double, double, ...) bitcast (i32 (...)* @divalent_to_monovalent to i32 (double, double, ...)*)(double %17, double %18)
%20 = sitofp i32 %19 to double
%21 = fcmp oeq double %20, 0xC12E847FFFF2E48F
br i1 %21, label %22, label %23
22: ; preds = %6
store double 0xC12E847FFFF2E48F, double* %7
br label %91
23: ; preds = %6
%24 = load double, double* %11
%25 = load double, double* %12
%26 = load double, double* %13
%27 = call i32 (double, double, ...) bitcast (i32 (...)* @divalent_to_monovalent to i32 (double, double, ...)*)(double %25, double %26)
%28 = sitofp i32 %27 to double
%29 = fadd double %24, %28
store double %29, double* %11
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = add nsw i32 %30, %31
%33 = sext i32 %32 to i64
%34 = load i8*, i8** %8
%35 = call i64 @strlen(i8* %34)
%36 = icmp ugt i64 %33, %35
br i1 %36, label %43, label %37
37: ; preds = %23
%38 = load i32, i32* %9
%39 = icmp slt i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = load i32, i32* %10
%42 = icmp sle i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %40, %37, %23
store double 0xC12E847FFFF2E48F, double* %7
br label %91
44: ; preds = %40
%45 = load i8*, i8** %8
%46 = load i32, i32* %9
%47 = load i32, i32* %10
%48 = add nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %45, i64 %49
store i8* %50, i8** %16
%51 = load i8*, i8** %8
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
store i8* %54, i8** %15
br label %55
55: ; preds = %73, %44
%56 = load i8*, i8** %15
%57 = load i8*, i8** %16
%58 = icmp ult i8* %56, %57
br i1 %58, label %59, label %76
59: ; preds = %55
%60 = load i8*, i8** %15
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 71, %62
br i1 %63, label %69, label %64
64: ; preds = %59
%65 = load i8*, i8** %15
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 67, %67
br i1 %68, label %69, label %72
69: ; preds = %64, %59
%70 = load i32, i32* %14
%71 = add nsw i32 %70, 1
store i32 %71, i32* %14
br label %72
72: ; preds = %69, %64
br label %73
73: ; preds = %72
%74 = load i8*, i8** %15
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %15
br label %55
76: ; preds = %55
%77 = load double, double* %11
%78 = fdiv double %77, 1.000000e+03
%79 = call double @log10(double %78)
%80 = call double @llvm.fmuladd.f64(double 1.660000e+01, double %79, double 8.150000e+01)
%81 = load i32, i32* %14
%82 = sitofp i32 %81 to double
%83 = load i32, i32* %10
%84 = sitofp i32 %83 to double
%85 = fdiv double %82, %84
%86 = call double @llvm.fmuladd.f64(double 4.100000e+01, double %85, double %80)
%87 = load i32, i32* %10
%88 = sitofp i32 %87 to double
%89 = fdiv double 6.000000e+02, %88
%90 = fsub double %86, %89
store double %90, double* %7
br label %91
91: ; preds = %76, %43, %22
%92 = load double, double* %7
ret double %92
}

LLVM IR (-O2):
define double @long_seq_tm(i8* %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @divalent_to_monovalent to i32 (double, double, ...)*)(double %4, double %5)
%8 = tail call i32 (double, double, ...) bitcast (i32 (...)* @divalent_to_monovalent to i32 (double, double, ...)*)(double %4, double %5)
%9 = sitofp i32 %8 to double
%10 = fadd double %9, %3
%11 = add nsw i32 %2, %1
%12 = sext i32 %11 to i64
%13 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%14 = icmp ult i64 %13, %12
%15 = icmp slt i32 %1, 0
%16 = or i1 %15, %14
%17 = icmp slt i32 %2, 1
%18 = or i1 %17, %16
br i1 %18, label %46, label %19
19: ; preds = %6
%20 = getelementptr inbounds i8, i8* %0, i64 %12
%21 = zext i32 %1 to i64
%22 = icmp slt i64 %21, %12
br i1 %22, label %23, label %35
23: ; preds = %19
%24 = getelementptr inbounds i8, i8* %0, i64 %21
br label %25
25: ; preds = %23, %31
%26 = phi i8* [ %33, %31 ], [ %24, %23 ]
%27 = phi i32 [ %32, %31 ], [ 0, %23 ]
%28 = load i8, i8* %26
switch i8 %28, label %31 [
i8 71, label %29
i8 67, label %29
]
29: ; preds = %25, %25
%30 = add nsw i32 %27, 1
br label %31
31: ; preds = %25, %29
%32 = phi i32 [ %30, %29 ], [ %27, %25 ]
%33 = getelementptr inbounds i8, i8* %26, i64 1
%34 = icmp ult i8* %33, %20
br i1 %34, label %25, label %35
35: ; preds = %31, %19
%36 = phi i32 [ 0, %19 ], [ %32, %31 ]
%37 = fdiv double %10, 1.000000e+03
%38 = tail call double @log10(double %37)
%39 = tail call double @llvm.fmuladd.f64(double %38, double 1.660000e+01, double 8.150000e+01)
%40 = sitofp i32 %36 to double
%41 = sitofp i32 %2 to double
%42 = fdiv double %40, %41
%43 = tail call double @llvm.fmuladd.f64(double %42, double 4.100000e+01, double %39)
%44 = fdiv double 6.000000e+02, %41
%45 = fsub double %43, %44
br label %46
46: ; preds = %6, %35
%47 = phi double [ %45, %35 ], [ 0xC12E847FFFF2E48F, %6 ]
ret double %47
}