// File: obliviousram[P]PathOHeap/src/OHeapReadPathEviction.cpp
// Function: operator<<(std::ostream&, OHeapReadPathEviction const&)
std::ostream& operator<<(std::ostream& out, const OHeapReadPathEviction& oheap) {
  out << "==========" << std::endl;
  for (int i = 0; i < oheap.num_buckets; i++) {
    std::vector<Block> blocks = oheap.storage->readBucket(i).getBlocks();
    bool all_dummy = true;
    for (const Block& bl : blocks) {
      if (bl.leaf_id != -1) {
        all_dummy = false;
        break;
      }
    }
    if (!all_dummy) {
      out << "Bucket " << i << " contains:" << std::endl;
    
      for (int j = 0; j < oheap.bucket_size; j++) {
        const Block& bl = blocks.at(j);
        if (bl.leaf_id != -1) {
          out << bl << std::endl;
        }
      }

      out << std::endl;
    }
  }
  out << "==========" << std::endl;
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x6aea(%rip), %rsi      # 0x10278
callq 0x2180
movq %rax, %rdi
movq 0xe813(%rip), %rsi      # 0x17fb0
callq 0x21b0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x99fe
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movl -0x14(%rbp), %edx
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x80(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq *%rax
movq -0xd0(%rbp), %rdi
callq 0x2f40
movq %rax, -0xc8(%rbp)
jmp 0x97ed
movq -0xc8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x9c10
jmp 0x97ff
leaq -0x80(%rbp), %rdi
callq 0x9ae0
movb $0x1, -0x8d(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x31f0
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x3840
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4040
testb $0x1, %al
jne 0x9859
jmp 0x98b1
leaq -0xa0(%rbp), %rdi
callq 0x9ba0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x98a1
movb $0x0, -0x8d(%rbp)
jmp 0x98b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9ae0
jmp 0x9a2a
jmp 0x98a3
leaq -0xa0(%rbp), %rdi
callq 0x9d00
jmp 0x9840
testb $0x1, -0x8d(%rbp)
jne 0x99e7
movq -0x8(%rbp), %rdi
leaq 0x6b95(%rip), %rsi      # 0x1045e
callq 0x2180
movq %rax, -0xd8(%rbp)
jmp 0x98d7
movq -0xd8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x2280
movq %rax, -0xe0(%rbp)
jmp 0x98ef
movq -0xe0(%rbp), %rdi
leaq 0x6986(%rip), %rsi      # 0x10283
callq 0x2180
movq %rax, -0xe8(%rbp)
jmp 0x990b
movq -0xe8(%rbp), %rdi
movq 0xe697(%rip), %rsi      # 0x17fb0
callq 0x21b0
jmp 0x9920
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x99d3
movslq -0xb4(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3120
movq %rax, -0xf0(%rbp)
jmp 0x9956
movq -0xf0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x99bd
movq -0x8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x2800
movq %rax, -0xf8(%rbp)
jmp 0x9989
movq -0xf8(%rbp), %rdi
movq 0xe619(%rip), %rsi      # 0x17fb0
callq 0x21b0
jmp 0x999e
jmp 0x99bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3020
jmp 0x9a2a
jmp 0x99bf
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x992a
movq -0x8(%rbp), %rdi
movq 0xe5d2(%rip), %rsi      # 0x17fb0
callq 0x21b0
jmp 0x99e5
jmp 0x99e7
leaq -0x30(%rbp), %rdi
callq 0x3020
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x97a9
movq -0x8(%rbp), %rdi
leaq 0x686f(%rip), %rsi      # 0x10278
callq 0x2180
movq %rax, %rdi
movq 0xe598(%rip), %rsi      # 0x17fb0
callq 0x21b0
movq -0x8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)