float sw_emboss(char *seq_a, char *seq_b, float gapopen, float gapextend,
                char *m, char *n, int *start1, int *start2, double *matrix_time,
                double *tracking_time, double *total_time) {
  int len_a = strlen(seq_a);
  int len_b = strlen(seq_b);
  int total = (len_a + 1) * (len_b + 1);
  float score;
  float *path = (float *)calloc(total, sizeof(float));
  int *compass = (int *)calloc(total, sizeof(int));
  double partial_t, partial1_t;
  partial1_t = sw_tic();
  partial_t = sw_tic();
  score = AlignPathCalcSW(seq_a, seq_b, len_a, len_b, gapopen, gapextend, path,
                          compass);
  *matrix_time += sw_toc(partial_t);
  partial_t = sw_tic();
  AlignWalkSWMatrix(path, compass, gapopen, gapextend, seq_a, seq_b, (char *)m,
                    (char *)n, len_a, len_b, start1, start2);
  *tracking_time += sw_toc(partial_t);
  *total_time += sw_toc(partial1_t);
  free(path);
  free(compass);
  return score;
}


x86 assembly (clang, -O0):
<sw_emboss>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x88,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    -0x48(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x4c(%rbp)
movslq -0x4c(%rbp),%rdi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0x4c(%rbp),%rdi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0x60(%rbp)
mov    $0x0,%al
call   1050 <sw_tic@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    $0x0,%al
call   1050 <sw_tic@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x58(%rbp),%r8
mov    -0x60(%rbp),%r9
mov    $0x2,%al
call   1080 <AlignPathCalcSW@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
cvtsi2sd %eax,%xmm0
mov    0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1050 <sw_tic@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x44(%rbp),%ebx
mov    -0x48(%rbp),%r11d
mov    -0x38(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x2,%al
call   1030 <AlignWalkSWMatrix@plt>
movsd  -0x68(%rbp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
cvtsi2sd %eax,%xmm0
mov    0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
movss  -0x50(%rbp),%xmm0
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_emboss>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x48(%rsp)
mov    %r8,0x50(%rsp)
mov    %rcx,0x40(%rsp)
mov    %rdx,0x38(%rsp)
movss  %xmm1,0x4(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
call   1060 <strlen@plt>
mov    %rax,%r14
mov    %r12,%rdi
mov    %r12,0x20(%rsp)
call   1060 <strlen@plt>
mov    %rax,0x28(%rsp)
lea    0x1(%rax),%rdx
mov    %r14,%rcx
shl    $0x20,%rcx
movabs $0x100000000,%rbx
add    %rcx,%rbx
imul   %rdx,%rbx
sar    $0x20,%rbx
mov    $0x4,%esi
mov    %rbx,%rdi
call   1070 <calloc@plt>
mov    %rax,%r15
mov    $0x4,%esi
mov    %rbx,%rdi
call   1070 <calloc@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1050 <sw_tic@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %eax,%eax
call   1050 <sw_tic@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
mov    0x28(%rsp),%r12
mov    %r12d,%ecx
movaps %xmm2,%xmm0
mov    %r15,%r8
mov    %rbp,%r9
mov    $0x2,%al
call   1080 <AlignPathCalcSW@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x90(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1050 <sw_tic@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
mov    %rbp,%rsi
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r13,%rdx
mov    0x20(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x40(%rsp),%r9
mov    $0x2,%al
push   0x48(%rsp)
push   0x58(%rsp)
push   %r12
push   %r14
call   1030 <AlignWalkSWMatrix@plt>
add    $0x20,%rsp
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x98(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1090 <sw_toc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0xa0(%rsp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    %r15,%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
movss  0x4(%rsp),%xmm0
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @sw_emboss(i8* %0, i8* %1, float %2, float %3, i8* %4, i8* %5, i32* %6, i32* %7, double* %8, double* %9, double* %10) {
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca float
%15 = alloca float
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca float
%27 = alloca float*
%28 = alloca i32*
%29 = alloca double
%30 = alloca double
store i8* %0, i8** %12
store i8* %1, i8** %13
store float %2, float* %14
store float %3, float* %15
store i8* %4, i8** %16
store i8* %5, i8** %17
store i32* %6, i32** %18
store i32* %7, i32** %19
store double* %8, double** %20
store double* %9, double** %21
store double* %10, double** %22
%31 = load i8*, i8** %12
%32 = call i64 @strlen(i8* %31)
%33 = trunc i64 %32 to i32
store i32 %33, i32* %23
%34 = load i8*, i8** %13
%35 = call i64 @strlen(i8* %34)
%36 = trunc i64 %35 to i32
store i32 %36, i32* %24
%37 = load i32, i32* %23
%38 = add nsw i32 %37, 1
%39 = load i32, i32* %24
%40 = add nsw i32 %39, 1
%41 = mul nsw i32 %38, %40
store i32 %41, i32* %25
%42 = load i32, i32* %25
%43 = sext i32 %42 to i64
%44 = call i8* @calloc(i64 %43, i64 4)
%45 = bitcast i8* %44 to float*
store float* %45, float** %27
%46 = load i32, i32* %25
%47 = sext i32 %46 to i64
%48 = call i8* @calloc(i64 %47, i64 4)
%49 = bitcast i8* %48 to i32*
store i32* %49, i32** %28
%50 = call i32 (...) @sw_tic()
%51 = sitofp i32 %50 to double
store double %51, double* %30
%52 = call i32 (...) @sw_tic()
%53 = sitofp i32 %52 to double
store double %53, double* %29
%54 = load i8*, i8** %12
%55 = load i8*, i8** %13
%56 = load i32, i32* %23
%57 = load i32, i32* %24
%58 = load float, float* %14
%59 = fpext float %58 to double
%60 = load float, float* %15
%61 = fpext float %60 to double
%62 = load float*, float** %27
%63 = load i32*, i32** %28
%64 = call i32 (i8*, i8*, i32, i32, double, double, float*, i32*, ...) bitcast (i32 (...)* @AlignPathCalcSW to i32 (i8*, i8*, i32, i32, double, double, float*, i32*, ...)*)(i8* %54, i8* %55, i32 %56, i32 %57, double %59, double %61, float* %62, i32* %63)
%65 = sitofp i32 %64 to float
store float %65, float* %26
%66 = load double, double* %29
%67 = call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %66)
%68 = sitofp i32 %67 to double
%69 = load double*, double** %20
%70 = load double, double* %69
%71 = fadd double %70, %68
store double %71, double* %69
%72 = call i32 (...) @sw_tic()
%73 = sitofp i32 %72 to double
store double %73, double* %29
%74 = load float*, float** %27
%75 = load i32*, i32** %28
%76 = load float, float* %14
%77 = fpext float %76 to double
%78 = load float, float* %15
%79 = fpext float %78 to double
%80 = load i8*, i8** %12
%81 = load i8*, i8** %13
%82 = load i8*, i8** %16
%83 = load i8*, i8** %17
%84 = load i32, i32* %23
%85 = load i32, i32* %24
%86 = load i32*, i32** %18
%87 = load i32*, i32** %19
%88 = call i32 (float*, i32*, double, double, i8*, i8*, i8*, i8*, i32, i32, i32*, i32*, ...) bitcast (i32 (...)* @AlignWalkSWMatrix to i32 (float*, i32*, double, double, i8*, i8*, i8*, i8*, i32, i32, i32*, i32*, ...)*)(float* %74, i32* %75, double %77, double %79, i8* %80, i8* %81, i8* %82, i8* %83, i32 %84, i32 %85, i32* %86, i32* %87)
%89 = load double, double* %29
%90 = call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %89)
%91 = sitofp i32 %90 to double
%92 = load double*, double** %21
%93 = load double, double* %92
%94 = fadd double %93, %91
store double %94, double* %92
%95 = load double, double* %30
%96 = call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %95)
%97 = sitofp i32 %96 to double
%98 = load double*, double** %22
%99 = load double, double* %98
%100 = fadd double %99, %97
store double %100, double* %98
%101 = load float*, float** %27
%102 = bitcast float* %101 to i8*
%103 = load i32*, i32** %28
%104 = bitcast i32* %103 to i8*
%105 = load float, float* %26
ret float %105
}

LLVM IR (-O2):
define float @sw_emboss(i8* %0, i8* %1, float %2, float %3, i8* %4, i8* %5, i32* %6, i32* %7, double* nocapture %8, double* nocapture %9, double* nocapture %10) {
%12 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%13 = trunc i64 %12 to i32
%14 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%15 = trunc i64 %14 to i32
%16 = add i64 %14, 1
%17 = shl i64 %12, 32
%18 = add i64 %17, 4294967296
%19 = mul i64 %18, %16
%20 = ashr exact i64 %19, 32
%21 = tail call i8* @calloc(i64 %20, i64 4)
%22 = bitcast i8* %21 to float*
%23 = tail call i8* @calloc(i64 %20, i64 4)
%24 = bitcast i8* %23 to i32*
%25 = tail call i32 (...) @sw_tic()
%26 = sitofp i32 %25 to double
%27 = tail call i32 (...) @sw_tic()
%28 = sitofp i32 %27 to double
%29 = fpext float %2 to double
%30 = fpext float %3 to double
%31 = tail call i32 (i8*, i8*, i32, i32, double, double, float*, i32*, ...) bitcast (i32 (...)* @AlignPathCalcSW to i32 (i8*, i8*, i32, i32, double, double, float*, i32*, ...)*)(i8* %0, i8* %1, i32 %13, i32 %15, double %29, double %30, float* %22, i32* %24)
%32 = sitofp i32 %31 to float
%33 = tail call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %28)
%34 = sitofp i32 %33 to double
%35 = load double, double* %8
%36 = fadd double %35, %34
store double %36, double* %8
%37 = tail call i32 (...) @sw_tic()
%38 = sitofp i32 %37 to double
%39 = tail call i32 (float*, i32*, double, double, i8*, i8*, i8*, i8*, i32, i32, i32*, i32*, ...) bitcast (i32 (...)* @AlignWalkSWMatrix to i32 (float*, i32*, double, double, i8*, i8*, i8*, i8*, i32, i32, i32*, i32*, ...)*)(float* %22, i32* %24, double %29, double %30, i8* %0, i8* %1, i8* %4, i8* %5, i32 %13, i32 %15, i32* %6, i32* %7)
%40 = tail call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %38)
%41 = sitofp i32 %40 to double
%42 = load double, double* %9
%43 = fadd double %42, %41
store double %43, double* %9
%44 = tail call i32 (double, ...) bitcast (i32 (...)* @sw_toc to i32 (double, ...)*)(double %26)
%45 = sitofp i32 %44 to double
%46 = load double, double* %10
%47 = fadd double %46, %45
store double %47, double* %10
tail call void @free(i8* %21)
tail call void @free(i8* %23)
ret float %32
}