// File: temelmertcan[P]multgen/src/dadda.cpp
// Function: create_daddatree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int&, int, bool, bool, std::queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, int&, bool**&)
void create_daddatree (string** pp_matrix,
		       string final_stage_adder,
		       int pp_dim1,
		       int pp_dim2,
		       int& out_size,
		       int shift_amount,
		       bool create_fin_adder,
		       bool signed_mult,
		       std::queue<string>& verilog,
		       int& adder_size,
		       bool**& zeros_in_output
		       ){


  //out_size = create_fin_adder ? out_size : pp_dim2;

  
  std::queue<string>* main_queue = new std::queue<string>[out_size];
  std::queue<string>* temp_queue = new std::queue<string>[out_size];

  // create the initial queue
  //for (int i = pp_dim1; i >= 0; i--)
  for (int i = 0; i < pp_dim1; i++)
    for (int j = 0; j < pp_dim2 && j< out_size; j++)
      if (pp_matrix[i][j] != "")
	main_queue[j].push (pp_matrix[i][j]);

  int cnt = 0;

  int* coeffs = 0;
  int coeffs_size;
  
  get_dadda_coeffs(get_max_queue_size(main_queue, out_size), coeffs, coeffs_size);
  


  // cout << "out_size " << out_size << endl;
  
  //print_queue(main_queue, out_size);

  //cout << "Dadda summmation stage count: " << coeffs_size << endl; 
  
  
  for (int phase = 0; phase < coeffs_size; phase++) {
    
    // Step 1: sum the stuff in main_queue with fa/ha
    verilog.push("");
    verilog.push("// Dadda Summation Stage " + to_string(phase+1));
    int carrysize = 0;
    
    for (int j = 0; j < out_size; j++){
      std::queue<string>& cur = main_queue[j];
      int sumsize = 0;
      while (((cur.size() + carrysize + sumsize) > coeffs[phase]) && (cur.size() >= 2)){
	if ((cur.size() + carrysize + sumsize) - coeffs[phase] > 1){
	  string var1 = cur.front();
	  cur.pop();
	  string var2 = cur.front();
	  cur.pop();
	  string var3 = cur.front();
	  cur.pop();
	  string inst = "logic s" + to_string(cnt)
	    + " ,c" + to_string(cnt) + "; \n";
	  inst += "    fa fa" + to_string(cnt)
	    + " (" + var1 + ", " + var2 + ", " + var3
	    + ", s" + to_string(cnt) + ", c" + to_string(cnt) + ");";

	  verilog.push(inst);

	  temp_queue[j].push("s" + to_string(cnt));

	  if (j+1 < out_size)
	    temp_queue[j+1].push("c" + to_string(cnt));
	  cnt++;
	  

	}else{
	  string var1 = cur.front();
	  cur.pop();
	  string var2 = cur.front();
	  cur.pop();
	  string inst = "logic s" + to_string(cnt)
	    + " ,c" + to_string(cnt) + ";\n";
	  inst += "    ha ha" + to_string(cnt)
	    + " (" + var1 + ", " + var2
	    + ", s" + to_string(cnt) + ", c" + to_string(cnt) + ");";

	  verilog.push(inst);

	  temp_queue[j].push("s" + to_string(cnt));

	  if (j+1 < out_size)
	    temp_queue[j+1].push("c" + to_string(cnt));
	  cnt++;
	}
	sumsize++;
      }
      carrysize = sumsize;
    }

    // Step 2; Move stuff from temp_queue to main_queue
    move_to_main_queue(temp_queue, main_queue, out_size);

    //print_queue(main_queue, out_size);

  }

  verilog.push("");

  if (create_fin_adder)
    create_finaladder_inst (main_queue,
			    final_stage_adder,
			    out_size,
			    shift_amount,
			    verilog,
			    adder_size);
  else
    create_two_result_vectors (main_queue,
			       out_size,
			       verilog,
			       signed_mult,
			       adder_size,
			       zeros_in_output);
  

   delete[] temp_queue;
   //delete[] coeffs;
  // delete[] main_queue;

   
  // cout << "adder size " << adder_size << endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x900, %rsp            # imm = 0x900
movl %ecx, -0x7f8(%rbp)
movl %edx, %eax
movl -0x7f8(%rbp), %edx
movl %eax, -0x7f4(%rbp)
movq %rsi, %rax
movl -0x7f4(%rbp), %esi
movq %rax, -0x7f0(%rbp)
movq %rdi, %r10
movq -0x7f0(%rbp), %rdi
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movb 0x18(%rbp), %al
movb 0x10(%rbp), %cl
movq %r10, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
andb $0x1, %cl
movb %cl, -0x25(%rbp)
andb $0x1, %al
movb %al, -0x26(%rbp)
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x7e8(%rbp)
movl $0x50, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x7e8(%rbp), %rax
movq %rcx, -0x7e0(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x7d8(%rbp)
cmpq $0x0, %rax
je 0x47162
movq -0x7d8(%rbp), %rax
movq -0x7e8(%rbp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x808(%rbp)
movq %rax, -0x800(%rbp)
movq -0x800(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x1ed10
jmp 0x47144
movq -0x808(%rbp), %rcx
movq -0x810(%rbp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, -0x800(%rbp)
jne 0x4712f
movq -0x7d8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x828(%rbp)
movl $0x50, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x828(%rbp), %rax
movq %rcx, -0x820(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x818(%rbp)
cmpq $0x0, %rax
je 0x47223
movq -0x818(%rbp), %rax
movq -0x828(%rbp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x838(%rbp)
movq %rax, -0x830(%rbp)
movq -0x830(%rbp), %rdi
movq %rdi, -0x840(%rbp)
callq 0x1ed10
jmp 0x47205
movq -0x838(%rbp), %rcx
movq -0x840(%rbp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, -0x830(%rbp)
jne 0x471f0
movq -0x818(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x473c1
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %ecx
xorl %eax, %eax
cmpl -0x18(%rbp), %ecx
movb %al, -0x841(%rbp)
jge 0x4726a
movl -0x50(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
setl %al
movb %al, -0x841(%rbp)
movb -0x841(%rbp), %al
testb $0x1, %al
jne 0x47279
jmp 0x473b1
movq -0x8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x1234a(%rip), %rsi     # 0x595e1
callq 0x1e470
testb $0x1, %al
jne 0x472a5
jmp 0x473a1
movq -0x30(%rbp), %rdi
movslq -0x50(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x2e150
jmp 0x473a1
movq -0x7d8(%rbp), %rcx
movq %rax, %rsi
movq -0x810(%rbp), %rax
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x850(%rbp)
je 0x4732a
movq -0x850(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x858(%rbp)
callq 0x1edc0
movq -0x7d8(%rbp), %rcx
movq -0x858(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x850(%rbp)
jne 0x472f9
movq -0x7e0(%rbp), %rdi
callq 0x32f0
jmp 0x4877d
movq -0x818(%rbp), %rcx
movq %rax, %rsi
movq -0x840(%rbp), %rax
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x860(%rbp)
je 0x47390
movq -0x860(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x868(%rbp)
callq 0x1edc0
movq -0x818(%rbp), %rcx
movq -0x868(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x860(%rbp)
jne 0x4735f
movq -0x820(%rbp), %rdi
callq 0x32f0
jmp 0x4877d
jmp 0x473a3
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x47248
jmp 0x473b3
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x47235
movl $0x0, -0x54(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
callq 0x4c540
movl %eax, %edi
leaq -0x60(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0x46de0
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x485c7
movq 0x20(%rbp), %rax
movq %rax, -0x878(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x870(%rbp)
callq 0x3430
movq -0x870(%rbp), %rdx
leaq 0x121b4(%rip), %rsi     # 0x595e1
leaq -0x88(%rbp), %rdi
callq 0x3320
jmp 0x4743b
movq -0x878(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x1e3c0
jmp 0x47450
leaq -0x88(%rbp), %rdi
callq 0x31a0
leaq -0x89(%rbp), %rdi
callq 0x32a0
movq 0x20(%rbp), %rax
movq %rax, -0x888(%rbp)
movl -0x68(%rbp), %esi
incl %esi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x880(%rbp)
callq 0x1e700
movq -0x880(%rbp), %rdx
leaq 0x12149(%rip), %rsi     # 0x595e2
leaq -0xb0(%rbp), %rdi
callq 0x1e930
jmp 0x474a7
movq -0x888(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1e3c0
jmp 0x474bc
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xd0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0xd4(%rbp)
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x485a6
movq -0x30(%rbp), %rax
movslq -0xd8(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movl $0x0, -0xe4(%rbp)
movq -0xe0(%rbp), %rdi
callq 0x487c0
movq %rax, %rcx
movslq -0xd4(%rbp), %rax
addq %rax, %rcx
movslq -0xe4(%rbp), %rax
addq %rax, %rcx
movq -0x60(%rbp), %rax
movslq -0x68(%rbp), %rdx
movslq (%rax,%rdx,4), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x889(%rbp)
jbe 0x47572
movq -0xe0(%rbp), %rdi
callq 0x487c0
cmpq $0x2, %rax
setae %al
movb %al, -0x889(%rbp)
movb -0x889(%rbp), %al
testb $0x1, %al
jne 0x47581
jmp 0x48586
movq -0xe0(%rbp), %rdi
callq 0x487c0
movslq -0xd4(%rbp), %rcx
addq %rcx, %rax
movslq -0xe4(%rbp), %rcx
addq %rcx, %rax
movq -0x60(%rbp), %rcx
movslq -0x68(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
subq %rcx, %rax
cmpq $0x1, %rax
jbe 0x47e44
movq -0xe0(%rbp), %rdi
callq 0x1ecd0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x3100
movq -0xe0(%rbp), %rdi
callq 0x1ecf0
jmp 0x475e3
movq -0xe0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x898(%rbp)
jmp 0x475f8
movq -0x898(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x3100
jmp 0x4760d
movq -0xe0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4761b
movq -0xe0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x8a0(%rbp)
jmp 0x47630
movq -0x8a0(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x3100
jmp 0x47645
movq -0xe0(%rbp), %rdi
callq 0x1ecf0
jmp 0x47653
movl -0x54(%rbp), %esi
leaq -0x1e8(%rbp), %rdi
callq 0x1e700
jmp 0x47664
leaq 0x11f91(%rip), %rsi     # 0x595fc
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rdx
callq 0x1e930
jmp 0x47680
leaq 0x11f7d(%rip), %rdx     # 0x59604
leaq -0x1a8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x1e560
jmp 0x4769c
movl -0x54(%rbp), %esi
leaq -0x208(%rbp), %rdi
callq 0x1e700
jmp 0x476ad
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x1e5b0
jmp 0x476c9
leaq 0x11f38(%rip), %rdx     # 0x59608
leaq -0x168(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x1e560
jmp 0x476e5
leaq -0x188(%rbp), %rdi
callq 0x31a0
leaq -0x208(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x1c8(%rbp), %rdi
callq 0x31a0
leaq -0x1e8(%rbp), %rdi
callq 0x31a0
movl -0x54(%rbp), %esi
leaq -0x3a8(%rbp), %rdi
callq 0x1e700
jmp 0x47732
leaq 0x11ed3(%rip), %rsi     # 0x5960c
leaq -0x388(%rbp), %rdi
leaq -0x3a8(%rbp), %rdx
callq 0x1e930
jmp 0x4774e
leaq 0x11937(%rip), %rdx     # 0x5908c
leaq -0x368(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x1e560
jmp 0x4776a
leaq -0x348(%rbp), %rdi
leaq -0x368(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x1e980
jmp 0x47786
leaq 0x10e6c(%rip), %rdx     # 0x585f9
leaq -0x328(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x1e560
jmp 0x477a2
leaq -0x308(%rbp), %rdi
leaq -0x328(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0x1e980
jmp 0x477be
leaq 0x10e34(%rip), %rdx     # 0x585f9
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x1e560
jmp 0x477da
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x1e980
jmp 0x477f6
leaq 0x11e19(%rip), %rdx     # 0x59616
leaq -0x2a8(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x1e560
jmp 0x47812
movl -0x54(%rbp), %esi
leaq -0x3c8(%rbp), %rdi
callq 0x1e700
jmp 0x47823
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
callq 0x1e5b0
jmp 0x4783f
leaq 0x11dd4(%rip), %rdx     # 0x5961a
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x1e560
jmp 0x4785b
movl -0x54(%rbp), %esi
leaq -0x3e8(%rbp), %rdi
callq 0x1e700
jmp 0x4786c
leaq -0x248(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x3e8(%rbp), %rdx
callq 0x1e5b0
jmp 0x47888
leaq 0x11e7b(%rip), %rdx     # 0x5970a
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x1e560
jmp 0x478a4
leaq -0x168(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x32e0
jmp 0x478b9
leaq -0x228(%rbp), %rdi
callq 0x31a0
leaq -0x248(%rbp), %rdi
callq 0x31a0
leaq -0x3e8(%rbp), %rdi
callq 0x31a0
leaq -0x268(%rbp), %rdi
callq 0x31a0
leaq -0x288(%rbp), %rdi
callq 0x31a0
leaq -0x3c8(%rbp), %rdi
callq 0x31a0
leaq -0x2a8(%rbp), %rdi
callq 0x31a0
leaq -0x2c8(%rbp), %rdi
callq 0x31a0
leaq -0x2e8(%rbp), %rdi
callq 0x31a0
leaq -0x308(%rbp), %rdi
callq 0x31a0
leaq -0x328(%rbp), %rdi
callq 0x31a0
leaq -0x348(%rbp), %rdi
callq 0x31a0
leaq -0x368(%rbp), %rdi
callq 0x31a0
leaq -0x388(%rbp), %rdi
callq 0x31a0
leaq -0x3a8(%rbp), %rdi
callq 0x31a0
movq 0x20(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x2e150
jmp 0x4797f
movq -0x48(%rbp), %rax
movslq -0xd8(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8a8(%rbp)
movl -0x54(%rbp), %esi
leaq -0x428(%rbp), %rdi
callq 0x1e700
jmp 0x479ad
leaq 0x11c64(%rip), %rsi     # 0x59618
leaq -0x408(%rbp), %rdi
leaq -0x428(%rbp), %rdx
callq 0x1e930
jmp 0x479c9
movq -0x8a8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x1e3c0
jmp 0x479de
leaq -0x408(%rbp), %rdi
callq 0x31a0
leaq -0x428(%rbp), %rdi
callq 0x31a0
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x47dd1
movq -0x48(%rbp), %rax
movl -0xd8(%rbp), %ecx
incl %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8b0(%rbp)
movl -0x54(%rbp), %esi
leaq -0x468(%rbp), %rdi
callq 0x1e700
jmp 0x47a3d
leaq 0x11bd8(%rip), %rsi     # 0x5961c
leaq -0x448(%rbp), %rdi
leaq -0x468(%rbp), %rdx
callq 0x1e930
jmp 0x47a59
movq -0x8b0(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x1e3c0
jmp 0x47a6e
leaq -0x448(%rbp), %rdi
callq 0x31a0
leaq -0x468(%rbp), %rdi
callq 0x31a0
jmp 0x47dd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47ab1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31a0
leaq -0x89(%rbp), %rdi
callq 0x32a0
jmp 0x4877d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47ae8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xd0(%rbp), %rdi
callq 0x31a0
jmp 0x4877d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47e33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47e27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47ba0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47b94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47b88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47b7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x31a0
leaq -0x208(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x1c8(%rbp), %rdi
callq 0x31a0
leaq -0x1e8(%rbp), %rdi
callq 0x31a0
jmp 0x47e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47e0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47cf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47cec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47ce0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47cd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47cc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47cbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x31a0
leaq -0x248(%rbp), %rdi
callq 0x31a0
leaq -0x3e8(%rbp), %rdi
callq 0x31a0
leaq -0x268(%rbp), %rdi
callq 0x31a0
leaq -0x288(%rbp), %rdi
callq 0x31a0
leaq -0x3c8(%rbp), %rdi
callq 0x31a0
leaq -0x2a8(%rbp), %rdi
callq 0x31a0
leaq -0x2c8(%rbp), %rdi
callq 0x31a0
leaq -0x2e8(%rbp), %rdi
callq 0x31a0
leaq -0x308(%rbp), %rdi
callq 0x31a0
leaq -0x328(%rbp), %rdi
callq 0x31a0
leaq -0x348(%rbp), %rdi
callq 0x31a0
leaq -0x368(%rbp), %rdi
callq 0x31a0
leaq -0x388(%rbp), %rdi
callq 0x31a0
leaq -0x3a8(%rbp), %rdi
callq 0x31a0
jmp 0x47e0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47d8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x31a0
leaq -0x428(%rbp), %rdi
callq 0x31a0
jmp 0x47e0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47dc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x31a0
leaq -0x468(%rbp), %rdi
callq 0x31a0
jmp 0x47e0f
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x31a0
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x128(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
jmp 0x48572
leaq -0x168(%rbp), %rdi
callq 0x31a0
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x128(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
jmp 0x4877d
movq -0xe0(%rbp), %rdi
callq 0x1ecd0
movq %rax, %rsi
leaq -0x488(%rbp), %rdi
callq 0x3100
movq -0xe0(%rbp), %rdi
callq 0x1ecf0
jmp 0x47e6d
movq -0xe0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x8b8(%rbp)
jmp 0x47e82
movq -0x8b8(%rbp), %rsi
leaq -0x4a8(%rbp), %rdi
callq 0x3100
jmp 0x47e97
movq -0xe0(%rbp), %rdi
callq 0x1ecf0
jmp 0x47ea5
movl -0x54(%rbp), %esi
leaq -0x548(%rbp), %rdi
callq 0x1e700
jmp 0x47eb6
leaq 0x1173f(%rip), %rsi     # 0x595fc
leaq -0x528(%rbp), %rdi
leaq -0x548(%rbp), %rdx
callq 0x1e930
jmp 0x47ed2
leaq 0x1172b(%rip), %rdx     # 0x59604
leaq -0x508(%rbp), %rdi
leaq -0x528(%rbp), %rsi
callq 0x1e560
jmp 0x47eee
movl -0x54(%rbp), %esi
leaq -0x568(%rbp), %rdi
callq 0x1e700
jmp 0x47eff
leaq -0x4e8(%rbp), %rdi
leaq -0x508(%rbp), %rsi
leaq -0x568(%rbp), %rdx
callq 0x1e5b0
jmp 0x47f1b
leaq 0x116fc(%rip), %rdx     # 0x5961e
leaq -0x4c8(%rbp), %rdi
leaq -0x4e8(%rbp), %rsi
callq 0x1e560
jmp 0x47f37
leaq -0x4e8(%rbp), %rdi
callq 0x31a0
leaq -0x568(%rbp), %rdi
callq 0x31a0
leaq -0x508(%rbp), %rdi
callq 0x31a0
leaq -0x528(%rbp), %rdi
callq 0x31a0
leaq -0x548(%rbp), %rdi
callq 0x31a0
movl -0x54(%rbp), %esi
leaq -0x6c8(%rbp), %rdi
callq 0x1e700
jmp 0x47f84
leaq 0x11696(%rip), %rsi     # 0x59621
leaq -0x6a8(%rbp), %rdi
leaq -0x6c8(%rbp), %rdx
callq 0x1e930
jmp 0x47fa0
leaq 0x110e5(%rip), %rdx     # 0x5908c
leaq -0x688(%rbp), %rdi
leaq -0x6a8(%rbp), %rsi
callq 0x1e560
jmp 0x47fbc
leaq -0x668(%rbp), %rdi
leaq -0x688(%rbp), %rsi
leaq -0x488(%rbp), %rdx
callq 0x1e980
jmp 0x47fd8
leaq 0x1061a(%rip), %rdx     # 0x585f9
leaq -0x648(%rbp), %rdi
leaq -0x668(%rbp), %rsi
callq 0x1e560
jmp 0x47ff4
leaq -0x628(%rbp), %rdi
leaq -0x648(%rbp), %rsi
leaq -0x4a8(%rbp), %rdx
callq 0x1e980
jmp 0x48010
leaq 0x115ff(%rip), %rdx     # 0x59616
leaq -0x608(%rbp), %rdi
leaq -0x628(%rbp), %rsi
callq 0x1e560
jmp 0x4802c
movl -0x54(%rbp), %esi
leaq -0x6e8(%rbp), %rdi
callq 0x1e700
jmp 0x4803d
leaq -0x5e8(%rbp), %rdi
leaq -0x608(%rbp), %rsi
leaq -0x6e8(%rbp), %rdx
callq 0x1e5b0
jmp 0x48059
leaq 0x115ba(%rip), %rdx     # 0x5961a
leaq -0x5c8(%rbp), %rdi
leaq -0x5e8(%rbp), %rsi
callq 0x1e560
jmp 0x48075
movl -0x54(%rbp), %esi
leaq -0x708(%rbp), %rdi
callq 0x1e700
jmp 0x48086
leaq -0x5a8(%rbp), %rdi
leaq -0x5c8(%rbp), %rsi
leaq -0x708(%rbp), %rdx
callq 0x1e5b0
jmp 0x480a2
leaq 0x11661(%rip), %rdx     # 0x5970a
leaq -0x588(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x1e560
jmp 0x480be
leaq -0x4c8(%rbp), %rdi
leaq -0x588(%rbp), %rsi
callq 0x32e0
jmp 0x480d3
leaq -0x588(%rbp), %rdi
callq 0x31a0
leaq -0x5a8(%rbp), %rdi
callq 0x31a0
leaq -0x708(%rbp), %rdi
callq 0x31a0
leaq -0x5c8(%rbp), %rdi
callq 0x31a0
leaq -0x5e8(%rbp), %rdi
callq 0x31a0
leaq -0x6e8(%rbp), %rdi
callq 0x31a0
leaq -0x608(%rbp), %rdi
callq 0x31a0
leaq -0x628(%rbp), %rdi
callq 0x31a0
leaq -0x648(%rbp), %rdi
callq 0x31a0
leaq -0x668(%rbp), %rdi
callq 0x31a0
leaq -0x688(%rbp), %rdi
callq 0x31a0
leaq -0x6a8(%rbp), %rdi
callq 0x31a0
leaq -0x6c8(%rbp), %rdi
callq 0x31a0
movq 0x20(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x2e150
jmp 0x48181
movq -0x48(%rbp), %rax
movslq -0xd8(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8c0(%rbp)
movl -0x54(%rbp), %esi
leaq -0x748(%rbp), %rdi
callq 0x1e700
jmp 0x481af
leaq 0x11462(%rip), %rsi     # 0x59618
leaq -0x728(%rbp), %rdi
leaq -0x748(%rbp), %rdx
callq 0x1e930
jmp 0x481cb
movq -0x8c0(%rbp), %rdi
leaq -0x728(%rbp), %rsi
callq 0x1e3c0
jmp 0x481e0
leaq -0x728(%rbp), %rdi
callq 0x31a0
leaq -0x748(%rbp), %rdi
callq 0x31a0
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x4851a
movq -0x48(%rbp), %rax
movl -0xd8(%rbp), %ecx
incl %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8c8(%rbp)
movl -0x54(%rbp), %esi
leaq -0x788(%rbp), %rdi
callq 0x1e700
jmp 0x4823f
leaq 0x113d6(%rip), %rsi     # 0x5961c
leaq -0x768(%rbp), %rdi
leaq -0x788(%rbp), %rdx
callq 0x1e930
jmp 0x4825b
movq -0x8c8(%rbp), %rdi
leaq -0x768(%rbp), %rsi
callq 0x1e3c0
jmp 0x48270
leaq -0x768(%rbp), %rdi
callq 0x31a0
leaq -0x788(%rbp), %rdi
callq 0x31a0
jmp 0x4851a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48561
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48555
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48323
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48317
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4830b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x482ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x31a0
leaq -0x568(%rbp), %rdi
callq 0x31a0
leaq -0x508(%rbp), %rdi
callq 0x31a0
leaq -0x528(%rbp), %rdi
callq 0x31a0
leaq -0x548(%rbp), %rdi
callq 0x31a0
jmp 0x48555
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48549
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x484a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48495
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48489
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4847d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48465
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48459
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4844d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48441
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x48429
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4841d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x588(%rbp), %rdi
callq 0x31a0
leaq -0x5a8(%rbp), %rdi
callq 0x31a0
leaq -0x708(%rbp), %rdi
callq 0x31a0
leaq -0x5c8(%rbp), %rdi
callq 0x31a0
leaq -0x5e8(%rbp), %rdi
callq 0x31a0
leaq -0x6e8(%rbp), %rdi
callq 0x31a0
leaq -0x608(%rbp), %rdi
callq 0x31a0
leaq -0x628(%rbp), %rdi
callq 0x31a0
leaq -0x648(%rbp), %rdi
callq 0x31a0
leaq -0x668(%rbp), %rdi
callq 0x31a0
leaq -0x688(%rbp), %rdi
callq 0x31a0
leaq -0x6a8(%rbp), %rdi
callq 0x31a0
leaq -0x6c8(%rbp), %rdi
callq 0x31a0
jmp 0x48549
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x484d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x728(%rbp), %rdi
callq 0x31a0
leaq -0x748(%rbp), %rdi
callq 0x31a0
jmp 0x48549
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4850c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x768(%rbp), %rdi
callq 0x31a0
leaq -0x788(%rbp), %rdi
callq 0x31a0
jmp 0x48549
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
leaq -0x4c8(%rbp), %rdi
callq 0x31a0
leaq -0x4a8(%rbp), %rdi
callq 0x31a0
leaq -0x488(%rbp), %rdi
callq 0x31a0
jmp 0x48572
leaq -0x4c8(%rbp), %rdi
callq 0x31a0
leaq -0x4a8(%rbp), %rdi
callq 0x31a0
leaq -0x488(%rbp), %rdi
callq 0x31a0
jmp 0x4877d
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x4751d
movl -0xe4(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x474e8
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rax
movl (%rax), %edx
callq 0x4c310
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x473f5
movq 0x20(%rbp), %rax
movq %rax, -0x8d8(%rbp)
leaq -0x7a9(%rbp), %rdi
movq %rdi, -0x8d0(%rbp)
callq 0x3430
movq -0x8d0(%rbp), %rdx
leaq 0x10fee(%rip), %rsi     # 0x595e1
leaq -0x7a8(%rbp), %rdi
callq 0x3320
jmp 0x48601
movq -0x8d8(%rbp), %rdi
leaq -0x7a8(%rbp), %rsi
callq 0x1e3c0
jmp 0x48616
leaq -0x7a8(%rbp), %rdi
callq 0x31a0
leaq -0x7a9(%rbp), %rdi
callq 0x32a0
testb $0x1, -0x25(%rbp)
je 0x486d7
movq -0x7f0(%rbp), %rsi
leaq -0x7d0(%rbp), %rdi
movq %rdi, -0x8e0(%rbp)
callq 0x3100
movq -0x8e0(%rbp), %rsi
movq -0x20(%rbp), %rax
movl (%rax), %edx
movl -0x24(%rbp), %ecx
movq 0x20(%rbp), %r8
movq 0x28(%rbp), %r9
leaq -0x30(%rbp), %rdi
callq 0x4dc30
jmp 0x48675
leaq -0x7d0(%rbp), %rdi
callq 0x31a0
jmp 0x486fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x486a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x7a8(%rbp), %rdi
callq 0x31a0
leaq -0x7a9(%rbp), %rdi
callq 0x32a0
jmp 0x4877d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x7d0(%rbp), %rdi
callq 0x31a0
jmp 0x4877d
movq -0x20(%rbp), %rax
movl (%rax), %esi
movq 0x20(%rbp), %rdx
movb -0x26(%rbp), %al
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %r9
leaq -0x30(%rbp), %rdi
andb $0x1, %al
movzbl %al, %ecx
callq 0x4c5a0
movq -0x48(%rbp), %rax
movq %rax, -0x8e8(%rbp)
cmpq $0x0, %rax
je 0x48774
movq -0x8e8(%rbp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, -0x8f8(%rbp)
imulq $0x50, -0x8(%rcx), %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x8f0(%rbp)
je 0x48768
movq -0x8f0(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x900(%rbp)
callq 0x1edc0
movq -0x8e8(%rbp), %rcx
movq -0x900(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x8f0(%rbp)
jne 0x48737
movq -0x8f8(%rbp), %rdi
callq 0x32f0
addq $0x900, %rsp            # imm = 0x900
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)