// File: /workspace/github_cpp_makefile_star2_O3/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 $0x168, %rsp            # imm = 0x168
movq %r9, -0x70(%rbp)
movq %r8, -0x98(%rbp)
movq %rcx, %rbx
movq %rdx, -0x38(%rbp)
movq %rsi, -0x140(%rbp)
movq %rdi, -0x48(%rbp)
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x1, %esi
callq 0x99e4
movq -0x48(%rbp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
movq -0x38(%rbp), %rax
addq (%rax), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x84c8
movq -0xb0(%rbp), %rdi
addq $0x20, %rdi
leaq 0x2c07(%rip), %rsi      # 0xb31b
callq 0x2080
testl %eax, %eax
je 0x974d
movq -0x48(%rbp), %rax
cmpq -0x140(%rbp), %rax
jbe 0x878b
movq 0x68a3(%rip), %rdi      # 0xefd8
leaq 0x2bf2(%rip), %rsi      # 0xb32e
movl $0x22, %edx
callq 0x2250
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x6884(%rip), %rdi      # 0xefd8
callq 0x2250
leaq 0x2bf1(%rip), %rsi      # 0xb351
movl $0x5, %edx
movq %rax, %rdi
callq 0x2250
leaq -0xb0(%rbp), %rdi
callq 0x4d2e
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x148(%rbp)
movq -0x98(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x138(%rbp)
movq %rbx, -0x30(%rbp)
movq -0xb0(%rbp), %r14
movq -0xa8(%rbp), %r15
cmpq %r14, %r15
je 0x87e8
movq %r14, %r12
movq (%r12), %rdi
addq $0x10, %r12
cmpq %r12, %rdi
je 0x87d8
callq 0x21c0
addq $0x10, %r12
cmpq %r15, %r12
jne 0x87c6
movq %r14, -0xa8(%rbp)
movq -0x48(%rbp), %rax
leaq (%rax,%rax,4), %r13
leaq (,%r13,8), %rdi
movq -0x38(%rbp), %rax
addq (%rax), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x84c8
movq -0xb0(%rbp), %r12
movq %r12, %rdi
leaq 0x285b(%rip), %rsi      # 0xb077
callq 0x2080
testl %eax, %eax
leaq 0x2845(%rip), %r14      # 0xb06f
je 0x897e
movq %r12, %rdi
leaq 0x284f(%rip), %rsi      # 0xb089
callq 0x2080
testl %eax, %eax
je 0x8b87
movq %r12, %rdi
movq %r14, %rsi
callq 0x2080
testl %eax, %eax
je 0x8c48
movq %r12, %rdi
movq %r14, %rsi
callq 0x2080
testl %eax, %eax
je 0x8f6a
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x4d94
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x2972(%rip), %rdx      # 0xb21e
movq %rdx, %rsi
callq 0x4e32
leaq 0x20(%r12), %rdi
leaq 0x283f(%rip), %rsi      # 0xb0ff
callq 0x2080
movl %eax, %ebx
xorl %r14d, %r14d
testl %eax, %eax
sete %r15b
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
leaq 0x2821(%rip), %rdx      # 0xb106
callq 0x59b1
movb %r15b, %r14b
shll $0x6, %r14d
addq %r14, %r12
movq -0xa8(%rbp), %rcx
cmpq %rcx, %rax
je 0x9014
leaq -0x20(%rcx), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rcx), %rdi
addq $-0x10, %rcx
cmpq %rcx, %rdi
je 0x8921
callq 0x21c0
movq 0x80(%r12), %rsi
movq 0x88(%r12), %rdx
leaq -0x90(%rbp), %rdi
callq 0x2090
leaq -0x58(%rbp), %r13
addq $0x60, %r12
xorl %r15d, %r15d
movl $0x20, %r14d
movq %r12, %rdi
leaq 0x280b(%rip), %rsi      # 0xb163
callq 0x2080
testl %eax, %eax
je 0x8e2f
incl %r15d
addq $0x20, %r12
addq $0x28, %r14
cmpl $0xf4240, %r15d         # imm = 0xF4240
jne 0x894e
jmp 0x9834
leaq 0x20(%r12), %r14
movq %r14, %rdi
leaq 0x26ed(%rip), %rsi      # 0xb07a
callq 0x2080
movl %eax, %r15d
addq $0x40, %r12
testl %eax, %eax
cmovneq %r14, %r12
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rdi
leaq 0x2863(%rip), %rdx      # 0xb21e
movq %rdx, %rsi
callq 0x4e32
testl %r15d, %r15d
jne 0x89db
leaq -0x108(%rbp), %rdi
leaq 0x26a8(%rip), %rsi      # 0xb07e
callq 0x23b0
movq %r12, %rdi
leaq 0x277e(%rip), %rsi      # 0xb163
callq 0x2080
testl %eax, %eax
je 0x8a0d
leaq 0x20(%r12), %r14
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq -0x108(%rbp), %rdi
callq 0x2090
movq %r14, %r12
jmp 0x89db
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r13,8), %rcx
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x264a(%rip), %rsi      # 0xb085
callq 0x23b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x26a3(%rip), %rsi      # 0xb103
callq 0x23b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r13,8), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x2884(%rip), %rsi      # 0xb313
callq 0x23b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq (%rax,%r13,8), %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 0x8aaa
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%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 -0x38(%rbp), %rdx
leaq -0x90(%rbp), %rcx
movq -0x98(%rbp), %r8
movq -0x70(%rbp), %r9
callq 0x8693
movq -0x30(%rbp), %rbx
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
sarq $0x20, %r15
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq (%r15,%r15,4), %rcx
movslq 0x20(%rax,%rcx,8), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x27d1(%rip), %rsi      # 0xb32b
callq 0x23b0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8b74
callq 0x21c0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
jmp 0x9001
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r13,8), %rcx
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x24da(%rip), %rsi      # 0xb08f
callq 0x23b0
addq $0x20, %r12
cmpq -0xa8(%rbp), %r12
je 0x8c34
movl $0x1, %r14d
movq %r12, %rdi
leaq 0x24f2(%rip), %rsi      # 0xb0c9
callq 0x2080
testl %eax, %eax
je 0x8bf3
movq %r12, %rdi
leaq 0x242f(%rip), %rsi      # 0xb019
callq 0x2080
testl %eax, %eax
jne 0x8bfe
xorl %eax, %eax
testl %r14d, %r14d
sete %al
movl %eax, %r14d
testl %r14d, %r14d
je 0x8c16
movq %r12, %rdi
leaq 0x2466(%rip), %rsi      # 0xb073
callq 0x2080
testl %eax, %eax
je 0x8c27
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x2090
addq $0x20, %r12
cmpq -0xa8(%rbp), %r12
jne 0x8bcd
movq %rbx, %rdi
leaq 0x24e9(%rip), %rsi      # 0xb127
callq 0x23b0
jmp 0x93b4
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq (%rax,%r13,8), %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 0x8c5e
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x88(%rbp)
movb %cl, -0x80(%rbp)
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq %rcx, -0x100(%rbp)
movb %cl, -0xf8(%rbp)
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq %rcx, -0xe0(%rbp)
movb %cl, -0xd8(%rbp)
leaq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq -0x1(%r14), %rsi
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq -0x90(%rbp), %rcx
leaq -0x108(%rbp), %r8
movq -0x70(%rbp), %r9
callq 0x2ef8
movq -0x30(%rbp), %rbx
leaq -0xe8(%rbp), %rdi
leaq 0x251f(%rip), %rsi      # 0xb21e
callq 0x2080
testl %eax, %eax
jne 0x8d2a
movq -0xe0(%rbp), %rdx
movl $0x4, %r8d
leaq -0xe8(%rbp), %rdi
xorl %esi, %esi
leaq 0x255c(%rip), %rcx      # 0xb281
callq 0x2310
leaq -0x108(%rbp), %rdi
leaq 0x25e9(%rip), %rsi      # 0xb321
callq 0x2080
movq -0x138(%rbp), %rcx
movq -0x98(%rbp), %r15
testl %eax, %eax
je 0x8da3
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x24bf(%rip), %rsi      # 0xb22e
callq 0x23b0
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq 0x259c(%rip), %rsi      # 0xb321
callq 0x2080
testl %eax, %eax
leaq -0x100(%rbp), %rcx
cmoveq -0x138(%rbp), %rcx
cmoveq -0x98(%rbp), %r15
movq (%r15), %rsi
movq (%rcx), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x230e(%rip), %rsi      # 0xb0c9
callq 0x23b0
movq -0xc8(%rbp), %r15
cmpq -0xc0(%rbp), %r15
je 0x8e13
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x2444(%rip), %rsi      # 0xb22e
callq 0x23b0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x226b(%rip), %rsi      # 0xb073
callq 0x23b0
addq $0x40, %r15
jmp 0x8dc7
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpb $0x2c, -0x1(%rax,%rcx)
jne 0x8f77
movb $0x29, -0x1(%rax,%rcx)
jmp 0x8f86
leaq -0x178(%rbp), %rax
movq %rax, -0x188(%rbp)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rbx
movq %rbx, %rdi
callq 0x4d94
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x7fb8
movq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2290
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x8e92
callq 0x21c0
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0x8eaa
callq 0x21c0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rcx
shlq $0x2, %rcx
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x2090
movq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq %rax, %rdi
leaq 0x2116(%rip), %rsi      # 0xb020
callq 0x2080
testl %eax, %eax
je 0x917b
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
leaq 0x2306(%rip), %rsi      # 0xb22e
leaq -0x108(%rbp), %rdx
callq 0x4b36
movq %rbx, %rdi
leaq 0x21e9(%rip), %rsi      # 0xb127
callq 0x23b0
movq %r13, -0x68(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x91ce
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x91d6
movq -0x48(%rbp), %r14
movq -0x30(%rbp), %rbx
jmp 0x93bb
movq %rbx, %rdi
leaq 0x2098(%rip), %rsi      # 0xb019
callq 0x23b0
movq %rbx, %rdi
leaq 0x2382(%rip), %rsi      # 0xb312
callq 0x23b0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rax, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x2375(%rip), %rsi      # 0xb32a
callq 0x23b0
leaq -0xc8(%rbp), %rdi
callq 0x73ba
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x8fde
callq 0x21c0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x8ff6
callq 0x21c0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x93bb
callq 0x21c0
jmp 0x93bb
testl %ebx, %ebx
je 0x905d
cmpq -0xa8(%rbp), %r12
je 0x907e
leaq 0x20(%r12), %r14
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq -0x90(%rbp), %rdi
callq 0x2090
movq %r14, %r12
jmp 0x9018
leaq 0x20(%r12), %r14
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq -0x90(%rbp), %rdi
callq 0x2090
movq %r14, %r12
movq %r12, %rdi
leaq 0x20fc(%rip), %rsi      # 0xb163
callq 0x2080
movq -0xa8(%rbp), %r14
testl %eax, %eax
je 0x9081
cmpq %r14, %r12
jne 0x9040
jmp 0x9081
movq %r12, %r14
movl %ebx, -0x130(%rbp)
testl %ebx, %ebx
jne 0x90e2
cmpq %r14, %r12
jne 0x90e2
movl $0x29, %edx
movq 0x5f3c(%rip), %rdi      # 0xefd8
leaq 0x2092(%rip), %rsi      # 0xb135
callq 0x2250
movq 0x5f29(%rip), %rdi      # 0xefd8
movq -0x48(%rbp), %rsi
callq 0x2130
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
cmpq %r14, %r12
setne -0x39(%rbp)
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
leaq -0x90(%rbp), %r15
movq %r15, %rsi
callq 0x811d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x911c
callq 0x21c0
cmpl $0x0, -0x130(%rbp)
je 0x9203
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r13,8), %rcx
shlq $0x2, %rcx
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1fb6(%rip), %rsi      # 0xb127
callq 0x23b0
jmp 0x9383
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
leaq 0x20a2(%rip), %rsi      # 0xb22e
leaq -0x108(%rbp), %rdx
callq 0x4b36
movq %rbx, %rdi
leaq 0x1f81(%rip), %rsi      # 0xb123
callq 0x23b0
movq %r13, -0x68(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x927b
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x9283
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x2090
jmp 0x92ab
movq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x5ab2
movq %rax, -0x130(%rbp)
cmpq %r14, %r12
leaq -0x168(%rbp), %rbx
je 0x9455
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
leaq 0x1fe1(%rip), %rdx      # 0xb21e
movq %rdx, %rsi
callq 0x4e32
movq -0x70(%rbp), %r14
xorl %eax, %eax
movb -0x39(%rbp), %cl
movb %cl, %al
shll $0x5, %eax
addq %rax, %r12
cmpq -0xa8(%rbp), %r12
je 0x93d1
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq -0x68(%rbp), %rdi
callq 0x2090
addq $0x20, %r12
jmp 0x9256
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x2090
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x92b9
callq 0x21c0
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
movq -0x30(%rbp), %rbx
je 0x92d5
callq 0x21c0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rcx
shlq $0x2, %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x1d8d(%rip), %rsi      # 0xb08f
callq 0x23b0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1e00(%rip), %rsi      # 0xb127
callq 0x23b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq (%rax,%r14), %rcx
shlq $0x2, %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq %rbx, %rdi
leaq 0x1dd1(%rip), %rsi      # 0xb12a
callq 0x23b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1da9(%rip), %rsi      # 0xb127
callq 0x23b0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x9398
callq 0x21c0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
movq -0x30(%rbp), %rbx
je 0x93b4
callq 0x21c0
movq -0x48(%rbp), %r14
incq %r14
movq %r14, -0x48(%rbp)
cmpq -0x140(%rbp), %r14
jbe 0x87b0
jmp 0x872e
leaq -0x158(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x4d94
leaq -0x128(%rbp), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
callq 0x7fb8
movq %r14, %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq %rax, %rdi
leaq -0x128(%rbp), %rsi
callq 0x2290
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x943b
callq 0x21c0
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x9487
callq 0x21c0
jmp 0x9487
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq -0x70(%rbp), %r14
movq %r14, %rdx
callq 0x8319
movq %r14, %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x9499
callq 0x21c0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq 0x20(%rax,%r13,8), %rcx
shlq $0x2, %rcx
movq -0x30(%rbp), %rdi
movq 0x8(%rdi), %rsi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
leaq -0x58(%rbp), %r13
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
leaq -0x90(%rbp), %rsi
movq -0x70(%rbp), %r14
movq %r14, %rdx
callq 0x8319
movq %rbx, %rdi
leaq 0x1b35(%rip), %rsi      # 0xb01b
callq 0x2080
movl %eax, %r15d
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x94fc
callq 0x21c0
testl %r15d, %r15d
je 0x95d5
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
leaq -0x90(%rbp), %rsi
movq %r14, %rdx
callq 0x8319
movq %rbx, %rdi
leaq 0x1af6(%rip), %rsi      # 0xb01b
callq 0x2080
movl %eax, %r15d
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x953b
callq 0x21c0
testl %r15d, %r15d
movq -0x30(%rbp), %rbx
je 0x9383
movq -0x130(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x9577
movq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1cad(%rip), %rsi      # 0xb22e
callq 0x23b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1bd2(%rip), %rsi      # 0xb178
callq 0x23b0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rdi
leaq 0x1b5c(%rip), %rsi      # 0xb127
callq 0x23b0
jmp 0x9383
movq -0xb0(%rbp), %r12
movq %r14, %rdi
leaq -0x108(%rbp), %rsi
callq 0x4bc2
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1b63(%rip), %rsi      # 0xb15f
movq %rax, %rdx
callq 0x4b36
movq %rbx, %rdi
leaq 0x1c20(%rip), %rsi      # 0xb22e
callq 0x23b0
movq %r13, -0x68(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9633
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x963b
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x2090
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rax, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x1af3(%rip), %rsi      # 0xb176
callq 0x23b0
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x9696
callq 0x21c0
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x96ae
callq 0x21c0
addq $0x60, %r12
movq %r12, %rdi
leaq 0x1aa9(%rip), %rsi      # 0xb165
callq 0x2080
testl %eax, %eax
je 0x9505
movq %r12, %rdi
leaq 0x1a94(%rip), %rsi      # 0xb167
callq 0x2080
testl %eax, %eax
je 0x9744
movq %r12, %rdi
leaq 0x198d(%rip), %rsi      # 0xb073
callq 0x2080
testl %eax, %eax
je 0x9744
movq -0x30(%rbp), %rdi
leaq 0x1b23(%rip), %rsi      # 0xb21d
callq 0x23b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %rax, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x1a4a(%rip), %rsi      # 0xb169
callq 0x23b0
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rax, %rdi
callq 0x2090
movq %rax, %rdi
leaq 0x1a36(%rip), %rsi      # 0xb175
callq 0x23b0
addq $0x20, %r12
jmp 0x96b2
movq -0xb0(%rbp), %rsi
addq $0x40, %rsi
movq -0x98(%rbp), %rdi
callq 0x2110
movq -0xb0(%rbp), %rdi
addq $0x60, %rdi
leaq 0x19ed(%rip), %rsi      # 0xb163
callq 0x2080
testl %eax, %eax
je 0x9821
movq -0xb0(%rbp), %rdi
addq $0x60, %rdi
leaq 0x1934(%rip), %rsi      # 0xb0c9
callq 0x2080
testl %eax, %eax
jne 0x8721
movq -0xb0(%rbp), %r14
leaq 0x80(%r14), %rdi
leaq 0x1862(%rip), %rsi      # 0xb019
callq 0x2080
testl %eax, %eax
je 0x8721
movq -0x98(%rbp), %rax
leaq 0x28(%rax), %r15
addq $0xa0, %r14
leaq 0x1896(%rip), %r13      # 0xb073
leaq -0x20(%r14), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2080
testl %eax, %eax
je 0x9805
movq %r15, %rdi
movq %r12, %rsi
callq 0x4c42
movq -0x98(%rbp), %rax
incl 0x20(%rax)
movq %r14, %rdi
leaq 0x180a(%rip), %rsi      # 0xb019
callq 0x2080
addq $0x20, %r14
testl %eax, %eax
jne 0x97dd
jmp 0x8721
movq -0x98(%rbp), %rax
movl $0x0, 0x20(%rax)
jmp 0x8721
movq 0x579d(%rip), %rdi      # 0xefd8
leaq 0x18ce(%rip), %rsi      # 0xb110
movl $0x12, %edx
callq 0x2250
movq 0x5785(%rip), %rdi      # 0xefd8
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2350
movq %rax, %rdi
callq 0x20e0
xorl %edi, %edi
callq 0x2280
jmp 0x98fd
jmp 0x994c
jmp 0x9979
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x989b
callq 0x21c0
jmp 0x989b
movq %rax, %rbx
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x994f
callq 0x21c0
jmp 0x994f
jmp 0x994c
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x98ea
jmp 0x98ea
jmp 0x98fd
jmp 0x9979
jmp 0x9979
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x9900
callq 0x21c0
jmp 0x9900
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
jmp 0x9957
jmp 0x9979
jmp 0x9993
jmp 0x9979
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x992c
callq 0x21c0
jmp 0x992c
movq %rax, %rbx
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
jmp 0x9957
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x9979
jmp 0x9998
jmp 0x9993
jmp 0x9993
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x997c
callq 0x21c0
jmp 0x997c
jmp 0x9979
jmp 0x9993
jmp 0x9993
jmp 0x9993
jmp 0x9979
jmp 0x9993
jmp 0x9979
jmp 0x9979
jmp 0x99ab
jmp 0x9979
jmp 0x9998
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x999b
callq 0x21c0
jmp 0x999b
movq %rax, %rbx
jmp 0x99cf
movq %rax, %rbx
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
jmp 0x99c5
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x6f08
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x99cf
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x4d2e
movq %rbx, %rdi
callq 0x2370
nop