// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::compareGroundTruth()
dnacnt_t Genome::compareGroundTruth() {

	if(haplotypes.size()<=0){
		return -1;
	}

	
	auto lowest = this->compareGroundTruth(haplotypes[0], file.groundTruth[0]);
	for(unsigned i = 1; i<haplotypes.size();i++){
		lowest += this->compareGroundTruth(haplotypes[i], file.groundTruth[i]);
	}
	vector<int> a(haplotypes.size());
	for(unsigned i =0;i<haplotypes.size();i++){
		a[i] = i;
	}

	do{
		auto temp = this->compareGroundTruth(haplotypes[0], file.groundTruth[a[0]]);
		for(unsigned i = 1; i<haplotypes.size();i++){
			temp += this->compareGroundTruth(haplotypes[i], file.groundTruth[a[i]]);
		}

		if(lowest > temp){
			lowest = temp;
		}
	}while(next_permutation(a.begin(), a.end()));


	return lowest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x78(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
cmpq $0x0, %rax
ja 0x4cc6
movq $-0x1, -0x8(%rbp)
jmp 0x5018
movq -0x78(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
xorl %eax, %eax
movl %eax, %esi
callq 0x5b10
movq -0x78(%rbp), %rdi
movq %rax, -0x80(%rbp)
addq $0x2380, %rdi           # imm = 0x2380
addq $0x88, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6090
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0x53c0
movq %rax, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x78(%rbp), %rdi
movl -0x1c(%rbp), %eax
movq %rax, -0x88(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x4d9e
movq -0x78(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x5b10
movq -0x78(%rbp), %rdi
movq %rax, -0x90(%rbp)
addq $0x2380, %rdi           # imm = 0x2380
addq $0x88, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x6090
movq -0x78(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0x53c0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4d14
movq -0x78(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, -0xa0(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x60b0
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x60d0
jmp 0x4dde
leaq -0x39(%rbp), %rdi
callq 0x6140
movl $0x0, -0x50(%rbp)
movq -0x78(%rbp), %rdi
movl -0x50(%rbp), %eax
movq %rax, -0xa8(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x4e5b
movl -0x50(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x6160
movl -0xac(%rbp), %ecx
movl %ecx, (%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x4dee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x6140
jmp 0x5025
jmp 0x4e5d
movq -0x78(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0xd0(%rbp)
callq 0x5b10
movq -0xd0(%rbp), %rsi
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0xc0(%rbp)
addq $0x2408, %rax           # imm = 0x2408
movq %rax, -0xc8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6160
movq -0xc8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x6090
movq -0x78(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq %rax, %rdx
callq 0x53c0
movq %rax, -0xb8(%rbp)
jmp 0x4ece
movq -0xb8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x1, -0x5c(%rbp)
movq -0x78(%rbp), %rdi
movl -0x5c(%rbp), %eax
movq %rax, -0xd8(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x4faa
movq -0x78(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movl -0x5c(%rbp), %eax
movl %eax, %esi
callq 0x5b10
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0xe8(%rbp)
addq $0x2408, %rax           # imm = 0x2408
movq %rax, -0xf0(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x6160
movq -0xf0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x6090
movq -0x78(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
callq 0x53c0
movq %rax, -0xe0(%rbp)
jmp 0x4f76
movq -0xe0(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4ee0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6220
jmp 0x5025
movq -0x18(%rbp), %rax
cmpq -0x58(%rbp), %rax
jbe 0x4fbc
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x4fbe
leaq -0x38(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x61c0
movq -0x100(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x61f0
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x6180
movb %al, -0xf1(%rbp)
jmp 0x4ff7
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x4e5d
jmp 0x5007
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6220
movq -0x8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2410
nop