// File: simonrharris[P]SKA/src/sk_summary.cpp
// Function: summariseKmerFiles(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 summariseKmerFiles(const std::vector < std::string > & kmerfiles)
{
	int kmersize;
	std::vector < std::string > fileSampleNames;
	std::ifstream fileStream;
	
	std::vector < char > baseorder = { 'A', 'C', 'G', 'T', 'N', 'O'};
	std::cout << "Sample\tKmer size\tTotal kmers\tAs\tCs\tGs\tTs\tNs\tOthers\tGC Content" << std::endl;
	for (int s = 0; s < kmerfiles.size(); ++s){
		
		if (openFileStream(kmerfiles[s], fileStream, false)){return 1;};
		
		readKmerHeader(fileStream, kmersize, fileSampleNames);

		std::map < char, std::vector < int > > basecounts{ {'A', std::vector < int > (fileSampleNames.size(), 0)}, {'C', std::vector < int > (fileSampleNames.size(), 0)}, {'G', std::vector < int > (fileSampleNames.size(), 0)}, {'T', std::vector < int > (fileSampleNames.size(), 0)}, {'N', std::vector < int > (fileSampleNames.size(), 0)}, {'O', std::vector < int > (fileSampleNames.size(), 0)}};

		std::vector < int > kmers(fileSampleNames.size(), 0);
		
		char base;
		char kmerbuffer[kmersize*2/3];
		char asciibuffer[int(ceil(float(fileSampleNames.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 vector of bools

			while (fileStream.peek()!='\n' && fileStream.get(base)){
				base=toupper(base);
				fileStream.read(kmerbuffer, sizeof(kmerbuffer));
				std::string kmer (kmerbuffer, kmersize*2/3);
				
				for (int i=0; i<fileSampleNames.size(); ++i){ //add the kmer count to all samples that are true in the bitset
					if (mybits[i]){
						kmers[i]++;
						std::map < char, std::vector < int > >::iterator it = basecounts.find(base);//check if the kmer is in the map
						if ( it != basecounts.end() ){//if the kmer is in the map
							it->second[i]++;//increment the count for the base
						}
						else {//if the kmer isn't in the map
							basecounts['O'][i]++;//increment the count for other
						}
					}
				}
			}
			fileStream.ignore(256,'\n');//skip the end ofline character
    	}
		fileStream.close();
		
		for (int i=0; i<fileSampleNames.size(); ++i){ //print the results	
			std::cout << fileSampleNames[i] << "\t" << kmersize << "\t" << kmers[i] << "\t";
			for (std::vector < char >::iterator it=baseorder.begin(); it!=baseorder.end(); ++it){
				std::cout << basecounts[*it][i] << "\t";
			}
			float gccontent=(float(basecounts['C'][i])+float(basecounts['G'][i]))/(float(basecounts['A'][i])+float(basecounts['C'][i])+float(basecounts['G'][i])+float(basecounts['T'][i]));
			std::cout << gccontent << std::endl;
		}
    	fileSampleNames.clear();
	}

	return 0;
		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x780, %rsp            # imm = 0x780
movq %rdi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1ab40
leaq -0x238(%rbp), %rdi
callq 0x65f0
jmp 0x3a266
movb $0x41, -0x276(%rbp)
movb $0x43, -0x275(%rbp)
movb $0x47, -0x274(%rbp)
movb $0x54, -0x273(%rbp)
movb $0x4e, -0x272(%rbp)
movb $0x4f, -0x271(%rbp)
leaq -0x276(%rbp), %rax
movq %rax, -0x270(%rbp)
movq $0x6, -0x268(%rbp)
leaq -0x277(%rbp), %rdi
movq %rdi, -0x550(%rbp)
callq 0x6910
movq -0x550(%rbp), %rcx
movq -0x270(%rbp), %rsi
movq -0x268(%rbp), %rdx
leaq -0x260(%rbp), %rdi
callq 0x3b510
jmp 0x3a2df
leaq -0x277(%rbp), %rdi
callq 0x65a0
movq 0x3ecb6(%rip), %rdi     # 0x78fa8
leaq 0x2015e(%rip), %rsi     # 0x5a457
callq 0x6520
movq %rax, -0x558(%rbp)
jmp 0x3a307
movq -0x558(%rbp), %rdi
movq 0x3ec7b(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x3a31c
movl $0x0, -0x27c(%rbp)
movslq -0x27c(%rbp), %rax
movq %rax, -0x560(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb670
movq %rax, %rcx
movq -0x560(%rbp), %rax
cmpq %rcx, %rax
jae 0x3b49a
movq -0x10(%rbp), %rdi
movslq -0x27c(%rbp), %rsi
callq 0xf2d0
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
xorl %edx, %edx
callq 0xa4f0
movl %eax, -0x564(%rbp)
jmp 0x3a379
movl -0x564(%rbp), %eax
cmpl $0x0, %eax
je 0x3a3eb
movl $0x1, -0x4(%rbp)
movl $0x1, -0x280(%rbp)
jmp 0x3b4ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3b4ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x277(%rbp), %rdi
callq 0x65a0
jmp 0x3b4e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3b4d4
leaq -0x238(%rbp), %rdi
leaq -0x14(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xcd40
jmp 0x3a401
movb $0x1, -0x44e(%rbp)
leaq -0x380(%rbp), %rax
movq %rax, -0x388(%rbp)
movb $0x41, -0x389(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x578(%rbp)
movl $0x0, -0x3ac(%rbp)
leaq -0x3ad(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x1a8f0
movq -0x578(%rbp), %rsi
movq -0x570(%rbp), %rcx
leaq -0x3a8(%rbp), %rdi
leaq -0x3ac(%rbp), %rdx
callq 0x1a910
jmp 0x3a46d
leaq -0x380(%rbp), %rdi
leaq -0x389(%rbp), %rsi
leaq -0x3a8(%rbp), %rdx
callq 0x3b590
jmp 0x3a489
leaq -0x360(%rbp), %rax
movq %rax, -0x590(%rbp)
movq %rax, -0x388(%rbp)
movb $0x43, -0x3ae(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x588(%rbp)
movl $0x0, -0x3cc(%rbp)
leaq -0x3cd(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x1a8f0
movq -0x588(%rbp), %rsi
movq -0x580(%rbp), %rcx
leaq -0x3c8(%rbp), %rdi
leaq -0x3cc(%rbp), %rdx
callq 0x1a910
jmp 0x3a4f5
movq -0x590(%rbp), %rdi
leaq -0x3ae(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
callq 0x3b590
jmp 0x3a511
leaq -0x340(%rbp), %rax
movq %rax, -0x5a8(%rbp)
movq %rax, -0x388(%rbp)
movb $0x47, -0x3ce(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x5a0(%rbp)
movl $0x0, -0x3ec(%rbp)
leaq -0x3ed(%rbp), %rdi
movq %rdi, -0x598(%rbp)
callq 0x1a8f0
movq -0x5a0(%rbp), %rsi
movq -0x598(%rbp), %rcx
leaq -0x3e8(%rbp), %rdi
leaq -0x3ec(%rbp), %rdx
callq 0x1a910
jmp 0x3a57d
movq -0x5a8(%rbp), %rdi
leaq -0x3ce(%rbp), %rsi
leaq -0x3e8(%rbp), %rdx
callq 0x3b590
jmp 0x3a599
leaq -0x320(%rbp), %rax
movq %rax, -0x5c0(%rbp)
movq %rax, -0x388(%rbp)
movb $0x54, -0x3ee(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x5b8(%rbp)
movl $0x0, -0x40c(%rbp)
leaq -0x40d(%rbp), %rdi
movq %rdi, -0x5b0(%rbp)
callq 0x1a8f0
movq -0x5b8(%rbp), %rsi
movq -0x5b0(%rbp), %rcx
leaq -0x408(%rbp), %rdi
leaq -0x40c(%rbp), %rdx
callq 0x1a910
jmp 0x3a605
movq -0x5c0(%rbp), %rdi
leaq -0x3ee(%rbp), %rsi
leaq -0x408(%rbp), %rdx
callq 0x3b590
jmp 0x3a621
leaq -0x300(%rbp), %rax
movq %rax, -0x5d8(%rbp)
movq %rax, -0x388(%rbp)
movb $0x4e, -0x40e(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x5d0(%rbp)
movl $0x0, -0x42c(%rbp)
leaq -0x42d(%rbp), %rdi
movq %rdi, -0x5c8(%rbp)
callq 0x1a8f0
movq -0x5d0(%rbp), %rsi
movq -0x5c8(%rbp), %rcx
leaq -0x428(%rbp), %rdi
leaq -0x42c(%rbp), %rdx
callq 0x1a910
jmp 0x3a68d
movq -0x5d8(%rbp), %rdi
leaq -0x40e(%rbp), %rsi
leaq -0x428(%rbp), %rdx
callq 0x3b590
jmp 0x3a6a9
leaq -0x2e0(%rbp), %rax
movq %rax, -0x5f0(%rbp)
movq %rax, -0x388(%rbp)
movb $0x4f, -0x42e(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x5e8(%rbp)
movl $0x0, -0x44c(%rbp)
leaq -0x44d(%rbp), %rdi
movq %rdi, -0x5e0(%rbp)
callq 0x1a8f0
movq -0x5e8(%rbp), %rsi
movq -0x5e0(%rbp), %rcx
leaq -0x448(%rbp), %rdi
leaq -0x44c(%rbp), %rdx
callq 0x1a910
jmp 0x3a715
movq -0x5f0(%rbp), %rdi
leaq -0x42e(%rbp), %rsi
leaq -0x448(%rbp), %rdx
callq 0x3b590
jmp 0x3a731
movb $0x0, -0x44e(%rbp)
leaq -0x380(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq $0x6, -0x2b8(%rbp)
leaq -0x450(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x3b5d0
movq -0x5f8(%rbp), %r8
movq -0x2c0(%rbp), %rsi
movq -0x2b8(%rbp), %rdx
leaq -0x2b0(%rbp), %rdi
leaq -0x44f(%rbp), %rcx
callq 0x3b5f0
jmp 0x3a78e
leaq -0x450(%rbp), %rdi
callq 0x3b6c0
leaq -0x380(%rbp), %rax
movq %rax, -0x608(%rbp)
addq $0xc0, %rax
movq %rax, -0x600(%rbp)
movq -0x600(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x610(%rbp)
callq 0x3b6e0
movq -0x608(%rbp), %rcx
movq -0x610(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x600(%rbp)
jne 0x3a7b5
leaq -0x448(%rbp), %rdi
callq 0x1aa00
leaq -0x44d(%rbp), %rdi
callq 0x1a990
leaq -0x428(%rbp), %rdi
callq 0x1aa00
leaq -0x42d(%rbp), %rdi
callq 0x1a990
leaq -0x408(%rbp), %rdi
callq 0x1aa00
leaq -0x40d(%rbp), %rdi
callq 0x1a990
leaq -0x3e8(%rbp), %rdi
callq 0x1aa00
leaq -0x3ed(%rbp), %rdi
callq 0x1a990
leaq -0x3c8(%rbp), %rdi
callq 0x1aa00
leaq -0x3cd(%rbp), %rdi
callq 0x1a990
leaq -0x3a8(%rbp), %rdi
callq 0x1aa00
leaq -0x3ad(%rbp), %rdi
callq 0x1a990
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, -0x620(%rbp)
movl $0x0, -0x46c(%rbp)
leaq -0x46d(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0x1a8f0
movq -0x620(%rbp), %rsi
movq -0x618(%rbp), %rcx
leaq -0x468(%rbp), %rdi
leaq -0x46c(%rbp), %rdx
callq 0x1a910
jmp 0x3a8c6
leaq -0x46d(%rbp), %rdi
callq 0x1a990
movl -0x14(%rbp), %eax
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
movq %rax, -0x638(%rbp)
movq %rsp, %rcx
movq %rcx, -0x478(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x630(%rbp)
movq %rcx, %rsp
movq %rax, -0x480(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x628(%rbp)
testq %rax, %rax
movss %xmm0, -0x624(%rbp)
js 0x3a96a
movss -0x628(%rbp), %xmm0
movss %xmm0, -0x624(%rbp)
movss -0x624(%rbp), %xmm0
movss 0x1ed02(%rip), %xmm1    # 0x5967c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x60b0
cvttsd2si %xmm0, %eax
movq %rax, -0x648(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x640(%rbp)
movq %rcx, %rsp
movq %rax, -0x488(%rbp)
movq -0x648(%rbp), %rdx
movq -0x640(%rbp), %rsi
leaq -0x238(%rbp), %rdi
callq 0x6680
movq %rax, -0x650(%rbp)
jmp 0x3a9d7
movq -0x650(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6670
movb %al, -0x651(%rbp)
jmp 0x3a9f5
movb -0x651(%rbp), %al
testb $0x1, %al
jne 0x3aa04
jmp 0x3b083
leaq -0x4a9(%rbp), %rdi
movq %rdi, -0x660(%rbp)
callq 0x6910
movq -0x640(%rbp), %rsi
movq -0x648(%rbp), %rdx
movq -0x660(%rbp), %rcx
leaq -0x4a8(%rbp), %rdi
callq 0x65e0
jmp 0x3aa3a
leaq -0x4a9(%rbp), %rdi
callq 0x65a0
leaq -0x4d8(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0x1acc0
movq -0x668(%rbp), %rsi
leaq -0x4a8(%rbp), %rdi
callq 0xbd50
jmp 0x3aa6e
jmp 0x3aa70
leaq -0x238(%rbp), %rdi
callq 0x61c0
movl %eax, -0x66c(%rbp)
jmp 0x3aa84
movl -0x66c(%rbp), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x66d(%rbp)
je 0x3aadf
leaq -0x238(%rbp), %rdi
leaq -0x46e(%rbp), %rsi
callq 0x6720
movq %rax, -0x678(%rbp)
jmp 0x3aab3
movq -0x678(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6670
movb %al, -0x679(%rbp)
jmp 0x3aad1
movb -0x679(%rbp), %al
movb %al, -0x66d(%rbp)
jmp 0x3aadf
movb -0x66d(%rbp), %al
testb $0x1, %al
jne 0x3aaee
jmp 0x3b031
movsbl -0x46e(%rbp), %edi
callq 0x6a20
movq -0x630(%rbp), %rsi
movq -0x638(%rbp), %rdx
movb %al, -0x46e(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x6680
jmp 0x3ab1c
movl -0x14(%rbp), %eax
addl %eax, %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
cltq
movq %rax, -0x690(%rbp)
leaq -0x4f9(%rbp), %rdi
movq %rdi, -0x688(%rbp)
callq 0x6910
movq -0x630(%rbp), %rsi
movq -0x690(%rbp), %rdx
movq -0x688(%rbp), %rcx
leaq -0x4f8(%rbp), %rdi
callq 0x65e0
jmp 0x3ab76
leaq -0x4f9(%rbp), %rdi
callq 0x65a0
movl $0x0, -0x500(%rbp)
movslq -0x500(%rbp), %rax
movq %rax, -0x698(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, %rcx
movq -0x698(%rbp), %rax
cmpq %rcx, %rax
jae 0x3b020
movslq -0x500(%rbp), %rsi
leaq -0x4d8(%rbp), %rdi
callq 0xedc0
movq %rdx, -0x6a8(%rbp)
movq %rax, -0x6a0(%rbp)
jmp 0x3abd9
movq -0x6a8(%rbp), %rax
movq -0x6a0(%rbp), %rcx
movq %rcx, -0x510(%rbp)
movq %rax, -0x508(%rbp)
leaq -0x510(%rbp), %rdi
callq 0xf510
testb $0x1, %al
jne 0x3ac0a
jmp 0x3b00a
movslq -0x500(%rbp), %rsi
leaq -0x468(%rbp), %rdi
callq 0x1a9b0
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0x2b0(%rbp), %rdi
leaq -0x46e(%rbp), %rsi
callq 0x3b700
movq %rax, -0x6b0(%rbp)
jmp 0x3ac3f
movq -0x6b0(%rbp), %rax
movq %rax, -0x518(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x3b760
movq %rax, -0x520(%rbp)
leaq -0x518(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x3b730
testb $0x1, %al
jne 0x3ac7c
jmp 0x3afcb
leaq -0x518(%rbp), %rdi
callq 0x3b790
movq %rax, %rdi
addq $0x8, %rdi
movslq -0x500(%rbp), %rsi
callq 0x1a9b0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3b008
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3aea8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3ae24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x3b6c0
leaq -0x380(%rbp), %rax
movq %rax, -0x6c0(%rbp)
addq $0xc0, %rax
movq %rax, -0x6b8(%rbp)
movq -0x6b8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x6c8(%rbp)
callq 0x3b6e0
movq -0x6c0(%rbp), %rcx
movq -0x6c8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x6b8(%rbp)
jne 0x3adf1
jmp 0x3ae24
leaq -0x448(%rbp), %rdi
callq 0x1aa00
leaq -0x44d(%rbp), %rdi
callq 0x1a990
leaq -0x428(%rbp), %rdi
callq 0x1aa00
leaq -0x42d(%rbp), %rdi
callq 0x1a990
leaq -0x408(%rbp), %rdi
callq 0x1aa00
leaq -0x40d(%rbp), %rdi
callq 0x1a990
leaq -0x3e8(%rbp), %rdi
callq 0x1aa00
leaq -0x3ed(%rbp), %rdi
callq 0x1a990
leaq -0x3c8(%rbp), %rdi
callq 0x1aa00
leaq -0x3cd(%rbp), %rdi
callq 0x1a990
leaq -0x3a8(%rbp), %rdi
callq 0x1aa00
leaq -0x3ad(%rbp), %rdi
callq 0x1a990
testb $0x1, -0x44e(%rbp)
jne 0x3aebf
jmp 0x3af0c
movq -0x388(%rbp), %rax
leaq -0x380(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x6d0(%rbp)
je 0x3af0a
movq -0x6d0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x6d8(%rbp)
callq 0x3b6e0
movq -0x6d8(%rbp), %rax
leaq -0x380(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x6d0(%rbp)
jne 0x3aed9
jmp 0x3af0c
jmp 0x3b4d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x46d(%rbp), %rdi
callq 0x1a990
jmp 0x3b48c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3b480
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x4a9(%rbp), %rdi
callq 0x65a0
jmp 0x3b480
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3b066
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x4f9(%rbp), %rdi
callq 0x65a0
jmp 0x3b066
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x4f8(%rbp), %rdi
callq 0x6a08
jmp 0x3b066
movb $0x4f, -0x521(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x521(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x6e0(%rbp)
jmp 0x3afee
movq -0x6e0(%rbp), %rdi
movslq -0x500(%rbp), %rsi
callq 0x1a9b0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x3b00a
jmp 0x3b00c
movl -0x500(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x500(%rbp)
jmp 0x3ab8c
leaq -0x4f8(%rbp), %rdi
callq 0x6a08
jmp 0x3aa70
leaq -0x238(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
movl $0xa, %edx
callq 0x6340
jmp 0x3b049
leaq -0x4d8(%rbp), %rdi
callq 0xf720
leaq -0x4a8(%rbp), %rdi
callq 0x6a08
jmp 0x3a9b4
leaq -0x4d8(%rbp), %rdi
callq 0xf720
leaq -0x4a8(%rbp), %rdi
callq 0x6a08
jmp 0x3b480
leaq -0x238(%rbp), %rdi
callq 0x60f0
jmp 0x3b091
movl $0x0, -0x528(%rbp)
movslq -0x528(%rbp), %rax
movq %rax, -0x6e8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb670
movq %rax, %rcx
movq -0x6e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x3b441
movslq -0x528(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x1ab60
movq %rax, %rsi
movq 0x3dec9(%rip), %rdi     # 0x78fa8
callq 0x64d0
movq %rax, -0x6f0(%rbp)
jmp 0x3b0ed
movq -0x6f0(%rbp), %rdi
leaq 0x1f1b6(%rip), %rsi     # 0x5a2b1
callq 0x6520
movq %rax, -0x6f8(%rbp)
jmp 0x3b109
movq -0x6f8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x68d0
movq %rax, -0x700(%rbp)
jmp 0x3b121
movq -0x700(%rbp), %rdi
leaq 0x1f182(%rip), %rsi     # 0x5a2b1
callq 0x6520
movq %rax, -0x708(%rbp)
jmp 0x3b13d
movslq -0x528(%rbp), %rsi
leaq -0x468(%rbp), %rdi
callq 0x1a9b0
movq -0x708(%rbp), %rdi
movl (%rax), %esi
callq 0x68d0
movq %rax, -0x710(%rbp)
jmp 0x3b167
movq -0x710(%rbp), %rdi
leaq 0x1f13c(%rip), %rsi     # 0x5a2b1
callq 0x6520
jmp 0x3b17c
leaq -0x260(%rbp), %rdi
callq 0x2e5d0
movq %rax, -0x530(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x2e640
movq %rax, -0x538(%rbp)
leaq -0x530(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x2e600
testb $0x1, %al
jne 0x3b1bb
jmp 0x3b231
leaq -0x530(%rbp), %rdi
callq 0x2e670
movq %rax, %rsi
leaq -0x2b0(%rbp), %rdi
callq 0x3b890
movq %rax, -0x718(%rbp)
jmp 0x3b1df
movq -0x718(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
movl (%rax), %esi
movq 0x3ddad(%rip), %rdi     # 0x78fa8
callq 0x68d0
movq %rax, -0x720(%rbp)
jmp 0x3b209
movq -0x720(%rbp), %rdi
leaq 0x1f09a(%rip), %rsi     # 0x5a2b1
callq 0x6520
jmp 0x3b21e
jmp 0x3b220
leaq -0x530(%rbp), %rdi
callq 0x2e690
jmp 0x3b18f
movb $0x43, -0x53d(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x53d(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x728(%rbp)
jmp 0x3b254
movq -0x728(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x734(%rbp)
movb $0x47, -0x53e(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x53e(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x730(%rbp)
jmp 0x3b296
movq -0x730(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
movss -0x734(%rbp), %xmm0
cvtsi2ssl (%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x744(%rbp)
movb $0x41, -0x53f(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x53f(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x740(%rbp)
jmp 0x3b2e4
movq -0x740(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x754(%rbp)
movb $0x43, -0x540(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x750(%rbp)
jmp 0x3b326
movq -0x750(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
movss -0x754(%rbp), %xmm0
cvtsi2ssl (%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x764(%rbp)
movb $0x47, -0x541(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x541(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x760(%rbp)
jmp 0x3b374
movq -0x760(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
movss -0x764(%rbp), %xmm0
cvtsi2ssl (%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x774(%rbp)
movb $0x54, -0x542(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x542(%rbp), %rsi
callq 0x3b7b0
movq %rax, -0x770(%rbp)
jmp 0x3b3c2
movq -0x770(%rbp), %rdi
movslq -0x528(%rbp), %rsi
callq 0x1a9b0
movss -0x774(%rbp), %xmm1
movss -0x744(%rbp), %xmm0
cvtsi2ssl (%rax), %xmm2
addss %xmm2, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x53c(%rbp)
movss -0x53c(%rbp), %xmm0
movq 0x3dba0(%rip), %rdi     # 0x78fa8
callq 0x63f0
movq %rax, -0x780(%rbp)
jmp 0x3b416
movq -0x780(%rbp), %rdi
movq 0x3db6c(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x3b42b
jmp 0x3b42d
movl -0x528(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x528(%rbp)
jmp 0x3b09b
leaq -0x30(%rbp), %rdi
callq 0x1aca0
movq -0x478(%rbp), %rax
movq %rax, %rsp
leaq -0x468(%rbp), %rdi
callq 0x1aa00
leaq -0x2b0(%rbp), %rdi
callq 0x3b970
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
jmp 0x3a326
leaq -0x468(%rbp), %rdi
callq 0x1aa00
leaq -0x2b0(%rbp), %rdi
callq 0x3b970
jmp 0x3b4d4
movl $0x0, -0x4(%rbp)
movl $0x1, -0x280(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x2e6d0
leaq -0x238(%rbp), %rdi
callq 0x6140
leaq -0x30(%rbp), %rdi
callq 0xfe90
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
leaq -0x260(%rbp), %rdi
callq 0x2e6d0
leaq -0x238(%rbp), %rdi
callq 0x6140
leaq -0x30(%rbp), %rdi
callq 0xfe90
movq -0x240(%rbp), %rdi
callq 0x6900
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)