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

  if (n > 64)
    return;

  if (to_file){
    verilog.push("");
    verilog.push("// The values to be summed in the summation tree, from LSB (left) to MSB:");

  }

  unsigned long len = 4;
  for (int i=0; i<m; i++){
    for (int j=0; j<n; j++){
      len = max (pp[i][j].size(), len);
    }
  }
  len++;

  for (int i=0; i<m; i++){
    string line = (to_file ? " // " : "");
    for (int j=0; j<n; j++){
      if (pp[i][j] != ""){
        line += pp[i][j];

        for (int k = pp[i][j].size(); k<len; k++)
          line += " ";
      }
      else{
        line += "  --";
        for (int k = 4; k<len; k++)
          line+= " ";
      }
    }
    if (to_file) verilog.push(line);
    else cout << line << endl;
  }

  // cout << "here" << endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
cmpl $0x40, -0x10(%rbp)
jle 0x2eaec
jmp 0x2ef31
testb $0x1, -0x19(%rbp)
je 0x2ec0a
movq -0x18(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x3430
movq -0xd8(%rbp), %rdx
leaq 0x2aac2(%rip), %rsi     # 0x595e1
leaq -0x40(%rbp), %rdi
callq 0x3320
jmp 0x2eb2a
movq -0xe0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1e3c0
jmp 0x2eb3c
leaq -0x40(%rbp), %rdi
callq 0x31a0
leaq -0x41(%rbp), %rdi
callq 0x32a0
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x3430
movq -0xe8(%rbp), %rdx
leaq 0x2a372(%rip), %rsi     # 0x58ee9
leaq -0x78(%rbp), %rdi
callq 0x3320
jmp 0x2eb82
movq -0xf0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1e3c0
jmp 0x2eb94
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x79(%rbp), %rdi
callq 0x32a0
jmp 0x2ec0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2ebcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x31a0
leaq -0x41(%rbp), %rdi
callq 0x32a0
jmp 0x2ef3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2ebfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x79(%rbp), %rdi
callq 0x32a0
jmp 0x2ef3a
movq $0x4, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2ecb0
movl $0x0, -0x90(%rbp)
movl -0x90(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x2ec9a
movq -0x8(%rbp), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x90(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x31c0
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x20020
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x2ec38
jmp 0x2ec9c
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x2ec1f
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2ef31
movb -0x19(%rbp), %dl
leaq 0x2a24e(%rip), %rcx     # 0x58f33
leaq 0x2a8f5(%rip), %rax     # 0x595e1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x100(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x3430
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x3320
jmp 0x2ed29
leaq -0xc1(%rbp), %rdi
callq 0x32a0
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x2eec4
movq -0x8(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0xc8(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x2a86f(%rip), %rsi     # 0x595e1
callq 0x1e470
movb %al, -0x101(%rbp)
jmp 0x2ed7f
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0x2ed8e
jmp 0x2ee55
movq -0x8(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq -0xc8(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x32e0
jmp 0x2edb9
movq -0x8(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0xc8(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x31c0
movl %eax, -0xcc(%rbp)
movslq -0xcc(%rbp), %rax
cmpq -0x88(%rbp), %rax
jae 0x2ee53
leaq 0x27e1f(%rip), %rsi     # 0x56c17
leaq -0xc0(%rbp), %rdi
callq 0x3230
jmp 0x2ee06
jmp 0x2ee08
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x2ede1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc1(%rbp), %rdi
callq 0x32a0
jmp 0x2ef3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x31a0
jmp 0x2ef3a
jmp 0x2eeae
leaq 0x2a0dc(%rip), %rsi     # 0x58f38
leaq -0xc0(%rbp), %rdi
callq 0x3230
jmp 0x2ee6a
movl $0x4, -0xd0(%rbp)
movslq -0xd0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jae 0x2eeac
leaq 0x27d8c(%rip), %rsi     # 0x56c17
leaq -0xc0(%rbp), %rdi
callq 0x3230
jmp 0x2ee99
jmp 0x2ee9b
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x2ee74
jmp 0x2eeae
jmp 0x2eeb0
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x2ed3f
testb $0x1, -0x19(%rbp)
je 0x2eede
movq -0x18(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2e150
jmp 0x2eedc
jmp 0x2ef11
movq 0x370e3(%rip), %rdi     # 0x65fc8
leaq -0xc0(%rbp), %rsi
callq 0x3210
movq %rax, -0x110(%rbp)
jmp 0x2eefa
movq -0x110(%rbp), %rdi
movq 0x370b0(%rip), %rsi     # 0x65fb8
callq 0x3280
jmp 0x2ef0f
jmp 0x2ef11
leaq -0xc0(%rbp), %rdi
callq 0x31a0
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x2eccc
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)