// File: temelmertcan[P]multgen/src/wallace.cpp
// Function: create_wallacetree(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_wallacetree (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){

  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-1; 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 stage_cnt = 0;

  while (get_max_queue_size(main_queue, out_size) > 2) {
    // Step 1: sum the stuff in main_queue with fa/ha

    verilog.push("");
    verilog.push("// Wallace Summation Stage " + to_string(++stage_cnt));
    for (int j = 0; j < out_size; j++){
      std::queue<string>& cur = main_queue[j];
      while (cur.size() >= 2){
        if (cur.size() >= 3){
          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++;
        }
      }
    }

    // Step 2; Move stuff from temp_queue to main_queue
    move_to_main_queue(temp_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[] main_queue;

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

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8e0, %rsp            # imm = 0x8E0
movl %ecx, -0x7e0(%rbp)
movl %edx, %eax
movl -0x7e0(%rbp), %edx
movl %eax, -0x7dc(%rbp)
movq %rsi, %rax
movl -0x7dc(%rbp), %esi
movq %rax, -0x7d8(%rbp)
movq %rdi, %r10
movq -0x7d8(%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)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
andb $0x1, %al
movb %al, -0x22(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0x7d0(%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 -0x7d0(%rbp), %rax
movq %rcx, -0x7c8(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x7c0(%rbp)
cmpq $0x0, %rax
je 0x4f06f
movq -0x7c0(%rbp), %rax
movq -0x7d0(%rbp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x7f0(%rbp)
movq %rax, -0x7e8(%rbp)
movq -0x7e8(%rbp), %rdi
movq %rdi, -0x7f8(%rbp)
callq 0x1ed10
jmp 0x4f051
movq -0x7f0(%rbp), %rcx
movq -0x7f8(%rbp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, -0x7e8(%rbp)
jne 0x4f03c
movq -0x7c0(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0x810(%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 -0x810(%rbp), %rax
movq %rcx, -0x808(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x800(%rbp)
cmpq $0x0, %rax
je 0x4f12d
movq -0x800(%rbp), %rax
movq -0x810(%rbp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x820(%rbp)
movq %rax, -0x818(%rbp)
movq -0x818(%rbp), %rdi
movq %rdi, -0x828(%rbp)
callq 0x1ed10
jmp 0x4f10f
movq -0x820(%rbp), %rcx
movq -0x828(%rbp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, -0x818(%rbp)
jne 0x4f0fa
movq -0x800(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4f2c8
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %ecx
xorl %eax, %eax
cmpl -0x18(%rbp), %ecx
movb %al, -0x829(%rbp)
jge 0x4f171
movl -0x50(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setl %al
movb %al, -0x829(%rbp)
movb -0x829(%rbp), %al
testb $0x1, %al
jne 0x4f180
jmp 0x4f2b8
movq -0x8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0xa443(%rip), %rsi      # 0x595e1
callq 0x1e470
testb $0x1, %al
jne 0x4f1ac
jmp 0x4f2a8
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 0x4f2a8
movq -0x7c0(%rbp), %rcx
movq %rax, %rsi
movq -0x7f8(%rbp), %rax
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x838(%rbp)
je 0x4f231
movq -0x838(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x840(%rbp)
callq 0x1edc0
movq -0x7c0(%rbp), %rcx
movq -0x840(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x838(%rbp)
jne 0x4f200
movq -0x7c8(%rbp), %rdi
callq 0x32f0
jmp 0x5059c
movq -0x800(%rbp), %rcx
movq %rax, %rsi
movq -0x828(%rbp), %rax
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x848(%rbp)
je 0x4f297
movq -0x848(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x850(%rbp)
callq 0x1edc0
movq -0x800(%rbp), %rcx
movq -0x850(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x848(%rbp)
jne 0x4f266
movq -0x808(%rbp), %rdi
callq 0x32f0
jmp 0x5059c
jmp 0x4f2aa
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x4f152
jmp 0x4f2ba
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x4f13f
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x4c540
cmpl $0x2, %eax
jle 0x503ec
movq 0x20(%rbp), %rax
movq %rax, -0x860(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x858(%rbp)
callq 0x3430
movq -0x858(%rbp), %rdx
leaq 0xa2cd(%rip), %rsi      # 0x595e1
leaq -0x78(%rbp), %rdi
callq 0x3320
jmp 0x4f31f
movq -0x860(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1e3c0
jmp 0x4f331
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x79(%rbp), %rdi
callq 0x32a0
movq 0x20(%rbp), %rax
movq %rax, -0x870(%rbp)
movl -0x58(%rbp), %esi
incl %esi
movl %esi, -0x58(%rbp)
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x868(%rbp)
callq 0x1e700
movq -0x868(%rbp), %rdx
leaq 0xa3a8(%rip), %rsi      # 0x5971f
leaq -0xa0(%rbp), %rdi
callq 0x1e930
jmp 0x4f385
movq -0x870(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1e3c0
jmp 0x4f39a
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0xc0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x503d7
movq -0x30(%rbp), %rax
movslq -0xc4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x487c0
cmpq $0x2, %rax
jb 0x503c1
movq -0xd0(%rbp), %rdi
callq 0x487c0
cmpq $0x3, %rax
jb 0x4fc91
movq -0xd0(%rbp), %rdi
callq 0x1ecd0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x3100
movq -0xd0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4f439
movq -0xd0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x878(%rbp)
jmp 0x4f44e
movq -0x878(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x3100
jmp 0x4f463
movq -0xd0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4f471
movq -0xd0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x880(%rbp)
jmp 0x4f486
movq -0x880(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x3100
jmp 0x4f49b
movq -0xd0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4f4a9
movl -0x54(%rbp), %esi
leaq -0x1d0(%rbp), %rdi
callq 0x1e700
jmp 0x4f4ba
leaq 0xa13b(%rip), %rsi      # 0x595fc
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rdx
callq 0x1e930
jmp 0x4f4d6
leaq 0xa127(%rip), %rdx      # 0x59604
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x1e560
jmp 0x4f4f2
movl -0x54(%rbp), %esi
leaq -0x1f0(%rbp), %rdi
callq 0x1e700
jmp 0x4f503
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0x1e5b0
jmp 0x4f51f
leaq 0xa0e2(%rip), %rdx      # 0x59608
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x1e560
jmp 0x4f53b
leaq -0x170(%rbp), %rdi
callq 0x31a0
leaq -0x1f0(%rbp), %rdi
callq 0x31a0
leaq -0x190(%rbp), %rdi
callq 0x31a0
leaq -0x1b0(%rbp), %rdi
callq 0x31a0
leaq -0x1d0(%rbp), %rdi
callq 0x31a0
movl -0x54(%rbp), %esi
leaq -0x390(%rbp), %rdi
callq 0x1e700
jmp 0x4f588
leaq 0xa07d(%rip), %rsi      # 0x5960c
leaq -0x370(%rbp), %rdi
leaq -0x390(%rbp), %rdx
callq 0x1e930
jmp 0x4f5a4
leaq 0x9ae1(%rip), %rdx      # 0x5908c
leaq -0x350(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x1e560
jmp 0x4f5c0
leaq -0x330(%rbp), %rdi
leaq -0x350(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x1e980
jmp 0x4f5dc
leaq 0x9016(%rip), %rdx      # 0x585f9
leaq -0x310(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x1e560
jmp 0x4f5f8
leaq -0x2f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x1e980
jmp 0x4f614
leaq 0x8fde(%rip), %rdx      # 0x585f9
leaq -0x2d0(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x1e560
jmp 0x4f630
leaq -0x2b0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x1e980
jmp 0x4f64c
leaq 0x9fc3(%rip), %rdx      # 0x59616
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1e560
jmp 0x4f668
movl -0x54(%rbp), %esi
leaq -0x3b0(%rbp), %rdi
callq 0x1e700
jmp 0x4f679
leaq -0x270(%rbp), %rdi
leaq -0x290(%rbp), %rsi
leaq -0x3b0(%rbp), %rdx
callq 0x1e5b0
jmp 0x4f695
leaq 0x9f7e(%rip), %rdx      # 0x5961a
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x1e560
jmp 0x4f6b1
movl -0x54(%rbp), %esi
leaq -0x3d0(%rbp), %rdi
callq 0x1e700
jmp 0x4f6c2
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
callq 0x1e5b0
jmp 0x4f6de
leaq 0xa025(%rip), %rdx      # 0x5970a
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x1e560
jmp 0x4f6fa
leaq -0x150(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x32e0
jmp 0x4f70f
leaq -0x210(%rbp), %rdi
callq 0x31a0
leaq -0x230(%rbp), %rdi
callq 0x31a0
leaq -0x3d0(%rbp), %rdi
callq 0x31a0
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x270(%rbp), %rdi
callq 0x31a0
leaq -0x3b0(%rbp), %rdi
callq 0x31a0
leaq -0x290(%rbp), %rdi
callq 0x31a0
leaq -0x2b0(%rbp), %rdi
callq 0x31a0
leaq -0x2d0(%rbp), %rdi
callq 0x31a0
leaq -0x2f0(%rbp), %rdi
callq 0x31a0
leaq -0x310(%rbp), %rdi
callq 0x31a0
leaq -0x330(%rbp), %rdi
callq 0x31a0
leaq -0x350(%rbp), %rdi
callq 0x31a0
leaq -0x370(%rbp), %rdi
callq 0x31a0
leaq -0x390(%rbp), %rdi
callq 0x31a0
movq 0x20(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x2e150
jmp 0x4f7d5
movq -0x48(%rbp), %rax
movslq -0xc4(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x888(%rbp)
movl -0x54(%rbp), %esi
leaq -0x410(%rbp), %rdi
callq 0x1e700
jmp 0x4f803
leaq 0x9e0e(%rip), %rsi      # 0x59618
leaq -0x3f0(%rbp), %rdi
leaq -0x410(%rbp), %rdx
callq 0x1e930
jmp 0x4f81f
movq -0x888(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x1e3c0
jmp 0x4f834
leaq -0x3f0(%rbp), %rdi
callq 0x31a0
leaq -0x410(%rbp), %rdi
callq 0x31a0
movl -0xc4(%rbp), %eax
addl $0x1, %eax
cmpl -0x1c(%rbp), %eax
jge 0x4fc1e
movq -0x48(%rbp), %rax
movl -0xc4(%rbp), %ecx
incl %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x890(%rbp)
movl -0x54(%rbp), %esi
leaq -0x450(%rbp), %rdi
callq 0x1e700
jmp 0x4f890
leaq 0x9d85(%rip), %rsi      # 0x5961c
leaq -0x430(%rbp), %rdi
leaq -0x450(%rbp), %rdx
callq 0x1e930
jmp 0x4f8ac
movq -0x890(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x1e3c0
jmp 0x4f8c1
leaq -0x430(%rbp), %rdi
callq 0x31a0
leaq -0x450(%rbp), %rdi
callq 0x31a0
jmp 0x4fc1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x79(%rbp), %rdi
callq 0x32a0
jmp 0x5059c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0xc0(%rbp), %rdi
callq 0x31a0
jmp 0x5059c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fc80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fc74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fc68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f9ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f9e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f9d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4f9c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x31a0
leaq -0x1f0(%rbp), %rdi
callq 0x31a0
leaq -0x190(%rbp), %rdi
callq 0x31a0
leaq -0x1b0(%rbp), %rdi
callq 0x31a0
leaq -0x1d0(%rbp), %rdi
callq 0x31a0
jmp 0x4fc68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fc5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fba5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fb09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x31a0
leaq -0x230(%rbp), %rdi
callq 0x31a0
leaq -0x3d0(%rbp), %rdi
callq 0x31a0
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x270(%rbp), %rdi
callq 0x31a0
leaq -0x3b0(%rbp), %rdi
callq 0x31a0
leaq -0x290(%rbp), %rdi
callq 0x31a0
leaq -0x2b0(%rbp), %rdi
callq 0x31a0
leaq -0x2d0(%rbp), %rdi
callq 0x31a0
leaq -0x2f0(%rbp), %rdi
callq 0x31a0
leaq -0x310(%rbp), %rdi
callq 0x31a0
leaq -0x330(%rbp), %rdi
callq 0x31a0
leaq -0x350(%rbp), %rdi
callq 0x31a0
leaq -0x370(%rbp), %rdi
callq 0x31a0
leaq -0x390(%rbp), %rdi
callq 0x31a0
jmp 0x4fc5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fbdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x31a0
leaq -0x410(%rbp), %rdi
callq 0x31a0
jmp 0x4fc5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4fc10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x31a0
leaq -0x450(%rbp), %rdi
callq 0x31a0
jmp 0x4fc5c
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x31a0
leaq -0x130(%rbp), %rdi
callq 0x31a0
leaq -0x110(%rbp), %rdi
callq 0x31a0
leaq -0xf0(%rbp), %rdi
callq 0x31a0
jmp 0x503bc
leaq -0x150(%rbp), %rdi
callq 0x31a0
leaq -0x130(%rbp), %rdi
callq 0x31a0
leaq -0x110(%rbp), %rdi
callq 0x31a0
leaq -0xf0(%rbp), %rdi
callq 0x31a0
jmp 0x5059c
movq -0xd0(%rbp), %rdi
callq 0x1ecd0
movq %rax, %rsi
leaq -0x470(%rbp), %rdi
callq 0x3100
movq -0xd0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4fcba
movq -0xd0(%rbp), %rdi
callq 0x1ecd0
movq %rax, -0x898(%rbp)
jmp 0x4fccf
movq -0x898(%rbp), %rsi
leaq -0x490(%rbp), %rdi
callq 0x3100
jmp 0x4fce4
movq -0xd0(%rbp), %rdi
callq 0x1ecf0
jmp 0x4fcf2
movl -0x54(%rbp), %esi
leaq -0x530(%rbp), %rdi
callq 0x1e700
jmp 0x4fd03
leaq 0x98f2(%rip), %rsi      # 0x595fc
leaq -0x510(%rbp), %rdi
leaq -0x530(%rbp), %rdx
callq 0x1e930
jmp 0x4fd1f
leaq 0x98de(%rip), %rdx      # 0x59604
leaq -0x4f0(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x1e560
jmp 0x4fd3b
movl -0x54(%rbp), %esi
leaq -0x550(%rbp), %rdi
callq 0x1e700
jmp 0x4fd4c
leaq -0x4d0(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
leaq -0x550(%rbp), %rdx
callq 0x1e5b0
jmp 0x4fd68
leaq 0x98af(%rip), %rdx      # 0x5961e
leaq -0x4b0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x1e560
jmp 0x4fd84
leaq -0x4d0(%rbp), %rdi
callq 0x31a0
leaq -0x550(%rbp), %rdi
callq 0x31a0
leaq -0x4f0(%rbp), %rdi
callq 0x31a0
leaq -0x510(%rbp), %rdi
callq 0x31a0
leaq -0x530(%rbp), %rdi
callq 0x31a0
movl -0x54(%rbp), %esi
leaq -0x6b0(%rbp), %rdi
callq 0x1e700
jmp 0x4fdd1
leaq 0x9849(%rip), %rsi      # 0x59621
leaq -0x690(%rbp), %rdi
leaq -0x6b0(%rbp), %rdx
callq 0x1e930
jmp 0x4fded
leaq 0x9298(%rip), %rdx      # 0x5908c
leaq -0x670(%rbp), %rdi
leaq -0x690(%rbp), %rsi
callq 0x1e560
jmp 0x4fe09
leaq -0x650(%rbp), %rdi
leaq -0x670(%rbp), %rsi
leaq -0x470(%rbp), %rdx
callq 0x1e980
jmp 0x4fe25
leaq 0x87cd(%rip), %rdx      # 0x585f9
leaq -0x630(%rbp), %rdi
leaq -0x650(%rbp), %rsi
callq 0x1e560
jmp 0x4fe41
leaq -0x610(%rbp), %rdi
leaq -0x630(%rbp), %rsi
leaq -0x490(%rbp), %rdx
callq 0x1e980
jmp 0x4fe5d
leaq 0x97b2(%rip), %rdx      # 0x59616
leaq -0x5f0(%rbp), %rdi
leaq -0x610(%rbp), %rsi
callq 0x1e560
jmp 0x4fe79
movl -0x54(%rbp), %esi
leaq -0x6d0(%rbp), %rdi
callq 0x1e700
jmp 0x4fe8a
leaq -0x5d0(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
leaq -0x6d0(%rbp), %rdx
callq 0x1e5b0
jmp 0x4fea6
leaq 0x976d(%rip), %rdx      # 0x5961a
leaq -0x5b0(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
callq 0x1e560
jmp 0x4fec2
movl -0x54(%rbp), %esi
leaq -0x6f0(%rbp), %rdi
callq 0x1e700
jmp 0x4fed3
leaq -0x590(%rbp), %rdi
leaq -0x5b0(%rbp), %rsi
leaq -0x6f0(%rbp), %rdx
callq 0x1e5b0
jmp 0x4feef
leaq 0x9814(%rip), %rdx      # 0x5970a
leaq -0x570(%rbp), %rdi
leaq -0x590(%rbp), %rsi
callq 0x1e560
jmp 0x4ff0b
leaq -0x4b0(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x32e0
jmp 0x4ff20
leaq -0x570(%rbp), %rdi
callq 0x31a0
leaq -0x590(%rbp), %rdi
callq 0x31a0
leaq -0x6f0(%rbp), %rdi
callq 0x31a0
leaq -0x5b0(%rbp), %rdi
callq 0x31a0
leaq -0x5d0(%rbp), %rdi
callq 0x31a0
leaq -0x6d0(%rbp), %rdi
callq 0x31a0
leaq -0x5f0(%rbp), %rdi
callq 0x31a0
leaq -0x610(%rbp), %rdi
callq 0x31a0
leaq -0x630(%rbp), %rdi
callq 0x31a0
leaq -0x650(%rbp), %rdi
callq 0x31a0
leaq -0x670(%rbp), %rdi
callq 0x31a0
leaq -0x690(%rbp), %rdi
callq 0x31a0
leaq -0x6b0(%rbp), %rdi
callq 0x31a0
movq 0x20(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x2e150
jmp 0x4ffce
movq -0x48(%rbp), %rax
movslq -0xc4(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8a0(%rbp)
movl -0x54(%rbp), %esi
leaq -0x730(%rbp), %rdi
callq 0x1e700
jmp 0x4fffc
leaq 0x9615(%rip), %rsi      # 0x59618
leaq -0x710(%rbp), %rdi
leaq -0x730(%rbp), %rdx
callq 0x1e930
jmp 0x50018
movq -0x8a0(%rbp), %rdi
leaq -0x710(%rbp), %rsi
callq 0x1e3c0
jmp 0x5002d
leaq -0x710(%rbp), %rdi
callq 0x31a0
leaq -0x730(%rbp), %rdi
callq 0x31a0
movl -0xc4(%rbp), %eax
addl $0x1, %eax
cmpl -0x1c(%rbp), %eax
jge 0x50364
movq -0x48(%rbp), %rax
movl -0xc4(%rbp), %ecx
incl %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8a8(%rbp)
movl -0x54(%rbp), %esi
leaq -0x770(%rbp), %rdi
callq 0x1e700
jmp 0x50089
leaq 0x958c(%rip), %rsi      # 0x5961c
leaq -0x750(%rbp), %rdi
leaq -0x770(%rbp), %rdx
callq 0x1e930
jmp 0x500a5
movq -0x8a8(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x1e3c0
jmp 0x500ba
leaq -0x750(%rbp), %rdi
callq 0x31a0
leaq -0x770(%rbp), %rdi
callq 0x31a0
jmp 0x50364
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x503ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5039f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5016d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50161
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50155
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50149
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x31a0
leaq -0x550(%rbp), %rdi
callq 0x31a0
leaq -0x4f0(%rbp), %rdi
callq 0x31a0
leaq -0x510(%rbp), %rdi
callq 0x31a0
leaq -0x530(%rbp), %rdi
callq 0x31a0
jmp 0x5039f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x502a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50297
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5028b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5027f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x570(%rbp), %rdi
callq 0x31a0
leaq -0x590(%rbp), %rdi
callq 0x31a0
leaq -0x6f0(%rbp), %rdi
callq 0x31a0
leaq -0x5b0(%rbp), %rdi
callq 0x31a0
leaq -0x5d0(%rbp), %rdi
callq 0x31a0
leaq -0x6d0(%rbp), %rdi
callq 0x31a0
leaq -0x5f0(%rbp), %rdi
callq 0x31a0
leaq -0x610(%rbp), %rdi
callq 0x31a0
leaq -0x630(%rbp), %rdi
callq 0x31a0
leaq -0x650(%rbp), %rdi
callq 0x31a0
leaq -0x670(%rbp), %rdi
callq 0x31a0
leaq -0x690(%rbp), %rdi
callq 0x31a0
leaq -0x6b0(%rbp), %rdi
callq 0x31a0
jmp 0x50393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50322
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x710(%rbp), %rdi
callq 0x31a0
leaq -0x730(%rbp), %rdi
callq 0x31a0
jmp 0x50393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x50356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x31a0
leaq -0x770(%rbp), %rdi
callq 0x31a0
jmp 0x50393
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
leaq -0x4b0(%rbp), %rdi
callq 0x31a0
leaq -0x490(%rbp), %rdi
callq 0x31a0
leaq -0x470(%rbp), %rdi
callq 0x31a0
jmp 0x503bc
leaq -0x4b0(%rbp), %rdi
callq 0x31a0
leaq -0x490(%rbp), %rdi
callq 0x31a0
leaq -0x470(%rbp), %rdi
callq 0x31a0
jmp 0x5059c
jmp 0x4f3e4
jmp 0x503c3
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x4f3bc
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x4c310
jmp 0x4f2d6
movq 0x20(%rbp), %rax
movq %rax, -0x8b8(%rbp)
leaq -0x791(%rbp), %rdi
movq %rdi, -0x8b0(%rbp)
callq 0x3430
movq -0x8b0(%rbp), %rdx
leaq 0x91c9(%rip), %rsi      # 0x595e1
leaq -0x790(%rbp), %rdi
callq 0x3320
jmp 0x50426
movq -0x8b8(%rbp), %rdi
leaq -0x790(%rbp), %rsi
callq 0x1e3c0
jmp 0x5043b
leaq -0x790(%rbp), %rdi
callq 0x31a0
leaq -0x791(%rbp), %rdi
callq 0x32a0
testb $0x1, -0x21(%rbp)
je 0x504f9
movq -0x7d8(%rbp), %rsi
leaq -0x7b8(%rbp), %rdi
movq %rdi, -0x8c0(%rbp)
callq 0x3100
movq -0x8c0(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq 0x20(%rbp), %r8
movq 0x28(%rbp), %r9
leaq -0x30(%rbp), %rdi
callq 0x4dc30
jmp 0x50497
leaq -0x7b8(%rbp), %rdi
callq 0x31a0
jmp 0x50519
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x504cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x790(%rbp), %rdi
callq 0x31a0
leaq -0x791(%rbp), %rdi
callq 0x32a0
jmp 0x5059c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x7b8(%rbp), %rdi
callq 0x31a0
jmp 0x5059c
movl -0x1c(%rbp), %esi
movq 0x20(%rbp), %rdx
movb -0x22(%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, -0x8c8(%rbp)
cmpq $0x0, %rax
je 0x50593
movq -0x8c8(%rbp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, -0x8d8(%rbp)
imulq $0x50, -0x8(%rcx), %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x8d0(%rbp)
je 0x50587
movq -0x8d0(%rbp), %rdi
addq $-0x50, %rdi
movq %rdi, -0x8e0(%rbp)
callq 0x1edc0
movq -0x8c8(%rbp), %rcx
movq -0x8e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x8d0(%rbp)
jne 0x50556
movq -0x8d8(%rbp), %rdi
callq 0x32f0
addq $0x8e0, %rsp            # imm = 0x8E0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)