// File: /workspace/github_cpp_makefile_star2_O2/simonrharris[P]SKA/src/sk_compare.cpp
// Function: compareKmerFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
int compareKmerFiles(const std::string & queryfile, const std::vector < std::string > & subjectfiles)
{

	// Create the kmer map
	std::unordered_map < std::string, char > kmerMap;

	//std::vector < std::string > sampleNames;
	//if (collectSampleNames(subjectfiles, sampleNames, false)!=0){return 1;}
	//int numSamples=sampleNames.size();
	//std::string emptySequence (numSamples , '-');
	

	int querykmersize;
	std::vector < std::string > querySampleNames;

	std::ifstream fileStream;

	if (openFileStream(queryfile, fileStream, false)){return 1;};		
		
	readKmerHeader(fileStream, querykmersize, querySampleNames);

	char base;
	char kmerbuffer[querykmersize*2/3];
	char asciibuffer[int(ceil(float(querySampleNames.size())/6))];
	while (fileStream.read(asciibuffer, sizeof(asciibuffer))){//read the ascii representation of the taxa
		std::string asciibits (asciibuffer, sizeof(asciibuffer));
		//std::vector < bool > mybits;
		//vectorbool_from_ascii(asciibits, mybits);//read the ascii representation of the taxa to a verctor of bools
		while (fileStream.peek()!='\n' && fileStream.get(base)){
			fileStream.read(kmerbuffer, sizeof(kmerbuffer));
			std::string kmer (kmerbuffer, querykmersize*2/3);
			
			std::unordered_map < std::string, char >::iterator it = kmerMap.find(kmer);//check if the kmer is in the hash
			if ( it != kmerMap.end() ){//if the kmer is in the hash
				it->second='N';
			}
			else {
				kmerMap.insert(std::make_pair(kmer, base));
			}
		}
		fileStream.ignore(256,'\n');//skip the end ofline character
	}
	querySampleNames.clear();
	fileStream.close();

	std::cout << "Subject\tKmers unique to Query\tKmers unique to Subject\tMatches\t% kmers in Query matching\t% kmers in Subject matching\tSNPs\t%ID of matching kmers\t%ID of Query kmers\t%ID of Subject kmers\tNs in Query\tNs in Subject\tNs in both" << std::endl;
	
	for (int s = 0; s < subjectfiles.size(); ++s){
		fileStream.open(subjectfiles[s], std::ios::in);
		if (fileStream.fail()) {
			std::cerr << "Failed to open " << subjectfiles[s] << std::endl << std::endl;
			return 1;
		}
		int subjectkmersize;
		std::vector < std::string > subjectSampleNames;
		
		try {
				int returnval = readKmerHeader(fileStream, subjectkmersize, subjectSampleNames);
			}
			catch (int e){
				std::cerr << "An exception occurred when reading file " << subjectfiles[s] << ". Please check the format. Exception Nr. " << e << std::endl;
				return 1;
			}
		if (subjectkmersize!=querykmersize){
			std::cout << subjectfiles[s] << " has different kmer size to query" << std::endl;
			return 1;
		}

		
		std::vector < int > kmerjustinsubject (subjectSampleNames.size(), 0);
		std::vector < int > snps (subjectSampleNames.size(), 0);
		std::vector < int > ninsubject (subjectSampleNames.size(), 0);
		std::vector < int > ninquery (subjectSampleNames.size(), 0);
		std::vector < int > ninboth (subjectSampleNames.size(), 0);
		std::vector < int > matches (subjectSampleNames.size(), 0);

		char base;
		char kmerbuffer[querykmersize*2/3];
		char asciibuffer[int(ceil(float(subjectSampleNames.size())/6))];

		while (fileStream.read(asciibuffer, sizeof(asciibuffer))){//read the ascii representation of the taxa
			std::string asciibits (asciibuffer, sizeof(asciibuffer));
			std::vector < bool > mybits;
			vectorbool_from_ascii(asciibits, mybits);//read the ascii representation of the taxa to a verctor of bools

			int nb=0;
			int nq=0;
			int ns=0;
			int m=0;
			int sn=0;
			int js=0;

			while (fileStream.peek()!='\n' && fileStream.get(base)){
				base=toupper(base);
				fileStream.read(kmerbuffer, sizeof(kmerbuffer));
				std::string kmer (kmerbuffer, querykmersize*2/3);

				std::unordered_map < std::string, char >::iterator it = kmerMap.find(kmer);//check if the kmer is in the hash
				if ( it != kmerMap.end() ){//if the kmer is in the hash
					if (it->second=='N' && base=='N'){
						nb++;
					}
					else if (it->second=='N'){
						nq++;
					}
					else if (base=='N'){
						ns++;
					}
					else if (it->second==base){
						m++;
					}
					else {
						sn++;
					}
				}
				else {
					js++;
				}
	    	}
	    	for (int i=0; i<subjectSampleNames.size(); ++i){ //add the base to all samples that are true in the bitset
				if (mybits[i]){
					ninboth[i]+=nb;
					ninquery[i]+=nq;
					ninsubject[i]+=ns;
					matches[i]+=m;
					snps[i]+=sn;
					kmerjustinsubject[i]+=js;
				}
			}
	    	fileStream.ignore(256,'\n');//skip the end ofline character
	    }
		fileStream.close();
		
		for (int i=0; i<subjectSampleNames.size(); ++i){

			int kmerjustinquery=kmerMap.size()-(matches[i]+snps[i]+ninquery[i]+ninboth[i]+ninsubject[i]);
			float percentmatchquery=float(matches[i]+snps[i]+ninquery[i]+ninboth[i])/(kmerjustinquery+matches[i]+snps[i]+ninquery[i]+ninboth[i])*100;
			float percentmatchsubject=float(matches[i]+snps[i]+ninsubject[i]+ninboth[i])/(kmerjustinsubject[i]+matches[i]+snps[i]+ninsubject[i]+ninboth[i])*100;
			float percentidofmatches=float(matches[i])/(matches[i]+snps[i])*100;
			float percentidofquery=(percentidofmatches*percentmatchquery)/100;
			float percentidofsubject=(percentidofmatches*percentmatchsubject)/100;
			
			std::cout << subjectSampleNames[i] << "\t" << kmerjustinquery << "\t" << kmerjustinsubject[i] << "\t" << (matches[i]+snps[i]+ninquery[i]+ninboth[i]+ninsubject[i]) << "\t" << percentmatchquery << "\t" << percentmatchsubject << "\t" << snps[i] << "\t" << percentidofmatches << "\t" << percentidofquery << "\t" << percentidofsubject << "\t" << ninquery[i] << "\t" << ninsubject[i] << "\t" << ninboth[i] << std::endl;

		}
	}
	return 0;
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rsi, -0x80(%rbp)
movq %rdi, %rbx
leaq -0x1d0(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movaps %xmm0, -0x120(%rbp)
andq $0x0, -0x110(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x5450
leaq -0x408(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x73fe
testl %eax, %eax
je 0xce40
pushq $0x1
popq %rbx
jmp 0xd861
leaq -0x408(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x832b
movq %rsp, -0x188(%rbp)
movl -0x3c(%rbp), %eax
addl %eax, %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
movl %eax, %ebx
leaq 0xf(%rbx), %rax
andq $-0x10, %rax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq -0x118(%rbp), %rax
subq -0x120(%rbp), %rax
sarq $0x5, %rax
js 0xce97
cvtsi2ss %rax, %xmm0
jmp 0xceac
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x187bc(%rip), %xmm0    # 0x25670
callq 0x5220
cvttss2si %xmm0, %ecx
leaq 0xf(%rcx), %rax
andq $-0x10, %rax
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
movq %rcx, -0x48(%rbp)
movq %rdx, -0x38(%rbp)
leaq (%rdx,%rcx), %rax
movq %rax, -0x50(%rbp)
leaq -0x408(%rbp), %r13
leaq -0xe8(%rbp), %r12
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x54c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xd011
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x7828
movq %r13, %rdi
callq 0x5140
cmpl $0xa, %eax
je 0xcff0
movq %r13, %rdi
leaq -0x2a(%rbp), %rsi
callq 0x5550
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xcff0
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x54c0
movl -0x3c(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movslq %eax, %rdx
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
addq %r14, %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x7828
leaq -0x200(%rbp), %rdi
movq %r12, %rsi
callq 0xdb18
testq %rax, %rax
je 0xcfb1
movb $0x4e, 0x28(%rax)
jmp 0xcfe3
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x5540
movb -0x2a(%rbp), %al
movb %al, -0xa8(%rbp)
leaq -0x200(%rbp), %rdi
movq %r15, %rsi
callq 0xdbe8
movq %r15, %rdi
callq 0x5778
movq %r12, %rdi
callq 0x5778
jmp 0xcf30
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
pushq $0xa
popq %rdx
callq 0x5260
leaq -0x108(%rbp), %rdi
callq 0x5778
jmp 0xceec
leaq -0x120(%rbp), %rdi
callq 0xbe96
leaq -0x408(%rbp), %rdi
callq 0x50a0
movq 0x28f88(%rip), %rdi     # 0x35fb8
leaq 0x187b4(%rip), %rsi     # 0x257eb
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
xorl %r15d, %r15d
leaq -0x108(%rbp), %rbx
movq -0x80(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %r14
subq %rsi, %r14
sarq $0x5, %r14
cmpq %r15, %r14
jbe 0xd852
movq %r15, -0x90(%rbp)
movq %r15, %r12
shlq $0x5, %r12
addq %r12, %rsi
leaq -0x408(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x5380
movq -0x408(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x3e8(%rbp,%rax)
jne 0xd7d7
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x408(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x832b
movl -0x9c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0xd815
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0xc8(%rbp), %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x180(%rbp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x168(%rbp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x150(%rbp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x138(%rbp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq -0x68(%rbp), %rsi
subq -0x70(%rbp), %rsi
sarq $0x5, %rsi
andl $0x0, -0xc8(%rbp)
leaq -0x1b0(%rbp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xbe22
movq %rsp, %rsi
movl -0x3c(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movq %rax, -0x78(%rbp)
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq -0x68(%rbp), %rax
subq -0x70(%rbp), %rax
sarq $0x5, %rax
movq %rsi, -0x190(%rbp)
js 0xd1f8
cvtsi2ss %rax, %xmm0
jmp 0xd20d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x1845b(%rip), %xmm0    # 0x25670
callq 0x5220
cvttss2si %xmm0, %ecx
leaq 0xf(%rcx), %rax
andq $-0x10, %rax
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
movq %rcx, -0x98(%rbp)
movq %rdx, -0x88(%rbp)
leaq (%rdx,%rcx), %rax
movq %rax, -0x198(%rbp)
leaq -0x408(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdx
callq 0x54c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xd485
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %r15
movq %r15, %rdi
movq -0x88(%rbp), %rsi
movq -0x198(%rbp), %rdx
callq 0x7828
andq $0x0, -0xc8(%rbp)
andl $0x0, -0xc0(%rbp)
andq $0x0, -0xb8(%rbp)
andl $0x0, -0xb0(%rbp)
andq $0x0, -0xa8(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x7bb6
xorl %r13d, %r13d
movl $0x0, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
xorl %r12d, %r12d
xorl %r14d, %r14d
leaq -0x408(%rbp), %rdi
callq 0x5140
cmpl $0xa, %eax
je 0xd3d9
leaq -0x408(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x5550
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xd3d9
movsbl -0x29(%rbp), %edi
callq 0x56f0
movb %al, -0x29(%rbp)
leaq -0x408(%rbp), %rdi
movq %rbx, %rsi
movq -0x78(%rbp), %rdx
callq 0x54c0
movl -0x3c(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movslq %eax, %rdx
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
addq %rbx, %rdx
leaq -0xe8(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7828
leaq -0x200(%rbp), %rdi
movq %r15, %rsi
callq 0xdb18
testq %rax, %rax
je 0xd3a4
movb 0x28(%rax), %al
movl %eax, %edx
xorb $0x4e, %dl
movb -0x29(%rbp), %cl
movl %ecx, %esi
xorb $0x4e, %sil
orb %dl, %sil
jne 0xd3a9
incl %r14d
jmp 0xd3c8
incl %r12d
jmp 0xd3c8
cmpb $0x4e, %al
jne 0xd3b2
incl %r13d
jmp 0xd3c8
cmpb $0x4e, %cl
jne 0xd3bc
incl -0x38(%rbp)
jmp 0xd3c8
cmpb %cl, %al
jne 0xd3c5
incl -0x48(%rbp)
jmp 0xd3c8
incl -0x50(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5778
jmp 0xd2ee
xorl %r15d, %r15d
movq -0x68(%rbp), %rax
subq -0x70(%rbp), %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0xd451
leaq -0xc8(%rbp), %rdi
movq %r15, %rsi
callq 0x903c
testq %rdx, (%rax)
je 0xd44c
movq -0x138(%rbp), %rax
addl %r14d, (%rax,%r15,4)
movq -0x150(%rbp), %rax
addl %r13d, (%rax,%r15,4)
movq -0x168(%rbp), %rax
movl -0x38(%rbp), %ecx
addl %ecx, (%rax,%r15,4)
movq -0x1b0(%rbp), %rax
movl -0x48(%rbp), %ecx
addl %ecx, (%rax,%r15,4)
movq -0x180(%rbp), %rax
movl -0x50(%rbp), %ecx
addl %ecx, (%rax,%r15,4)
movq -0x1c8(%rbp), %rax
addl %r12d, (%rax,%r15,4)
incq %r15
jmp 0xd3dc
movl $0x100, %esi            # imm = 0x100
leaq -0x408(%rbp), %rdi
pushq $0xa
popq %rdx
callq 0x5260
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
callq 0x908a
leaq -0x108(%rbp), %rdi
callq 0x5778
jmp 0xd248
leaq -0x408(%rbp), %rdi
callq 0x50a0
xorl %ecx, %ecx
xorl %edx, %edx
leaq -0x108(%rbp), %rbx
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rdx, %rax
jbe 0xd770
movl -0x1e8(%rbp), %ebx
movq -0x1b0(%rbp), %rax
movl (%rax,%rdx,4), %edi
movq -0x180(%rbp), %rax
movl (%rax,%rdx,4), %r8d
movl %edi, -0x88(%rbp)
addl %edi, %r8d
movq -0x150(%rbp), %rax
movl (%rax,%rdx,4), %r15d
movq -0x138(%rbp), %rax
movl (%rax,%rdx,4), %eax
movq %r8, -0x48(%rbp)
movq %rax, -0x50(%rbp)
leal (%rax,%r8), %r12d
movq -0x168(%rbp), %rax
movl (%rax,%rdx,4), %r13d
leal (%r12,%r13), %edi
movq -0x1c8(%rbp), %rax
movq %rdx, -0x38(%rbp)
movl (%rax,%rdx,4), %r14d
movl %edi, -0x78(%rbp)
addl %edi, %r14d
movq %rcx, -0x98(%rbp)
addq %rcx, %rsi
movq 0x28a8a(%rip), %rdi     # 0x35fb8
callq 0x53a0
movq %rax, %rdi
leaq 0x18d84(%rip), %rsi     # 0x262c1
callq 0x53f0
addl %r15d, %r12d
addl %r12d, %r13d
subl %r13d, %ebx
movq %rax, %rdi
movl %ebx, %esi
callq 0x56a0
movq %rax, %rdi
leaq 0x18d62(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x1c8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
leaq 0x18d3d(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x1b0(%rbp), %rcx
movq -0x180(%rbp), %rdx
movq -0x38(%rbp), %rdi
movl (%rdx,%rdi,4), %esi
addl (%rcx,%rdi,4), %esi
movq -0x150(%rbp), %rcx
addl (%rcx,%rdi,4), %esi
movq -0x138(%rbp), %rcx
addl (%rcx,%rdi,4), %esi
movq -0x168(%rbp), %rcx
addl (%rcx,%rdi,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
leaq 0x18cf0(%rip), %rsi     # 0x262c1
callq 0x53f0
cvtsi2ss %r12d, %xmm0
addl -0x50(%rbp), %r15d
addl -0x48(%rbp), %r15d
addl %ebx, %r15d
cvtsi2ss %r15d, %xmm1
divss %xmm1, %xmm0
mulss 0x18075(%rip), %xmm0    # 0x2566c
movq %rax, %rdi
movss %xmm0, -0x50(%rbp)
callq 0x5300
movq %rax, %rdi
leaq 0x18cb3(%rip), %rsi     # 0x262c1
callq 0x53f0
cvtsi2ssl -0x78(%rbp), %xmm0
cvtsi2ss %r14d, %xmm1
divss %xmm1, %xmm0
mulss 0x18043(%rip), %xmm0    # 0x2566c
movq %rax, %rdi
movss %xmm0, -0x78(%rbp)
callq 0x5300
movq %rax, %rdi
leaq 0x18c81(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x180(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
leaq 0x18c5c(%rip), %rsi     # 0x262c1
callq 0x53f0
cvtsi2ssl -0x88(%rbp), %xmm0
cvtsi2ssl -0x48(%rbp), %xmm1
divss %xmm1, %xmm0
mulss 0x17fe9(%rip), %xmm0    # 0x2566c
movq %rax, %rdi
movss %xmm0, -0x48(%rbp)
callq 0x5300
movq %rax, %rdi
leaq 0x18c27(%rip), %rsi     # 0x262c1
callq 0x53f0
movss -0x50(%rbp), %xmm0
mulss -0x48(%rbp), %xmm0
divss 0x17fbb(%rip), %xmm0    # 0x2566c
movq %rax, %rdi
callq 0x5300
movq %rax, %rdi
leaq 0x18bfe(%rip), %rsi     # 0x262c1
callq 0x53f0
movss -0x48(%rbp), %xmm0
mulss -0x78(%rbp), %xmm0
divss 0x17f92(%rip), %xmm0    # 0x2566c
movq %rax, %rdi
callq 0x5300
movq %rax, %rdi
leaq 0x18bd5(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x150(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
leaq 0x18bb0(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x168(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
leaq 0x18b8b(%rip), %rsi     # 0x262c1
callq 0x53f0
movq -0x138(%rbp), %rcx
movq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x56a0
movq %rax, %rdi
callq 0x51c0
movq -0x38(%rbp), %rdx
incq %rdx
movq -0x98(%rbp), %rcx
addq $0x20, %rcx
jmp 0xd495
movq -0x190(%rbp), %rsp
leaq -0x1b0(%rbp), %rdi
callq 0xc052
leaq -0x138(%rbp), %rdi
callq 0xc052
leaq -0x150(%rbp), %rdi
callq 0xc052
leaq -0x168(%rbp), %rdi
callq 0xc052
leaq -0x180(%rbp), %rdi
callq 0xc052
leaq -0x1c8(%rbp), %rdi
callq 0xc052
leaq -0x70(%rbp), %rdi
callq 0x911e
movq -0x90(%rbp), %r15
incq %r15
jmp 0xd04e
movq 0x28812(%rip), %rdi     # 0x35ff0
leaq 0x17c42(%rip), %rsi     # 0x25427
callq 0x53f0
movq -0x90(%rbp), %r15
movq -0x80(%rbp), %rcx
addq (%rcx), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x53a0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
jmp 0xd852
movq -0x80(%rbp), %rax
addq (%rax), %r12
movq 0x28795(%rip), %rdi     # 0x35fb8
movq %r12, %rsi
callq 0x53a0
leaq 0x180e8(%rip), %rsi     # 0x2591a
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
leaq -0x70(%rbp), %rdi
callq 0x911e
movq -0x90(%rbp), %r15
xorl %ebx, %ebx
cmpq %r15, %r14
seta %bl
movq -0x188(%rbp), %rsp
leaq -0x408(%rbp), %rdi
callq 0x50e0
leaq -0x120(%rbp), %rdi
callq 0x911e
leaq -0x200(%rbp), %rdi
callq 0xda5a
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd8cc
jmp 0xd95d
movq %rax, %rbx
jmp 0xda39
jmp 0xd95d
jmp 0xd95d
jmp 0xd9ba
movq %rax, %rbx
jmp 0xda00
movq %rax, %rbx
jmp 0xda18
movq %rax, %rbx
jmp 0xd9f4
movq %rax, %rbx
jmp 0xda24
movq %rax, %rbx
jmp 0xda0c
movq %rax, %rbx
jmp 0xd9e8
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xda24
movq %rbx, %rdi
callq 0x5170
movl (%rax), %ebx
movq 0x286ef(%rip), %rdi     # 0x35ff0
leaq 0x17fbf(%rip), %rsi     # 0x258c7
callq 0x53f0
movq -0x80(%rbp), %rcx
addq (%rcx), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x53a0
leaq 0x17fca(%rip), %rsi     # 0x258f0
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x56a0
movq %rax, %rdi
callq 0x51c0
callq 0x5640
jmp 0xd842
movq %rax, %rbx
callq 0x5640
jmp 0xda24
jmp 0xd95d
jmp 0xd993
jmp 0xd95d
movq %rax, %rbx
jmp 0xda2d
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x5778
jmp 0xd983
jmp 0xd980
jmp 0xd9c1
jmp 0xd9ba
jmp 0xd9c1
jmp 0xd9ba
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x5778
jmp 0xd996
jmp 0xd993
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x5778
jmp 0xda2d
jmp 0xd9c1
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x5778
jmp 0xd9c4
movq %rax, %rbx
jmp 0xd9dc
jmp 0xd9c1
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x908a
leaq -0x108(%rbp), %rdi
callq 0x5778
leaq -0x1b0(%rbp), %rdi
callq 0xc052
leaq -0x138(%rbp), %rdi
callq 0xc052
leaq -0x150(%rbp), %rdi
callq 0xc052
leaq -0x168(%rbp), %rdi
callq 0xc052
leaq -0x180(%rbp), %rdi
callq 0xc052
leaq -0x1c8(%rbp), %rdi
callq 0xc052
leaq -0x70(%rbp), %rdi
callq 0x911e
leaq -0x408(%rbp), %rdi
callq 0x50e0
leaq -0x120(%rbp), %rdi
callq 0x911e
leaq -0x200(%rbp), %rdi
callq 0xda5a
movq %rbx, %rdi
callq 0x56c0
nop