// File: /workspace/github_cpp_makefile_star2_O3/obliviousram[P]oblivious-avl-tree/src/CorrectnessTester.cpp
// Function: CorrectnessTester::runTester1()
void CorrectnessTester::runTester1() {
    int bucketSize = 4;
    int numBlocks = pow(2, 10);
    Bucket::setMaxSize(bucketSize);    

    UntrustedStorageInterface* storage = new ServerStorage();
    RandForOramInterface* random = new RandomForOram();
    OAVLTreeInterface* oavl = new OAVLTreePathEviction(storage, random, bucketSize, numBlocks);

    cout << "Test begins..." << endl;

    cout << "insert " << 9<< endl;
    oavl->insert(9,9);
    storage->dumpAllValidBlocks();
    
    for (int i = 7; i >= 1; i-=2){
        cout << "insert " << i<< endl;
        oavl->insert(i,i);
        storage->dumpAllValidBlocks();
        cout << "insert " << i+1<< endl;
        oavl->insert(i+1,i+1);
        storage->dumpAllValidBlocks();
    }
    int res = oavl->search(9);
    cout << res << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x4, %edi
callq 0x2f02
movl $0x28, %edi
callq 0x2180
movq %rax, %rbx
movq %rax, %rdi
callq 0x79a8
movl $0x13d0, %edi           # imm = 0x13D0
callq 0x2180
movq %rax, %r12
movq %rax, %rdi
callq 0x70f4
movl $0x70, %edi
callq 0x2180
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x4, %ecx
movl $0x400, %r8d            # imm = 0x400
callq 0x5ae4
movq 0x99d4(%rip), %r15      # 0xcfd8
leaq 0x5c15(%rip), %rsi      # 0x9220
movl $0xe, %edx
movq %r15, %rdi
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x5bec(%rip), %rsi      # 0x9232
movl $0x7, %edx
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
movl $0x9, %esi
callq 0x2290
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq (%r14), %rax
movq %r14, %rdi
movl $0x9, %esi
movl $0x9, %edx
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movl $0x7, %r13d
movl $0x7, %edx
movq %r15, %rdi
leaq 0x5b78(%rip), %r12      # 0x9232
movq %r12, %rsi
callq 0x21b0
movq %r15, %rdi
movl %r13d, %esi
callq 0x2290
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
movl %r13d, %edx
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movl $0x7, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21b0
leal 0x1(%r13), %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
leal -0x2(%r13), %eax
cmpl $0x2, %r13d
movl %eax, %r13d
ja 0x36ab
movq (%r14), %rax
movq %r14, %rdi
movl $0x9, %esi
callq *0x8(%rax)
movq 0x9847(%rip), %rdi      # 0xcfd8
movl %eax, %esi
callq 0x2290
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
movq %rax, %r15
movl $0x70, %esi
movq %r14, %rdi
jmp 0x37f5
movq %rax, %r15
movl $0x13d0, %esi           # imm = 0x13D0
movq %r12, %rdi
jmp 0x37f5
movq %rax, %r15
movl $0x28, %esi
movq %rbx, %rdi
callq 0x2190
movq %r15, %rdi
callq 0x22a0