// File: /workspace/github_c_makefile_star2_O2/luixmao[P]verilog/vlg_parser_man.cpp
// Function: VlgParser::parse(char*)
Design* VlgParser::parse(char *filename) {


  //take text into ifile
  ifstream ifile(filename);

  //initializers
  Design* ptr_des1; //needs to be inialized later    // = new Design(designName);
  int next_line_no=1;//line number 
  bool hasModule=false; //whether it has module
  bool hasEndmodule=false; //whether it has endmodule

  //check that the first thing is module
  while ( !ifile.eof() ){
    string line_of_text;
    //get a line of text
    getline(ifile, line_of_text);
    //increase to the next line
    next_line_no++;
    //clean up, erase comments and repeated spaces
    line_of_text= errase_comments_and_spaces(line_of_text);

    stringstream ss(line_of_text);
    string token;
    ss >>token;
          //check that first thing is module
          if(token!="module" && token!=" "  && !token.empty()){
	      cout << " error: line " << next_line_no-1 << ": need module   " <<endl;
	      return NULL;
          } 
          //if module, set name
          else if (token=="module"){
            hasModule=true;
            string designName;
            getline(ss , designName, '(' );
            designName= remove_side_spaces( designName);//might contain side spaces, so remove them
            if(! (isID(designName)) ){
		 cout << " error: line " << next_line_no-1 << ": not a valid name   " <<endl; 
                 return NULL;
            }
            ptr_des1= new Design(designName);

            //check inside the parentesis
               //check proper close parenthesis ')'
               string pos_parentesis;
               getline(ss , pos_parentesis );
               if(!has_proper_parentesis(pos_parentesis) ){
	  	  cout << " error: line " << next_line_no-1 << ": not proper parenthesis   " <<endl; 
                  delete ptr_des1;
                  return NULL;
               }

               //check for validity inside parentesis
               stringstream temp(pos_parentesis);
               string inside_parentesis; 
               getline(temp , inside_parentesis ,')'); 
               inside_parentesis=remove_side_spaces(inside_parentesis);
 
               if (inside_parentesis[inside_parentesis.length()-1] == ','){//error if last item is ',' 
                  cout << " error: line " << next_line_no-1 << ":  additional ','  " <<endl; 
                  delete ptr_des1;
                  return NULL;
               }
               //check parentesis are right
               stringstream temp2(inside_parentesis);
               string name_id;
               int count_elements=0;
               while( temp2.good() ){ //while there are inputs
                 count_elements++;
                 getline(temp2,name_id, ',');
                 name_id=remove_side_spaces(name_id);
                 //check valid id
                 if( !isID(name_id)){
	  	   cout << " error: line " << next_line_no-1 << ": not valid ID, or issue with ','    " <<endl;
                   delete ptr_des1; 
                   return NULL;
                 }
               }
               //if not enough elements display error
 	       if(count_elements<2){
	  	   cout << " error: line " << next_line_no-1 << ": needs at least one input and one output ','   " <<endl; 
                   delete ptr_des1;
                   return NULL;
               }
            //end check inside parentesis
            break;
          }
  }
  //if didn't find module, error
  if(!hasModule){
     cout << " error: missing module declaration" <<endl;
     return NULL;
  }

     // cout << " error: line " << next_line_no-1 << ": not a valid name   " <<endl;


  //run while until there is no more text
  while ( !ifile.eof() ){
    string line_of_text;
    //get a line of text
    getline(ifile, line_of_text);
    //increase to the next line
    next_line_no++;
    //clean up, erase comments and repeated spaces
    line_of_text= errase_comments_and_spaces(line_of_text);

    stringstream ss(line_of_text);
    string token;
    ss >>token;
    if(ss.fail() || (token.length()==1 && token[0]==' ')){ //if no text in this line
      continue;
    }
    else{
       //if it has semicolon
       if(!has_proper_Semicolon(remove_spaces(line_of_text)) && token!="endmodule"){//has one ';' and it is last item 
          cout << " error: line " << next_line_no-1 << ":  improper ';'  " <<endl;
          delete ptr_des1;
          return NULL;
       }
       else{
          if( token=="endmodule" ){
             hasEndmodule=true;
             //check if there is anything after endmodule
             while ( !ifile.eof() ){
      	        getline(ifile, line_of_text);
  	        //increase to the next line
  	        next_line_no++;
  	        //clean up, erase comments and repeated spaces
  	        line_of_text= errase_comments_and_spaces(line_of_text);
   	        for(unsigned int i=0 ; i!=line_of_text.length();i++){
    	           if(line_of_text!=" "){
    	              cout << " error: line " << next_line_no-1 << ": nothing allowed after endmodule   " <<endl;
                      delete ptr_des1;
     	              return NULL;
     	           }
   	        }

             }
          }     
          //add input if it is possible ID
          else if( token=="input" ){
            string input_name;
 	    getline(ss , input_name, ';' );
            input_name= remove_side_spaces( input_name);//might contain spaces on sides, so remove them
            if(! (isID(input_name)) ){
		 cout << " error: line " << next_line_no-1 << ": not a valid name   " <<endl; 
                 delete ptr_des1;
                 return NULL;
            }
   	    ptr_des1->addPI(input_name); //add new input
          }     
          //add output if it is possible ID
          else if( token=="output" ){
            string output_name;
 	    getline(ss , output_name, ';' );
            output_name= remove_side_spaces( output_name);//might contain spaces on sides, so remove them
            if(! (isID(output_name)) ){
		 cout << " error: line " << next_line_no-1 << ": not a valid name   " <<endl; 
                 delete ptr_des1;
                 return NULL;
            }
   	    ptr_des1->addPO(output_name); //add new input
          }     

          //add wire if it is possible ID
          else if( token=="wire" ){
            string wire_name;
 	    getline(ss , wire_name, ';' );
            wire_name= remove_side_spaces( wire_name); //might contain spaces on sides, so remove them
            if(! (isID(wire_name)) ){
		 cout << " error: line " << next_line_no-1 << ": not a valid name   " <<endl; 
                 delete ptr_des1;
                 return NULL;
            }
   	    ptr_des1->addFindNet(wire_name); //add new input
          }     
          else if(token == "and" || token == "or" || token == "nand"|| token == "nor"|| token == "xor"|| token == "not"){
             int gate_type =  find_gate_type(token);
	     string pre_parentesis; //rest of the line after "and" declaration
             getline(ss , pre_parentesis, '(' );
             vector<string>* ptr_vec =return_words(pre_parentesis);
 	     int num_elements=ptr_vec->size();
             if(num_elements >2){
                 cout << " error: line " << next_line_no-1 << ": too many entries before '('   " <<endl; 
                 delete ptr_vec;
                 delete ptr_des1;
                 return NULL;
             }
             else if(num_elements ==1 || num_elements ==2){
               string gate_name;//gate name
               if(num_elements ==1 ){
                 gate_name =(*ptr_vec)[0];
                 if(! (isID(gate_name)) ){
  	  	    cout << " error: line " << next_line_no-1 << ": not a valid gate name   " <<endl; 
                    delete ptr_vec;
                    delete ptr_des1;
                    return NULL;
                 }
                 ptr_des1->addFindGate(gate_type, gate_name);
               }
               else{ //if(num_elements ==2)
                 //check proper name
                 gate_name =(*ptr_vec)[1];
                 if(! (isID(gate_name)) ){
	    	    cout << " error: line " << next_line_no-1 << ": not a valid gate name   " <<endl; 
                    delete ptr_vec;
                    delete ptr_des1;
                    return NULL;
                 }
                  
                 //check proper delay
                 string delay_str =(*ptr_vec)[0];// delay with
                 if(! (isDelay(delay_str)) ){
	  	    cout << " error: line " << next_line_no-1 << ": not a valid delay   " <<endl; 
                    delete ptr_vec;
                    delete ptr_des1;
                    return NULL;
                 }
                 delay_str.erase(delay_str.begin());
                 int delay = atoi( delay_str.c_str() );
                 ptr_des1->addFindGate(gate_type, gate_name)->setDelay(delay);
               }



               //check proper close parenthesis ')'

               string pos_parentesis;
               getline(ss , pos_parentesis );
               if(!has_proper_parentesis(pos_parentesis) ){
	  	  cout << " error: line " << next_line_no-1 << ": not proper parenthesis   " <<endl; 
                  delete ptr_vec;
                  delete ptr_des1;
                  return NULL;
               }

               //check for validity inside parentesis
               stringstream temp(pos_parentesis);
               string inside_parentesis; 
               getline(temp , inside_parentesis ,')'); 
               inside_parentesis=remove_side_spaces(inside_parentesis);
 
               if (inside_parentesis[inside_parentesis.length()-1] == ','){//error if last item is ',' 
                  cout << " error: line " << next_line_no-1 << ": not additional ','  " <<endl; 
                  delete ptr_vec;
                  delete ptr_des1;
                  return NULL;
               }
               
               stringstream temp2(inside_parentesis);
               string name_id;
               bool isOutput = true;
               int count_elements=0;
           
               while( temp2.good() ){ //while there are inputs, get the names and make new nets if valid name
                 count_elements++;
                 getline(temp2,name_id, ',');
                 name_id=remove_side_spaces(name_id);
                 //check valid id
                 if( !isID(name_id)){
	  	   cout << " error: line " << next_line_no-1 << ": not valid ID or missing ','   " <<endl;
                   delete ptr_vec;
                   delete ptr_des1; 
                   return NULL;
                 }
                 if(isOutput){ //first item is output
                   //add output
                   ptr_des1->addFindGate(gate_type, gate_name)->addOutput(ptr_des1->addFindNet(name_id));
		   isOutput=false;//to not enter again
                 }
                 else{
                   //add inputs
                   ptr_des1->addFindGate(gate_type, gate_name)->addInput(ptr_des1->addFindNet(name_id));
                 }
               }
               //error if elements is not enough
 	       if(count_elements<2){
	  	   cout << " error: line " << next_line_no-1 << ": needs at least one input and one output    " <<endl;
                   delete ptr_vec; 
                   delete ptr_des1;
                   return NULL;
               }

             }
             else{  
                  cout << " error: line " << next_line_no-1 << ": expected gate name   " <<endl; 
                  delete ptr_vec;
                  delete ptr_des1;
                  return NULL;
             }
           
             delete ptr_vec;
          }

          else{ //if it is not one of the expected declarations
    	     cout << " error: line " << next_line_no-1 << ": not a valid declaration   " <<endl;
             delete ptr_des1;
     	     return NULL;
          }
         
      }
    }

  }


  //if didn't find module, error
  if(!hasEndmodule){
     cout << " error: missing endmodule " <<endl;
     delete ptr_des1;
     return NULL;
  }


 
  ifile.close();
  return ptr_des1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x798, %rsp            # imm = 0x798
leaq -0x7b8(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3310
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
leaq -0xc0(%rbp), %r15
leaq -0x228(%rbp), %r13
leaq -0x5b0(%rbp), %rbx
movq -0x7b8(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x798(%rbp,%rax), %eax
testb $0x2, %al
jne 0x6434
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
andq $0x0, -0xb8(%rbp)
movb $0x0, -0xb0(%rbp)
leaq -0x7b8(%rbp), %rdi
movq %r15, %rsi
callq 0x3050
movq %r13, %rdi
movq %r15, %rsi
callq 0x3240
movq %rbx, %rdi
movq %r13, %rsi
callq 0x72ef
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x30d0
movq %r13, %rdi
callq 0x30d0
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x18
popq %rdx
callq 0x32a0
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
andq $0x0, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq %rbx, %rdi
leaq -0xa0(%rbp), %r14
movq %r14, %rsi
callq 0x3220
movq %r14, %rdi
leaq 0x1f73(%rip), %rsi      # 0x8143
callq 0x78d3
testb %al, %al
je 0x6234
movq %r14, %rdi
leaq 0x206a(%rip), %rsi      # 0x824d
callq 0x78d3
cmpq $0x0, -0x98(%rbp)
setne %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x6234
movq 0x5dd0(%rip), %rdi      # 0xbfd0
leaq 0x1f59(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1f4c(%rip), %rsi      # 0x816e
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x63f6
movq %r14, %rdi
leaq 0x1f05(%rip), %rsi      # 0x8143
callq 0x78e0
movb $0x1, %r13b
testb %al, %al
je 0x63f9
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
pushq $0x28
popq %rdx
callq 0x3320
leaq -0x408(%rbp), %r13
movq %r13, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
leaq -0x80(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x7396
movq %r13, %r14
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3200
movq %r12, %rdi
callq 0x30d0
movq %r14, %rdi
callq 0x30d0
leaq -0x3e8(%rbp), %rdi
movq %r13, %rsi
callq 0x3240
leaq -0x3e8(%rbp), %r14
movq %r14, %rdi
callq 0x73ef
movl %eax, %r13d
movq %r14, %rdi
callq 0x30d0
testb %r13b, %r13b
je 0x63b4
movl $0xd8, %edi
callq 0x31a0
movq %rax, -0x30(%rbp)
leaq -0x3c8(%rbp), %r12
movq %r12, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x485a
leaq -0x80(%rbp), %r14
leaq -0x3a8(%rbp), %r13
movq %r12, %rdi
callq 0x30d0
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
andq $0x0, -0x78(%rbp)
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3050
movq %r13, %rdi
movq %r14, %rsi
callq 0x3240
movq %r13, %rdi
callq 0x745b
movq %r13, %rdi
callq 0x30d0
movq 0x5c6e(%rip), %rdi      # 0xbfd0
leaq 0x1df7(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1e11(%rip), %rsi      # 0x8195
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %r13, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x30d0
jmp 0x63ea
movq 0x5c15(%rip), %rdi      # 0xbfd0
leaq 0x1d9e(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1da2(%rip), %rsi      # 0x817f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
leaq -0x58(%rbp), %rdi
callq 0x30d0
movb $0x1, %r12b
xorl %r13d, %r13d
leaq -0xa0(%rbp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3130
movq %r15, %rdi
callq 0x30d0
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
testb %r13b, %r13b
leaq -0x228(%rbp), %r13
jne 0x6112
jmp 0x70ca
testb $0x1, %r12b
je 0x705c
movl $0x0, -0x60(%rbp)
leaq -0x388(%rbp), %r14
testb $0x2, %al
jne 0x7079
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
andq $0x0, -0xb8(%rbp)
movb $0x0, -0xb0(%rbp)
leaq -0x7b8(%rbp), %rdi
leaq -0xc0(%rbp), %r15
movq %r15, %rsi
callq 0x3050
movq %r14, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3240
leaq -0x5b0(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x72ef
movq %r15, %rdi
movq %r13, %rsi
callq 0x3200
movq %r13, %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x30d0
movq %r13, %rdi
movq %r15, %rsi
pushq $0x18
popq %rdx
callq 0x32a0
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
andq $0x0, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq %r13, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3220
movq -0x38(%rbp), %rax
incl %eax
movl %eax, -0x5c(%rbp)
movq -0x5b0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x590(%rbp,%rax)
je 0x6521
pushq $0x6
jmp 0x6731
cmpq $0x1, -0x98(%rbp)
jne 0x6537
movq -0xa0(%rbp), %rax
cmpb $0x20, (%rax)
je 0x651a
leaq -0x108(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3240
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
leaq -0x108(%rbp), %rsi
callq 0x761d
movq %rbx, %rdi
callq 0x757e
testb %al, %al
je 0x6589
leaq -0x128(%rbp), %rdi
callq 0x30d0
leaq -0x108(%rbp), %rdi
callq 0x30d0
jmp 0x6613
leaq -0xa0(%rbp), %rdi
leaq 0x1ba9(%rip), %rsi      # 0x8140
callq 0x78d3
movl %eax, %ebx
leaq -0x128(%rbp), %rdi
callq 0x30d0
leaq -0x108(%rbp), %rdi
callq 0x30d0
testb %bl, %bl
je 0x6613
movq 0x5a0f(%rip), %rdi      # 0xbfd0
leaq 0x1b98(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1bf1(%rip), %rsi      # 0x81d4
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x6601
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
jmp 0x672f
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1b1c(%rip), %rsi      # 0x8140
callq 0x78e0
testb %al, %al
je 0x6784
movl -0x5c(%rbp), %eax
movl %eax, %ebx
movq -0x7b8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x798(%rbp,%rax)
leaq -0xc0(%rbp), %r15
jne 0x6cba
leaq -0x7b8(%rbp), %rdi
movq %r15, %rsi
callq 0x3050
leaq -0x368(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3240
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x72ef
leal 0x1(%rbx), %eax
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
movq %r13, %rsi
callq 0x3200
movq %r13, %rdi
callq 0x30d0
movq %r12, %rdi
callq 0x30d0
xorl %r12d, %r12d
movl %r12d, %eax
cmpq %rax, -0xb8(%rbp)
je 0x6631
leaq -0xc0(%rbp), %rdi
leaq 0x1b81(%rip), %rsi      # 0x824d
callq 0x78d3
incl %r12d
testb %al, %al
je 0x66ae
movq 0x58f1(%rip), %rdi      # 0xbfd0
leaq 0x1a7a(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movl %ebx, %esi
callq 0x32e0
movq %rax, %rdi
leaq 0x1ae7(%rip), %rsi      # 0x81e6
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x671d
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
movb $0x1, %al
movl %eax, -0x60(%rbp)
pushq $0x1
popq %r12
leaq -0xa0(%rbp), %rdi
callq 0x30d0
leaq -0x5b0(%rbp), %rdi
callq 0x3130
leaq -0xc0(%rbp), %rdi
callq 0x30d0
cmpl $0x6, %r12d
je 0x6766
testl %r12d, %r12d
jne 0x70ca
movq -0x7b8(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x798(%rbp,%rax), %eax
movl -0x5c(%rbp), %ecx
movq %rcx, -0x38(%rbp)
jmp 0x644c
movq %rbx, %rdi
leaq 0x1a7d(%rip), %rsi      # 0x820b
callq 0x78e0
testb %al, %al
je 0x6858
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
pushq $0x3b
popq %rdx
callq 0x3320
leaq -0x348(%rbp), %r13
movq %r13, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x7396
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3200
movq %r15, %rdi
callq 0x30d0
movq %r13, %rdi
callq 0x30d0
leaq -0x328(%rbp), %rdi
movq %rbx, %rsi
callq 0x3240
leaq -0x328(%rbp), %r15
movq %r15, %rdi
callq 0x73ef
movl %eax, %ebx
movq %r15, %rdi
callq 0x30d0
testb %bl, %bl
je 0x6a08
leaq -0x208(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
leaq -0x208(%rbp), %r15
movq %r15, %rsi
callq 0x4b12
jmp 0x69fb
movq %rbx, %rdi
leaq 0x19af(%rip), %rsi      # 0x8211
callq 0x78e0
testb %al, %al
je 0x692c
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
pushq $0x3b
popq %rdx
callq 0x3320
leaq -0x308(%rbp), %r13
movq %r13, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x7396
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3200
movq %r15, %rdi
callq 0x30d0
movq %r13, %rdi
callq 0x30d0
leaq -0x2e8(%rbp), %rdi
movq %rbx, %rsi
callq 0x3240
leaq -0x2e8(%rbp), %r15
movq %r15, %rdi
callq 0x73ef
movl %eax, %ebx
movq %r15, %rdi
callq 0x30d0
testb %bl, %bl
je 0x6b79
leaq -0x1e8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
leaq -0x1e8(%rbp), %r15
movq %r15, %rsi
callq 0x4bbe
jmp 0x69fb
movq %rbx, %rdi
leaq 0x18e2(%rip), %rsi      # 0x8218
callq 0x78e0
testb %al, %al
je 0x6a43
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
pushq $0x3b
popq %rdx
callq 0x3320
leaq -0x2c8(%rbp), %r13
movq %r13, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x7396
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3200
movq %r15, %rdi
callq 0x30d0
movq %r13, %rdi
callq 0x30d0
leaq -0x2a8(%rbp), %rdi
movq %rbx, %rsi
callq 0x3240
leaq -0x2a8(%rbp), %r15
movq %r15, %rdi
callq 0x73ef
movl %eax, %ebx
movq %r15, %rdi
callq 0x30d0
testb %bl, %bl
je 0x6bb1
leaq -0x1c8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
leaq -0x1c8(%rbp), %r15
movq %r15, %rsi
callq 0x4c94
movq %r15, %rdi
callq 0x30d0
jmp 0x6c05
movq 0x55c1(%rip), %rdi      # 0xbfd0
leaq 0x174a(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x174e(%rip), %rsi      # 0x817f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x6be7
movq %rbx, %rdi
leaq 0x17d1(%rip), %rsi      # 0x821e
callq 0x78e0
testb %al, %al
jne 0x6ab9
movq %rbx, %rdi
leaq 0x17c3(%rip), %rsi      # 0x8223
callq 0x78e0
testb %al, %al
jne 0x6ab9
movq %rbx, %rdi
leaq 0x17aa(%rip), %rsi      # 0x821d
callq 0x78e0
testb %al, %al
jne 0x6ab9
movq %rbx, %rdi
leaq 0x179c(%rip), %rsi      # 0x8222
callq 0x78e0
testb %al, %al
jne 0x6ab9
movq %rbx, %rdi
leaq 0x178d(%rip), %rsi      # 0x8226
callq 0x78e0
testb %al, %al
jne 0x6ab9
movq %rbx, %rdi
leaq 0x177e(%rip), %rsi      # 0x822a
callq 0x78e0
testb %al, %al
je 0x7021
leaq -0x428(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3240
movq %r15, %rdi
callq 0x766e
movl %eax, %ebx
movq %r15, %rdi
callq 0x30d0
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0x58(%rbp), %r13
movq %r13, %rsi
pushq $0x28
popq %rdx
callq 0x3320
leaq -0x288(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x3240
movq %r15, %rdi
callq 0x7704
movq %rax, %r13
movq %r15, %rdi
callq 0x30d0
movq 0x8(%r13), %rax
subq (%r13), %rax
shrq $0x5, %rax
cmpl $0x3, %eax
jl 0x6c22
movq 0x548b(%rip), %rdi      # 0xbfd0
leaq 0x1614(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x16c7(%rip), %rsi      # 0x822e
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x6cfd
movq 0x5450(%rip), %rdi      # 0xbfd0
leaq 0x15d9(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x15dd(%rip), %rsi      # 0x817f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x6be7
movq 0x5418(%rip), %rdi      # 0xbfd0
leaq 0x15a1(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x15a5(%rip), %rsi      # 0x817f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq -0x30(%rbp), %r12
testq %r12, %r12
je 0x6bf8
movq %r12, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %r12, %rdi
callq 0x31b0
leaq -0x58(%rbp), %rdi
callq 0x30d0
pushq $0x1
popq %r12
testb %bl, %bl
je 0x6733
xorl %r12d, %r12d
jmp 0x6733
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0x6cc7
andq $0x0, -0x78(%rbp)
leaq -0x70(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movb $0x0, -0x70(%rbp)
movq (%r13), %rsi
cmpl $0x1, %eax
jne 0x6d33
leaq -0x80(%rbp), %rdi
callq 0x3100
leaq -0x268(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3240
leaq -0x268(%rbp), %r15
movq %r15, %rdi
callq 0x73ef
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
testb %r12b, %r12b
je 0x6e1d
leaq -0x1a8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
movl %ebx, %esi
leaq -0x1a8(%rbp), %rbx
movq %rbx, %rdx
callq 0x5058
movq %rbx, %rdi
callq 0x30d0
jmp 0x6f3d
movb $0x1, %al
movl %eax, -0x60(%rbp)
movl %ebx, -0x5c(%rbp)
jmp 0x6c1a
movq 0x5302(%rip), %rdi      # 0xbfd0
leaq 0x148b(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1591(%rip), %rsi      # 0x8281
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq %r13, %rdi
callq 0x53b6
movq %r13, %rdi
pushq $0x18
popq %rsi
callq 0x31b0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x6d21
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
jmp 0x7013
addq $0x20, %rsi
leaq -0x80(%rbp), %rdi
callq 0x3100
leaq -0x248(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3240
leaq -0x248(%rbp), %r15
movq %r15, %rdi
callq 0x73ef
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
testb %r12b, %r12b
je 0x6e55
movq (%r13), %rsi
leaq -0xe8(%rbp), %r15
movq %r15, %rdi
callq 0x3240
leaq -0x188(%rbp), %rdi
movq %r15, %rsi
callq 0x3240
leaq -0x188(%rbp), %r15
movq %r15, %rdi
callq 0x77c2
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
testb %r12b, %r12b
je 0x6ec1
movq -0xe8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x3210
movq -0xe8(%rbp), %rdi
callq 0x3290
movl %eax, -0xc4(%rbp)
leaq -0x168(%rbp), %r15
movq %r15, %rdi
leaq -0x80(%rbp), %rsi
callq 0x3240
movq -0x30(%rbp), %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x5058
movq %rax, %rdi
movl -0xc4(%rbp), %esi
callq 0x3be6
leaq -0x168(%rbp), %rdi
callq 0x30d0
jmp 0x6f28
movq 0x51ac(%rip), %rdi      # 0xbfd0
leaq 0x1335(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1409(%rip), %rsi      # 0x824f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x6e8b
movq 0x5174(%rip), %rdi      # 0xbfd0
leaq 0x12fd(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x13d1(%rip), %rsi      # 0x824f
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq %r13, %rdi
callq 0x53b6
movq %r13, %rdi
pushq $0x18
popq %rsi
callq 0x31b0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x6eaf
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
jmp 0x700a
movq 0x5108(%rip), %rdi      # 0xbfd0
leaq 0x1291(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x1380(%rip), %rsi      # 0x826a
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq %r13, %rdi
callq 0x53b6
movq %r13, %rdi
pushq $0x18
popq %rsi
callq 0x31b0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x6f1b
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
leaq -0xe8(%rbp), %rdi
callq 0x30d0
testb %r12b, %r12b
je 0x700a
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
andq $0x0, -0xe0(%rbp)
movb $0x0, -0xd8(%rbp)
leaq -0x5b0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3050
leaq -0x148(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3240
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x745b
movq %rbx, %rdi
callq 0x30d0
movq 0x5032(%rip), %rdi      # 0xbfd0
leaq 0x11bb(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x11d5(%rip), %rsi      # 0x8195
callq 0x3190
movq %rax, %rdi
callq 0x30e0
movq %r13, %rdi
callq 0x53b6
movq %r13, %rdi
pushq $0x18
popq %rsi
callq 0x31b0
movq -0x30(%rbp), %rbx
testq %rbx, %rbx
je 0x6ff1
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
leaq -0xe8(%rbp), %rdi
callq 0x30d0
leaq -0x80(%rbp), %rdi
callq 0x30d0
leaq -0x58(%rbp), %rdi
callq 0x30d0
jmp 0x672f
movq 0x4fa8(%rip), %rdi      # 0xbfd0
leaq 0x1131(%rip), %rsi      # 0x8160
callq 0x3190
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x124f(%rip), %rsi      # 0x8299
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x65f0
movq 0x4f6d(%rip), %rdi      # 0xbfd0
leaq 0x1147(%rip), %rsi      # 0x81b1
callq 0x3190
movq %rax, %rdi
callq 0x30e0
jmp 0x70ca
testb $0x1, -0x60(%rbp)
je 0x7091
leaq -0x7b8(%rbp), %rdi
callq 0x3060
movq -0x30(%rbp), %rbx
jmp 0x70cc
movq 0x4f38(%rip), %rdi      # 0xbfd0
leaq 0x1217(%rip), %rsi      # 0x82b6
callq 0x3190
movq -0x30(%rbp), %rbx
movq %rax, %rdi
callq 0x30e0
testq %rbx, %rbx
je 0x70bd
movq %rbx, %rdi
callq 0x49a4
movl $0xd8, %esi
movq %rbx, %rdi
callq 0x31b0
xorl %ebx, %ebx
leaq -0x7b8(%rbp), %rdi
callq 0x3070
movq %rbx, %rax
addq $0x798, %rsp            # imm = 0x798
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x713f
jmp 0x713f
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
jmp 0x722f
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
jmp 0x7127
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
jmp 0x7127
jmp 0x7298
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x30d0
jmp 0x7142
jmp 0x713f
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
jmp 0x729f
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x722f
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
jmp 0x729f
jmp 0x72a6
jmp 0x72a6
jmp 0x72b4
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
jmp 0x729f
jmp 0x72a6
movq %rax, %rbx
leaq -0x1e8(%rbp), %rdi
jmp 0x729f
jmp 0x7298
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
jmp 0x729f
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
jmp 0x729f
jmp 0x72a6
jmp 0x72a6
movq %rax, %rbx
leaq -0x348(%rbp), %rdi
jmp 0x729f
jmp 0x72a6
jmp 0x72a6
jmp 0x72a6
movq %rax, %rbx
jmp 0x72db
movq %rax, %rbx
leaq -0x368(%rbp), %rdi
jmp 0x72ad
jmp 0x72b4
jmp 0x72b4
jmp 0x72a6
movq %rax, %rbx
jmp 0x7219
jmp 0x72b4
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x30d0
leaq -0x108(%rbp), %rdi
jmp 0x72ad
movq %rax, %rbx
leaq -0x3a8(%rbp), %rdi
callq 0x30d0
jmp 0x729b
movq %rax, %rbx
leaq -0x3c8(%rbp), %rdi
callq 0x30d0
jmp 0x724a
movq %rax, %rbx
movl $0xd8, %esi
movq -0x30(%rbp), %rdi
callq 0x31b0
jmp 0x72a9
jmp 0x7291
movq %rax, %rbx
leaq -0x388(%rbp), %rdi
jmp 0x728a
jmp 0x7291
jmp 0x7291
movq %rax, %rbx
leaq -0x408(%rbp), %rdi
jmp 0x729f
jmp 0x72a6
jmp 0x72b4
jmp 0x7291
jmp 0x7291
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x30d0
jmp 0x72cf
movq %rax, %rbx
jmp 0x72cf
jmp 0x72b4
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x30d0
jmp 0x72a9
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x30d0
jmp 0x72b7
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x30d0
leaq -0x5b0(%rbp), %rdi
callq 0x3130
leaq -0xc0(%rbp), %rdi
callq 0x30d0
leaq -0x7b8(%rbp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x32f0