// File: cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::Print(std::ostream&) const
ostream & BufferCache::Print(ostream &os) const
{
  os << "BufferCache(cachesize="<<cachesize
     << ", blocksize="<<GetBlockSize()
     << ", curtime="<<curtime
     << ", allocs="<<allocs
     << ", deallocs="<<deallocs
     << ", reads="<<reads
     << ", writes="<<writes
     << ", diskreads="<<diskreads
     << ", diskwrites="<<diskwrites
     << ", blocks = {";

  
  for (map<SIZE_T, Block, cache_compare_lessthan>::const_iterator b=blockmap.begin(); 
       b!=blockmap.end(); 
       ++b) {
    if (b!=blockmap.begin()) { 
      os << ", ";
    }
    os << (*b).first << ((*b).second.dirty ? "(dirty)" : "");
  }
  os << "}, disk="<<*disk<<")";
  
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x86cd(%rip), %rsi      # 0x10610
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x85da(%rip), %rsi      # 0x1053b
callq 0x31f0
movq -0x30(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0x79c0
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0x3320
movq %rax, %rdi
leaq 0x869f(%rip), %rsi      # 0x10627
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movsd 0x40(%rax), %xmm0
callq 0x3440
movq %rax, %rdi
leaq 0x868a(%rip), %rsi      # 0x10632
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x8676(%rip), %rsi      # 0x1063c
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x4c(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x8664(%rip), %rsi      # 0x10648
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x864f(%rip), %rsi      # 0x10651
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x863b(%rip), %rsi      # 0x1065b
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x58(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x862a(%rip), %rsi      # 0x10668
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x5c(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x861a(%rip), %rsi      # 0x10676
callq 0x31f0
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
callq 0x8460
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
callq 0x84c0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x8490
testb $0x1, %al
jne 0x8099
jmp 0x8125
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
callq 0x8460
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x8490
testb $0x1, %al
jne 0x80bd
jmp 0x80cd
movq -0x10(%rbp), %rdi
leaq 0x85bb(%rip), %rsi      # 0x10683
callq 0x31f0
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x84f0
movq -0x48(%rbp), %rdi
movl (%rax), %esi
callq 0x3320
movq %rax, -0x40(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x84f0
movq -0x40(%rbp), %rdi
movb 0x28(%rax), %cl
leaq 0x86d5(%rip), %rsi      # 0x107d9
leaq 0x857b(%rip), %rax      # 0x10686
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x31f0
leaq -0x18(%rbp), %rdi
callq 0x8510
jmp 0x8072
movq -0x10(%rbp), %rdi
leaq 0x855e(%rip), %rsi      # 0x1068e
callq 0x31f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x8540
movq %rax, %rdi
leaq 0x860f(%rip), %rsi      # 0x1075d
callq 0x31f0
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)