// File: /workspace/github_cpp_makefile_star2_O1/obliviousram[P]PathOHeap/src/Job.cpp
// Function: Job::run()
void Job::run() {
  int bucket_size = 4;
  int num_blocks = pow(2, 5);
  UntrustedStorageInterface* storage = new ServerStorage();
  RandForOHeapInterface* random = new RandomForOHeap();
  OHeapInterface* oheap = new OHeapReadPathEviction(storage, random, bucket_size, num_blocks, false);

  // Sample computation: fill the heap with some numbers, then read it back.
  for (int i = 0; i < num_blocks; i++) {
    oheap->insertBlock(i, Job::sampleData(i));
    std::cout << "Inserting Block " << i << " to OHeap. The stash size is: " <<
        oheap->getStashSize() << std::endl;
  }

  for (int i = 0; i < num_blocks; i++) {
    std::cout << "Extracting Block " << i << " from OHeap. " << oheap->extractMin() << std::endl;
  }

  delete oheap;
  delete random;
  delete storage;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl $0x28, %edi
callq 0x2160
movq %rax, %r14
movq %rax, %rdi
callq 0x6178
movl $0x20, %edi
callq 0x2160
movq %rax, %r12
movq %rax, %rdi
callq 0x6000
movl $0x58, %edi
callq 0x2160
movq %rax, %r15
xorl %ebp, %ebp
movq %rax, %rdi
movq %r14, %rsi
movq %r12, 0x28(%rsp)
movq %r12, %rdx
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x3c98
movq %r14, 0x20(%rsp)
movq 0x83db(%rip), %r12      # 0xafd0
leaq 0x44e7(%rip), %r13      # 0x70e3
leaq 0x44f1(%rip), %rbx      # 0x70f4
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movb %bpl, 0x33(%rsp)
movq (%r15), %rax
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movl %ebp, %esi
callq *0x8(%rax)
movl $0x10, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2190
movq %r12, %rdi
movl %ebp, %esi
callq 0x2240
movq %rax, %r14
movl $0x1e, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %r14, %rdi
movl %eax, %esi
callq 0x2240
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
incl %ebp
cmpl $0x20, %ebp
jne 0x2c03
xorl %ebx, %ebx
movq 0x831f(%rip), %r12      # 0xafd0
leaq 0x446d(%rip), %rbp      # 0x7125
leaq 0x50(%rsp), %r14
movl $0x11, %edx
movq %r12, %rdi
leaq 0x4447(%rip), %rsi      # 0x7113
callq 0x2190
movq %r12, %rdi
movl %ebx, %esi
callq 0x2240
movq %rax, %r13
movl $0xd, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2190
movq (%r15), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x266f
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
incl %ebx
cmpl $0x20, %ebx
jne 0x2cbd
movl $0x8, %esi
movq %r15, %rdi
callq 0x2170
movl $0x8, %esi
movq 0x28(%rsp), %rdi
callq 0x2170
movl $0x8, %esi
movq 0x20(%rsp), %rdi
callq 0x2170
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x58, %esi
movq %r15, %rdi
jmp 0x2d98
movq %rax, %rbx
movl $0x20, %esi
movq %r12, %rdi
jmp 0x2d98
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
nopl (%rax)