#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ compare_lists(int *, int *, int *, int *, int, int, float *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ make_ref_alilist(int *, char *, char *, char *, char *,
                                    int **, int *);
float CompareRefPairAlignments(int *ref, char *known1, char *known2,
                               char *calc1, char *calc2) {
  int *klist1;
  int *klist2;
  int *tlist1;
  int *tlist2;
  int len1, len2;
  float score;
  if (!make_ref_alilist(ref, known1, known2, calc1, calc2, &tlist1, &len1))
    return -1.0;
  if (!make_ref_alilist(ref, known2, known1, calc2, calc1, &tlist2, &len2))
    return -1.0;
  if (!make_ref_alilist(ref, known1, known2, known1, known2, &klist1, &len1))
    return -1.0;
  if (!make_ref_alilist(ref, known2, known1, known2, known1, &klist2, &len2))
    return -1.0;
  if (!compare_lists(klist1, klist2, tlist1, tlist2, len1, len2, &score))
    return -1.0;
  free(klist1);
  free(klist2);
  free(tlist1);
  free(tlist2);
  return score;
}


x86 assembly (clang, -O0):
<CompareRefPairAlignments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    -0x48(%rbp),%r9
lea    -0x54(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <make_ref_alilist@plt>
cmp    $0x0,%eax
jne    118c <CompareRefPairAlignments+0x5c>
movss  0xe7e(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ba <CompareRefPairAlignments+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    -0x50(%rbp),%r9
lea    -0x58(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <make_ref_alilist@plt>
cmp    $0x0,%eax
jne    11cc <CompareRefPairAlignments+0x9c>
movss  0xe3e(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ba <CompareRefPairAlignments+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    -0x38(%rbp),%r9
lea    -0x54(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <make_ref_alilist@plt>
cmp    $0x0,%eax
jne    120c <CompareRefPairAlignments+0xdc>
movss  0xdfe(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ba <CompareRefPairAlignments+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    -0x40(%rbp),%r9
lea    -0x58(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <make_ref_alilist@plt>
cmp    $0x0,%eax
jne    124c <CompareRefPairAlignments+0x11c>
movss  0xdbe(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ba <CompareRefPairAlignments+0x18a>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x54(%rbp),%r8d
mov    -0x58(%rbp),%r9d
lea    -0x5c(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <compare_lists@plt>
cmp    $0x0,%eax
jne    128c <CompareRefPairAlignments+0x15c>
movss  0xd7e(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ba <CompareRefPairAlignments+0x18a>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareRefPairAlignments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r13
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
lea    0x14(%rsp),%rbp
mov    %rbp,(%rsp)
lea    0x20(%rsp),%r9
call   1040 <make_ref_alilist@plt>
movss  0xe98(%rip),%xmm0
test   %eax,%eax
je     1255 <CompareRefPairAlignments+0x125>
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
lea    0x18(%rsp),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1040 <make_ref_alilist@plt>
test   %eax,%eax
je     124d <CompareRefPairAlignments+0x11d>
mov    %rbp,(%rsp)
lea    0x30(%rsp),%r9
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %r14,%r8
call   1040 <make_ref_alilist@plt>
test   %eax,%eax
je     124d <CompareRefPairAlignments+0x11d>
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
lea    0x28(%rsp),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r12,%r8
call   1040 <make_ref_alilist@plt>
test   %eax,%eax
je     124d <CompareRefPairAlignments+0x11d>
mov    0x30(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
call   1050 <compare_lists@plt>
test   %eax,%eax
movss  0xde5(%rip),%xmm0
je     1255 <CompareRefPairAlignments+0x125>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
movss  0x10(%rsp),%xmm0
jmp    1255 <CompareRefPairAlignments+0x125>
movss  0xdab(%rip),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @CompareRefPairAlignments(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca float
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%19 = load i32*, i32** %7
%20 = load i8*, i8** %8
%21 = load i8*, i8** %9
%22 = load i8*, i8** %10
%23 = load i8*, i8** %11
%24 = call i32 @make_ref_alilist(i32* %19, i8* %20, i8* %21, i8* %22, i8* %23, i32** %14, i32* %16)
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %5
store float -1.000000e+00, float* %6
br label %74
27: ; preds = %5
%28 = load i32*, i32** %7
%29 = load i8*, i8** %9
%30 = load i8*, i8** %8
%31 = load i8*, i8** %11
%32 = load i8*, i8** %10
%33 = call i32 @make_ref_alilist(i32* %28, i8* %29, i8* %30, i8* %31, i8* %32, i32** %15, i32* %17)
%34 = icmp ne i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %27
store float -1.000000e+00, float* %6
br label %74
36: ; preds = %27
%37 = load i32*, i32** %7
%38 = load i8*, i8** %8
%39 = load i8*, i8** %9
%40 = load i8*, i8** %8
%41 = load i8*, i8** %9
%42 = call i32 @make_ref_alilist(i32* %37, i8* %38, i8* %39, i8* %40, i8* %41, i32** %12, i32* %16)
%43 = icmp ne i32 %42, 0
br i1 %43, label %45, label %44
44: ; preds = %36
store float -1.000000e+00, float* %6
br label %74
45: ; preds = %36
%46 = load i32*, i32** %7
%47 = load i8*, i8** %9
%48 = load i8*, i8** %8
%49 = load i8*, i8** %9
%50 = load i8*, i8** %8
%51 = call i32 @make_ref_alilist(i32* %46, i8* %47, i8* %48, i8* %49, i8* %50, i32** %13, i32* %17)
%52 = icmp ne i32 %51, 0
br i1 %52, label %54, label %53
53: ; preds = %45
store float -1.000000e+00, float* %6
br label %74
54: ; preds = %45
%55 = load i32*, i32** %12
%56 = load i32*, i32** %13
%57 = load i32*, i32** %14
%58 = load i32*, i32** %15
%59 = load i32, i32* %16
%60 = load i32, i32* %17
%61 = call i32 @compare_lists(i32* %55, i32* %56, i32* %57, i32* %58, i32 %59, i32 %60, float* %18)
%62 = icmp ne i32 %61, 0
br i1 %62, label %64, label %63
63: ; preds = %54
store float -1.000000e+00, float* %6
br label %74
64: ; preds = %54
%65 = load i32*, i32** %12
%66 = call i32 @free(i32* %65)
%67 = load i32*, i32** %13
%68 = call i32 @free(i32* %67)
%69 = load i32*, i32** %14
%70 = call i32 @free(i32* %69)
%71 = load i32*, i32** %15
%72 = call i32 @free(i32* %71)
%73 = load float, float* %18
store float %73, float* %6
br label %74
74: ; preds = %64, %63, %53, %44, %35, %26
%75 = load float, float* %6
ret float %75
}

LLVM IR (-O2):
define float @CompareRefPairAlignments(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = bitcast i32** %6 to i8*
%14 = bitcast i32** %7 to i8*
%15 = bitcast i32** %8 to i8*
%16 = bitcast i32** %9 to i8*
%17 = bitcast i32* %10 to i8*
%18 = bitcast i32* %11 to i8*
%19 = bitcast float* %12 to i8*
%20 = call i32 @make_ref_alilist(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32** %8, i32* %10)
%21 = icmp eq i32 %20, 0
br i1 %21, label %50, label %22
22: ; preds = %5
%23 = call i32 @make_ref_alilist(i32* %0, i8* %2, i8* %1, i8* %4, i8* %3, i32** %9, i32* %11)
%24 = icmp eq i32 %23, 0
br i1 %24, label %50, label %25
25: ; preds = %22
%26 = call i32 @make_ref_alilist(i32* %0, i8* %1, i8* %2, i8* %1, i8* %2, i32** %6, i32* %10)
%27 = icmp eq i32 %26, 0
br i1 %27, label %50, label %28
28: ; preds = %25
%29 = call i32 @make_ref_alilist(i32* %0, i8* %2, i8* %1, i8* %2, i8* %1, i32** %7, i32* %11)
%30 = icmp eq i32 %29, 0
br i1 %30, label %50, label %31
31: ; preds = %28
%32 = load i32*, i32** %6
%33 = load i32*, i32** %7
%34 = load i32*, i32** %8
%35 = load i32*, i32** %9
%36 = load i32, i32* %10
%37 = load i32, i32* %11
%38 = call i32 @compare_lists(i32* %32, i32* %33, i32* %34, i32* %35, i32 %36, i32 %37, float* %12)
%39 = icmp eq i32 %38, 0
br i1 %39, label %50, label %40
40: ; preds = %31
%41 = load i32*, i32** %6
%42 = call i32 @free(i32* %41)
%43 = load i32*, i32** %7
%44 = call i32 @free(i32* %43)
%45 = load i32*, i32** %8
%46 = call i32 @free(i32* %45)
%47 = load i32*, i32** %9
%48 = call i32 @free(i32* %47)
%49 = load float, float* %12
br label %50
50: ; preds = %31, %28, %25, %22, %5, %40
%51 = phi float [ %49, %40 ], [ -1.000000e+00, %5 ], [ -1.000000e+00, %22 ], [ -1.000000e+00, %25 ], [ -1.000000e+00, %28 ], [ -1.000000e+00, %31 ]
ret float %51
}