// File: /workspace/github_cpp_makefile_star2_O2/nikhilYadala[P]Python_to_cpp/Source/src/convert_to_cpp_classes.cpp
// Function: convert_to_cpp_classes(unsigned long, unsigned long, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, class_declaration*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void convert_to_cpp_classes(unsigned long int start,
							unsigned long int end,
							std::vector< line_pair >& lines,
							std::string& converted_code,
							class_declaration* final_class,
							std::map< std::string,
							std::string >& variables )
   {

     	// if(start == end)
     	// 	std::cout<<"-------------\n\n\n\n"<<lines[start].first<<"\n\n-----------------"
        std ::vector < std::string > tokens;
        tokens.resize(1);
        break_into_words_(lines[start].first,tokens);//the lines get tokenized,inherited function

        if(tokens[1]=="class")
        {
            final_class->name=tokens[2];


            if(tokens[3]==":")
            	final_class->num_base_func=0;
            else if (tokens[3]=="(")
            {
                 std::vector<std::string>::iterator tokens_itr =tokens.begin()+3;
                 while(*(++tokens_itr)!=")")
                 {  
                 	if(*tokens_itr==",")
                 		continue;  //delimeter for inherited list of functions

                 	(final_class->base_functions).push_back(*tokens_itr);
                 	(final_class->num_base_func)++;//incremented each time a base func is found
                 	//tokens_itr++; //to bypass the commas after each base function

                 }



            }//all the base classes(if any)are noted till here;
        
          }
          /*while(*tokens_itr=="\n")
          	tokens_itr++; //gets rid of all the new lines, infact only one new line char would be there
           */
          	//the above block is now no more required as, tokens no more store '\n'

          /************THE FOLLOWING LINES FILL std::string converted_code *******************/
          	//converted_code.append("{\npublic:\n");

           
             for(unsigned long int i=start;i<=end;)
	            {	
		             tokens.clear();
		              break_into_words_(lines[i].first,tokens);
		              std::vector< std::string >::iterator itr=tokens.begin();

		 if(*itr=="if")
		{

			itr++;
			bool is_not=0;
			if(*itr=="not")
				{
					is_not=1;
					itr++;
				}	
			std::string expr="";
			
			if(is_not)
				expr.append("!");

			while(*itr!=":")
				expr.append(*(itr++));
			
			converted_code.append((size_t)lines[i].second,' ');
			converted_code.append("if(");
			converted_code.append(expr);
			converted_code.append(")\n");
			converted_code.append((size_t)lines[i].second,' ');
			converted_code.append("{\n");
			
			int space_count=lines[i].second,st=i;
			
			while(lines[++i].second>space_count);
				
			std::string snippet;
			convert_to_cpp_classes(st+1,i-1,lines,snippet,final_class,variables);
			converted_code.append(snippet);
			
			converted_code.append((size_t)lines[st].second,' ');
			converted_code.append("}\n");
			//i already incremented while changing lines
			continue;

		}
		
		////NOTE:- Every section puts \n at its end so no need to put one in each section's beginning

		if(*itr=="print")
		{

			itr++;
			converted_code.append((size_t)lines[i].second,' ');
			converted_code.append("std::cout<<");
			int f=1;
			while(itr!=tokens.end())
			{
				if(*itr=="("||*itr==")")
					f=!f;

				if(!f||*itr!=",")
					converted_code.append(*itr);
				itr++;
			}
			converted_code.append(";\n");
			i++;
			continue;
		}


		//handle functionn definition inside the classes
		else if(*itr=="def")
		{
			long int space_count=lines[i].second;
			long int st=i;
			std::vector< std::string >::iterator itr1=tokens.begin();

			while(lines[++i].second>space_count); //upto i-1, we have to consider func
			std::string converted_function;
			function_declaration converted_function_declaration;
			convert_to_cpp(st,i-1,lines,converted_function,&converted_function_declaration,variables);

			//rendering the code for function
			if(converted_function_declaration.return_type == "")
				converted_function_declaration.return_type = "void";
			//the funciton can be a constructor
			if(converted_function_declaration.name=="__init__")
				converted_code.append(final_class->name).append("(");
			else{
			converted_code.append(converted_function_declaration.return_type).append(" ");
			//the funciton can be a constructor
			if(converted_function_declaration.name=="__init__")
				converted_code.append(final_class->name).append("(");
			else
			converted_code.append(converted_function_declaration.name).append("(");
			}
			 for(std::vector< string_pair >::iterator j=converted_function_declaration.args.begin();j!=converted_function_declaration.args.end();++j)
			 {
			 	converted_code.append(j->second).append(" "); //arg datatype
			 	converted_code.append(j->first).append(","); // arg name
			 
			 }
			 if(*(converted_code.end()-1) == ',')
			 	*(converted_code.end()-1)=')';
			 else  converted_code.append(")");
			 
			converted_code.append("\n{\n").append(converted_function).append("\n}\n");
			//i already got incremented while checking for the function block
			continue;

		}//end elif statement for functions inside the class




		else if (*itr!="def")	//variable declaration
		{
			std::string v=*itr;
			std::string expr="";
			bool is_function_call=1;
			if(*(itr+1)=="="){
				is_function_call=0;
				itr=itr+2;	//skip = sign
			}



			if(std::find(tokens.begin(), tokens.end(),"raw_input")!=tokens.end())
			{
				tokens.pop_back();
				itr=itr+3;
				bool f = 0;
				int i = 0;
				expr.append(*(itr+1));
				while(*itr!=":") {
					i++;
					// if(*itr=="(") f=1;
					// if(!f) expr.append(*itr);
					itr++;
					if(i==1000000)
					{
						std::cout<<": missing on line "<<i<<std::endl;
						exit(0);
					}
				}
				itr++;
				variables[v]=map_type_(*itr,i);
				converted_code.append((size_t)lines[i].second*tab_size,' ');			
				converted_code.append(variables[v]);
				if(variables[v]=="artificial_string")
					converted_code.append(" "+v+"(\"\");\n");					
				else converted_code.append(" "+v+";\n"	);

				converted_code.append((size_t)lines[i].second*tab_size,' ');
				converted_code.append("std::cout<<");
				converted_code.append(expr);
				converted_code.append(";\n");
				converted_code.append((size_t)lines[i].second*tab_size,' ');
				converted_code.append("std::cin>>");
				converted_code.append(v);
				converted_code.append(";\n");

				
			}
			//all other function calls and varible declarations and procesing
			else{
					if(is_function_call)
						while(itr!=tokens.end()) expr.append(*itr++);
					else{
							while(*itr!=":" && itr!=tokens.end())
								expr.append(*itr++);
					}
					//if the type is expliciyly mentioned 
					bool type_annotated = 1;
					if(itr == tokens.end())
					{
						type_annotated = 0;
						if(!is_function_call)
							std::cout<<"[ WARNING ] Auto type predicting at line "<<i<<std::endl;
					}

					std::vector< std::string >::iterator itr1 = itr;
					if(type_annotated)	
						itr1 = itr+1;
					

		    		expr = eval_expr_(expr);

					if(!is_function_call)
					{
						bool not_decl = (variables.find(v) != variables.end());
				
							if(!type_annotated)
								variables[v]=expr_type_(expr,variables);
							else{
								std::string t ="";
								while(itr1!=tokens.end()){
									t.append(*itr1);
									itr1++;
								}
								variables[v]=map_type_(t,i);
							}
									
							converted_code.append((size_t)lines[i].second*tab_size,' ');		
							
								if(expr_type_(expr,variables)=="list")
								{
									itr = tokens.begin()+3;
									converted_code.append("std::"+variables[v]+" ").append(v).append(";");
									// std::string::iterator itr3=itr;
									// if(variables.count(*itr3))
									// {
									// 	for(std::vector <int>::iterator it=(*itr3).begin();it!=(*itr3).end();it++)

									// }


									while(*itr!="]")
									{
										if(*itr=="["||*itr==",")
											itr++;
 										else {converted_code.append("\n").append(v).append(".push_back(").append(*itr).append(");");
 											itr++;
 									}
 								    }


                                   }

						 		   if(expr_type_(expr,variables)!="list")
									{	
										if(!not_decl) 
										converted_code.append(variables[v]);	
										converted_code.append(" ");
										converted_code.append(v);
										converted_code.append(" = ");
										converted_code.append(expr);
										converted_code.append(";\n");
									
									}
					}

					
					else{// if it is a function call
						converted_code.append((size_t)lines[i].second*tab_size,' ');
						converted_code.append(expr);
						converted_code.append(";\n");
					}
			}
			i++;
			continue;

		}	



		/***** SOME MORE CASES HAVE TO BE TAKEN CARE OF HERE.*****/
		/***** Variables have to be explicitly taken care off.****/
      
      //At the the end, the closing lines of the classe in c++ is written

    
     }

    //  converted_code.append("\ntalking of this one};\n");
     // the above step to be taken care off in rendering the cpp code
   
 std::cout<<"printing the converted class code\n"<<converted_code <<"haha\n";

     }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, %r14
