// File: /workspace/github_cpp_makefile_star2_O1/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: test_get_update_3()
void test_get_update_3() {
    // -- This is a bit of stress test
    // Test update all elements in order from element 0 to last element.
    // make value = key. Do multiple passes with random tree sizes.
    for (int i = 0; i < 100; i++) {
        // limit size to the range [0...10000]
        // no point in doing more.
        int t_size = 1 + rand() % 10000;
        CA_static_search_tree tree(t_size);
        for (int j = 0; j < t_size; j++) {
            tree.update(j, j);
        }
        for (int j = 0; j < t_size; j++) {
            if (tree.get(j) != j) {
                cout << "test_get_update_3 failed: expected value " << j << " at index " << j << ", tree size: " << t_size << endl;
                return;
            }
        }
    }
    cout << "test_get_update_3: OK" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ecx, %ecx
leaq 0x10(%rsp), %r14
xorl %ebx, %ebx
movl %ecx, 0x8(%rsp)
callq 0x1060
cltq
imulq $0x68db8bad, %rax, %rcx # imm = 0x68DB8BAD
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x2c, %rcx
addl %edx, %ecx
imull $0x2710, %ecx, %ecx     # imm = 0x2710
movl %eax, %r12d
subl %ecx, %r12d
negl %ecx
leal (%rax,%rcx), %esi
incl %esi
movq %r14, %rdi
movl %esi, 0xc(%rsp)
callq 0x1fda
testl %r12d, %r12d
js 0x2cb0
leal 0x1(%r12), %ebp
xorl %r15d, %r15d
movq %r14, %rdi
movl %r15d, %esi
movl %r15d, %edx
callq 0x2204
incl %r15d
cmpl %r15d, %ebp
jne 0x2c9a
testl %r12d, %r12d
js 0x2ce6
movl %r12d, %r13d
shrl $0x1f, %r13d
leal 0x1(%r12), %ebp
xorl %r15d, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x2234
cmpl %eax, %r15d
jne 0x2cf3
cmpl %r12d, %r15d
leal 0x1(%r15), %eax
setge %r13b
movl %eax, %r15d
cmpl %eax, %ebp
jne 0x2cc4
movq %r14, %rdi
callq 0x2040
jmp 0x2d97
movl $0x29, %edx
movq 0x42d9(%rip), %rdi      # 0x6fd8
leaq 0x15eb(%rip), %rsi      # 0x42f1
callq 0x1130
movq 0x42c6(%rip), %rdi      # 0x6fd8
movl %r15d, %esi
callq 0x11b0
movq %rax, %r12
movl $0xa, %edx
movq %rax, %rdi
leaq 0x15ef(%rip), %rsi      # 0x431b
callq 0x1130
movq %r12, %rdi
movl %r15d, %esi
callq 0x11b0
movq %rax, %r15
movl $0xd, %edx
movq %rax, %rdi
leaq 0x15d8(%rip), %rsi      # 0x4326
callq 0x1130
movq %r15, %rdi
movl 0xc(%rsp), %esi
callq 0x11b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x2040
testb $0x1, %r13b
je 0x2dfc
cmpl $0x63, %ebx
leal 0x1(%rbx), %eax
setae %cl
movl %eax, %ebx
cmpl $0x64, %eax
jne 0x2c4f
leaq 0x1582(%rip), %rsi      # 0x4334
movl $0x15, %edx
movq 0x421a(%rip), %rbx      # 0x6fd8
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x8(%rsp)
jne 0x2dab
jmp 0x2ded
jmp 0x2e09
jmp 0x2e09
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x11c0