// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree.cc
// Function: BTreeIndex::DisplayInternal(unsigned int const&, std::ostream&, BTreeDisplayType) const
ERROR_T BTreeIndex::DisplayInternal(const SIZE_T &node,
  ostream &o,
  BTreeDisplayType display_type) const
{
  KEY_T testkey;
  SIZE_T ptr;
  BTreeNode b;
  ERROR_T rc;
  SIZE_T offset;

  rc= b.Unserialize(buffercache,node);

  if (rc!=ERROR_NOERROR) { 
    return rc;
  }

  rc = PrintNode(o,node,b,display_type);
  
  if (rc) { return rc; }

  if (display_type==BTREE_DEPTH_DOT) { 
    o << ";";
  }

  if (display_type!=BTREE_SORTED_KEYVAL) {
    o << endl;
  }

  switch (b.info.nodetype) { 
    case BTREE_ROOT_NODE:
    case BTREE_INTERIOR_NODE:
    if (b.info.numkeys>0) { 
      for (offset=0;offset<=b.info.numkeys;offset++) { 
       rc=b.GetPtr(offset,ptr);
       if (rc) { return rc; }
       if (display_type==BTREE_DEPTH_DOT) { 
         o << node << " -> "<<ptr<<";\n";
       }
       rc=DisplayInternal(ptr,o,display_type);
       if (rc) { return rc; }
     }
   }
   return ERROR_NOERROR;
   break;
   case BTREE_LEAF_NODE:
   return ERROR_NOERROR;
   break;
   default:
   if (display_type==BTREE_DEPTH_DOT) { 
   } else {
    o << "Unsupported Node Type " << b.info.nodetype ;
  }
  return ERROR_INSANE;
}

return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc0(%rsp), %rdi
callq 0x2c54
leaq 0x20(%rsp), %rdi
callq 0x7d2a
movq %r15, 0x68(%rsp)
movq 0x8(%r15), %rsi
movq %r14, 0x50(%rsp)
movl (%r14), %edx
leaq 0x20(%rsp), %rdi
callq 0x7eee
movl %eax, %r15d
testl %eax, %eax
jne 0x7370
movq 0x50(%rsp), %rax
movl (%rax), %r14d
leaq 0x70(%rsp), %rdi
callq 0x2c54
leaq 0x98(%rsp), %rdi
callq 0x2c54
movq 0x10(%rsp), %rax
cmpl $0x1, %eax
jne 0x6fe1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq %rax, %r15
leaq 0x28ed(%rip), %rsi      # 0x98bf
movl $0xa, %edx
movq %rax, %rdi
callq 0x2230
jmp 0x6fe8
testl %eax, %eax
jne 0x7007
movq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2120
leaq 0x28df(%rip), %rsi      # 0x98d9
movl $0x2, %edx
movq %rax, %rdi
callq 0x2230
movl 0x20(%rsp), %eax
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jae 0x7118
cmpl $0x2, 0x10(%rsp)
je 0x7336
cmpl $0x1, 0x10(%rsp)
je 0x703d
leaq 0x289a(%rip), %rsi      # 0x98ca
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2230
xorl %r12d, %r12d
leaq 0x20(%rsp), %r13
leaq 0x2628(%rip), %rbp      # 0x9674
leaq 0xf(%rsp), %r14
movq %r13, %rdi
movl %r12d, %esi
leaq 0x1c(%rsp), %rdx
callq 0x8162
movl %eax, %r15d
testl %eax, %eax
jne 0x7354
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x254e(%rip), %rsi      # 0x95c9
callq 0x2230
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2230
cmpl 0x38(%rsp), %r12d
je 0x7336
movq %r13, %rdi
movl %r12d, %esi
leaq 0x70(%rsp), %rdx
callq 0x8114
movl %eax, %r15d
testl %eax, %eax
jne 0x7354
cmpl $0x0, 0x24(%rsp)
je 0x70f5
xorl %r15d, %r15d
movq 0x78(%rsp), %rax
movb (%rax,%r15), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2230
incq %r15
movl 0x24(%rsp), %eax
cmpq %rax, %r15
jb 0x70cc
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2230
incl %r12d
cmpl 0x38(%rsp), %r12d
jbe 0x7051
jmp 0x7336
cmpl $0x4, %eax
jne 0x72d9
movq 0x10(%rsp), %rax
decl %eax
cmpl $0x2, %eax
jb 0x7141
leaq 0x27a1(%rip), %rsi      # 0x98d5
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2230
cmpl $0x0, 0x38(%rsp)
je 0x7336
xorl %r13d, %r13d
cmpl $0x2, 0x10(%rsp)
sete %r13b
leaq 0x277d(%rip), %rax      # 0x98dc
leaq 0x250e(%rip), %rcx      # 0x9674
cmovneq %rcx, %rax
movq %rax, 0x60(%rsp)
leaq 0x2768(%rip), %rax      # 0x98de
cmovneq %rcx, %rax
movq %rax, 0x58(%rsp)
incq %r13
xorl %r12d, %r12d
leaq 0xf(%rsp), %rbp
testl %r12d, %r12d
jne 0x71e6
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
leaq 0x1c(%rsp), %rdx
callq 0x8162
movl %eax, %r15d
testl %eax, %eax
jne 0x7354
cmpl $0x2, 0x10(%rsp)
je 0x71ed
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x2408(%rip), %rsi      # 0x95c9
callq 0x2230
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2493(%rip), %rsi      # 0x9674
callq 0x2230
cmpl $0x2, 0x10(%rsp)
jne 0x7201
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x2961(%rip), %rsi      # 0x9b5d
callq 0x2230
leaq 0x20(%rsp), %rdi
movl %r12d, %esi
leaq 0x70(%rsp), %rdx
callq 0x8114
movl %eax, %r15d
testl %eax, %eax
jne 0x7354
cmpl $0x0, 0x24(%rsp)
je 0x7251
xorl %r14d, %r14d
movq 0x78(%rsp), %rax
movb (%rax,%r14), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2230
incq %r14
movl 0x24(%rsp), %eax
cmpq %rax, %r14
jb 0x7228
movl $0x1, %edx
movq %rbx, %rdi
movq 0x60(%rsp), %rsi
callq 0x2230
leaq 0x20(%rsp), %rdi
movl %r12d, %esi
leaq 0x98(%rsp), %rdx
callq 0x8180
movl %eax, %r15d
testl %eax, %eax
jne 0x7354
cmpl $0x0, 0x28(%rsp)
je 0x72b9
xorl %r14d, %r14d
movq 0xa0(%rsp), %rax
movb (%rax,%r14), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2230
incq %r14
movl 0x28(%rsp), %eax
cmpq %rax, %r14
jb 0x728d
movq %rbx, %rdi
movq 0x58(%rsp), %rsi
movq %r13, %rdx
callq 0x2230
incl %r12d
cmpl 0x38(%rsp), %r12d
jb 0x718a
jmp 0x7336
cmpl $0x1, 0x10(%rsp)
jne 0x7316
leaq 0x25fa(%rip), %rsi      # 0x98e1
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0x2360
leaq 0x2446(%rip), %rsi      # 0x974d
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
jmp 0x7336
leaq 0x2485(%rip), %rsi      # 0x97a2
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0x2360
xorl %r15d, %r15d
cmpl $0x1, 0x10(%rsp)
jne 0x7354
leaq 0x25a3(%rip), %rsi      # 0x98ea
movl $0x3, %edx
movq %rbx, %rdi
callq 0x2230
leaq 0x98(%rsp), %rdi
callq 0x2e22
leaq 0x70(%rsp), %rdi
callq 0x2e22
testl %r15d, %r15d
je 0x739c
leaq 0x20(%rsp), %rdi
callq 0x7d3a
leaq 0xc0(%rsp), %rdi
callq 0x2e22
movl %r15d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, 0x10(%rsp)
jne 0x73b7
leaq 0x23ee(%rip), %rsi      # 0x9798
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2230
cmpl $0x2, 0x10(%rsp)
je 0x73e5
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
xorl %r15d, %r15d
movl 0x20(%rsp), %eax
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jae 0x74ab
cmpl $0x0, 0x38(%rsp)
je 0x7370
xorl %ebp, %ebp
leaq 0x20(%rsp), %r14
leaq 0x4c(%rsp), %r12
leaq 0x2389(%rip), %r13      # 0x979f
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x8162
movl %eax, %r15d
testl %eax, %eax
jne 0x7370
cmpl $0x1, 0x10(%rsp)
jne 0x7477
movq 0x50(%rsp), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2120
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x2344(%rip), %rsi      # 0x979a
callq 0x2230
movl 0x4c(%rsp), %esi
movq %r15, %rdi
callq 0x2120
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2230
movq 0x68(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq 0x10(%rsp), %rcx
callq 0x6f38
movl %eax, %r15d
testl %eax, %eax
jne 0x7370
incl %ebp
xorl %r15d, %r15d
cmpl 0x38(%rsp), %ebp
jbe 0x7416
jmp 0x7370
cmpl $0x4, %eax
je 0x7370
movl $0xfffffff1, %r15d      # imm = 0xFFFFFFF1
cmpl $0x1, 0x10(%rsp)
je 0x7370
leaq 0x22d6(%rip), %rsi      # 0x97a2
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0x2360
jmp 0x7370
movq %rax, %rbx
jmp 0x7515
movq %rax, %rbx
jmp 0x7529
jmp 0x7505
jmp 0x74f8
movq %rax, %rbx
jmp 0x751f
jmp 0x7505
jmp 0x7505
jmp 0x7505
jmp 0x7505
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x2e22
leaq 0x70(%rsp), %rdi
callq 0x2e22
leaq 0x20(%rsp), %rdi
callq 0x7d3a
leaq 0xc0(%rsp), %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2370