movq %r8, -0x50(%rbp)
movq %rcx, %rbx
movq %rdx, -0x30(%rbp)
movq %rsi, -0x140(%rbp)
movq %rdi, -0x48(%rbp)
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
pushq $0x1
popq %rsi
callq 0x8238
imulq $0x28, -0x48(%rbp), %rdi
movq -0x30(%rbp), %rax
addq (%rax), %rdi
leaq -0x90(%rbp), %rsi
callq 0x7206
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
leaq 0x1ef6(%rip), %rsi      # 0x92fb
callq 0x42a8
testb %al, %al
je 0x74c2
movq -0x90(%rbp), %rsi
addq $0x40, %rsi
movq -0x50(%rbp), %rdi
callq 0x2110
movq -0x90(%rbp), %rdi
addq $0x60, %rdi
leaq 0x1d2b(%rip), %rsi      # 0x9163
callq 0x42a8
testb %al, %al
je 0x744b
movq -0x50(%rbp), %rax
andl $0x0, 0x20(%rax)
jmp 0x74c2
movq -0x90(%rbp), %rdi
addq $0x60, %rdi
leaq 0x1c6c(%rip), %rsi      # 0x90c9
callq 0x42a8
testb %al, %al
je 0x74c2
movq -0x90(%rbp), %r15
movq -0x50(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x40(%rbp)
subq $-0x80, %r15
leaq 0x1b95(%rip), %r13      # 0x9019
leaq 0x1be8(%rip), %r12      # 0x9073
movq %r15, %rdi
movq %r13, %rsi
callq 0x4381
testb %al, %al
je 0x74c2
movq %r15, %rdi
movq %r12, %rsi
callq 0x42a8
testb %al, %al
jne 0x74bc
movq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x4346
movq -0x50(%rbp), %rax
incl 0x20(%rax)
addq $0x20, %r15
jmp 0x748b
movq %r14, -0x40(%rbp)
leaq 0x8(%r14), %rax
movq %rax, -0x138(%rbp)
movq -0x48(%rbp), %r14
movq %r14, -0x48(%rbp)
imulq $0x28, %r14, %r14
movq -0x48(%rbp), %rax
cmpq -0x140(%rbp), %rax
ja 0x80ab
leaq -0x90(%rbp), %r15
movq %r15, %rdi
callq 0x43d4
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq %r14, %rdi
movq %r15, %rsi
callq 0x7206
movq -0x90(%rbp), %r13
movq %r13, %rdi
leaq 0x1b57(%rip), %rsi      # 0x9077
callq 0x42a8
testb %al, %al
jne 0x7646
movq %r13, %rdi
leaq 0x1b52(%rip), %rsi      # 0x9089
callq 0x42a8
testb %al, %al
jne 0x77d4
movq %r13, %rdi
leaq 0x1b21(%rip), %r15      # 0x906f
movq %r15, %rsi
callq 0x42a8
testb %al, %al
jne 0x7880
movq %r13, %rdi
movq %r15, %rsi
callq 0x4381
testb %al, %al
je 0x74dd
leaq -0x110(%rbp), %rdi
movq %r13, %rsi
callq 0x2290
leaq -0x70(%rbp), %rdi
leaq 0x1c73(%rip), %rsi      # 0x91fe
leaq -0xb0(%rbp), %rdx
callq 0x20b0
leaq 0x20(%r13), %rdi
leaq 0x1b5d(%rip), %rsi      # 0x90ff
callq 0x42a8
movl %eax, %r15d
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
leaq 0x1b47(%rip), %rdx      # 0x9106
callq 0x4e80
movzbl %r15b, %r12d
shll $0x6, %r12d
movl %r15d, %ecx
leaq (%r12,%r13), %r15
movq -0x88(%rbp), %rdi
cmpq %rdi, %rax
je 0x7b73
addq $-0x20, %rdi
movq %rdi, -0x88(%rbp)
callq 0x20e0
subq $-0x80, %r15
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x2360
addq %r13, %r12
addq $0x80, %r12
xorl %r15d, %r15d
pushq $0x20
popq %r14
leaq -0x20(%r12), %rdi
leaq 0x1b43(%rip), %rsi      # 0x9163
callq 0x4381
testb %al, %al
je 0x7a26
incl %r15d
addq $0x20, %r12
addq $0x28, %r14
cmpl $0xf4240, %r15d         # imm = 0xF4240
jne 0x7614
jmp 0x80f6
leaq 0x20(%r13), %r12
movq %r12, %rdi
leaq 0x1a26(%rip), %rsi      # 0x907a
callq 0x42a8
movl %eax, %r15d
addq $0x40, %r13
testb %al, %al
cmoveq %r12, %r13
leaq -0x110(%rbp), %rdi
leaq 0x1b8a(%rip), %rsi      # 0x91fe
leaq -0x70(%rbp), %rdx
callq 0x20b0
testb %r15b, %r15b
je 0x7695
leaq -0x110(%rbp), %rdi
leaq 0x19ee(%rip), %rsi      # 0x907e
callq 0x2340
movq %r13, %rdi
leaq 0x1ac4(%rip), %rsi      # 0x9163
callq 0x4381
testb %al, %al
je 0x76c0
leaq 0x20(%r13), %r15
leaq -0x110(%rbp), %rdi
movq %r13, %rsi
callq 0x2360
movq %r15, %r13
jmp 0x7695
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r14), %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x19a4(%rip), %rsi      # 0x9085
callq 0x2340
movq %rbx, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x1a04(%rip), %rsi      # 0x9103
callq 0x2340
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r14), %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x1bce(%rip), %rsi      # 0x92f3
callq 0x2340
movq -0x30(%rbp), %rax
movq (%rax), %rax
leaq (%rax,%r14), %rcx
addq $0x48, %rcx
movl -0x28(%rcx), %eax
movq -0x48(%rbp), %r14
incq %r14
leaq 0x28(%rcx), %rdx
cmpl %eax, (%rcx)
movq %rdx, %rcx
jg 0x7740
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
movq -0x48(%rbp), %rcx
shlq $0x20, %rcx
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rcx, %r15
leaq (%rcx,%rax), %rdi
sarq $0x20, %rdi
leaq -0x1(%r14), %rsi
movq -0x30(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x7394
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2360
sarq $0x20, %r15
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x28, %r15, %rcx
movslq 0x20(%rax,%rcx), %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x1b41(%rip), %rsi      # 0x930b
callq 0x2340
jmp 0x8091
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r14), %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x189a(%rip), %rsi      # 0x908f
callq 0x2340
addq $0x20, %r13
pushq $0x1
popq %r14
cmpq -0x88(%rbp), %r13
je 0x7865
movq %r13, %rdi
leaq 0x18b4(%rip), %rsi      # 0x90c9
callq 0x42a8
testb %al, %al
jne 0x7831
movq %r13, %rdi
leaq 0x17f1(%rip), %rsi      # 0x9019
callq 0x42a8
testb %al, %al
je 0x783c
xorl %eax, %eax
testl %r14d, %r14d
sete %al
movl %eax, %r14d
testl %r14d, %r14d
je 0x7854
movq %r13, %rdi
leaq 0x1828(%rip), %rsi      # 0x9073
callq 0x4381
testb %al, %al
je 0x785f
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2360
addq $0x20, %r13
jmp 0x7802
movq %rbx, %rdi
leaq 0x18b8(%rip), %rsi      # 0x9127
callq 0x2340
movq -0x48(%rbp), %r14
incq %r14
jmp 0x74d5
movq -0x30(%rbp), %rax
movq (%rax), %rax
leaq (%rax,%r14), %rcx
addq $0x48, %rcx
movl -0x28(%rcx), %eax
movq -0x48(%rbp), %r15
incq %r15
leaq 0x28(%rcx), %rdx
cmpl %eax, (%rcx)
movq %rdx, %rcx
jg 0x7896
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x110(%rbp)
andq $0x0, -0x108(%rbp)
xorl %edx, %edx
movb %dl, -0x100(%rbp)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0xf0(%rbp)
andq $0x0, -0xe8(%rbp)
movb %dl, -0x60(%rbp)
movb %dl, -0xe0(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
andq $0x0, 0x40(%rax)
leaq -0x1(%r15), %rsi
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x70(%rbp), %rcx
leaq -0x110(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x2bd9
leaq -0xf0(%rbp), %rdi
leaq 0x18d6(%rip), %rsi      # 0x91fe
callq 0x42a8
testb %al, %al
je 0x7944
leaq -0xf0(%rbp), %rdi
leaq 0x1922(%rip), %rsi      # 0x9261
callq 0x2350
leaq -0x110(%rbp), %rdi
leaq 0x19af(%rip), %rsi      # 0x9301
callq 0x42a8
movq -0x50(%rbp), %rsi
testb %al, %al
jne 0x799d
movq %rbx, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x1896(%rip), %rsi      # 0x920e
callq 0x2340
leaq -0x110(%rbp), %r14
movq %r14, %rdi
leaq 0x1973(%rip), %rsi      # 0x9301
callq 0x42a8
testb %al, %al
movq %r14, %rsi
cmovneq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x2360
movq %rax, %rdi
leaq 0x171a(%rip), %rsi      # 0x90c9
callq 0x2340
movq -0xd0(%rbp), %r14
cmpq -0xc8(%rbp), %r14
je 0x7a06
addq $0x20, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x1831(%rip), %rsi      # 0x920e
callq 0x2340
addq $-0x20, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x1678(%rip), %rsi      # 0x9073
callq 0x2340
addq $0x40, %r14
jmp 0x79bb
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpb $0x2c, -0x1(%rax,%rcx)
jne 0x7b1b
movb $0x29, -0x1(%rax,%rcx)
leaq -0x70(%rbp), %r14
jmp 0x7b2e
leaq -0x180(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x2290
leaq -0xb0(%rbp), %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x6e7c
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rax, %rdi
leaq -0xb0(%rbp), %r15
movq %r15, %rsi
callq 0x2240
movq %r15, %rdi
callq 0x20e0
leaq -0x180(%rbp), %rdi
callq 0x20e0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2360
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rax, %rdi
leaq 0x1551(%rip), %rsi      # 0x9020
callq 0x42a8
testb %al, %al
je 0x7bdb
leaq -0x130(%rbp), %r12
movq %r12, %rdi
leaq 0x1721(%rip), %rsi      # 0x920e
leaq -0x110(%rbp), %rdx
callq 0x4232
movq %r15, %rdi
movq %r12, %rsi
leaq 0x161d(%rip), %rdx      # 0x9123
callq 0x4209
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2360
jmp 0x7c15
movq %rbx, %rdi
leaq 0x14f4(%rip), %rsi      # 0x9019
callq 0x2340
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
leaq 0x17ba(%rip), %rsi      # 0x92f2
callq 0x2340
movq %rax, %rdi
movq %r14, %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x17b8(%rip), %rsi      # 0x930a
callq 0x2340
leaq -0x110(%rbp), %rdi
callq 0x5f8e
movq %r14, %rdi
callq 0x20e0
movq %r15, %r14
jmp 0x74d5
movb %cl, -0xb8(%rbp)
testb %cl, %cl
je 0x7bb9
movq %r15, %rdi
leaq 0x15dc(%rip), %rsi      # 0x9163
callq 0x4381
movq -0x88(%rbp), %r13
testb %al, %al
je 0x7cbc
cmpq %r13, %r15
je 0x7cbc
leaq 0x20(%r15), %r12
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x2360
movq %r12, %r15
jmp 0x7b7d
cmpq -0x88(%rbp), %r15
je 0x7cb9
leaq 0x20(%r15), %r12
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x2360
movq %r12, %r15
jmp 0x7bb9
leaq -0x130(%rbp), %r12
movq %r12, %rdi
leaq 0x1622(%rip), %rsi      # 0x920e
leaq -0x110(%rbp), %rdx
callq 0x4232
movq %r15, %rdi
movq %r12, %rsi
leaq 0x1522(%rip), %rdx      # 0x9127
callq 0x4209
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2360
movq %r15, %rdi
callq 0x20e0
leaq -0x130(%rbp), %rdi
callq 0x20e0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x1442(%rip), %rsi      # 0x908f
callq 0x2340
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x14bf(%rip), %rsi      # 0x9127
callq 0x2340
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq 0x1499(%rip), %rsi      # 0x912a
callq 0x2340
movq %rbx, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x1478(%rip), %rsi      # 0x9127
callq 0x2340
jmp 0x808a
movq %r15, %r13
cmpq %r13, %r15
setne %al
movb -0xb8(%rbp), %cl
xorb $0x1, %cl
orb %al, %cl
jne 0x7cf6
movq 0x5302(%rip), %rdi      # 0xcfd8
leaq 0x1458(%rip), %rsi      # 0x9135
callq 0x21a0
movq %rax, %rdi
movq -0x48(%rbp), %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20f0
cmpq %r13, %r15
setne -0x31(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %r12
movq %r12, %rsi
callq 0x6f50
movq %r12, %rdi
leaq -0xb0(%rbp), %r12
movq %r12, %rsi
callq 0x2240
movq %r12, %rdi
callq 0x20e0
cmpb $0x0, -0xb8(%rbp)
je 0x7d98
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x4f76
movq %rax, -0xb8(%rbp)
cmpq %r13, %r15
je 0x7e3b
leaq -0xb0(%rbp), %rdi
leaq 0x149d(%rip), %rsi      # 0x91fe
leaq -0x130(%rbp), %rdx
callq 0x20b0
xorl %eax, %eax
movb -0x31(%rbp), %cl
movb %cl, %al
shll $0x5, %eax
addq %rax, %r15
cmpq -0x88(%rbp), %r15
je 0x7dd3
leaq -0xb0(%rbp), %rdi
movq %r15, %rsi
callq 0x2360
addq $0x20, %r15
jmp 0x7d7a
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r14), %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x135e(%rip), %rsi      # 0x9127
callq 0x2340
jmp 0x808a
leaq -0x160(%rbp), %r15
movq %r15, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2290
leaq -0x130(%rbp), %rdi
movq %r15, %rsi
movq -0x48(%rbp), %rdx
callq 0x6e7c
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rax, %rdi
leaq -0x130(%rbp), %r15
movq %r15, %rsi
callq 0x2240
movq %r15, %rdi
callq 0x20e0
leaq -0x160(%rbp), %rdi
callq 0x20e0
leaq -0xb0(%rbp), %rdi
jmp 0x7e76
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq -0x40(%rbp), %r15
movq %r15, %rdx
callq 0x70c0
movq %r15, %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rax, %rdi
leaq -0xb0(%rbp), %r15
movq %r15, %rsi
callq 0x2240
movq %r15, %rdi
callq 0x20e0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r14), %rsi
shlq $0x2, %rsi
movq %rbx, %rdi
pushq $0x20
popq %rdx
callq 0x21f0
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
movq -0x40(%rbp), %r14
movq %r14, %rdx
callq 0x70c0
movq %r12, %rdi
leaq 0x1161(%rip), %rsi      # 0x901b
callq 0x42a8
movl %eax, %r15d
movq %r12, %rdi
callq 0x20e0
testb %r15b, %r15b
je 0x7fe2
movq -0x90(%rbp), %r15
movq %r14, %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
leaq -0x130(%rbp), %r13
movq %r13, %rdi
leaq 0x1265(%rip), %rsi      # 0x915f
movq %rax, %rdx
callq 0x4232
movq %r12, %rdi
movq %r13, %rsi
leaq 0x12ff(%rip), %rdx      # 0x920e
callq 0x4209
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2360
movq %rax, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x123e(%rip), %rsi      # 0x9176
callq 0x2340
addq $0x60, %r15
leaq -0xb0(%rbp), %rdi
callq 0x20e0
leaq -0x130(%rbp), %rdi
callq 0x20e0
movq %r15, %rdi
leaq 0x1202(%rip), %rsi      # 0x9165
callq 0x4381
testb %al, %al
je 0x7fe2
movq %r15, %rdi
leaq 0x11f1(%rip), %rsi      # 0x9167
callq 0x42a8
testb %al, %al
jne 0x7fd9
movq %r15, %rdi
leaq 0x10ea(%rip), %rsi      # 0x9073
callq 0x42a8
testb %al, %al
jne 0x7fd9
movq %rbx, %rdi
leaq 0x1261(%rip), %rsi      # 0x91fd
callq 0x2340
movq %rax, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x11af(%rip), %rsi      # 0x9169
callq 0x2340
movq %rax, %rdi
movq %r15, %rsi
callq 0x2360
movq %rax, %rdi
leaq 0x11a1(%rip), %rsi      # 0x9175
callq 0x2340
addq $0x20, %r15
jmp 0x7f59
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
movq %r14, %rdx
callq 0x70c0
movq %r12, %rdi
leaq 0x1019(%rip), %rsi      # 0x901b
callq 0x4381
movl %eax, %r15d
movq %r12, %rdi
callq 0x20e0
testb %r15b, %r15b
je 0x808a
movq -0xb8(%rbp), %rax
cmpq -0x138(%rbp), %rax
jne 0x8042
movq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x42dc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x11c2(%rip), %rsi      # 0x920e
callq 0x2340
movq %rbx, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x110e(%rip), %rsi      # 0x9178
callq 0x2340
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2360
movq %rbx, %rdi
leaq 0x10a2(%rip), %rsi      # 0x9127
callq 0x2340
movq -0x48(%rbp), %r14
incq %r14
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x110(%rbp), %rdi
callq 0x20e0
jmp 0x74d5
movq 0x4f26(%rip), %rdi      # 0xcfd8
leaq 0x1255(%rip), %rsi      # 0x930e
callq 0x21a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2180
leaq 0x1261(%rip), %rsi      # 0x9331
movq %rax, %rdi
callq 0x21a0
leaq -0x90(%rbp), %rdi
callq 0x43e2
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4edb(%rip), %rdi      # 0xcfd8
leaq 0x100c(%rip), %rsi      # 0x9110
callq 0x21a0
movq %rax, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2310
movq %rax, %rdi
callq 0x20f0
xorl %edi, %edi
callq 0x2230
jmp 0x81cb
jmp 0x81ea
jmp 0x8184
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x20e0
jmp 0x8145
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x20e0
jmp 0x81ce
jmp 0x81cb
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x8173
jmp 0x8173
jmp 0x8184
jmp 0x81ea
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x20e0
jmp 0x8187
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0x81d5
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x20e0
jmp 0x81ac
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
jmp 0x81d5
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x81fa
jmp 0x8206
jmp 0x8206
jmp 0x8206
jmp 0x8206
jmp 0x8206
jmp 0x81ea
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x20e0
jmp 0x81ed
jmp 0x81ea
jmp 0x81ea
jmp 0x81ea
jmp 0x8206
jmp 0x81fa
jmp 0x81ea
jmp 0x820b
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20e0
jmp 0x81fd
jmp 0x8206
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0x821e
movq %rax, %rbx
jmp 0x8223
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x5f8e
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x43e2
movq %rbx, %rdi
callq 0x2320
nop