// File: ratulSharker[P]Havec/src/vector_with_rehash_8_hash_with_N_detection_6_bytes.cpp
// Function: populateBlock6Byte(khmerInfo6Byte*, unsigned long long, char*, unsigned short)
void populateBlock6Byte(struct khmerInfo6Byte * memBlock, unsigned long long blockSize, char *fileName,unsigned short int khmerSize){

	//opening the given file
	std::ifstream inputFile;
	inputFile.open(fileName,std::fstream::in);
	std::string buf,temp="";
	bool isFirstKhmer = true;
	unsigned long long * lastFoundKHashVal;
	lastFoundKHashVal=new unsigned long long[LAST_HASH_FUNC+1];
	
	bool n_found = false;//if n found in the read, then the read processing is left inactive 
						 // till the next new read sequence is found !!!
	
	unsigned long long consumedRead = 0;
	unsigned int lastHashFuncUsed = 0;//containe the value that is last used to store last khmer
	
	//for stat purpose use only:)
	unsigned long mem_block_occupied_stat = 0,mem_block_found_stat=0;
	unsigned long list_occupied_stat = 0,list_occupied_found=0;
	unsigned long mem_block_total_number_of_occupied = 0; //exact number of khmer stored in the memblock
	unsigned long vector_total_number_of_occupied = 0; //exact number of khmer stored in the vector 
	
	//ofstream myfile;
	//myfile.open("firstKmers.txt");
	//error log if can't be opened
	if(inputFile.fail() == true){
		/*
		 * if fail to load the file -- return
		 */
		std::cout<<"Fail to open the "<<fileName << std::endl;
		return;
	}


	//if successfull then log it !!!
	std::cout<<"Consuming... "<<fileName<<std::endl;

	//parsing the fasta file
	while(getline(inputFile,buf)){//reading a line

			if(buf[0] == '>'){
				//its a sequence name -- omit it !!! -- before omit clear the temp
				
				n_found = false; //new sequence found so i can't tell that exactly that, this new read sequence is bad or not -- time to consume
				
				temp = ""; //cleaning the old remaining khmer
				
				isFirstKhmer = true;
				consumedRead++;
				if(consumedRead%1000000==0){
					std::cout<<consumedRead/1000000<<" million read consumed..."<<std::endl;
					currentDateTime();
					/*show_vect_status_6_byte();
						std::cout<<"stat from consume function :: "<<std::endl
							<<"khmer in memBlock :: "<<mem_block_occupied_stat<<std::endl
							<<"khmer in list :: "<<list_occupied_stat<<std::endl<<std::endl;
							cout<<"*********************************"<<endl;
					*/	double vm, rss;
						process_mem_usage(vm, rss);
						cout << "Memory used (GB):  " << ((vm)/1024)/1024 <<endl;
				}
				//std::cout<<buf<<std::endl;
				continue;
			}
			else if(n_found == false){//if read sequence is not bad, consume it
									//if it is bad, then just omit consuming :) till a new read sequence found
									
				//here come the one sequnece of read
				buf = temp.append(buf);//no new read sequnence is found so the next line of read must be appended to the last
				unsigned int i;
				unsigned int bufSize = buf.size();//for optimization purpose only
				unsigned int loopTime = bufSize - khmerSize;//for optimization purpose only
				unsigned int addResult; //for optimization only

				if(isFirstKhmer == true){
					//its the first read line of the multiple read lines
					i = 1;
				}
				else{
					//its not the first line of the multiple read line
					i= 0;
				}

				//if it the first line then consume it explicitly by using fullHasher
				if(isFirstKhmer == true){
				
					if(bufSize < khmerSize){
						/*cout<<"**************************************************"<<endl;						
						cout<<"Problem detected !!!"<<endl;
						cout<<"read sequence size is less then the khmer size -- processing next read :("<<endl;
						cout<<"seq :: "<<buf<<endl;
						cout<<"**************************************************"<<endl;
						*/
						continue;						
					}
					//start of a new read detected
					temp = buf.substr(0,khmerSize); //here temp denote the string khmer
					
					//std::cout<<"khmer's in the read (first):: "<<temp<<std::endl;
					
					if(bufSize > khmerSize){
						//khmer has a neighbour :) -- so put the khmer in the blockArray
						
						//saving the first khmer
						//myfile<<temp<<endl;//_revhash(lastFoundKHashVal,khmerSize)<<endl; //saving the first khmer -- revhash isn't working right now
						
						// hash function trying formation 0th->1th->2th->3th
						bool stored = false;
						for(int ii=0;ii<=LAST_HASH_FUNC;ii++){
						
							//for the first khmer all the 
							//saving signature that which hash function is being used for the first khmer
							lastFoundKHashVal[ii] = fullHasher(temp,ii); //saving the hash
							
							if(buf.length() > khmerSize ){//checking that next khmer is not invalid
								switch(toupper(buf[khmerSize])){
									case 'A':
									case 'T':
									case 'G':
									case 'C':
									break;
									
									default:
									neucleotide_status = N_FOUND_IN_NEUCLEOTIDE;
									break;
								}
							}
							
							if(neucleotide_status == N_FOUND_IN_NEUCLEOTIDE){
								n_found = true;
								break;
							}
							
							//std::cout<<"store try ("<<ii<<")"<<endl;
							
							//cout<<"trying to store-"<<temp<<" hashfunc-"<<ii<<" hashed value-"<<lastFoundKHashVal[ii]<<" neighbour "<<buf[khmerSize]<<endl;
							switch(storeKhmerInMemBlock6Byte(temp,memBlock,blockSize,lastFoundKHashVal[ii],buf[khmerSize],ii)){
							
							case MEM_BLOCK:
								mem_block_occupied_stat++;
								mem_block_total_number_of_occupied++;
								lastHashFuncUsed = ii;
								stored = true;
								break;
							case MEM_BLOCK_FOUND:
								//cout<<"mem_block_found :: "<<temp<<endl;
								mem_block_found_stat++;
								mem_block_total_number_of_occupied++;
								lastHashFuncUsed = ii;
								stored=true;
								break;
							case LIST:
								list_occupied_stat++; //this will happen only for the las time (hash Func 3)
								lastHashFuncUsed = ii;
								vector_total_number_of_occupied++;
								stored = true;
								break;
							case LIST_FOUND:
								//cout<<"list_found :: "<<temp<<endl;
								list_occupied_found++;
								vector_total_number_of_occupied++;
								lastHashFuncUsed = ii;
								stored=true;
								break;
							case ERROR:
								//std::cout<<"ERROR OCCURED"<<std::endl;
								//return;
								break;
							}
							if(stored){
								break; //break out from the for loop
							}
						}
						//for debug purpose
						//std::cout<<"inside firstkhmer "<<std::endl;
						//std::cout<<temp<<std::endl;
					}

					isFirstKhmer = false;
				}
				
				if(n_found == true){ //in the first khmer N found so abort consuming using continue statement
					continue;
				}
				
				
				
				for( ; i <= loopTime && n_found == false; i++){
					temp = buf.substr(i,khmerSize);

					//std::cout<<"khmer's in the read (intermediate) :: "<<temp<<std::endl;

					addResult = i + khmerSize;

					if(bufSize > addResult){
						
						bool stored = false;
						for(int ii=0;ii<=LAST_HASH_FUNC;ii++){
							
							if(ii<=lastHashFuncUsed){
								//last used hash func & current hashfunc is same -- so partial hasher would do the job
								
								//neighbour left so put it into the memBlock
								//cout<<"using partial hash func with last hash func value "<<lastFoundKHashVal[ii]<<" and next neighbour "<<temp[khmerSize - 1]<<endl;
								lastFoundKHashVal[ii] = partialHasher(lastFoundKHashVal[ii],temp[khmerSize - 1],khmerSize,ii);
								//lastFoundKHashVal = fullHasher(temp,ii); //saving the hash
							}  
							else{
								lastFoundKHashVal[ii] = fullHasher(temp,ii); //saving the hash
							}
							
							if(buf.length() >= addResult + 1){//checking that next khmer is not invalid
								switch(toupper(buf[addResult])){
									case 'A':
									case 'T':
									case 'G':
									case 'C':
									break;
									
									default:
									neucleotide_status = N_FOUND_IN_NEUCLEOTIDE;
									break;
								}
							}
							
							if(neucleotide_status == N_FOUND_IN_NEUCLEOTIDE){//N found in the middle of consuming
								n_found = true;
								break;
							}
							
							//std::cout<<"store try ("<<ii<<")"<<endl;
							
							//cout<<"trying to store-"<<temp<<" neighbour "<<buf[addResult]<<" hashfunc-"<<ii<<" last found hashed value "<<lastFoundKHashVal[ii]<<endl;
							//cout<<"Hash "<<temp<<" "<<buf[addResult]<<endl;
							
							switch(storeKhmerInMemBlock6Byte(temp,memBlock, blockSize, lastFoundKHashVal[ii], buf[addResult],ii)){

								case MEM_BLOCK:
									mem_block_occupied_stat++;
									mem_block_total_number_of_occupied++;
									lastHashFuncUsed = ii;
									stored = true;
									break;
								case MEM_BLOCK_FOUND:
									//cout<<"mem_block_found:: "<<temp<<endl;
									mem_block_found_stat++;
									mem_block_total_number_of_occupied++;
									lastHashFuncUsed = ii;
									stored=true;
									break;
								case LIST:
									list_occupied_stat++;
									vector_total_number_of_occupied++;
									lastHashFuncUsed = ii;
									stored = true;
									break;
								case LIST_FOUND:
									//cout<<"list_found:: "<<temp<<endl;
									list_occupied_found++;
									vector_total_number_of_occupied++;
									lastHashFuncUsed = ii;
									stored=true;
									break;
								case ERROR:
									//std::cout<<"ERROR OCCURED"<<std::endl;
									break;
								
							}

							if(stored == true){
								//if stored then just end the loop
								break;
							}
							
							//for debug purpose
							//std::cout<<"\tinside loop "<<std::endl;
							//std::cout<<"\t\t"<<temp<<std::endl;
						}
					}

				}

				//temp = temp.substr(1,khmerSize-1);//advance to next khmer one time of ahead
			}
		}

	//myfile.close();

	//spit out the stats
	std::cout<<"stat from consume function :: "<<std::endl
			<<"khmer in memBlock (distinct):: "<<mem_block_occupied_stat<<std::endl
			<<"khmer in list (distinct):: "<<list_occupied_stat<<std::endl<<std::endl;
			/*<<"khmer in memBlock (found):: "<<mem_block_found_stat<<std::endl
			<<"khmer in list (found):: "<<list_occupied_found<<std::endl<<std::endl
			<<"Khmer in memBlock(total) "<<mem_block_total_number_of_occupied<<std::endl
			<<"khmer in vector(total) "<<vector_total_number_of_occupied<<endl;*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x540, %rsp            # imm = 0x540
movw %cx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movw %ax, -0x1a(%rbp)
leaq -0x228(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x33b0
movq -0x3d0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x31c0
jmp 0xa6d8
leaq -0x258(%rbp), %rdi
callq 0x3460
leaq -0x279(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x3550
movq -0x3d8(%rbp), %rdx
leaq 0x7029(%rip), %rsi      # 0x1172e
leaq -0x278(%rbp), %rdi
callq 0x7760
jmp 0xa713
leaq -0x279(%rbp), %rdi
callq 0x3380
movb $0x1, -0x27a(%rbp)
leaq 0xcc27(%rip), %rax      # 0x17354
movl (%rax), %eax
incl %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x3e0(%rbp)
jmp 0xa745
movq -0x3e0(%rbp), %rax
movq %rax, -0x288(%rbp)
movb $0x0, -0x289(%rbp)
movq $0x0, -0x298(%rbp)
movl $0x0, -0x29c(%rbp)
movq $0x0, -0x2a8(%rbp)
movq $0x0, -0x2b0(%rbp)
movq $0x0, -0x2b8(%rbp)
movq $0x0, -0x2c0(%rbp)
movq $0x0, -0x2c8(%rbp)
movq $0x0, -0x2d0(%rbp)
movq -0x228(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x228(%rbp,%rax), %rdi
callq 0x3030
movb %al, -0x3e1(%rbp)
jmp 0xa7d1
movb -0x3e1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xa88f
movq 0xc7e4(%rip), %rdi      # 0x16fd0
leaq 0x69e6(%rip), %rsi      # 0x111d9
callq 0x32f0
movq %rax, -0x3f0(%rbp)
jmp 0xa801
movq -0x3f0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32f0
movq %rax, -0x3f8(%rbp)
jmp 0xa81a
movq -0x3f8(%rbp), %rdi
movq 0xc798(%rip), %rsi      # 0x16fc0
callq 0x3340
jmp 0xa82f
movl $0x1, -0x2d4(%rbp)
jmp 0xb487
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0xb4cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x279(%rbp), %rdi
callq 0x3380
jmp 0xb4c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0xb4b4
movq 0xc73a(%rip), %rdi      # 0x16fd0
leaq 0x694e(%rip), %rsi      # 0x111eb
callq 0x32f0
movq %rax, -0x400(%rbp)
jmp 0xa8ab
movq -0x400(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32f0
movq %rax, -0x408(%rbp)
jmp 0xa8c4
movq -0x408(%rbp), %rdi
movq 0xc6ee(%rip), %rsi      # 0x16fc0
callq 0x3340
jmp 0xa8d9
jmp 0xa8db
leaq -0x228(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3090
movq %rax, -0x410(%rbp)
jmp 0xa8f7
movq -0x410(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3410
movb %al, -0x411(%rbp)
jmp 0xa915
movb -0x411(%rbp), %al
testb $0x1, %al
jne 0xa924
jmp 0xb388
xorl %eax, %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x420(%rbp)
jmp 0xa93d
movq -0x420(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0xaa82
movb $0x0, -0x289(%rbp)
leaq 0x6dd0(%rip), %rsi      # 0x1172e
leaq -0x278(%rbp), %rdi
callq 0x3450
jmp 0xa96c
movb $0x1, -0x27a(%rbp)
movq -0x298(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xaa7d
movq -0x298(%rbp), %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
mulq %rcx
movq %rdx, %rsi
shrq $0x12, %rsi
movq 0xc60e(%rip), %rdi      # 0x16fd0
callq 0x32d0
movq %rax, -0x428(%rbp)
jmp 0xa9d0
movq -0x428(%rbp), %rdi
leaq 0x681b(%rip), %rsi      # 0x111f9
callq 0x32f0
movq %rax, -0x430(%rbp)
jmp 0xa9ec
movq -0x430(%rbp), %rdi
movq 0xc5c6(%rip), %rsi      # 0x16fc0
callq 0x3340
jmp 0xaa01
callq 0x10000
jmp 0xaa08
leaq -0x2e0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0xf7b0
jmp 0xaa1d
movq 0xc5ac(%rip), %rdi      # 0x16fd0
leaq 0x67e8(%rip), %rsi      # 0x11213
callq 0x32f0
movq %rax, -0x438(%rbp)
jmp 0xaa39
movq -0x438(%rbp), %rdi
movsd -0x2e0(%rbp), %xmm0
movsd 0x66e8(%rip), %xmm1     # 0x11138
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
callq 0x35a0
movq %rax, -0x440(%rbp)
jmp 0xaa66
movq -0x440(%rbp), %rdi
movq 0xc54c(%rip), %rsi      # 0x16fc0
callq 0x3340
jmp 0xaa7b
jmp 0xaa7d
jmp 0xa8db
movb -0x289(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb381
leaq -0x278(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x35c0
movq %rax, -0x448(%rbp)
jmp 0xaab2
movq -0x448(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x3050
jmp 0xaac7
leaq -0x258(%rbp), %rdi
callq 0x31f0
movl %eax, -0x2f0(%rbp)
movl -0x2f0(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x2f4(%rbp)
movb -0x27a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xab07
movl $0x1, -0x2ec(%rbp)
jmp 0xab11
movl $0x0, -0x2ec(%rbp)
movb -0x27a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xaed3
movl -0x2f0(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jae 0xab38
jmp 0xa8db
movzwl -0x1a(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edx
leaq -0x318(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3330
jmp 0xab57
leaq -0x278(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x33e0
leaq -0x318(%rbp), %rdi
callq 0x31b0
movl -0x2f0(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jbe 0xaecc
movb $0x0, -0x319(%rbp)
movl $0x0, -0x320(%rbp)
movl -0x320(%rbp), %eax
leaq 0xc7ae(%rip), %rcx      # 0x17354
cmpl (%rcx), %eax
ja 0xaeca
leaq -0x340(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0xabc3
movl -0x320(%rbp), %esi
leaq -0x340(%rbp), %rdi
callq 0x100e0
movq %rax, -0x450(%rbp)
jmp 0xabde
movq -0x450(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x320(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x340(%rbp), %rdi
callq 0x31b0
leaq -0x258(%rbp), %rdi
callq 0x34c0
movzwl -0x1a(%rbp), %ecx
cmpq %rcx, %rax
jbe 0xacb0
movzwl -0x1a(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x458(%rbp)
jmp 0xac37
movq -0x458(%rbp), %rax
movsbl (%rax), %edi
callq 0x3590
movl %eax, %ecx
movl %ecx, -0x45c(%rbp)
subl $0x41, %eax
je 0xac9f
jmp 0xac55
movl -0x45c(%rbp), %eax
subl $0x43, %eax
je 0xac9f
jmp 0xac62
movl -0x45c(%rbp), %eax
subl $0x47, %eax
je 0xac9f
jmp 0xac6f
movl -0x45c(%rbp), %eax
subl $0x54, %eax
je 0xac9f
jmp 0xaca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x31b0
jmp 0xb4b4
jmp 0xacae
leaq 0xc6d0(%rip), %rax      # 0x17378
movl $0x7, (%rax)
jmp 0xacb0
leaq 0xc6c1(%rip), %rax      # 0x17378
cmpl $0x7, (%rax)
jne 0xacc8
movb $0x1, -0x289(%rbp)
jmp 0xaeca
leaq -0x360(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0xacdd
movq -0x8(%rbp), %rax
movq %rax, -0x480(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x478(%rbp)
movq -0x288(%rbp), %rax
movslq -0x320(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x470(%rbp)
movzwl -0x1a(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x468(%rbp)
jmp 0xad27
movq -0x470(%rbp), %rcx
movq -0x478(%rbp), %rdx
movq -0x480(%rbp), %rsi
movq -0x468(%rbp), %rax
movsbl (%rax), %r8d
movl -0x320(%rbp), %r9d
leaq -0x360(%rbp), %rdi
callq 0x9d90
movl %eax, -0x484(%rbp)
jmp 0xad62
leaq -0x360(%rbp), %rdi
callq 0x31b0
movl -0x484(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x490(%rbp)
subl $0x6, %eax
ja 0xaea9
movq -0x490(%rbp), %rax
leaq 0x6888(%rip), %rcx      # 0x1161c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x31b0
jmp 0xb4b4
movq -0x2a8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2a8(%rbp)
movq -0x2c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c8(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x319(%rbp)
jmp 0xaea9
movq -0x2b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b0(%rbp)
movq -0x2c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c8(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x319(%rbp)
jmp 0xaea9
movq -0x2b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b8(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x29c(%rbp)
movq -0x2d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2d0(%rbp)
movb $0x1, -0x319(%rbp)
jmp 0xaea9
movq -0x2c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c0(%rbp)
movq -0x2d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2d0(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x319(%rbp)
jmp 0xaea9
jmp 0xaea9
testb $0x1, -0x319(%rbp)
je 0xaeb4
jmp 0xaeca
jmp 0xaeb6
movl -0x320(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x320(%rbp)
jmp 0xab99
jmp 0xaecc
movb $0x0, -0x27a(%rbp)
movb -0x289(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xaee8
jmp 0xa8db
jmp 0xaeea
movl -0x2ec(%rbp), %ecx
xorl %eax, %eax
cmpl -0x2f4(%rbp), %ecx
movb %al, -0x491(%rbp)
ja 0xaf17
movb -0x289(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x491(%rbp)
movb -0x491(%rbp), %al
testb $0x1, %al
jne 0xaf26
jmp 0xb37f
movl -0x2ec(%rbp), %eax
movl %eax, %edx
movzwl -0x1a(%rbp), %eax
movl %eax, %ecx
leaq -0x380(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3330
jmp 0xaf49
leaq -0x278(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x33e0
leaq -0x380(%rbp), %rdi
callq 0x31b0
movl -0x2ec(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x2f8(%rbp)
movl -0x2f0(%rbp), %eax
cmpl -0x2f8(%rbp), %eax
jbe 0xb369
movb $0x0, -0x381(%rbp)
movl $0x0, -0x388(%rbp)
movl -0x388(%rbp), %eax
leaq 0xc3aa(%rip), %rcx      # 0x17354
cmpl (%rcx), %eax
ja 0xb367
movl -0x388(%rbp), %eax
cmpl -0x29c(%rbp), %eax
ja 0xb03b
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x4a8(%rbp)
movzwl -0x1a(%rbp), %eax
movl %eax, %esi
decq %rsi
leaq -0x278(%rbp), %rdi
callq 0x35e0
movq %rax, -0x4a0(%rbp)
jmp 0xaff7
movq -0x4a8(%rbp), %rdi
movq -0x4a0(%rbp), %rax
movsbl (%rax), %esi
movzwl -0x1a(%rbp), %edx
movl -0x388(%rbp), %ecx
callq 0x10250
movq %rax, -0x4b0(%rbp)
jmp 0xb020
movq -0x4b0(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xb0b5
leaq -0x3a8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0xb050
movl -0x388(%rbp), %esi
leaq -0x3a8(%rbp), %rdi
callq 0x100e0
movq %rax, -0x4b8(%rbp)
jmp 0xb06b
movq -0x4b8(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x3a8(%rbp), %rdi
callq 0x31b0
jmp 0xb0b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x31b0
jmp 0xb4b4
leaq -0x258(%rbp), %rdi
callq 0x34c0
movl -0x2f8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jb 0xb144
movl -0x2f8(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x4c0(%rbp)
jmp 0xb0ee
movq -0x4c0(%rbp), %rax
movsbl (%rax), %edi
callq 0x3590
movl %eax, %ecx
movl %ecx, -0x4c4(%rbp)
subl $0x41, %eax
je 0xb133
jmp 0xb10c
movl -0x4c4(%rbp), %eax
subl $0x43, %eax
je 0xb133
jmp 0xb119
movl -0x4c4(%rbp), %eax
subl $0x47, %eax
je 0xb133
jmp 0xb126
movl -0x4c4(%rbp), %eax
subl $0x54, %eax
jne 0xb135
jmp 0xb133
jmp 0xb142
leaq 0xc23c(%rip), %rax      # 0x17378
movl $0x7, (%rax)
jmp 0xb144
leaq 0xc22d(%rip), %rax      # 0x17378
cmpl $0x7, (%rax)
jne 0xb15c
movb $0x1, -0x289(%rbp)
jmp 0xb367
leaq -0x3c8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0xb171
movq -0x8(%rbp), %rax
movq %rax, -0x4e8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x4e0(%rbp)
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x4d8(%rbp)
movl -0x2f8(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x4d0(%rbp)
jmp 0xb1bd
movq -0x4d8(%rbp), %rcx
movq -0x4e0(%rbp), %rdx
movq -0x4e8(%rbp), %rsi
movq -0x4d0(%rbp), %rax
movsbl (%rax), %r8d
movl -0x388(%rbp), %r9d
leaq -0x3c8(%rbp), %rdi
callq 0x9d90
movl %eax, -0x4ec(%rbp)
jmp 0xb1f8
leaq -0x3c8(%rbp), %rdi
callq 0x31b0
movl -0x4ec(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x4f8(%rbp)
subl $0x6, %eax
ja 0xb33f
movq -0x4f8(%rbp), %rax
leaq 0x640e(%rip), %rcx      # 0x11638
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x31b0
jmp 0xb4b4
movq -0x2a8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2a8(%rbp)
movq -0x2c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c8(%rbp)
movl -0x388(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x381(%rbp)
jmp 0xb33f
movq -0x2b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b0(%rbp)
movq -0x2c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c8(%rbp)
movl -0x388(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x381(%rbp)
jmp 0xb33f
movq -0x2b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b8(%rbp)
movq -0x2d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2d0(%rbp)
movl -0x388(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x381(%rbp)
jmp 0xb33f
movq -0x2c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c0(%rbp)
movq -0x2d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2d0(%rbp)
movl -0x388(%rbp), %eax
movl %eax, -0x29c(%rbp)
movb $0x1, -0x381(%rbp)
jmp 0xb33f
jmp 0xb33f
movb -0x381(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xb351
jmp 0xb367
jmp 0xb353
movl -0x388(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x388(%rbp)
jmp 0xaf9d
jmp 0xb369
jmp 0xb36b
movl -0x2ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2ec(%rbp)
jmp 0xaeea
jmp 0xb381
jmp 0xb383
jmp 0xa8db
movq 0xbc41(%rip), %rdi      # 0x16fd0
leaq 0x5e91(%rip), %rsi      # 0x11227
callq 0x32f0
movq %rax, -0x500(%rbp)
jmp 0xb3a4
movq -0x500(%rbp), %rdi
movq 0xbc0e(%rip), %rsi      # 0x16fc0
callq 0x3340
movq %rax, -0x508(%rbp)
jmp 0xb3c0
movq -0x508(%rbp), %rdi
leaq 0x5e78(%rip), %rsi      # 0x11246
callq 0x32f0
movq %rax, -0x510(%rbp)
jmp 0xb3dc
movq -0x510(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
callq 0x30b0
movq %rax, -0x518(%rbp)
jmp 0xb3f8
movq -0x518(%rbp), %rdi
movq 0xbbba(%rip), %rsi      # 0x16fc0
callq 0x3340
movq %rax, -0x520(%rbp)
jmp 0xb414
movq -0x520(%rbp), %rdi
leaq 0x5e44(%rip), %rsi      # 0x11266
callq 0x32f0
movq %rax, -0x528(%rbp)
jmp 0xb430
movq -0x528(%rbp), %rdi
movq -0x2b8(%rbp), %rsi
callq 0x30b0
movq %rax, -0x530(%rbp)
jmp 0xb44c
movq -0x530(%rbp), %rdi
movq 0xbb66(%rip), %rsi      # 0x16fc0
callq 0x3340
movq %rax, -0x538(%rbp)
jmp 0xb468
movq -0x538(%rbp), %rdi
movq 0xbb4a(%rip), %rsi      # 0x16fc0
callq 0x3340
jmp 0xb47d
movl $0x0, -0x2d4(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x31b0
leaq -0x258(%rbp), %rdi
callq 0x31b0
leaq -0x228(%rbp), %rdi
callq 0x30c0
addq $0x540, %rsp            # imm = 0x540
popq %rbp
retq
leaq -0x278(%rbp), %rdi
callq 0x31b0
leaq -0x258(%rbp), %rdi
callq 0x31b0
leaq -0x228(%rbp), %rdi
callq 0x30c0
movq -0x230(%rbp), %rdi
callq 0x3540
nopw %cs:(%rax,%rax)