// File: /workspace/github_c_makefile_star2_O3/aspone[P]OrderBook/./OrderBook.h
// Function: OrderBook::OrderBook<unsigned int, OrderLevelEntry>::printBook()
void printBook() {
      int max_buffer = 500;
      char *buffer = (char*)calloc(max_buffer, sizeof(char));
      int index = 0;

      for (auto it = sell_book_map_.rbegin(); it != sell_book_map_.rend(); ++it) {
         if (it->second.getQuantity() != 0) {
            // char header[50];
            // sprintf(header, "%.2f ", it->first / 100.);
            // safeCopyToBuffer(buffer, header, index, max_buffer);

            // 2 ^ 308, double max, is 93 digits.
            if (index + 100 > max_buffer) growBuffer(buffer, max_buffer);
            index += sprintf(&buffer[index], "%.2f ", it->first / 100.);

            it->second.printLevel('S', buffer, index, max_buffer);

            // safeCopyToBuffer(buffer, "\n", index, max_buffer);

            if (index + 10 > max_buffer) growBuffer(buffer, max_buffer);
            index += sprintf(&buffer[index], "\n");
         }
      }
      safeCopyToBuffer(buffer, "\n", index, max_buffer);
      for (auto it = buy_book_map_.rbegin(); it != buy_book_map_.rend(); ++it) {
         if (it->second.getQuantity() != 0) {
            // char header[50];
            // sprintf(header, "%.2f ", it->first / 100.);
            // safeCopyToBuffer(buffer, header, index, max_buffer);

            // 2 ^ 308, double max, is 93 digits.
            if (index + 100 > max_buffer) growBuffer(buffer, max_buffer);
            index += sprintf(&buffer[index], "%.2f ", it->first / 100.);

            it->second.printLevel('B', buffer, index, max_buffer);

            // safeCopyToBuffer(buffer, "\n", index, max_buffer);

            if (index + 10 > max_buffer) growBuffer(buffer, max_buffer);
            index += sprintf(&buffer[index], "\n");
         }
      }
      // safeCopyToBuffer(buffer, "\n", index, max_buffer);
      if (index + 10 > max_buffer) growBuffer(buffer, max_buffer);
      index += sprintf(&buffer[index], "\n");

      logger_.print(buffer);
      free(buffer);
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl $0x1f4, 0x4(%rsp)       # imm = 0x1F4
movl $0x1f4, %edi            # imm = 0x1F4
movl $0x1, %esi
callq 0x2120
movq %rax, 0x8(%rsp)
movl $0x0, (%rsp)
leaq 0x110(%rbx), %r14
movq 0x120(%rbx), %r15
cmpq %r15, %r14
je 0x5ed9
xorl %r12d, %r12d
leaq 0x4(%rsp), %rbp
movq %r14, %rdi
callq 0x2200
cmpl $0x0, 0x40(%rax)
je 0x5ec5
leal 0x64(%r12), %eax
movslq 0x4(%rsp), %r13
movq 0x8(%rsp), %r15
cmpl %r13d, %eax
jle 0x5dfc
leaq (,%r13,2), %rsi
movl %esi, 0x4(%rsp)
movq %r15, %rdi
callq 0x22f0
movq %rax, %r15
movq %rax, 0x8(%rsp)
leaq (%rax,%r13), %rdi
movslq 0x4(%rsp), %rdx
subq %r13, %rdx
xorl %esi, %esi
callq 0x20f0
movl (%rsp), %r12d
movslq %r12d, %r12
addq %r15, %r12
movq %r14, %rdi
callq 0x2200
movsd 0x20(%rax), %xmm1
unpcklps 0x121a(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1222(%rip), %xmm1     # 0x7040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x11de(%rip), %xmm0     # 0x7010
movq %r12, %rdi
leaq 0x145b(%rip), %rsi      # 0x7297
movb $0x1, %al
callq 0x2050
addl %eax, (%rsp)
movq %r14, %rdi
callq 0x2200
leaq 0x28(%rax), %rdi
movl $0x53, %esi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbp, %r8
callq 0x60f6
movl (%rsp), %eax
leal 0xa(%rax), %ecx
movslq 0x4(%rsp), %r12
movq 0x8(%rsp), %r15
cmpl %r12d, %ecx
jle 0x5eaa
leaq (%r12,%r12), %rsi
movl %esi, 0x4(%rsp)
movq %r15, %rdi
callq 0x22f0
movq %rax, %r15
movq %rax, 0x8(%rsp)
leaq (%rax,%r12), %rdi
movslq 0x4(%rsp), %rdx
subq %r12, %rdx
xorl %esi, %esi
callq 0x20f0
movl (%rsp), %eax
cltq
movw $0xa, (%r15,%rax)
movl (%rsp), %r12d
incl %r12d
movl %r12d, (%rsp)
movq 0x120(%rbx), %r15
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
cmpq %r15, %rax
jne 0x5da3
leaq 0x13b0(%rip), %rsi      # 0x7290
leaq 0x8(%rsp), %rdi
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
callq 0x2761
leaq 0xe0(%rbx), %r14
movq 0xf0(%rbx), %r15
cmpq %r15, %r14
je 0x603b
movq %rsp, %r13
leaq 0x4(%rsp), %rbp
movq %r14, %rdi
callq 0x2200
cmpl $0x0, 0x40(%rax)
je 0x6027
movl (%rsp), %eax
leal 0x64(%rax), %ecx
movslq 0x4(%rsp), %r12
movq 0x8(%rsp), %r15
cmpl %r12d, %ecx
jle 0x5f66
leaq (%r12,%r12), %rsi
movl %esi, 0x4(%rsp)
movq %r15, %rdi
callq 0x22f0
movq %rax, %r15
movq %rax, 0x8(%rsp)
leaq (%rax,%r12), %rdi
movslq 0x4(%rsp), %rdx
subq %r12, %rdx
xorl %esi, %esi
callq 0x20f0
movl (%rsp), %eax
movslq %eax, %r12
addq %r15, %r12
movq %r14, %rdi
callq 0x2200
movsd 0x20(%rax), %xmm1
unpcklps 0x10b0(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x10b8(%rip), %xmm1     # 0x7040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x1074(%rip), %xmm0     # 0x7010
movq %r12, %rdi
leaq 0x12f1(%rip), %rsi      # 0x7297
movb $0x1, %al
callq 0x2050
addl %eax, (%rsp)
movq %r14, %rdi
callq 0x2200
leaq 0x28(%rax), %rdi
movl $0x42, %esi
leaq 0x8(%rsp), %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x60f6
movl (%rsp), %eax
leal 0xa(%rax), %ecx
movslq 0x4(%rsp), %r12
movq 0x8(%rsp), %r15
cmpl %r12d, %ecx
jle 0x6014
leaq (%r12,%r12), %rsi
movl %esi, 0x4(%rsp)
movq %r15, %rdi
callq 0x22f0
movq %rax, %r15
movq %rax, 0x8(%rsp)
leaq (%rax,%r12), %rdi
movslq 0x4(%rsp), %rdx
subq %r12, %rdx
xorl %esi, %esi
callq 0x20f0
movl (%rsp), %eax
cltq
movw $0xa, (%r15,%rax)
incl (%rsp)
movq 0xf0(%rbx), %r15
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
cmpq %r15, %rax
jne 0x5f11
movl (%rsp), %eax
leal 0xa(%rax), %ecx
movslq 0x4(%rsp), %r15
movq 0x8(%rsp), %r14
cmpl %r15d, %ecx
jle 0x607e
leaq (%r15,%r15), %rsi
movl %esi, 0x4(%rsp)
movq %r14, %rdi
callq 0x22f0
movq %rax, %r14
movq %rax, 0x8(%rsp)
leaq (%rax,%r15), %rdi
movslq 0x4(%rsp), %rdx
subq %r15, %rdx
xorl %esi, %esi
callq 0x20f0
movl (%rsp), %eax
cltq
movw $0xa, (%r14,%rax)
incl (%rsp)
movq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %r14
leaq 0x17(%rsp), %rdx
movq %r14, %rdi
callq 0x2080
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5220
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x60bf
callq 0x21c0
movq 0x8(%rsp), %rdi
callq 0x2240
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x60ee
callq 0x21c0
movq %rbx, %rdi
callq 0x2310