LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/vividvilla[P]hackerrank/src/largest-sum-m.cpp
// Function: partitions(int)
int partitions(int Z) {
    vector<int> p = vector<int>(Z + 1, 0);
    p[0] = 1;

    for (int i = 1; i <= Z; i++) {
        for (int j = i; j <= Z; j++) {
            p[j] = (p[j] + p[j - i]) % MOD;
        }
    }

    return p[Z];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
leal 0x1(%rbx), %r15d
movslq %r15d, %rsi
leaq 0x4(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x8(%rsp), %r14
leaq 0x3(%rsp), %rcx
movq %r14, %rdi
callq 0x1708
movq (%r14), %rcx
movl $0x1, (%rcx)
xorl %esi, %esi
testl %ebx, %ebx
cmovgl %ebx, %esi
incl %esi
decq %r15
leaq 0x4(%rcx), %rdi
pushq $0x1
popq %r8
movl $0x3b9aca07, %r9d       # imm = 0x3B9ACA07
cmpq %rsi, %r8
je 0x14d5
xorl %r10d, %r10d
cmpq %r10, %r15
je 0x14c9
movl (%rcx,%r10,4), %eax
addl (%rdi,%r10,4), %eax
cltd
idivl %r9d
movl %edx, (%rdi,%r10,4)
incq %r10
jmp 0x14af
incq %r8
decq %r15
addq $0x4, %rdi
jmp 0x14a7
movslq %ebx, %rax
movl (%rcx,%rax,4), %ebx
leaq 0x8(%rsp), %rdi
callq 0x1be0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/vividvilla[P]hackerrank/src/largest-sum-m.cpp
// Function: main
int main() {
    int n, k, M, x;
    cin >> n >> k >> M;

    vector<int> d;
    for (int i = 0; i < n; i++) {
        cin >> x;
        d.push_back(x);
    }

    int Z = largestSum(k, d, M);
    cout << Z << endl;
    cout << partitions(Z) << endl;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x2ade(%rip), %rbx      # 0x3fe0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1090
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x1090
movq %rsp, %rsi
movq %rax, %rdi
callq 0x1090
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
xorl %ebp, %ebp
leaq 0xc(%rsp), %r15
cmpl 0x8(%rsp), %ebp
jge 0x155f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1090
movq %r14, %rdi
movq %r15, %rsi
callq 0x175e
incl %ebp
jmp 0x153f
movl 0x4(%rsp), %ebx
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177c
movl (%rsp), %edx
leaq 0x30(%rsp), %rsi
movl %ebx, %edi
callq 0x126c
movl %eax, %ebx
leaq 0x30(%rsp), %rdi
callq 0x1be0
movq 0x2a3c(%rip), %rdi      # 0x3fd0
movl %ebx, %esi
callq 0x1120
movq %rax, %rdi
callq 0x1060
movl %ebx, %edi
callq 0x1458
movq 0x2a1f(%rip), %rdi      # 0x3fd0
movl %eax, %esi
callq 0x1120
movq %rax, %rdi
callq 0x1060
leaq 0x10(%rsp), %rdi
callq 0x1be0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1be0
jmp 0x15eb
jmp 0x15e8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1be0
movq %rbx, %rdi
callq 0x1130
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::co_static_search_tree(int)
co_static_search_tree::co_static_search_tree(int n) {
    this->n = n;
    this->length = next_power_of_2(n);
    this->size = this->length * 2;
    this->height = log2(this->length) + 1;
    this->tree = (int *)malloc(sizeof(int) * this->size);
    for (int i = 0; i < this->size; ++i) {
        this->tree[i] = MINUS_INFINITY;
    }
    this->array = (int *)malloc(sizeof(int) * this->n);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x10(%rdi)
movl %esi, %edi
callq 0x21c2
movl %eax, 0x14(%rbx)
leal (%rax,%rax), %ecx
movl %ecx, 0x18(%rbx)
movl %eax, %edi
callq 0x21ea
addsd 0x1cc3(%rip), %xmm0     # 0x3008
cvttsd2si %xmm0, %eax
movl %eax, 0x1c(%rbx)
movslq 0x18(%rbx), %r14
movq %r14, %rdi
shlq $0x2, %rdi
callq 0x1150
movq %rax, (%rbx)
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %edx
cmovgl %r14d, %edx
cmpq %rcx, %rdx
je 0x137b
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x136d
movslq 0x10(%rbx), %rdi
shlq $0x2, %rdi
callq 0x1150
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::update_tree_height_pwr_2(int, int, int, int, int, int)
int co_static_search_tree::update_tree_height_pwr_2(int block_index, int height, int range_left, int og_height, int index, int value) {
    int inner_block_index = 0;
    int depth = 1;
    int path = 0;
    int length = (1 << (og_height - 2));
    while (depth != height)
    {
        this->block_index_memo[depth] = inner_block_index;
        if (index < range_left + length)
        {
            inner_block_index = this->left_child(inner_block_index, depth, path);
            path <<= 1;
        }
        else {
            inner_block_index = this->right_child(inner_block_index, depth, path);
            path = (path << 1) | 1;
            range_left += length;
        }
        length >>= 1;
        depth += 1;
    }
    this->tree[block_index + inner_block_index] = value;
    for (int i = height - 1; i >= 1; --i) {
        path >>= 1;
        int inner_block_index = this->block_index_memo[i];
        int left_child_inner_block_index = this->left_child(inner_block_index, i, path);
        int right_child_inner_block_index = this->right_child(inner_block_index, i, path);
        this->tree[block_index + inner_block_index] = max(this->tree[block_index + left_child_inner_block_index], this->tree[block_index + right_child_inner_block_index]);
    }
    return this->tree[block_index];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x1c(%rsp)
movl %ecx, %r9d
movl %edx, %r14d
movl %esi, %r15d
movl 0x70(%rsp), %ebx
leal -0x2(%r8), %ecx
pushq $0x1
popq %rax
shll %cl, %eax
movl %edx, %ecx
decq %rcx
movq %rcx, 0x28(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq %r14, 0x20(%rsp)
cmpq %r13, 0x28(%rsp)
je 0x195a
movl %ebp, 0x24(%rdi,%r13,4)
movq %rax, 0x30(%rsp)
leal (%r9,%rax), %r15d
incq %r13
leal (%r12,%r12), %r14d
cmpl 0x1c(%rsp), %r15d
jle 0x1929
movl %ebp, %esi
movl %r13d, %edx
movl %r12d, %ecx
movq %r9, %r15
callq 0x23fc
movq %r15, %r9
movl %eax, %ebp
jmp 0x193f
movl %ebp, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x2436
movl %eax, %ebp
orl $0x1, %r14d
movl %r15d, %r9d
movl 0xc(%rsp), %r15d
movq 0x30(%rsp), %rax
sarl %eax
movl %r14d, %r12d
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %rdi
jmp 0x18ef
movq (%rdi), %rcx
leal -0x1(%r14), %r13d
addl %r15d, %ebp
movslq %ebp, %rax
movl %ebx, (%rcx,%rax,4)
cmpl $0x1, %r14d
jle 0x19c4
sarl %r12d
movl 0x20(%rdi,%r13,4), %ebp
movq 0x10(%rsp), %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x23fc
movl %eax, %ebx
movq 0x10(%rsp), %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x2436
movq 0x10(%rsp), %rdi
movq (%rdi), %rcx
addl %r15d, %ebx
movslq %ebx, %rdx
addl %r15d, %eax
cltq
movl (%rcx,%rdx,4), %edx
movl (%rcx,%rax,4), %ebx
cmpl %ebx, %edx
cmovgl %edx, %ebx
decl %r14d
decq %r13
jmp 0x1961
movslq %r15d, %rax
movl (%rcx,%rax,4), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::get_tree_height_pwr_2(int, int, int, int, int)
int co_static_search_tree::get_tree_height_pwr_2(int block_index, int height, int range_left, int og_height, int value) {
    int inner_block_index = 0;
    int depth = 1;
    int path = 0;
    int length = (1 << (og_height - 2));
    while (depth != height)
    {
        this->block_index_memo[depth] = inner_block_index;
        int left_child_inner_block_index = this->left_child(inner_block_index, depth, path);
        if (value <= this->tree[block_index + left_child_inner_block_index])
        {
            path <<= 1;
            inner_block_index = left_child_inner_block_index;
        }
        else {
            inner_block_index = this->right_child(inner_block_index, depth, path);
            path = (path << 1) | 1;
            range_left += length;
        }
        length >>= 1;
        depth += 1;
    }
    return range_left;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
leal -0x2(%r8), %ecx
pushq $0x1
popq %r14
shll %cl, %r14d
movl %edx, %ebp
decq %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r13d, %r13d
cmpq %r12, %rbp
je 0x1a6f
movl %ebx, 0x24(%r15,%r12,4)
incq %r12
movq %r15, %rdi
movl %ebx, %esi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x23fc
movq (%r15), %rcx
movq 0x10(%rsp), %rdx
addl %eax, %edx
movslq %edx, %rdx
movl 0xc(%rsp), %esi
cmpl %esi, (%rcx,%rdx,4)
jge 0x1a65
movq %r15, %rdi
movl %ebx, %esi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x2436
movl %eax, %ebx
leal 0x1(,%r13,2), %r13d
addl %r14d, 0x8(%rsp)
jmp 0x1a6a
addl %r13d, %r13d
movl %eax, %ebx
sarl %r14d
jmp 0x1a11
movl 0x8(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: built_co_static_search_tree::built_co_static_search_tree(int)
built_co_static_search_tree::built_co_static_search_tree(int n) {
    this->n = n;
    this->length = next_power_of_2(n);
    this->size = this->length * 2;
    this->height = log2(this->length) + 1;
    this->tree = (int *)malloc(sizeof(int) * this->size * 3);
    this->temp_tree = (int *)malloc(sizeof(int) * this->size);
    this->van_emde_boas_build(0, this->height, this->height, 1);
    this->build(1, this->height);
    free(this->temp_tree);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x10(%rdi)
movl %esi, %edi
callq 0x21c2
movl %eax, 0x14(%rbx)
leal (%rax,%rax), %ecx
movl %ecx, 0x18(%rbx)
movl %eax, %edi
callq 0x21ea
addsd 0x155d(%rip), %xmm0     # 0x3008
cvttsd2si %xmm0, %ebp
movl %ebp, 0x1c(%rbx)
movslq 0x18(%rbx), %r14
imulq $0xc, %r14, %rdi
callq 0x1150
movq %rax, (%rbx)
shlq $0x2, %r14
movq %r14, %rdi
callq 0x1150
movq %rax, 0x8(%rbx)
pushq $0x1
popq %r14
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %ebp, %ecx
movl %r14d, %r8d
callq 0x1b02
movl 0x1c(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1bbc
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: built_co_static_search_tree::van_emde_boas_build(int, int, int, int)
void built_co_static_search_tree::van_emde_boas_build(int tree_l, int h, int og_height, int bfs_order) {
    if (h == 1)
    {
        this->temp_tree[bfs_order] = tree_l;
        return;
    }

    int bottom_tree_h = bottom_tree_height_memo[h];
    int top_tree_h = h - bottom_tree_h;

    this->van_emde_boas_build(tree_l, top_tree_h, og_height, bfs_order);
    
    int top_tree_size = (1 << top_tree_h) - 1;

    int bottom_tree_og_height = og_height - top_tree_h;
    int bottom_tree_size = (1 << bottom_tree_h) - 1;
    int bottom_tree_tree_l = tree_l + top_tree_size;

    for (int bottom_tree_index = 0; bottom_tree_index < (1 << top_tree_h); ++bottom_tree_index) {
        int bottom_tree_bfs_order = (bfs_order << top_tree_h) | bottom_tree_index;
        this->van_emde_boas_build(bottom_tree_tree_l, bottom_tree_h, bottom_tree_og_height, bottom_tree_bfs_order);
        bottom_tree_tree_l += bottom_tree_size;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebx
cmpl $0x1, %edx
jne 0x1b31
movq 0x8(%rdi), %rax
movslq %ebx, %rcx
movl %esi, (%rax,%rcx,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %r15d
movslq %edx, %rax
leaq 0x14f2(%rip), %rcx      # 0x3030
movl (%rcx,%rax,4), %r12d
subl %r12d, %edx
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, %ebp
movl %r15d, %ecx
movl %ebx, %r8d
callq 0x1b02
pushq $0x1
popq %r13
movl %ebp, %ecx
shll %cl, %r13d
pushq $-0x1
popq %r14
movl %r12d, 0x4(%rsp)
movl %r12d, %ecx
shll %cl, %r14d
subl %ebp, %r15d
notl %r14d
movq 0x8(%rsp), %rax
leal (%rax,%r13), %r12d
decl %r12d
movl %ebp, %ecx
shll %cl, %ebx
movl %ebx, %ebp
xorl %ebx, %ebx
testl %r13d, %r13d
cmovlel %ebx, %r13d
cmpl %ebx, %r13d
je 0x1b22
movl %ebx, %r8d
orl %ebp, %r8d
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl 0x4(%rsp), %edx
movl %r15d, %ecx
callq 0x1b02
addl %r14d, %r12d
incl %ebx
jmp 0x1b95
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: built_co_static_search_tree::build(int, int)
void built_co_static_search_tree::build(int index, int h) {
    if(h == 1) {
        return;
    }
    int van_emde_boas_index = this->temp_tree[index];
    this->tree[van_emde_boas_index * 3 + 1] = this->temp_tree[index << 1] * 3;
    this->tree[van_emde_boas_index * 3 + 2] = this->temp_tree[(index << 1) + 1] * 3;
    this->build(index << 1, h-1);
    this->build((index << 1) + 1, h-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
decl %edx
movl %edx, %r14d
subl $0x1, %r14d
jb 0x1c12
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movslq %ebp, %rdi
leal (%rdi,%rdi), %esi
movslq %esi, %rsi
imull $0x3, (%rcx,%rsi,4), %r8d
movslq (%rcx,%rdi,4), %r9
imulq $0xc, %r9, %r9
movl %r8d, 0x4(%rax,%r9)
leal 0x1(,%rdi,2), %ebp
movslq %ebp, %rdi
imull $0x3, (%rcx,%rdi,4), %ecx
movl %ecx, 0x8(%rax,%r9)
movq %rbx, %rdi
callq 0x1bbc
movl %r14d, %edx
jmp 0x1bca
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: built_co_static_search_tree::update(int, int, int, int)
void built_co_static_search_tree::update(int current_node, int h, int index, int value) {
    if(h == 1) {
        this->tree[current_node] = value;
        return;
    }
    if(index & (1 << (h - 2))) {
        this->update(this->tree[current_node + 2], h - 1, index, value);
    } else {
        this->update(this->tree[current_node + 1], h - 1, index, value);
    }
    this->tree[current_node] = max(this->tree[this->tree[current_node + 1]], this->tree[this->tree[current_node + 2]]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, %edx
jne 0x1c38
movq (%rbx), %rax
movslq %esi, %rcx
movl %r8d, (%rax,%rcx,4)
jmp 0x1c7f
leal -0x2(%rdx), %eax
movzbl %al, %eax
xorl %edi, %edi
btl %eax, %ecx
setb %dil
movslq %esi, %r14
leaq (,%r14,4), %rax
addq (%rbx), %rax
decl %edx
movl 0x4(%rax,%rdi,4), %esi
movq %rbx, %rdi
callq 0x1c20
movq (%rbx), %rax
movslq 0x4(%rax,%r14,4), %rcx
movslq 0x8(%rax,%r14,4), %rdx
movl (%rax,%rcx,4), %ecx
movl (%rax,%rdx,4), %edx
cmpl %edx, %ecx
cmovgl %ecx, %edx
movl %edx, (%rax,%r14,4)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: built_co_static_search_tree::get(int)
int built_co_static_search_tree::get(int value) {
    int current_node = 0;
    int index = 0;
    for (int i = 0; i < this->height - 1; ++i)
    {
        if (value <= this->tree[this->tree[current_node + 1]])
        {
            current_node = this->tree[current_node + 1];
            index <<= 1;
        }
        else
        {
            current_node = this->tree[current_node + 2];
            index <<= 1;
            index += 1;
        }
    }
    return index;
}

// Assembly:
movl 0x1c(%rdi), %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovgel %eax, %ecx
movq (%rdi), %rdx
decl %ecx
xorl %edi, %edi
xorl %eax, %eax
subl $0x1, %ecx
jb 0x1cd1
movslq %edi, %r8
movslq 0x4(%rdx,%r8,4), %rdi
cmpl %esi, (%rdx,%rdi,4)
jge 0x1ccd
movl 0x8(%rdx,%r8,4), %edi
leal 0x1(,%rax,2), %eax
jmp 0x1cad
addl %eax, %eax
jmp 0x1cad
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: CA_static_search_tree::CA_static_search_tree(int)
CA_static_search_tree::CA_static_search_tree(int n) {
    this->n = n;
    this->length = next_power_of_2(n);
    this->size = this->length * 2;
    this->height = log2(this->length) + 1;
    this->tree = (int *)malloc(sizeof(int) * this->size);
    // this->parents.resize(this->height);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movl %esi, %edi
callq 0x21c2
movl %eax, 0xc(%rbx)
leal (%rax,%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %eax, %edi
callq 0x21ea
addsd 0x1310(%rip), %xmm0     # 0x3008
cvttsd2si %xmm0, %eax
movl %eax, 0x14(%rbx)
movslq 0x10(%rbx), %rdi
shlq $0x2, %rdi
callq 0x1150
movq %rax, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: CA_static_search_tree::get(int, int, int, int, int, int, int)
int CA_static_search_tree::get(int tree_l, int num_inner_nodes, int temp_root, int h, int arr_l, int arr_r, int value) {
    if (arr_l == arr_r)
    {
        // printf("get at index %d, real index %d, value %d\n", arr_l, tree_l + temp_root, this->tree[tree_l+temp_root]);
        return arr_l;
    }
    int mid = (arr_l + arr_r) >> 1;
    if (h > 0 && (h+1) & 3 == 0) {
        h++;
        num_inner_nodes += (1 << (h-4));
        // update tree_l
        int mid = (arr_l + arr_r) >> 1;
        int left_or_right = 1;
        int new_tree_l = (tree_l << 4) + ((temp_root-8) << 1) + 1;
        tree_l = new_tree_l;
        temp_root = 1;
        int last_subtree_size = min((1 << (this->height-((h>>2)<<2))) - 1, 15);
        int real_subtree_root = ((num_inner_nodes<<4)-num_inner_nodes) + (tree_l-num_inner_nodes)*last_subtree_size;
        if (value <= this->tree[real_subtree_root + temp_root]) {
            arr_r = mid;
        } else {
            arr_l = mid + 1;
            tree_l++;
        }
        if (h == this->height - 1) {
            return arr_l;
        }
    }
    mid = (arr_l + arr_r) >> 1;
    int left_child = temp_root << 1;
    int right_child = (temp_root << 1) + 1;
    h++;
    int last_subtree_size = min((1 << (this->height-((h>>2)<<2))) - 1, 15);
    int real_subtree_root = ((num_inner_nodes<<4)-num_inner_nodes) + (tree_l-num_inner_nodes)*last_subtree_size;
    if(value <= this->tree[real_subtree_root + left_child]) {
        return this->get(tree_l, num_inner_nodes, left_child, h, arr_l, mid, value);
    } else {
        return this->get(tree_l, num_inner_nodes, right_child, h, mid + 1, arr_r, value);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %eax
movl %ecx, %r9d
movl 0x38(%rsp), %r10d
movl 0x30(%rsp), %r14d
movl 0x14(%rdi), %r11d
imull $0xf, %edx, %ebx
subl %edx, %esi
movq (%rdi), %rdx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xfffffff0, %ebp       # imm = 0xFFFFFFF0
movl %r14d, %r15d
cmpl %r15d, %eax
je 0x1ec5
movl %r15d, %r14d
leal (%r14,%rax), %r15d
sarl %r15d
incl %r8d
movl %r8d, %r12d
andl $0xfc, %r12d
movl %r11d, %ecx
subl %r12d, %ecx
movl %edi, %r12d
shll %cl, %r12d
leal (%r9,%r9), %ecx
cmpl $-0xf, %r12d
cmovbl %ebp, %r12d
notl %r12d
imull %esi, %r12d
leal (%rbx,%r9,2), %r9d
addl %r12d, %r9d
movslq %r9d, %r12
movl %ecx, %r9d
cmpl %r10d, (%rdx,%r12,4)
jge 0x1e69
orl $0x1, %ecx
incl %r15d
movl %ecx, %r9d
movl %r15d, %eax
jmp 0x1e66
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: CA_static_search_tree::print_tree()
void CA_static_search_tree::print_tree() {
    int start = 1;
    // printf("")
    for (int i = 1; i < this->size; i++) {
        printf("%d ", this->tree[i]);
    }
    printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %r15
leaq 0x122f(%rip), %r14      # 0x3164
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jge 0x1f54
movq (%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1030
incq %r15
jmp 0x1f35
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::simple_static_search_tree(int, bool)
simple_static_search_tree::simple_static_search_tree(int n, bool recursive) {
    this->n = n;
    this->recursive = recursive;
    this->length = next_power_of_2(n);
    this->size = this->length * 2;
    this->height = log2(this->length) + 1;
    this->tree = (int *)malloc(sizeof(int) * this->size);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movb %dl, 0x18(%rdi)
movl %esi, %edi
callq 0x21c2
movl %eax, 0xc(%rbx)
leal (%rax,%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %eax, %edi
callq 0x21ea
addsd 0x107d(%rip), %xmm0     # 0x3008
cvttsd2si %xmm0, %eax
movl %eax, 0x14(%rbx)
movslq 0x10(%rbx), %rdi
shlq $0x2, %rdi
callq 0x1150
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::update_recursive(int, int, int, int, int)
void simple_static_search_tree::update_recursive(int tree_l, int arr_l, int arr_r, int index, int value) {
    if (arr_l == arr_r)
    {
        this->tree[tree_l] = value;
        return;
    }

    int mid = (arr_l + arr_r) / 2;
    int left_child = tree_l * 2;
    int right_child = tree_l * 2 + 1;
    if (index <= mid)
    {
        this->update_recursive(left_child, arr_l, mid, index, value);
    }
    else
    {
        this->update_recursive(right_child, mid + 1, arr_r, index, value);
    }

    this->tree[tree_l] = this->merge(this->tree[left_child], this->tree[right_child]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl %ecx, %edx
jne 0x2001
movq (%r14), %rax
jmp 0x2050
movl %edx, %r10d
leal (%rcx,%r10), %eax
pushq $0x2
popq %rsi
cltd
idivl %esi
leal (%rbx,%rbx), %ebp
leal 0x1(,%rbx,2), %r15d
cmpl %r8d, %eax
jge 0x202a
incl %eax
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
jmp 0x2034
movq %r14, %rdi
movl %ebp, %esi
movl %r10d, %edx
movl %eax, %ecx
callq 0x1fec
movq (%r14), %rax
movslq %ebp, %rcx
movl (%rax,%rcx,4), %ecx
movslq %r15d, %rdx
movl (%rax,%rdx,4), %r9d
cmpl %r9d, %ecx
cmovgl %ecx, %r9d
movslq %ebx, %rcx
movl %r9d, (%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::update_iterative(int, int, int, int, int)
void simple_static_search_tree::update_iterative(int tree_l, int arr_l, int arr_r, int index, int value) {
    while(arr_l != arr_r) {
        int mid = (arr_l + arr_r) >> 1;
        int left_child = tree_l << 1;
        int right_child = left_child + 1;
        if(index <= mid){
            tree_l = left_child;
            arr_r = mid;
        }
        else {
            tree_l = right_child;
            arr_l = mid + 1;
        }
    }
    this->tree[tree_l] = value;
    while(tree_l != 1) {
        tree_l /= 2;
        int left_child = tree_l << 1;
        int right_child = left_child + 1;
        this->tree[tree_l] = this->merge(this->tree[left_child], this->tree[right_child]);
    }
}

// Assembly:
movl %esi, %eax
cmpl %ecx, %edx
je 0x208d
leal (%rdx,%rcx), %esi
sarl %esi
leal 0x1(%rsi), %r10d
xorl %r11d, %r11d
cmpl %r8d, %esi
cmovll %ecx, %esi
cmovgel %edx, %r10d
setl %r11b
leal (%r11,%rax,2), %eax
movl %esi, %ecx
movl %r10d, %edx
jmp 0x2064
movq (%rdi), %rcx
pushq $0x2
popq %rsi
movslq %eax, %rdx
movl %r9d, (%rcx,%rdx,4)
cmpl $0x1, %edx
je 0x20c3
cltd
idivl %esi
movl %eax, %edx
addl %eax, %edx
leal 0x1(,%rax,2), %edi
movslq %edx, %rdx
movl (%rcx,%rdx,4), %edx
movslq %edi, %rdi
movl (%rcx,%rdi,4), %r9d
cmpl %r9d, %edx
cmovgl %edx, %r9d
jmp 0x2093
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::get_recursive(int, int, int, int)
int simple_static_search_tree::get_recursive(int tree_l, int arr_l, int arr_r, int value) {
    if (arr_l == arr_r)
    {
        return arr_l;
    }

    int mid = (arr_l + arr_r) / 2;
    int left_child = tree_l * 2;
    int right_child = tree_l * 2 + 1;

    if(value <= this->tree[left_child]) {
        return this->get_recursive(left_child, arr_l, mid, value);
    } else {
        return this->get_recursive(right_child, mid + 1, arr_r, value);
    }
}

// Assembly:
movl %edx, %r9d
movq (%rdi), %rdi
pushq $0x2
popq %r10
movl %ecx, %eax
cmpl %eax, %r9d
je 0x20f4
movl %eax, %ecx
leal (%rcx,%r9), %eax
cltd
idivl %r10d
addl %esi, %esi
movslq %esi, %rdx
cmpl %r8d, (%rdi,%rdx,4)
jge 0x20d0
orl $0x1, %esi
incl %eax
movl %eax, %r9d
jmp 0x20ce
movl %r9d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::get_iterative(int, int, int, int)
int simple_static_search_tree::get_iterative(int tree_l, int arr_l, int arr_r, int value) {
    while(arr_l != arr_r) {
        int mid = (arr_l + arr_r) >> 1;
        int left_child = tree_l << 1;
        int right_child = left_child + 1;
        if(value <= this->tree[left_child]){
            tree_l = left_child;
            arr_r = mid;
        }
        else {
            tree_l = right_child;
            arr_l = mid + 1;
        }
    }
    return arr_l;
}

// Assembly:
movl %ecx, %eax
movq (%rdi), %rcx
cmpl %eax, %edx
je 0x212e
leal (%rdx,%rax), %edi
sarl %edi
leal (%rsi,%rsi), %r9d
movslq %r9d, %r9
leal 0x1(%rdi), %r10d
xorl %r11d, %r11d
cmpl %r8d, (%rcx,%r9,4)
cmovll %eax, %edi
cmovgel %edx, %r10d
setl %r11b
leal (%r11,%rsi,2), %esi
movl %edi, %eax
movl %r10d, %edx
jmp 0x20fd
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::update(int, int)
void simple_static_search_tree:: update(int index, int value){
    if (this->recursive)
    {
        this->update_recursive(1, 0, this->length - 1, index, value);
    }
    else
    {
        this->update_iterative(1, 0, this->length - 1, index, value);
    }
}

// Assembly:
movl %edx, %r9d
movl %esi, %r8d
movl 0xc(%rdi), %ecx
decl %ecx
cmpb $0x1, 0x18(%rdi)
jne 0x214b
pushq $0x1
popq %rsi
xorl %edx, %edx
jmp 0x1fec
pushq $0x1
popq %rsi
xorl %edx, %edx
jmp 0x2062
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: simple_static_search_tree::get(int)
int simple_static_search_tree::get(int value) {
    if(this->recursive) {
        int result = this->get_recursive(1, 0, this->length - 1, value);
        return result;
    }
    else {
        int result = this->get_iterative(1, 0, this->length - 1, value);
        return result;
    }
}

// Assembly:
movl %esi, %r8d
movl 0xc(%rdi), %ecx
decl %ecx
cmpb $0x1, 0x18(%rdi)
jne 0x216e
pushq $0x1
popq %rsi
xorl %edx, %edx
jmp 0x20c4
pushq $0x1
popq %rsi
xorl %edx, %edx
jmp 0x20f8
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: map_rep_static_search_tree::get(int)
int map_rep_static_search_tree::get(int value) {
    auto it = this->m.lower_bound(value);
    if(it == m.end()) {
        return NOT_FOUND_INDEX;
    }
    return it->second;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x270c
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x21b9
movl 0x24(%rax), %eax
jmp 0x21bc
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::update_3_base_case(int, int, int, int, int)
inline int co_static_search_tree::update_3_base_case(int block_index, int range_left, int og_height, int index, int value) {
    /*
                            0
                    1               4
                2       3       5       6
    */
    int leafs_og_height = og_height - 2;
    int leaf_index = (index - range_left) >> (leafs_og_height - 1);
    if(leaf_index == 0) {
        this->tree[block_index + 2] = value;
        this->tree[block_index + 1] = max(this->tree[block_index + 2], this->tree[block_index + 3]);
        this->tree[block_index + 0] = max(this->tree[block_index + 1], this->tree[block_index + 4]);
    }
    else if(leaf_index == 1) {
        this->tree[block_index + 3] = value;
        this->tree[block_index + 1] = max(this->tree[block_index + 2], this->tree[block_index + 3]);
        this->tree[block_index + 0] = max(this->tree[block_index + 1], this->tree[block_index + 4]);
    }
    else if(leaf_index == 2) {
        this->tree[block_index + 5] = value;
        this->tree[block_index + 4] = max(this->tree[block_index + 5], this->tree[block_index + 6]);
        this->tree[block_index + 0] = max(this->tree[block_index + 1], this->tree[block_index + 4]);
    }
    else if(leaf_index == 3) {
        this->tree[block_index + 6] = value;
        this->tree[block_index + 4] = max(this->tree[block_index + 5], this->tree[block_index + 6]);
        this->tree[block_index + 0] = max(this->tree[block_index + 1], this->tree[block_index + 4]);
    }
    return this->tree[block_index];
}

// Assembly:
subl %edx, %r8d
addb $-0x3, %cl
sarl %cl, %r8d
movq (%rdi), %rcx
movslq %esi, %rdx
cmpl $0x3, %r8d
ja 0x226e
movl %r9d, %eax
leaq 0xf21(%rip), %rsi       # 0x3134
movslq (%rsi,%r8,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
movl %eax, 0x8(%rcx,%rdx,4)
movl 0xc(%rcx,%rdx,4), %esi
jmp 0x2258
movl %eax, 0x14(%rcx,%rdx,4)
movl 0x4(%rcx,%rdx,4), %esi
movl 0x18(%rcx,%rdx,4), %edi
jmp 0x2240
movl %eax, 0x18(%rcx,%rdx,4)
movl 0x4(%rcx,%rdx,4), %esi
movl 0x14(%rcx,%rdx,4), %edi
cmpl %eax, %edi
cmovgl %edi, %eax
movl %eax, 0x10(%rcx,%rdx,4)
cmpl %eax, %esi
cmovgl %esi, %eax
jmp 0x226a
movl %eax, 0xc(%rcx,%rdx,4)
movl 0x8(%rcx,%rdx,4), %esi
movl 0x10(%rcx,%rdx,4), %edi
cmpl %eax, %esi
cmovgl %esi, %eax
movl %eax, 0x4(%rcx,%rdx,4)
cmpl %edi, %eax
cmovlel %edi, %eax
movl %eax, (%rcx,%rdx,4)
retq
movl (%rcx,%rdx,4), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::get_3_base_case(int, int, int, int)
inline int co_static_search_tree::get_3_base_case(int block_index, int range_left, int og_height, int value) {
    /*
                            0
                    1               4
                2       3       5       6
    */

    int leafs_og_height = og_height - 2;
    int leafs_range_length = (1 << (leafs_og_height - 1));
    if(value <= this->tree[block_index + 1]){
        if (value <= this->tree[block_index + 2])
            return range_left;
        else    
            return range_left + leafs_range_length;
    } else {
        if(value <= this->tree[block_index + 5])
            return range_left + leafs_range_length << 1;
        else
            return range_left + (leafs_range_length << 1) + leafs_range_length; 
    }
}

// Assembly:
addl $-0x3, %ecx
pushq $0x1
popq %r9
shll %cl, %r9d
movq (%rdi), %rdi
movslq %esi, %rsi
cmpl %r8d, 0x4(%rdi,%rsi,4)
jge 0x2371
cmpl %r8d, 0x14(%rdi,%rsi,4)
jge 0x237f
pushq $0x2
popq %rax
shll %cl, %eax
addl %edx, %eax
addl %r9d, %eax
retq
xorl %eax, %eax
cmpl %r8d, 0x8(%rdi,%rsi,4)
cmovll %r9d, %eax
addl %edx, %eax
retq
addl %edx, %r9d
addl %r9d, %r9d
movl %r9d, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::get_4_base_case(int, int, int, int)
inline int co_static_search_tree::get_4_base_case(int block_index, int range_left, int og_height, int value) {
    /*
                                    0
                    1                                   2
            3               6                   9                 12
        4       5       7       8           10       11      13          14                    
    */
    int leafs_og_height = og_height - 3;
    int leafs_range_length = (1 << (leafs_og_height - 1));
    if(value <= this->tree[block_index + 1]) {
        if(value <= this->tree[block_index + 3]) {
            if(value <= this->tree[block_index + 4])
                return range_left;
            return range_left + leafs_range_length;
        }
        else
        { //6
            if(value <= this->tree[block_index + 7])
                return range_left + (leafs_range_length << 1);
            return range_left + (leafs_range_length << 1) + leafs_range_length;
        }
    } else //2
    {
        if(value <= this->tree[block_index + 9]) {
            if(value <= this->tree[block_index + 10]) return  range_left + (leafs_range_length << 2);
            return range_left + (leafs_range_length << 2) + leafs_range_length;
        }
        else //12 
        {
            if(value <= this->tree[block_index + 13])
                return range_left + (leafs_range_length << 2) + (leafs_range_length << 1);
            return range_left + (leafs_range_length << 2) + (leafs_range_length << 1) + leafs_range_length;
        }
    }
}

// Assembly:
addl $-0x4, %ecx
pushq $0x1
popq %r9
shll %cl, %r9d
movq (%rdi), %rdi
movslq %esi, %rsi
cmpl %r8d, 0x4(%rdi,%rsi,4)
jge 0x23bb
cmpl %r8d, 0x24(%rdi,%rsi,4)
jge 0x23d5
pushq $0x6
popq %r10
shll %cl, %r10d
addl %edx, %r10d
xorl %eax, %eax
cmpl %r8d, 0x34(%rdi,%rsi,4)
jmp 0x23e6
cmpl %r8d, 0xc(%rdi,%rsi,4)
jge 0x23ee
pushq $0x2
popq %r10
shll %cl, %r10d
addl %edx, %r10d
xorl %eax, %eax
cmpl %r8d, 0x1c(%rdi,%rsi,4)
jmp 0x23e6
pushq $0x4
popq %r10
shll %cl, %r10d
addl %edx, %r10d
xorl %eax, %eax
cmpl %r8d, 0x28(%rdi,%rsi,4)
cmovll %r9d, %eax
addl %r10d, %eax
retq
xorl %eax, %eax
cmpl %r8d, 0x10(%rdi,%rsi,4)
cmovll %r9d, %eax
addl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::left_child(int, int, int)
inline int co_static_search_tree::left_child(int block_index, int depth, int path) {
    if (depth & 1){
        return block_index + 1;
    }
    int biggest_leaving_block_h = (depth & ~(depth - 1));
    int bottom_tree_index = (path << 1) & ((1 << biggest_leaving_block_h) - 1);
    int next_big_block_index = this->block_index_memo[depth + 1 - biggest_leaving_block_h];
    int left_child_block_index = next_big_block_index + ((bottom_tree_index + 1) << biggest_leaving_block_h) - (bottom_tree_index + 1);
    return left_child_block_index;
}

// Assembly:
testb $0x1, %dl
jne 0x2431
movl %ecx, %eax
movl %edx, %ecx
negl %ecx
andl %edx, %ecx
pushq $-0x1
popq %r8
shll %cl, %r8d
addl %eax, %eax
notl %r8d
andl %eax, %r8d
orl $0x1, %edx
subl %ecx, %edx
incl %r8d
movl %r8d, %esi
shll %cl, %esi
movslq %edx, %rax
subl %r8d, %esi
addl 0x20(%rdi,%rax,4), %esi
jmp 0x2433
incl %esi
movl %esi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/static_search_trees.cpp
// Function: co_static_search_tree::right_child(int, int, int)
inline int co_static_search_tree::right_child(int block_index, int depth, int path) {
    if (depth & 1){
        return block_index + 2;
    }
    int biggest_leaving_block_h = (depth & ~(depth - 1));
    int bottom_tree_index = ((path << 1) | 1) & ((1 << biggest_leaving_block_h) - 1);
    int next_big_block_index = this->block_index_memo[depth + 1 - biggest_leaving_block_h];
    int right_child_block_index = next_big_block_index + ((bottom_tree_index + 1) << biggest_leaving_block_h) - (bottom_tree_index + 1);
    return right_child_block_index;
}

// Assembly:
testb $0x1, %dl
jne 0x246b
movl %ecx, %r8d
movl %edx, %ecx
negl %ecx
andl %edx, %ecx
pushq $-0x1
popq %rax
shll %cl, %eax
leal 0x1(,%r8,2), %esi
notl %eax
andl %esi, %eax
orl $0x1, %edx
subl %ecx, %edx
movslq %edx, %rdx
leal 0x1(%rax), %esi
shll %cl, %esi
notl %eax
addl %esi, %eax
addl 0x20(%rdi,%rdx,4), %eax
retq
movl %esi, %eax
addl $0x2, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: print_array(int*, int)
void print_array(int *a, int n) {
    printf("Array of length: %d\n", n);
    for (int i = 0; i < n; ++i){
        printf("%d ", a[i]);
    }
    printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0xa19(%rip), %rdi       # 0x3169
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x1030
testl %ebx, %ebx
cmovlel %r15d, %ebx
leaq 0x9fd(%rip), %r15       # 0x3164
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x2782
movl (%r14,%r12,4), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
incq %r12
jmp 0x276a
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1160
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: test_get_update_1()
void test_get_update_1() {
    // Test with a tree of size 15.
    int n = 15;
    CA_static_search_tree tree(n);
    int a[15];
    a[0] = rand() % 10;
    // for (int i = 1; i < n; ++i) {
    //     a[i] = a[i - 1] + rand() % 10;
    //     tree.update(i, a[i]);
    // }

    for (int i = 0; i < n; ++i) {
        a[i] = i;
        tree.update(i, i);
    }

    int index;

    index = tree.get(a[13]);
    if (index != 13)
    {
        print_array(a, n);
        printf("test_get_update_1 failed: expected %d at index 13, got: %d\n", a[13], index);
        tree.print_tree();
        return;
    }

    index = tree.get(a[5]);
    if (index != 5)
    {
        print_array(a, n);
        printf("test_get_update_1 failed: expected %d at index 5, got: %d\n", a[5], index);
        return;
    }

    index = tree.get(a[0]);
    if (index != 0)
    {
        print_array(a, n);
        printf("test_get_update_1 failed: expected %d at index 0, got: %d\n", a[0], index);
        return;
    }

    index = tree.get(a[13]);
    if (index != 13)
    {
        print_array(a, n);
        printf("test_get_update_1 failed: expected %d at index 13, got: %d\n", a[13], index);
        return;
    }
    cout << "test_get_update_1: OK" << endl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
leaq 0x8(%rsp), %rbx
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0x1cd2
callq 0x1050
pushq $0xa
popq %rcx
cltd
idivl %ecx
movl %edx, 0x20(%rsp)
xorl %r14d, %r14d
cmpq $0xf, %r14
je 0x27dd
movl %r14d, 0x20(%rsp,%r14,4)
movq %rbx, %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x1ece
incq %r14
jmp 0x27bf
movl 0x54(%rsp), %ebx
leaq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x1efc
movl %eax, %ebp
cmpl $0xd, %eax
jne 0x2839
movl 0x34(%rsp), %ebp
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x1efc
movl %eax, %r14d
cmpl $0x5, %eax
jne 0x2864
movl 0x20(%rsp), %ebp
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x1efc
movl %eax, %r14d
testl %eax, %eax
je 0x2897
leaq 0x20(%rsp), %rdi
pushq $0xf
popq %rsi
callq 0x273c
leaq 0x9be(%rip), %rdi       # 0x31f5
jmp 0x2878
leaq 0x20(%rsp), %rdi
pushq $0xf
popq %rsi
callq 0x273c
leaq 0x931(%rip), %rdi       # 0x317e
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1030
leaq 0x8(%rsp), %rdi
callq 0x1f22
jmp 0x2884
leaq 0x20(%rsp), %rdi
pushq $0xf
popq %rsi
callq 0x273c
leaq 0x942(%rip), %rdi       # 0x31ba
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1030
leaq 0x8(%rsp), %rdi
callq 0x1d12
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x1efc
movl %eax, %ebp
cmpl $0xd, %eax
jne 0x28c7
movq 0x3727(%rip), %rdi      # 0x5fd8
leaq 0x978(%rip), %rsi       # 0x3230
callq 0x10f0
movq %rax, %rdi
callq 0x1090
jmp 0x2884
leaq 0x20(%rsp), %rdi
pushq $0xf
popq %rsi
callq 0x273c
leaq 0x8a3(%rip), %rdi       # 0x317e
movl %ebx, %esi
movl %ebp, %edx
jmp 0x287d
jmp 0x28e3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1d12
movq %rbx, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: test_get_update_2()
void test_get_update_2() {
    // Test edge case with a tree of size 1.
    CA_static_search_tree tree(1);
    tree.update(0, 2);
    if (tree.get(2) != 0) {
        cout << "test_get_update_2 failed: expected 2 at index 0." << endl;
        return;
    }
    tree.update(0, 5);
    if (tree.get(5) != 0) {
        cout << "test_get_update_2 failed: expected 5 at index 0." << endl;
        return;
    }
    tree.update(0, 501);
    if (tree.get(501) != 0) {
        cout << "test_get_update_2 failed: expected 501 at index 0." << endl;
        return;
    }
    cout << "test_get_update_2: OK" << endl;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x8(%rsp), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1cd2
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ece
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x1efc
testl %eax, %eax
je 0x2934
leaq 0x914(%rip), %rsi       # 0x3246
jmp 0x2991
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rdx
xorl %esi, %esi
callq 0x1ece
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rsi
callq 0x1efc
testl %eax, %eax
je 0x295d
leaq 0x91c(%rip), %rsi       # 0x3277
jmp 0x2991
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x1ece
leaq 0x8(%rsp), %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x1efc
testl %eax, %eax
leaq 0x955(%rip), %rax       # 0x32db
leaq 0x91b(%rip), %rsi       # 0x32a8
cmoveq %rax, %rsi
movq 0x3640(%rip), %rdi      # 0x5fd8
callq 0x10f0
movq %rax, %rdi
callq 0x1090
leaq 0x8(%rsp), %rdi
callq 0x1d12
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1d12
movq %rbx, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x18, %rsp
xorl %r15d, %r15d
movl $0x2710, %r12d          # imm = 0x2710
movq %rsp, %r14
cmpl $0x64, %r15d
je 0x2abc
callq 0x1050
cltd
idivl %r12d
movl %edx, %ebx
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1cd2
xorl %ebp, %ebp
testl %ebx, %ebx
movl $0x0, %r13d
cmovgl %ebx, %r13d
cmpl %ebp, %r13d
je 0x2a28
movq %r14, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x1ece
incl %ebp
jmp 0x2a13
xorl %ebp, %ebp
cmpl %ebp, %r13d
je 0x2a41
movq %r14, %rdi
movl %ebp, %esi
callq 0x1efc
cmpl %eax, %ebp
jne 0x2a4e
incl %ebp
jmp 0x2a2a
movq %r14, %rdi
callq 0x1d12
incl %r15d
jmp 0x29e4
movq 0x3583(%rip), %rdi      # 0x5fd8
leaq 0x895(%rip), %rsi       # 0x32f1
callq 0x10f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x11a0
leaq 0x8a9(%rip), %rsi       # 0x331b
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x11a0
leaq 0x89b(%rip), %rsi       # 0x3326
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x11a0
movq %rax, %rdi
callq 0x1090
movq %rsp, %rdi
callq 0x1d12
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3515(%rip), %rdi      # 0x5fd8
leaq 0x86a(%rip), %rsi       # 0x3334
callq 0x10f0
movq %rax, %rdi
callq 0x1090
jmp 0x2aad
jmp 0x2add
jmp 0x2add
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1d12
movq %rbx, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: test_get_update_4()
void test_get_update_4() {
    // -- This is a bit of stress test
    // Test update all elements.
    // make value = key^2. 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);
        }
        // now update them again but in BACKWARDS order.
        for (int j = t_size - 1; j >= 0; j--) {
            tree.update(j, j*j);
        }
        for (int j = 0; j < t_size; j++) {
            if (tree.get(j * j) != j) {
                cout << "test_get_update_4 failed: expected value " << j*j << " at index " << j << ", tree size: " << t_size << endl;
                return;
            }
        }
    }
    cout << "test_get_update_4: OK" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r12d, %r12d
movl $0x2710, %ebx           # imm = 0x2710
movq %rsp, %r14
cmpl $0x64, %r12d
je 0x2c0c
callq 0x1050
cltd
idivl %ebx
movl %edx, %ebp
movl %edx, %ebx
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1cd2
xorl %r15d, %r15d
testl %ebx, %ebx
movl $0x0, %r13d
cmovgl %ebx, %r13d
cmpl %r15d, %r13d
je 0x2b63
movq %r14, %rdi
movl %r15d, %esi
movl %r15d, %edx
callq 0x1ece
incl %r15d
jmp 0x2b3a
movl %ebp, %edx
imull %ebp, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x1ece
decl %ebp
testl %ebp, %ebp
jns 0x2b52
xorl %ebp, %ebp
cmpl %ebp, %r13d
je 0x2b88
movl %ebp, %r15d
imull %ebp, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x1efc
cmpl %eax, %ebp
jne 0x2b9d
incl %ebp
jmp 0x2b69
movq %r14, %rdi
callq 0x1d12
incl %r12d
movl $0x2710, %ebx           # imm = 0x2710
jmp 0x2b09
movq 0x3434(%rip), %rdi      # 0x5fd8
leaq 0x79f(%rip), %rsi       # 0x334a
callq 0x10f0
movq %rax, %rdi
movl %r15d, %esi
callq 0x11a0
leaq 0x759(%rip), %rsi       # 0x331b
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x11a0
leaq 0x74b(%rip), %rsi       # 0x3326
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x11a0
movq %rax, %rdi
callq 0x1090
movq %rsp, %rdi
callq 0x1d12
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x33c5(%rip), %rdi      # 0x5fd8
leaq 0x75a(%rip), %rsi       # 0x3374
callq 0x10f0
movq %rax, %rdi
callq 0x1090
jmp 0x2bfd
jmp 0x2c2f
jmp 0x2c2f
jmp 0x2c2f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1d12
movq %rbx, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_ca_sst.cpp
// Function: main
int main() {
    srand(10);
    chrono::steady_clock::time_point begin = chrono::steady_clock::now();
    test_get_update_1();
    test_get_update_2();
    test_get_update_3();
    test_get_update_4();
    test_get_update_5();
    chrono::steady_clock::time_point end = chrono::steady_clock::now();
    cout << "Time difference = " << chrono::duration_cast<chrono::microseconds>(end - begin).count() << "[µs]" << std::endl;

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0xa
popq %rdi
callq 0x10e0
callq 0x1140
movq %rax, %rbx
callq 0x2795
callq 0x28f8
callq 0x29ca
callq 0x2af0
callq 0x2c42
callq 0x1140
movq %rax, %r14
movq 0x31fc(%rip), %rdi      # 0x5fd8
leaq 0x5e7(%rip), %rsi       # 0x33ca
callq 0x10f0
movq %rax, %rdi
subq %rbx, %r14
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %rsi
callq 0x10d0
leaq 0x5d3(%rip), %rsi       # 0x33dd
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
callq 0x1090
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq