// File: ratulSharker[P]Havec/src/vector_with_rehash_8_hash_with_N_detection_5_bytes.cpp
// Function: reCheckTheKhmerExistence5Byte(khmerInfo5Byte*, unsigned long long, char*, unsigned short)
void reCheckTheKhmerExistence5Byte(struct khmerInfo5Byte * 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];		
		unsigned long long consumedRead = 0;
		unsigned int lastHashFuncUsed = 0;//containe the value that is last used to store last khmers
		unsigned long mem_block_occupied_stat = 0;
		unsigned long list_occupied_stat = 0;
		
		bool n_found = false;//added for the purpose of detecting N in the khmer
		
		//for stat purpose use only:)
		unsigned long found_khmer = 0,not_found=0;

		//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<<"Rechecking... "<<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 so assign false to the N found tag
					temp = ""; //cleaning the old remaining khmer
					isFirstKhmer = true;
					continue;
				}
				else if (n_found == false){
					//here come the one sequnece of read
					buf = temp + 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
						
						//lastFoundKHashVal = fullHasher(temp); //saving the hash value
						//std::cout<<"recheck khmer's in the read (first) :: "<<temp<<std::endl;

						
						
						if(bufSize > khmerSize){
							
							bool found = false;
							
							for(int ii=0;ii<=LAST_HASH_FUNC;ii++){
							
							
								lastFoundKHashVal[ii] = fullHasher(temp,ii); 
									
								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;//breaking the hash loop !!!!
								}
								
								//std::cout<<"try to find("<<ii<<")"<<endl;
								
								//khmer has a neighbour :) -- so put the khmer in the blockArray
								//cout<<"trying to find "<<termp<<endl;
								switch(findGivenKhmer5Byte(temp,memBlock,blockSize,lastFoundKHashVal[ii],ii)){

								case FOUND:
									found_khmer++;
									//std::cout<<temp<< " -- found"<<std::endl;
									found = true;
									lastHashFuncUsed=ii;
									break;
								case NOT_FOUND:
									//std::cout<<temp<< " -- not found"<<std::endl;
									found = false;
									break;
								}
								if(found){
								break; //break out from the for loop
							}
						}
						
						if(n_found == true){ //main while loop continues -- allowing to consume the line of read
							continue ;
						}
						else if(n_found  == false && found == false){//error reporting that -- the khmer is not found
							not_found++;
							std::cout<<temp<< "at first -- not found "<<std::endl;
							std::cout<<"buffer :: " <<buf<<std::endl;
						}
						
						//for debug purpose
						//std::cout<<"inside firstkhmer "<<std::endl;
						//std::cout<<temp<<std::endl;
					}
					isFirstKhmer = false;
				}

				if(n_found == true){ //main while loop continues -- allowing to consume the line of read
					continue ;
				}
				
				for( ; i <= loopTime && n_found == false; i++){
					temp = buf.substr(i,khmerSize);

					//std::cout<<"recheck khmer's in the read (intermediate) :: "<<temp<<std::endl;
					
					addResult = i + khmerSize;
					
					if(bufSize > addResult){
						
						bool found = 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
								lastFoundKHashVal[ii] = partialHasher(lastFoundKHashVal[ii],temp[khmerSize - 1],khmerSize,ii);
								//lastFoundKHashVal = fullHasher(temp,ii);
							}
							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 = true;
								break;
							}
							
							//std::cout<<"try to find("<<ii<<")"<<endl;
							
							//neighbour left so put it into the memBlock
							//lastFoundKHashVal[ii] = partialHasher(lastFoundKHashVal,temp[khmerSize - 1],khmerSize,ii);
							switch(findGivenKhmer5Byte(temp,memBlock,blockSize,lastFoundKHashVal[ii],ii)){
								case FOUND:
									found_khmer++;
									//std::cout<<temp<< " -- found"<<std::endl;
									lastHashFuncUsed = ii;
									found = true;
									break;
								case NOT_FOUND:
									//cout<<temp<< " -- not found"<<std::endl;
									found = false;
									break;
							}

							//for debug purpose
							//std::cout<<"\tinside loop "<<std::endl;
							//std::cout<<"\t\t"<<temp<<std::endl;
							if(found){								
								break; //break out from the for loop
							}
						}
						
						if(n_found == false && found == false){//error reporting that -- the khmer is not found
							not_found++;
							std::cout<<temp<< " -- not found"<<std::endl;
						}

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

				//std::cout<<"one line of read consumed" <<std::endl;
			}
		}

		//spit out the stats
		std::cout<<"stat from recheck function :: "<<endl
				<<"\tkhmer found :: "<<found_khmer<<endl<<"\tkhmer not found:: "<<not_found<<endl<<endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
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 0x5488
leaq -0x258(%rbp), %rdi
callq 0x3460
leaq -0x279(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x3550
movq -0x3d8(%rbp), %rdx
leaq 0xc279(%rip), %rsi      # 0x1172e
leaq -0x278(%rbp), %rdi
callq 0x7760
jmp 0x54c3
leaq -0x279(%rbp), %rdi
callq 0x3380
movb $0x1, -0x27a(%rbp)
leaq 0x11e77(%rip), %rax     # 0x17354
movl (%rax), %eax
incl %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x3e0(%rbp)
jmp 0x54f5
movq -0x3e0(%rbp), %rax
movq %rax, -0x288(%rbp)
movq $0x0, -0x290(%rbp)
movl $0x0, -0x294(%rbp)
movq $0x0, -0x2a0(%rbp)
movq $0x0, -0x2a8(%rbp)
movb $0x0, -0x2a9(%rbp)
movq $0x0, -0x2b8(%rbp)
movq $0x0, -0x2c0(%rbp)
movq -0x228(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x228(%rbp,%rax), %rdi
callq 0x3030
movb %al, -0x3e1(%rbp)
jmp 0x556b
movb -0x3e1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5629
movq 0x11a4a(%rip), %rdi     # 0x16fd0
leaq 0xbc4c(%rip), %rsi      # 0x111d9
callq 0x32f0
movq %rax, -0x3f0(%rbp)
jmp 0x559b
movq -0x3f0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32f0
movq %rax, -0x3f8(%rbp)
jmp 0x55b4
movq -0x3f8(%rbp), %rdi
movq 0x119fe(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x55c9
movl $0x1, -0x2c4(%rbp)
jmp 0x601e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x6063
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x279(%rbp), %rdi
callq 0x3380
jmp 0x6057
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x604b
movq 0x119a0(%rip), %rdi     # 0x16fd0
leaq 0xbc4b(%rip), %rsi      # 0x11282
callq 0x32f0
movq %rax, -0x400(%rbp)
jmp 0x5645
movq -0x400(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32f0
movq %rax, -0x408(%rbp)
jmp 0x565e
movq -0x408(%rbp), %rdi
movq 0x11954(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x5673
jmp 0x5675
leaq -0x228(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3090
movq %rax, -0x410(%rbp)
jmp 0x5691
movq -0x410(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3410
movb %al, -0x411(%rbp)
jmp 0x56af
movb -0x411(%rbp), %al
testb $0x1, %al
jne 0x56be
jmp 0x5f1f
xorl %eax, %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x420(%rbp)
jmp 0x56d7
movq -0x420(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x570e
movb $0x0, -0x2a9(%rbp)
leaq 0xc03a(%rip), %rsi      # 0x1172e
leaq -0x278(%rbp), %rdi
callq 0x3450
jmp 0x5702
movb $0x1, -0x27a(%rbp)
jmp 0x5675
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5f18
leaq -0x2e8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
leaq -0x258(%rbp), %rdx
callq 0x7810
jmp 0x573e
leaq -0x258(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x33e0
leaq -0x2e8(%rbp), %rdi
callq 0x31b0
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 0x579d
movl $0x1, -0x2ec(%rbp)
jmp 0x57a7
movl $0x0, -0x2ec(%rbp)
movb -0x27a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5b1b
movl -0x2f0(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jae 0x57ce
jmp 0x5675
movzwl -0x1a(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edx
leaq -0x318(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3330
jmp 0x57ed
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 0x5b14
movb $0x0, -0x319(%rbp)
movl $0x0, -0x320(%rbp)
movl -0x320(%rbp), %eax
leaq 0x11b18(%rip), %rcx     # 0x17354
cmpl (%rcx), %eax
ja 0x5a26
leaq -0x340(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0x5859
movl -0x320(%rbp), %esi
leaq -0x340(%rbp), %rdi
callq 0x100e0
movq %rax, -0x428(%rbp)
jmp 0x5874
movq -0x428(%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 0x5946
movzwl -0x1a(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x430(%rbp)
jmp 0x58cd
movq -0x430(%rbp), %rax
movsbl (%rax), %edi
callq 0x3590
movl %eax, %ecx
movl %ecx, -0x434(%rbp)
subl $0x41, %eax
je 0x5935
jmp 0x58eb
movl -0x434(%rbp), %eax
subl $0x43, %eax
je 0x5935
jmp 0x58f8
movl -0x434(%rbp), %eax
subl $0x47, %eax
je 0x5935
jmp 0x5905
movl -0x434(%rbp), %eax
subl $0x54, %eax
je 0x5935
jmp 0x5937
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x31b0
jmp 0x604b
jmp 0x5944
leaq 0x11a3a(%rip), %rax     # 0x17378
movl $0x7, (%rax)
jmp 0x5946
leaq 0x11a2b(%rip), %rax     # 0x17378
cmpl $0x7, (%rax)
jne 0x595e
movb $0x1, -0x2a9(%rbp)
jmp 0x5a26
leaq -0x360(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0x5973
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x320(%rbp), %rcx
movl %ecx, %r8d
movq (%rax,%rcx,8), %rcx
leaq -0x360(%rbp), %rdi
movq %rdi, -0x448(%rbp)
callq 0x5070
movq -0x448(%rbp), %rdi
movl %eax, -0x43c(%rbp)
callq 0x31b0
movl -0x43c(%rbp), %eax
movl %eax, %ecx
movl %ecx, -0x438(%rbp)
subl $0x4, %eax
je 0x59d7
jmp 0x59ca
movl -0x438(%rbp), %eax
subl $0x5, %eax
je 0x59fe
jmp 0x5a05
movq -0x2b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b8(%rbp)
movb $0x1, -0x319(%rbp)
movl -0x320(%rbp), %eax
movl %eax, -0x294(%rbp)
jmp 0x5a05
movb $0x0, -0x319(%rbp)
testb $0x1, -0x319(%rbp)
je 0x5a10
jmp 0x5a26
jmp 0x5a12
movl -0x320(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x320(%rbp)
jmp 0x582f
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5a3b
jmp 0x5675
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5b10
movb -0x319(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5b10
movq -0x2c0(%rbp), %rax
incq %rax
movq %rax, -0x2c0(%rbp)
movq 0x11555(%rip), %rdi     # 0x16fd0
leaq -0x278(%rbp), %rsi
callq 0x32a0
movq %rax, -0x450(%rbp)
jmp 0x5a90
movq -0x450(%rbp), %rdi
leaq 0xb7f3(%rip), %rsi      # 0x11291
callq 0x32f0
movq %rax, -0x458(%rbp)
jmp 0x5aac
movq -0x458(%rbp), %rdi
movq 0x11506(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x5ac1
movq 0x11508(%rip), %rdi     # 0x16fd0
leaq 0xb7d9(%rip), %rsi      # 0x112a8
callq 0x32f0
movq %rax, -0x460(%rbp)
jmp 0x5add
movq -0x460(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x32a0
movq %rax, -0x468(%rbp)
jmp 0x5af9
movq -0x468(%rbp), %rdi
movq 0x114b9(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x5b0e
jmp 0x5b10
jmp 0x5b12
jmp 0x5b14
movb $0x0, -0x27a(%rbp)
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5b30
jmp 0x5675
jmp 0x5b32
movl -0x2ec(%rbp), %ecx
xorl %eax, %eax
cmpl -0x2f4(%rbp), %ecx
movb %al, -0x469(%rbp)
ja 0x5b5f
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x469(%rbp)
movb -0x469(%rbp), %al
testb $0x1, %al
jne 0x5b6e
jmp 0x5f16
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 0x5b91
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 0x5eee
movb $0x0, -0x381(%rbp)
movl $0x0, -0x388(%rbp)
movl -0x388(%rbp), %eax
leaq 0x11762(%rip), %rcx     # 0x17354
cmpl (%rcx), %eax
ja 0x5e6c
movl -0x388(%rbp), %eax
cmpl -0x294(%rbp), %eax
ja 0x5c83
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x480(%rbp)
movzwl -0x1a(%rbp), %eax
movl %eax, %esi
decq %rsi
leaq -0x278(%rbp), %rdi
callq 0x35e0
movq %rax, -0x478(%rbp)
jmp 0x5c3f
movq -0x480(%rbp), %rdi
movq -0x478(%rbp), %rax
movsbl (%rax), %esi
movzwl -0x1a(%rbp), %edx
movl -0x388(%rbp), %ecx
callq 0x10250
movq %rax, -0x488(%rbp)
jmp 0x5c68
movq -0x488(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x5cfd
leaq -0x3a8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0x5c98
movl -0x388(%rbp), %esi
leaq -0x3a8(%rbp), %rdi
callq 0x100e0
movq %rax, -0x490(%rbp)
jmp 0x5cb3
movq -0x490(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x3a8(%rbp), %rdi
callq 0x31b0
jmp 0x5cfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x31b0
jmp 0x604b
leaq -0x258(%rbp), %rdi
callq 0x34c0
movl -0x2f8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jb 0x5d8c
movl -0x2f8(%rbp), %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x35e0
movq %rax, -0x498(%rbp)
jmp 0x5d36
movq -0x498(%rbp), %rax
movsbl (%rax), %edi
callq 0x3590
movl %eax, %ecx
movl %ecx, -0x49c(%rbp)
subl $0x41, %eax
je 0x5d7b
jmp 0x5d54
movl -0x49c(%rbp), %eax
subl $0x43, %eax
je 0x5d7b
jmp 0x5d61
movl -0x49c(%rbp), %eax
subl $0x47, %eax
je 0x5d7b
jmp 0x5d6e
movl -0x49c(%rbp), %eax
subl $0x54, %eax
jne 0x5d7d
jmp 0x5d7b
jmp 0x5d8a
leaq 0x115f4(%rip), %rax     # 0x17378
movl $0x7, (%rax)
jmp 0x5d8c
leaq 0x115e5(%rip), %rax     # 0x17378
cmpl $0x7, (%rax)
jne 0x5da4
movb $0x1, -0x2a9(%rbp)
jmp 0x5e6c
leaq -0x3c8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3120
jmp 0x5db9
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x288(%rbp), %rax
movslq -0x388(%rbp), %rcx
movl %ecx, %r8d
movq (%rax,%rcx,8), %rcx
leaq -0x3c8(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x5070
movq -0x4b0(%rbp), %rdi
movl %eax, -0x4a4(%rbp)
callq 0x31b0
movl -0x4a4(%rbp), %eax
movl %eax, %ecx
movl %ecx, -0x4a0(%rbp)
subl $0x4, %eax
je 0x5e1d
jmp 0x5e10
movl -0x4a0(%rbp), %eax
subl $0x5, %eax
je 0x5e44
jmp 0x5e4b
movq -0x2b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2b8(%rbp)
movl -0x388(%rbp), %eax
movl %eax, -0x294(%rbp)
movb $0x1, -0x381(%rbp)
jmp 0x5e4b
movb $0x0, -0x381(%rbp)
testb $0x1, -0x381(%rbp)
je 0x5e56
jmp 0x5e6c
jmp 0x5e58
movl -0x388(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x388(%rbp)
jmp 0x5be5
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5eec
movb -0x381(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5eec
movq -0x2c0(%rbp), %rax
incq %rax
movq %rax, -0x2c0(%rbp)
movq 0x1112c(%rip), %rdi     # 0x16fd0
leaq -0x278(%rbp), %rsi
callq 0x32a0
movq %rax, -0x4b8(%rbp)
jmp 0x5eb9
movq -0x4b8(%rbp), %rdi
leaq 0xb3ec(%rip), %rsi      # 0x112b3
callq 0x32f0
movq %rax, -0x4c0(%rbp)
jmp 0x5ed5
movq -0x4c0(%rbp), %rdi
movq 0x110dd(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x5eea
jmp 0x5eec
jmp 0x5eee
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5f00
jmp 0x5f16
jmp 0x5f02
movl -0x2ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2ec(%rbp)
jmp 0x5b32
jmp 0x5f18
jmp 0x5f1a
jmp 0x5675
movq 0x110aa(%rip), %rdi     # 0x16fd0
leaq 0xb394(%rip), %rsi      # 0x112c1
callq 0x32f0
movq %rax, -0x4c8(%rbp)
jmp 0x5f3b
movq -0x4c8(%rbp), %rdi
movq 0x11077(%rip), %rsi     # 0x16fc0
callq 0x3340
movq %rax, -0x4d0(%rbp)
jmp 0x5f57
movq -0x4d0(%rbp), %rdi
leaq 0xb37b(%rip), %rsi      # 0x112e0
callq 0x32f0
movq %rax, -0x4d8(%rbp)
jmp 0x5f73
movq -0x4d8(%rbp), %rdi
movq -0x2b8(%rbp), %rsi
callq 0x30b0
movq %rax, -0x4e0(%rbp)
jmp 0x5f8f
movq -0x4e0(%rbp), %rdi
movq 0x11023(%rip), %rsi     # 0x16fc0
callq 0x3340
movq %rax, -0x4e8(%rbp)
jmp 0x5fab
movq -0x4e8(%rbp), %rdi
leaq 0xb338(%rip), %rsi      # 0x112f1
callq 0x32f0
movq %rax, -0x4f0(%rbp)
jmp 0x5fc7
movq -0x4f0(%rbp), %rdi
movq -0x2c0(%rbp), %rsi
callq 0x30b0
movq %rax, -0x4f8(%rbp)
jmp 0x5fe3
movq -0x4f8(%rbp), %rdi
movq 0x10fcf(%rip), %rsi     # 0x16fc0
callq 0x3340
movq %rax, -0x500(%rbp)
jmp 0x5fff
movq -0x500(%rbp), %rdi
movq 0x10fb3(%rip), %rsi     # 0x16fc0
callq 0x3340
jmp 0x6014
movl $0x0, -0x2c4(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x31b0
leaq -0x258(%rbp), %rdi
callq 0x31b0
leaq -0x228(%rbp), %rdi
callq 0x30c0
addq $0x500, %rsp            # imm = 0x500
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
nopl (%rax,%rax)