double seqtm(seq, dna_conc, salt_conc, divalent_conc, dntp_conc, nn_max_len,
             tm_santalucia, salt_corrections) const char *seq;
double dna_conc;
double salt_conc;
double divalent_conc;
double dntp_conc;
int nn_max_len;
int tm_santalucia;
int salt_corrections;
{
  int len = strlen(seq);
  if (tm_santalucia != 0 && tm_santalucia != 1)
    return -999999.9999;
  if (salt_corrections != 0 && salt_corrections != 1 && salt_corrections != 2)
    return -999999.9999;
  return (len > nn_max_len)
             ? long_seq_tm(seq, 0, len, salt_conc, divalent_conc, dntp_conc)
             : oligotm(seq, dna_conc, salt_conc, divalent_conc, dntp_conc,
                       tm_santalucia, salt_corrections);
}


x86 assembly (clang, -O0):
<seqtm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x38(%rbp)
je     118b <seqtm+0x5b>
cmpl   $0x1,-0x38(%rbp)
je     118b <seqtm+0x5b>
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1222 <seqtm+0xf2>
cmpl   $0x0,-0x3c(%rbp)
je     11bb <seqtm+0x8b>
cmpl   $0x1,-0x3c(%rbp)
je     11bb <seqtm+0x8b>
cmpl   $0x2,-0x3c(%rbp)
je     11bb <seqtm+0x8b>
movsd  0xe4f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1222 <seqtm+0xf2>
mov    -0x40(%rbp),%eax
cmp    -0x34(%rbp),%eax
jle    11ee <seqtm+0xbe>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
xor    %esi,%esi
mov    $0x3,%al
call   1030 <long_seq_tm@plt>
mov    %eax,-0x44(%rbp)
jmp    1216 <seqtm+0xe6>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    $0x4,%al
call   1040 <oligotm@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqtm>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %rdi,%rbx
call   1050 <strlen@plt>
movsd  0xe96(%rip),%xmm0
cmp    $0x1,%ebp
ja     11c7 <seqtm+0x97>
cmp    $0x2,%r14d
ja     11c7 <seqtm+0x97>
mov    %rbx,%rdi
cmp    %r15d,%eax
jle    119c <seqtm+0x6c>
xor    %esi,%esi
mov    %eax,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    $0x3,%al
call   1030 <long_seq_tm@plt>
jmp    11c0 <seqtm+0x90>
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x4,%al
call   1040 <oligotm@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @seqtm(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8* %0, i8** %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
%19 = load i8*, i8** %10
%20 = call i64 @strlen(i8* %19)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %18
%22 = load i32, i32* %16
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %8
%25 = load i32, i32* %16
%26 = icmp ne i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %24
store double 0xC12E847FFFF2E48F, double* %9
br label %61
28: ; preds = %24, %8
%29 = load i32, i32* %17
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %28
%32 = load i32, i32* %17
%33 = icmp ne i32 %32, 1
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = load i32, i32* %17
%36 = icmp ne i32 %35, 2
br i1 %36, label %37, label %38
37: ; preds = %34
store double 0xC12E847FFFF2E48F, double* %9
br label %61
38: ; preds = %34, %31, %28
%39 = load i32, i32* %18
%40 = load i32, i32* %15
%41 = icmp sgt i32 %39, %40
br i1 %41, label %42, label %49
42: ; preds = %38
%43 = load i8*, i8** %10
%44 = load i32, i32* %18
%45 = load double, double* %12
%46 = load double, double* %13
%47 = load double, double* %14
%48 = call i32 (i8*, i32, i32, double, double, double, ...) bitcast (i32 (...)* @long_seq_tm to i32 (i8*, i32, i32, double, double, double, ...)*)(i8* %43, i32 0, i32 %44, double %45, double %46, double %47)
br label %58
49: ; preds = %38
%50 = load i8*, i8** %10
%51 = load double, double* %11
%52 = load double, double* %12
%53 = load double, double* %13
%54 = load double, double* %14
%55 = load i32, i32* %16
%56 = load i32, i32* %17
%57 = call i32 (i8*, double, double, double, double, i32, i32, ...) bitcast (i32 (...)* @oligotm to i32 (i8*, double, double, double, double, i32, i32, ...)*)(i8* %50, double %51, double %52, double %53, double %54, i32 %55, i32 %56)
br label %58
58: ; preds = %49, %42
%59 = phi i32 [ %48, %42 ], [ %57, %49 ]
%60 = sitofp i32 %59 to double
store double %60, double* %9
br label %61
61: ; preds = %58, %37, %27
%62 = load double, double* %9
ret double %62
}

LLVM IR (-O2):
define double @seqtm(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = trunc i64 %9 to i32
%11 = icmp ugt i32 %6, 1
%12 = icmp ugt i32 %7, 2
%13 = or i1 %11, %12
br i1 %13, label %23, label %14
14: ; preds = %8
%15 = icmp sgt i32 %10, %5
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = tail call i32 (i8*, i32, i32, double, double, double, ...) bitcast (i32 (...)* @long_seq_tm to i32 (i8*, i32, i32, double, double, double, ...)*)(i8* %0, i32 0, i32 %10, double %2, double %3, double %4)
br label %20
18: ; preds = %14
%19 = tail call i32 (i8*, double, double, double, double, i32, i32, ...) bitcast (i32 (...)* @oligotm to i32 (i8*, double, double, double, double, i32, i32, ...)*)(i8* %0, double %1, double %2, double %3, double %4, i32 %6, i32 %7)
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
%22 = sitofp i32 %21 to double
br label %23
23: ; preds = %8, %20
%24 = phi double [ %22, %20 ], [ 0xC12E847FFFF2E48F, %8 ]
ret double %24
}