// File: temelmertcan[P]multgen/src/pp_gen.cpp
// Function: create_signedpp(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>**&, int&, int&, std::__cxx11::list<int, std::allocator<int>>&, 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>>>>>&)
void create_signedpp (int m, int n,
                      string**& pp_matrix,
                      int& pp_dim1,
                      int& pp_dim2,
                      std::list<int>& extra_ones_indices,
		   
                      std::queue<string>& verilog){

  pp_dim1 = m+1;
  pp_dim2 = n+m;

  pp_matrix = new string*[pp_dim1];
  for (int i = 0; i < pp_dim1; i++){
    pp_matrix[i] = new string[pp_dim2];
    for (int j = 0; j < pp_dim2; j++)
      pp_matrix[i][j] = "";
  }

  // if (m != n) {
  //   cout << "Simple signed partial products are only supported when IN1 and IN2 has the same dimensions." << endl;
  //   return;
  // }


  for (int i = 0; i<m; i++)
    verilog.push ( "wire logic [" + to_string(n-1) + ":0] pp" + to_string(i) + ";");

  for (int i = 0; i < m; i++){
    pp_matrix[i] = new string[pp_dim2];
    for (int j = 0; j < i; j++){
      pp_matrix[i][j] = "";
    }
    for (int j = 0; j < n; j++){
      string cur;
      cur = "pp" + to_string(i) + "[" + to_string(j) + "]";
      pp_matrix[i][j+i] = cur;
    }

    for (int j = n+i; j < pp_dim2; j++){
      pp_matrix[i][j] = "";
    }

    if (i==m-1)
      verilog.push ("assign pp" + to_string(i)  + " = ~({"
                    + to_string(n)
                    + "{IN1["
                    + to_string(i)
                    + "]}} & IN2) ^ ((1'b1)<<" + to_string(n-1) + ");");
    else
      verilog.push ("assign pp" + to_string(i)  + " = ({"
                    + to_string(n)
                    + "{IN1["
                    + to_string(i)
                    + "]}} & IN2) ^ ((1'b1)<<" + to_string(n-1) + ");");
  }

  std::list<int> extra_ones_indices1;
  for (int i = n-1; i<m-1+n-1; i++)
    extra_ones_indices1.push_back (i);
  std::list<int> extra_ones_indices2;
  for (int i = m-1; i<m-1+n-1; i++)
    extra_ones_indices2.push_back (i);

  extra_ones_indices = merge_extra_ones_indices(extra_ones_indices1,extra_ones_indices2,0);

  // extra_ones_indices.push_back(n);
  // extra_ones_indices.push_back(m+n-1);
  // pp_matrix[m][n] = "1'b1";
  // pp_matrix[m][m+n-1] = "1'b1";

  // print_pp(pp_matrix, pp_dim1, pp_dim2, verilog, true);

  //print_pp(pp_matrix, pp_dim1, pp_dim2);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5f0, %rsp            # imm = 0x5F0
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
addl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2f9cb
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x570(%rbp)
movl $0x20, %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 -0x570(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x568(%rbp)
cmpq $0x0, %rax
je 0x2f962
movq -0x568(%rbp), %rax
movq -0x570(%rbp), %rdx
shlq $0x5, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x580(%rbp)
movq %rax, -0x578(%rbp)
movq -0x578(%rbp), %rdi
movq %rdi, -0x588(%rbp)
callq 0x3330
movq -0x588(%rbp), %rax
movq -0x580(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x578(%rbp)
jne 0x2f931
movq -0x568(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2f9bb
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x30(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x29c36(%rip), %rsi     # 0x595e1
callq 0x3310
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2f97f
jmp 0x2f9bd
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2f8a6
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x2fb9b
movq 0x10(%rbp), %rax
movq %rax, -0x598(%rbp)
movl -0x8(%rbp), %esi
decl %esi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x590(%rbp)
callq 0x1e700
movq -0x590(%rbp), %rdx
leaq 0x28521(%rip), %rsi     # 0x57f30
leaq -0xb8(%rbp), %rdi
callq 0x1e930
jmp 0x2fa1d
leaq 0x29519(%rip), %rdx     # 0x58f3d
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1e560
jmp 0x2fa39
movl -0x34(%rbp), %esi
leaq -0x108(%rbp), %rdi
callq 0x1e700
jmp 0x2fa4a
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x1e5b0
jmp 0x2fa63
leaq 0x29ca1(%rip), %rdx     # 0x5970b
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1e560
jmp 0x2fa79
movq -0x598(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1e3c0
jmp 0x2fa8b
leaq -0x58(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
callq 0x31a0
leaq -0xb8(%rbp), %rdi
callq 0x31a0
leaq -0xd8(%rbp), %rdi
callq 0x31a0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2f9d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fb8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fb7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fb72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fb66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fb5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
callq 0x31a0
leaq -0xb8(%rbp), %rdi
callq 0x31a0
leaq -0xd8(%rbp), %rdi
callq 0x31a0
jmp 0x307e7
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x3068e
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x5a8(%rbp)
movl $0x20, %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 -0x5a8(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x5a0(%rbp)
cmpq $0x0, %rax
je 0x2fc61
movq -0x5a0(%rbp), %rax
movq -0x5a8(%rbp), %rdx
shlq $0x5, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x5b8(%rbp)
movq %rax, -0x5b0(%rbp)
movq -0x5b0(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
callq 0x3330
movq -0x5c0(%rbp), %rax
movq -0x5b8(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x5b0(%rbp)
jne 0x2fc30
movq -0x5a0(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x10c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x110(%rbp)
movl -0x110(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x2fccf
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x10c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x110(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x29928(%rip), %rsi     # 0x595e1
callq 0x3310
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x2fc84
movl $0x0, -0x114(%rbp)
movl -0x114(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2ff0e
leaq -0x138(%rbp), %rdi
callq 0x3330
movl -0x10c(%rbp), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x1e700
jmp 0x2fd08
leaq 0x29232(%rip), %rsi     # 0x58f41
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rdx
callq 0x1e930
jmp 0x2fd24
leaq 0x28762(%rip), %rdx     # 0x5848d
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x1e560
jmp 0x2fd40
movl -0x114(%rbp), %esi
leaq -0x1f8(%rbp), %rdi
callq 0x1e700
jmp 0x2fd54
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x1e5b0
jmp 0x2fd70
leaq 0x280a5(%rip), %rdx     # 0x57e1c
leaq -0x158(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x1e560
jmp 0x2fd8c
leaq -0x138(%rbp), %rdi
movq %rdi, -0x5c8(%rbp)
leaq -0x158(%rbp), %rsi
movq %rsi, -0x5d0(%rbp)
callq 0x32b0
movq -0x5d0(%rbp), %rdi
callq 0x31a0
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
movq -0x5c8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x10c(%rbp), %rdx
movl %edx, %ecx
movq (%rax,%rdx,8), %rdi
movl -0x114(%rbp), %eax
addl %ecx, %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
callq 0x3050
jmp 0x2fe28
leaq -0x138(%rbp), %rdi
callq 0x31a0
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x2fcd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fefd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fef1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fed9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2fecd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
leaq -0x138(%rbp), %rdi
callq 0x31a0
jmp 0x307e7
movl -0x8(%rbp), %eax
addl -0x10c(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movl -0x1fc(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2ff68
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x10c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x1fc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x2968f(%rip), %rsi     # 0x595e1
callq 0x3310
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
jmp 0x2ff1d
movl -0x10c(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x302fa
movq 0x10(%rbp), %rax
movq %rax, -0x5e0(%rbp)
movl -0x10c(%rbp), %esi
leaq -0x320(%rbp), %rdi
movq %rdi, -0x5d8(%rbp)
callq 0x1e700
movq -0x5d8(%rbp), %rdx
leaq 0x28f96(%rip), %rsi     # 0x58f44
leaq -0x300(%rbp), %rdi
callq 0x1e930
jmp 0x2ffbc
leaq 0x28f9b(%rip), %rdx     # 0x58f5e
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x1e560
jmp 0x2ffd8
movl -0x8(%rbp), %esi
leaq -0x340(%rbp), %rdi
callq 0x1e700
jmp 0x2ffe9
leaq -0x2c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
leaq -0x340(%rbp), %rdx
callq 0x1e5b0
jmp 0x30005
leaq 0x28384(%rip), %rdx     # 0x58390
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x1e560
jmp 0x30021
movl -0x10c(%rbp), %esi
leaq -0x360(%rbp), %rdi
callq 0x1e700
jmp 0x30035
leaq -0x280(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0x1e5b0
jmp 0x30051
leaq 0x28f0d(%rip), %rdx     # 0x58f65
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x1e560
jmp 0x3006d
movl -0x8(%rbp), %esi
decl %esi
leaq -0x380(%rbp), %rdi
callq 0x1e700
jmp 0x30080
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x380(%rbp), %rdx
callq 0x1e5b0
jmp 0x3009c
leaq 0x29667(%rip), %rdx     # 0x5970a
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x1e560
jmp 0x300b8
movq -0x5e0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x1e3c0
jmp 0x300cd
leaq -0x220(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
callq 0x31a0
leaq -0x380(%rbp), %rdi
callq 0x31a0
leaq -0x260(%rbp), %rdi
callq 0x31a0
leaq -0x280(%rbp), %rdi
callq 0x31a0
leaq -0x360(%rbp), %rdi
callq 0x31a0
leaq -0x2a0(%rbp), %rdi
callq 0x31a0
leaq -0x2c0(%rbp), %rdi
callq 0x31a0
leaq -0x340(%rbp), %rdi
callq 0x31a0
leaq -0x2e0(%rbp), %rdi
callq 0x31a0
leaq -0x300(%rbp), %rdi
callq 0x31a0
leaq -0x320(%rbp), %rdi
callq 0x31a0
jmp 0x30678
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x302a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30295
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30289
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x3027d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30271
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
callq 0x31a0
leaq -0x380(%rbp), %rdi
callq 0x31a0
leaq -0x260(%rbp), %rdi
callq 0x31a0
leaq -0x280(%rbp), %rdi
callq 0x31a0
leaq -0x360(%rbp), %rdi
callq 0x31a0
leaq -0x2a0(%rbp), %rdi
callq 0x31a0
leaq -0x2c0(%rbp), %rdi
callq 0x31a0
leaq -0x340(%rbp), %rdi
callq 0x31a0
leaq -0x2e0(%rbp), %rdi
callq 0x31a0
leaq -0x300(%rbp), %rdi
callq 0x31a0
leaq -0x320(%rbp), %rdi
callq 0x31a0
jmp 0x307e7
movq 0x10(%rbp), %rax
movq %rax, -0x5f0(%rbp)
movl -0x10c(%rbp), %esi
leaq -0x4a0(%rbp), %rdi
movq %rdi, -0x5e8(%rbp)
callq 0x1e700
movq -0x5e8(%rbp), %rdx
leaq 0x28c18(%rip), %rsi     # 0x58f44
leaq -0x480(%rbp), %rdi
callq 0x1e930
jmp 0x3033a
leaq 0x28c3b(%rip), %rdx     # 0x58f7c
leaq -0x460(%rbp), %rdi
leaq -0x480(%rbp), %rsi
callq 0x1e560
jmp 0x30356
movl -0x8(%rbp), %esi
leaq -0x4c0(%rbp), %rdi
callq 0x1e700
jmp 0x30367
leaq -0x440(%rbp), %rdi
leaq -0x460(%rbp), %rsi
leaq -0x4c0(%rbp), %rdx
callq 0x1e5b0
jmp 0x30383
leaq 0x28006(%rip), %rdx     # 0x58390
leaq -0x420(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x1e560
jmp 0x3039f
movl -0x10c(%rbp), %esi
leaq -0x4e0(%rbp), %rdi
callq 0x1e700
jmp 0x303b3
leaq -0x400(%rbp), %rdi
leaq -0x420(%rbp), %rsi
leaq -0x4e0(%rbp), %rdx
callq 0x1e5b0
jmp 0x303cf
leaq 0x28b8f(%rip), %rdx     # 0x58f65
leaq -0x3e0(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x1e560
jmp 0x303eb
movl -0x8(%rbp), %esi
decl %esi
leaq -0x500(%rbp), %rdi
callq 0x1e700
jmp 0x303fe
leaq -0x3c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
leaq -0x500(%rbp), %rdx
callq 0x1e5b0
jmp 0x3041a
leaq 0x292e9(%rip), %rdx     # 0x5970a
leaq -0x3a0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0x1e560
jmp 0x30436
movq -0x5f0(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x1e3c0
jmp 0x3044b
leaq -0x3a0(%rbp), %rdi
callq 0x31a0
leaq -0x3c0(%rbp), %rdi
callq 0x31a0
leaq -0x500(%rbp), %rdi
callq 0x31a0
leaq -0x3e0(%rbp), %rdi
callq 0x31a0
leaq -0x400(%rbp), %rdi
callq 0x31a0
leaq -0x4e0(%rbp), %rdi
callq 0x31a0
leaq -0x420(%rbp), %rdi
callq 0x31a0
leaq -0x440(%rbp), %rdi
callq 0x31a0
leaq -0x4c0(%rbp), %rdi
callq 0x31a0
leaq -0x460(%rbp), %rdi
callq 0x31a0
leaq -0x480(%rbp), %rdi
callq 0x31a0
leaq -0x4a0(%rbp), %rdi
callq 0x31a0
jmp 0x30678
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30667
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x3065b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x3064f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30643
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30637
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x3062b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x3061f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30613
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x30607
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x305fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x305ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x3a0(%rbp), %rdi
callq 0x31a0
leaq -0x3c0(%rbp), %rdi
callq 0x31a0
leaq -0x500(%rbp), %rdi
callq 0x31a0
leaq -0x3e0(%rbp), %rdi
callq 0x31a0
leaq -0x400(%rbp), %rdi
callq 0x31a0
leaq -0x4e0(%rbp), %rdi
callq 0x31a0
leaq -0x420(%rbp), %rdi
callq 0x31a0
leaq -0x440(%rbp), %rdi
callq 0x31a0
leaq -0x4c0(%rbp), %rdi
callq 0x31a0
leaq -0x460(%rbp), %rdi
callq 0x31a0
leaq -0x480(%rbp), %rdi
callq 0x31a0
leaq -0x4a0(%rbp), %rdi
callq 0x31a0
jmp 0x307e7
jmp 0x3067a
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x2fba5
leaq -0x518(%rbp), %rdi
callq 0x1eb00
movl -0x8(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x51c(%rbp)
movl -0x51c(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
addl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x306fb
leaq -0x518(%rbp), %rdi
leaq -0x51c(%rbp), %rsi
callq 0x46d70
jmp 0x306d1
jmp 0x306d3
movl -0x51c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51c(%rbp)
jmp 0x306a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x307db
leaq -0x538(%rbp), %rdi
callq 0x1eb00
movl -0x4(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x53c(%rbp)
movl -0x53c(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
addl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x30771
leaq -0x538(%rbp), %rdi
leaq -0x53c(%rbp), %rsi
callq 0x46d70
jmp 0x3073e
jmp 0x30740
movl -0x53c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x53c(%rbp)
jmp 0x30713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x1eb50
jmp 0x307db
movl $0x0, -0x55c(%rbp)
leaq -0x558(%rbp), %rdi
leaq -0x518(%rbp), %rsi
leaq -0x538(%rbp), %rdx
leaq -0x55c(%rbp), %rcx
callq 0x2e5b0
jmp 0x3079e
movq -0x28(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x1eb20
leaq -0x558(%rbp), %rdi
callq 0x1eb50
leaq -0x538(%rbp), %rdi
callq 0x1eb50
leaq -0x518(%rbp), %rdi
callq 0x1eb50
addq $0x5f0, %rsp            # imm = 0x5F0
popq %rbp
retq
leaq -0x518(%rbp), %rdi
callq 0x1eb50
movq -0xe0(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)