LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/./kstring.h
// Function: ksprintf
static inline int ksprintf(kstring_t *s, const char *fmt, ...)
{
	va_list ap;
	int l;
	va_start(ap, fmt);
	l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap); // This line does not work with glibc 2.0. See `man snprintf'.
	va_end(ap);
	if ((size_t)l + 1 > s->m - s->l) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
		va_start(ap, fmt);
		l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
	}
	va_end(ap);
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x46fa
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0x100(%rsp), %r12
movq %r12, 0x8(%rcx)
movabsq $0x3000000010, %r13     # imm = 0x3000000010
movq %r13, (%rcx)
movl (%rdi), %edi
movl 0x4(%rbx), %esi
subl %edi, %esi
addq 0x8(%rbx), %rdi
movq %r14, %rdx
callq 0x20a0
movslq %eax, %rdx
incq %rdx
movl (%rbx), %ecx
movl 0x4(%rbx), %esi
subl %ecx, %esi
cmpq %rsi, %rdx
jbe 0x4798
addl %ecx, %eax
incl %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %esi
shrl $0x10, %esi
orl %eax, %esi
incl %esi
movl %esi, 0x4(%rbx)
movq 0x8(%rbx), %rdi
callq 0x21d0
movq %rax, 0x8(%rbx)
movq %rsp, %rcx
movq %r13, (%rcx)
movq %r12, 0x8(%rcx)
movq %r15, 0x10(%rcx)
movl (%rbx), %edi
movl 0x4(%rbx), %esi
subl %edi, %esi
addq 0x8(%rbx), %rdi
movq %r14, %rdx
callq 0x20a0
addl %eax, (%rbx)
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_init
ac_automaton *ac_init() {
    ac_automaton *ac = mp_new(sizeof(ac_automaton));
    ac->root = ac_tree_node_init('\0');
    ac->match = ac->root;
    return ac;
}

// Assembly:
pushq %rbx
pushq $0x18
popq %rdi
callq 0x232d
movq %rax, %rbx
xorl %edi, %edi
callq 0x1348
movq %rax, (%rbx)
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_tree_node_init
ac_tree_node *ac_tree_node_init(char value) {
    ac_tree_node *actn = mp_new(sizeof(ac_tree_node));
    actn->children = mp_new(256 * sizeof(ac_tree_node *));
    actn->is_pattern_end = F;
    // actn->value = value;
    actn->failed = NULL;
    actn->next = NULL;
    actn->match_number = 0;
    memset(actn->children, 0, 256 * sizeof(ac_tree_node *));
    return actn;
}

// Assembly:
pushq %rbx
pushq $0x20
popq %rdi
callq 0x232d
movq %rax, %rbx
movl $0x800, %edi            # imm = 0x800
callq 0x232d
movq %rax, (%rbx)
leaq 0x2d38(%rip), %rcx      # 0x40a0
movl (%rcx), %ecx
movl %ecx, 0x18(%rbx)
andl $0x0, 0x1c(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movl $0x800, %edx            # imm = 0x800
movq %rax, %rdi
xorl %esi, %esi
callq 0x10c0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_tree_node_add
ac_tree_node *ac_tree_node_add(ac_tree_node *actn, char *s) {
    int idx = char2int(*s);
    if (compare_char('\0', *(s)) == 0) {
        return actn;
    }
    if (actn->children[idx] == NULL) {
        actn->children[idx] = ac_tree_node_init(*s);
    }
    if (compare_char('\0', *(s + 1)) == 0) {
        actn->children[idx]->is_pattern_end = T;
        return actn->children[idx];
    }
    return ac_tree_node_add(actn->children[idx], s + 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
incq %r14
movsbl -0x1(%r14), %r15d
xorl %edi, %edi
movl %r15d, %esi
callq 0x2061
testl %eax, %eax
je 0x1409
leal 0x100(%r15), %eax
testb %r15b, %r15b
cmovgl %r15d, %eax
movq (%rbx), %rcx
movslq %eax, %r15
cmpq $0x0, (%rcx,%r15,8)
jne 0x13de
xorl %edi, %edi
callq 0x1348
movq (%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movsbl (%r14), %esi
xorl %edi, %edi
callq 0x2061
testl %eax, %eax
je 0x13f6
movq (%rbx), %rax
movq (%rax,%r15,8), %rbx
jmp 0x139f
leaq 0x2c9f(%rip), %rax      # 0x409c
movl (%rax), %eax
movq (%rbx), %rcx
movq (%rcx,%r15,8), %rbx
movl %eax, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_build
void ac_build(ac_automaton *ac) {
    ac->root->failed = ac->root;
    ac->root->next = ac->root;
    ac->queue = lk_init();

    lk_add(ac->queue, ac->root);

    while (!lk_empty(ac->queue)) {
        ac_tree_node *parent = ac->queue->head->value;
        lk_remove(ac->queue, ac->queue->head);

        for (int i = 0; i < 256; ++i) {
            ac_tree_node *child = parent->children[i];
            if (child != NULL) {
                lk_add(ac->queue, child);

                ac_tree_node *ptr = parent->failed;
                while (
                    (ptr->children[i] == NULL || ptr->children[i] == child) &&
                    ptr != ac->root) {
                    ptr = ptr->failed;
                }
                if (ptr->children[i] != NULL && ptr->children[i] != child) {
                    child->failed = ptr->children[i];
                } else {
                    child->failed = ptr;
                }

                if (child->failed->is_pattern_end == T) {
                    child->next = child->failed;
                } else {
                    child->next = child->failed->next;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq %rax, 0x8(%rax)
movq %rax, 0x10(%rax)
xorl %eax, %eax
callq 0x25c8
movq %rax, 0x8(%rbx)
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x260c
leaq 0x2c57(%rip), %rax      # 0x409c
movl (%rax), %ebp
movq 0x8(%rbx), %rdi
callq 0x2638
testl %eax, %eax
jne 0x14bd
movq 0x8(%rbx), %rdi
movq (%rdi), %rsi
movq (%rsi), %r15
callq 0x264c
xorl %r12d, %r12d
cmpq $0x100, %r12            # imm = 0x100
je 0x1447
movq (%r15), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x14b8
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x260c
movq %r15, %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x149f
cmpq %r14, %rax
jne 0x14a7
movq %rcx, %rax
cmpq (%rbx), %rcx
jne 0x148a
movq %rax, 0x8(%r14)
cmpl %ebp, 0x18(%rax)
je 0x14b4
movq 0x10(%rax), %rax
movq %rax, 0x10(%r14)
incq %r12
jmp 0x1466
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_match_char
void ac_match_char(ac_automaton *ac, char c) {
    int idx = char2int(c);
    ++compare_number;
    while (ac->match->children[idx] == NULL && ac->match != ac->root) {
        ac->match = ac->match->failed;
        ++compare_number;
    }
    if (ac->match->children[idx] != NULL) {
        ac->match = ac->match->children[idx];
        ac_tree_node *p = ac->match;
        while (p != ac->root) {
            ++p->match_number;
            p = p->next;
            ++compare_number;
        }
    }
}

// Assembly:
leal 0x100(%rsi), %eax
testb %sil, %sil
cmovgl %esi, %eax
movslq %eax, %rdx
leaq 0x5c94(%rip), %rax      # 0x7170
movq (%rax), %rcx
movq 0x10(%rdi), %r8
addq $0x2, %rcx
movq (%r8), %rsi
movq (%rsi,%rdx,8), %rsi
testq %rsi, %rsi
jne 0x1505
cmpq (%rdi), %r8
je 0x1527
movq 0x8(%r8), %r8
movq %r8, 0x10(%rdi)
incq %rcx
jmp 0x14e7
leaq -0x1(%rcx), %rdx
movq %rdx, (%rax)
movq %rsi, 0x10(%rdi)
movq (%rdi), %rdx
cmpq %rdx, %rsi
je 0x152d
incl 0x1c(%rsi)
movq 0x10(%rsi), %rsi
movq %rcx, (%rax)
incq %rcx
jmp 0x1513
decq %rcx
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/ac_automaton/ac_automaton.c
// Function: ac_tree_node_print
void ac_tree_node_print(ac_tree_node *actn, ac_tree_node *parent, int value) {
    if (actn != NULL) {
        printf("%1c %3d (%p) failed->%p parent=%p\n", value, value, actn,
               actn->failed, parent);
        for (int i = 0; i < 256; ++i) {
            ac_tree_node_print(actn->children[i], actn, i);
        }
    }
}

// Assembly:
testq %rdi, %rdi
je 0x158a
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r9
movq %rdi, %rbx
movq 0x8(%rdi), %r8
leaq 0x2ab0(%rip), %rdi      # 0x4004
xorl %r14d, %r14d
movl %edx, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10b0
cmpq $0x100, %r14            # imm = 0x100
je 0x1583
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x153a
incq %r14
jmp 0x1563
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_init
bits *bits_init() {
    ++_bits_num;
    _bits_mem += sizeof(bits);

    bits *b = mp_new(sizeof(bits));
    b->value = NULL;
    b->start = 0;
    b->end = 0;
    return b;
}

// Assembly:
pushq %rax
incl 0x5bb1(%rip)            # 0x7144
addl $0x10, 0x5bae(%rip)     # 0x7148
pushq $0x10
popq %rdi
callq 0x232d
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_init_with_minimum_bytes
bits *bits_init_with_minimum_bytes(void *value, int start, int end) {
    bits *b = bits_init();
    int   start_byte = start / 8;
    int   end_byte = end / 8 + (end % 8 ? 1 : 0);
    b->value = mp_new(end_byte - start_byte);
    b->start = start - start_byte * 8;
    b->end = end - start_byte * 8;
    memcpy(b->value, value + start_byte, end_byte - start_byte);

    _bits_string_mem += end_byte - start_byte;
    ++_bits_string_num;

    return b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
callq 0x158c
movq %rax, %rbx
pushq $0x8
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movl %eax, %r12d
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %r13d
movl %ebp, %eax
andl $0x7, %eax
subl %r12d, %r13d
cmpl $0x1, %eax
sbbl $-0x1, %r13d
movl %r13d, %edi
callq 0x232d
movq %rax, (%rbx)
leal (,%r12,8), %ecx
subl %ecx, %r15d
movl %r15d, 0x8(%rbx)
subl %ecx, %ebp
movl %ebp, 0xc(%rbx)
movslq %r12d, %rsi
addq %r14, %rsi
movslq %r13d, %r14
movq %rax, %rdi
movq %r14, %rdx
callq 0x1130
addl %r14d, 0x5b1e(%rip)     # 0x7140
incl 0x5b14(%rip)            # 0x713c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_init_with_minimum_bits
bits *bits_init_with_minimum_bits(bits *b, int start, int end) {
    bits *bb = bits_init();
    int   start_byte = start / 8;
    int   end_byte = end / 8 + (end % 8 ? 1 : 0);
    bb->value = mp_new(end_byte - start_byte);
    bb->start = start - start_byte * 8;
    bb->end = end - start_byte * 8;
    memcpy(bb->value, b->value + start_byte, end_byte - start_byte);

    _bits_string_mem += end_byte - start_byte;
    ++_bits_string_num;

    return bb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
callq 0x158c
movq %rax, %rbx
pushq $0x8
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movl %eax, %r12d
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %r13d
movl %ebp, %eax
andl $0x7, %eax
subl %r12d, %r13d
cmpl $0x1, %eax
sbbl $-0x1, %r13d
movl %r13d, %edi
callq 0x232d
movq %rax, (%rbx)
leal (,%r12,8), %ecx
subl %ecx, %r15d
movl %r15d, 0x8(%rbx)
subl %ecx, %ebp
movl %ebp, 0xc(%rbx)
movslq %r12d, %rsi
addq (%r14), %rsi
movslq %r13d, %r14
movq %rax, %rdi
movq %r14, %rdx
callq 0x1130
addl %r14d, 0x5a8e(%rip)     # 0x7140
incl 0x5a84(%rip)            # 0x713c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_sub
bits *bits_sub(bits *b, int start, int end) {
    if (end + b->start >= b->end || start + b->start >= b->end) {
        print_err("bits overflow in bits_sub()\n");
        exit(1);
    }
    bits *bb = bits_init();
    bb->value = b->value;
    bb->start = b->start + start;
    bb->end = b->start + end;
    return bb;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %ecx
leal (%rax,%rbx), %edx
cmpl %ecx, %edx
jge 0x1706
movl %esi, %ebp
addl %esi, %eax
cmpl %ecx, %eax
jge 0x1706
movq %rdi, %r14
callq 0x158c
movq (%r14), %rcx
movq %rcx, (%rax)
addl 0x8(%r14), %ebp
movl %ebp, 0x8(%rax)
addl 0x8(%r14), %ebx
movl %ebx, 0xc(%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x291a(%rip), %rdi      # 0x4027
xorl %eax, %eax
callq 0x27a0
pushq $0x1
popq %rdi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_get
int bits_get(bits *b, int pos) {
    pos += b->start;
    if (pos >= b->end || pos < 0) {
        print_err("bits overflow in bits_get()\n");
        exit(1);
    }
    return (b->value[pos >> 3] >> (pos & 7)) & 1;
}

// Assembly:
addl 0x8(%rdi), %esi
cmpl 0xc(%rdi), %esi
jge 0x1740
testl %esi, %esi
js 0x1740
movq (%rdi), %rax
movl %esi, %ecx
shrl $0x3, %ecx
movsbl (%rax,%rcx), %ecx
andl $0x7, %esi
xorl %eax, %eax
btl %esi, %ecx
setb %al
retq
pushq %rax
leaq 0x28fc(%rip), %rdi      # 0x4044
xorl %eax, %eax
callq 0x27a0
pushq $0x1
popq %rdi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bits/bits.c
// Function: bits_prefix
int bits_prefix(bits *b1, bits *b2, int group_length) {
    int l1 = bits_len(b1);
    int l2 = bits_len(b2);
    int lmin = l1 < l2 ? l1 : l2;
    int prefix = 0;
    for (int i = 0; i < lmin; i += group_length) {
        int group_match = 0;
        for (int j = i; j - i < group_length && j < lmin; ++j) {
            if (bits_get(b1, j) == bits_get(b2, j)) {
                ++group_match;
            } else {
                break;
            }
        }
        if (group_match == group_length) {
            prefix += group_match;
        } else {
            break;
        }
    }
    return prefix;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl 0xc(%rdi), %eax
movq %rdi, 0x10(%rsp)
subl 0x8(%rdi), %eax
movl 0xc(%rsi), %r14d
movq %rsi, 0x8(%rsp)
subl 0x8(%rsi), %r14d
cmpl %r14d, %eax
cmovll %eax, %r14d
xorl %r12d, %r12d
cmpl %r14d, %r12d
jge 0x17d5
xorl %r15d, %r15d
leal (%r12,%r15), %ebp
cmpl %r14d, %ebp
jge 0x17cb
cmpl %ebx, %r15d
jge 0x17cb
movq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x171c
movl %eax, %r13d
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x171c
cmpl %eax, %r13d
jne 0x17cb
incl %r15d
jmp 0x1798
cmpl %r15d, %ebx
jne 0x17d5
addl %ebx, %r12d
jmp 0x1790
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/avl_tree.c
// Function: at_init
avl_tree *at_init(compare_function compare) {
    avl_tree *at = mp_new(sizeof(avl_tree));
    at->root = NULL;
    at->compare = compare;
    return at;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x232d
andq $0x0, (%rax)
movq %rbx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_init
avl_tree_node *avl_tn_init(void *value, int size) {
    ++_avl_tree_node_number;

    char *s = mp_new(size);
    memcpy(s, value, size);
    ++_avl_tree_strnum;
    _avl_tree_strmem += size;

    avl_tree_node *avl_tn = mp_new(sizeof(avl_tree_node));
    _avl_tree_nodemem += sizeof(avl_tree_node);

    avl_tn->value = s;
    // avl_tn->parent = NULL;
    avl_tn->left = NULL;
    avl_tn->right = NULL;
    avl_tn->deep = 1;
    return avl_tn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
incl 0x58b4(%rip)            # 0x714c
movl %esi, %edi
callq 0x232d
movq %rax, %r15
movslq %ebx, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1130
incl 0x589f(%rip)            # 0x7158
addl %ebx, 0x5891(%rip)      # 0x7150
pushq $0x20
popq %rdi
callq 0x232d
addl $0x20, 0x5886(%rip)     # 0x7154
movq %r15, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x1, 0x18(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_search
avl_tree_node *avl_tn_search(avl_tree_node *avl_tn, void *value,
                             compare_function compare) {
    if (avl_tn == NULL) {
        return NULL;
    }
    ++compare_number;

    int res = compare(avl_tn->value, value);
    if (res == 0) {
        return avl_tn;
    } else if (res > 0) {
        return avl_tn_search(avl_tn->left, value, compare);
    } else {
        return avl_tn_search(avl_tn->right, value, compare);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x5873(%rip), %r12      # 0x7170
testq %r14, %r14
je 0x191f
incq (%r12)
movq (%r14), %rdi
movq %r15, %rsi
callq *%rbx
testl %eax, %eax
je 0x191f
setle %al
movzbl %al, %eax
movq 0x8(%r14,%rax,8), %r14
jmp 0x18fd
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_add
avl_tree_node *avl_tn_add(avl_tree_node *avl_tn, void *value, int size,
                          compare_function compare) {
    if (avl_tn == NULL) {
        return avl_tn_init(value, size);
    }
    int res = compare(avl_tn->value, value);
    if (res > 0) {
        avl_tn->left = avl_tn_add(avl_tn->left, value, size, compare);
        // avl_tn->left->parent = avl_tn;
    } else if (res < 0) {
        avl_tn->right = avl_tn_add(avl_tn->right, value, size, compare);
        // avl_tn->right->parent = avl_tn;
    } else {
        // same value do nothing
        return avl_tn;
    }

    int l = avl_tn->left ? avl_tn->left->deep : 0;
    int r = avl_tn->right ? avl_tn->right->deep : 0;
    if (abs(l - r) <= 1) {
        avl_tn->deep = (l > r ? l : r) + 1;
    } else {
        if (l - r > 1) {
            return avl_tn_right(avl_tn);
        } else {
            return avl_tn_left(avl_tn);
        }
    }

    return avl_tn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
testq %rdi, %rdi
je 0x199d
movq %rcx, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
movq %r15, %rsi
callq *%rcx
testl %eax, %eax
jle 0x19c8
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x192e
movq %rax, 0x8(%rbx)
xorl %ecx, %ecx
movl $0x0, %edx
testq %rax, %rax
je 0x1975
movl 0x18(%rax), %edx
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x1981
movl 0x18(%rax), %ecx
movl %edx, %eax
subl %ecx, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl $0x1, %esi
ja 0x19b1
cmpl %ecx, %edx
cmovgl %edx, %ecx
incl %ecx
movl %ecx, 0x18(%rbx)
jmp 0x19ca
movq %r15, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1888
movq %rbx, %rdi
addq $0x8, %rsp
cmpl $0x2, %eax
jl 0x19d8
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1a01
js 0x19e3
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1a38
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x192e
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rax
jmp 0x1966
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_print
char *avl_tn_print(avl_tree_node *avl_tn) {
    if (avl_tn == NULL) {
        return "NULL";
    } else {
        char *t = (char *)(avl_tn->value);
        char *l = avl_tn_print(avl_tn->left);
        char *r = avl_tn_print(avl_tn->right);
        printf("    %s(%d)\n    ↙    ↘\n%s    %s\n\n", t, avl_tn->deep, l, r);
        return t;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1ab1
movq %rdi, %r14
movq (%rdi), %rbx
movq 0x8(%rdi), %rdi
callq 0x1a6f
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x1a6f
movl 0x18(%r14), %edx
leaq 0x25d5(%rip), %rdi      # 0x4074
movq %rbx, %rsi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x10b0
jmp 0x1ab8
leaq 0x25b7(%rip), %rbx      # 0x406f
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_update_deep
void avl_tn_update_deep(avl_tree_node *avl_tn) {
    if (avl_tn != NULL) {
        int l = avl_tn->left ? avl_tn->left->deep : 0;
        int r = avl_tn->right ? avl_tn->right->deep : 0;
        avl_tn->deep = (l > r ? l : r) + 1;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x1aef
movq 0x8(%rdi), %rdx
xorl %eax, %eax
movl $0x0, %ecx
testq %rdx, %rdx
je 0x1ad9
movl 0x18(%rdx), %ecx
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x1ae5
movl 0x18(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
incl %eax
movl %eax, 0x18(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree.c
// Function: bpt_init
bplus_tree *bpt_init(int m, compare_function compare) {
    bplus_tree *bpt = mp_new(sizeof(bplus_tree));
    bpt->m = m;
    bpt->root = NULL;
    bpt->compare = compare;
    return bpt;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x18
popq %rdi
callq 0x232d
movl %ebp, (%rax)
andq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree.c
// Function: bpt_add
void bpt_add(bplus_tree *bpt, void *value, int size) {
    if (bpt->root == NULL) {
        extern int _bplus_string_mem;
        void *     p = mp_new(size);
        memcpy(p, value, size);
        _bplus_string_mem += size;

        bplus_tree_node *root = bptn_init(bpt->m);
        root->keys[0] = p;
        root->pointers[0] = NULL;

        root->is_leaf = T;
        root->num = 1;

        bpt->root = root;
    } else {
        bplus_tree_node *split_node =
            bptn_add(bpt->root, value, bpt->m, bpt->compare);
        if (split_node != NULL) {
            bplus_tree_node *root = bptn_init(bpt->m);
            root->keys[0] = bptn_get_extremum(bpt->root);
            root->pointers[0] = bpt->root;
            root->keys[1] = bptn_get_extremum(split_node);
            root->pointers[1] = split_node;

            root->is_leaf = F;
            root->num = 2;

            bpt->root = root;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x1b8c
movl (%rbx), %edx
movq 0x10(%rbx), %rcx
movq %r14, %rsi
callq 0x1e13
testq %rax, %rax
je 0x1be3
movq %rax, %r15
movl (%rbx), %edi
callq 0x1c10
movq %rax, %r14
movq 0x8(%rbx), %rdi
callq 0x1e0b
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq 0x8(%rbx), %rax
movq 0x10(%r14), %rcx
movq %rax, (%rcx)
movq %r15, %rdi
callq 0x1e0b
movq 0x8(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%r14), %rax
movq %r15, 0x8(%rax)
pushq $0x2
popq %rax
leaq 0x2516(%rip), %rcx      # 0x40a0
jmp 0x1bd6
movl %edx, %ebp
movl %edx, %edi
callq 0x232d
movq %rax, %r15
movslq %ebp, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1130
leaq 0x55b4(%rip), %rax      # 0x7164
addl %r12d, (%rax)
movl (%rbx), %edi
callq 0x1c10
movq %rax, %r14
movq 0x8(%rax), %rax
movq %r15, (%rax)
movq 0x10(%r14), %rax
andq $0x0, (%rax)
pushq $0x1
popq %rax
leaq 0x24c6(%rip), %rcx      # 0x409c
movl (%rcx), %ecx
movl %ecx, (%r14)
movl %eax, 0x4(%r14)
movq %r14, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_init
bplus_tree_node *bptn_init(int max_length) {
    ++_bplus_node_number;
    bplus_tree_node *bptn = mp_new(sizeof(bplus_tree_node));
    bptn->keys = mp_new(sizeof(void *) * (max_length + 1));
    bptn->pointers = mp_new(sizeof(void *) * (max_length + 1));

    _bplus_node_mem +=
        (sizeof(bplus_tree_node) + sizeof(void *) * (max_length + 1) +
         sizeof(void *) * (max_length + 1));
    memset(bptn->pointers, 0, sizeof(void *) * (max_length + 1));
    bptn->num = 0;
    bptn->is_leaf = T;
    return bptn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %r14d
incl 0x553e(%rip)            # 0x715c
pushq $0x18
popq %rdi
callq 0x232d
movq %rax, %rbx
movslq %r14d, %rax
shll $0x4, %r14d
leaq 0x8(,%rax,8), %r15
movl %r15d, %edi
callq 0x232d
movq %rax, 0x8(%rbx)
movl %r15d, %edi
callq 0x232d
movq %rax, 0x10(%rbx)
movl 0x550a(%rip), %ecx      # 0x7160
addl %r14d, %ecx
addl $0x28, %ecx
movl %ecx, 0x54fe(%rip)      # 0x7160
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10c0
andl $0x0, 0x4(%rbx)
leaq 0x2422(%rip), %rax      # 0x409c
movl (%rax), %eax
movl %eax, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_add_to_node
int bptn_add_to_node(bplus_tree_node *bptn, void *value,
                     compare_function compare) {
    int i = 0;

    // this value has been inserted
    for (i = 0; i < bptn->num; ++i) {
        if (compare(value, bptn->keys[i]) == 0) {
            return -1;
        }
    }

    for (i = bptn->num; i >= 1; --i) {
        int res = compare(value, bptn->keys[i - 1]);
        if (res > 0) {
            break;
        } else {
            bptn->keys[i] = bptn->keys[i - 1];
            bptn->pointers[i] = bptn->pointers[i - 1];
        }
    }
    bptn->keys[i] = value;
    bptn->pointers[i] = i == bptn->num ? NULL : bptn->pointers[i + 1];
    ++bptn->num;
    return i;
    // printf("unexcepted error: can find a appropriate space to add.\n");
    // exit(1);
    // return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $-0x1
popq %rbp
movslq 0x4(%rbx), %rax
cmpq %rax, %r12
jge 0x1cc6
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq *%r15
incq %r12
testl %eax, %eax
jne 0x1ca6
jmp 0x1d34
movl %eax, %r12d
movl %r12d, %ebp
sarl $0x1f, %ebp
andl %r12d, %ebp
testl %r12d, %r12d
jle 0x1d0c
movq 0x8(%rbx), %rax
movq -0x8(%rax,%r12,8), %rsi
movq %r14, %rdi
callq *%r15
testl %eax, %eax
jg 0x1d09
movq 0x8(%rbx), %rax
movq -0x8(%rax,%r12,8), %rcx
movq %rcx, (%rax,%r12,8)
movq 0x10(%rbx), %rax
movq -0x8(%rax,%r12,8), %rcx
movq %rcx, (%rax,%r12,8)
decq %r12
jmp 0x1cd2
movl %r12d, %ebp
movq 0x8(%rbx), %rax
movslq %ebp, %rcx
movq %r14, (%rax,%rcx,8)
movl 0x4(%rbx), %eax
movq 0x10(%rbx), %rdx
cmpl %eax, %ecx
jne 0x1d26
xorl %esi, %esi
jmp 0x1d2b
movq 0x8(%rdx,%rcx,8), %rsi
movq %rsi, (%rdx,%rcx,8)
incl %eax
movl %eax, 0x4(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_split
bplus_tree_node *bptn_split(bplus_tree_node *bptn, int max_length) {
    if (bptn->num > max_length) {
        // need split
        bplus_tree_node *bptn2 = bptn_init(max_length);
        bptn->num = ((max_length + 1) / 2) + ((max_length + 1) % 2);
        bptn2->num = max_length - bptn->num + 1;

        // move data to the new node
        for (int i = 0; i < bptn2->num; ++i) {
            bptn2->keys[i] = bptn->keys[bptn->num + i];
            bptn2->pointers[i] = bptn->pointers[bptn->num + i];
        }

        return bptn2;
    }
    return NULL;
}

// Assembly:
cmpl %esi, 0x4(%rdi)
jle 0x1dab
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %edi
callq 0x1c10
movq %rax, %rcx
leal 0x1(%r14), %eax
pushq $-0x2
popq %rsi
cltd
idivl %esi
addl %r14d, %eax
incl %eax
movl %eax, 0x4(%rbx)
subl %eax, %r14d
leal 0x1(%r14), %eax
movl %eax, 0x4(%rcx)
movslq %r14d, %rax
xorl %edx, %edx
cmpq %rax, %rdx
jg 0x1daf
movq 0x8(%rbx), %rsi
movl 0x4(%rbx), %edi
addl %edx, %edi
movslq %edi, %rdi
movq (%rsi,%rdi,8), %rsi
movq 0x8(%rcx), %r8
movq %rsi, (%r8,%rdx,8)
movq 0x10(%rbx), %rsi
movq (%rsi,%rdi,8), %rsi
movq 0x10(%rcx), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
jmp 0x1d79
xorl %ecx, %ecx
jmp 0x1db6
addq $0x8, %rsp
popq %rbx
popq %r14
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_search_index
int bptn_search_index(bplus_tree_node *bptn, void *value,
                      compare_function compare) {
    int i = 0;
    for (i = 0; i < bptn->num; ++i) {
        // find the first bigger value and insert
#ifdef MIN_VALUE
        // keys[i] > value
        if (compare(bptn->keys[i], value) > 0) {
            if (i == 0) {
                return 0;
            }
            return i - 1;
        }
#else
        // keys[i] >= value
        if (compare(bptn->keys[i], value) >= 0) {
            if (i == 0) {
                return 0;
            }
            return i;
        }
#endif
    }
    return bptn->num - 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movslq 0x4(%r12), %rax
cmpq %rax, %rbx
jge 0x1def
movq 0x8(%r12), %rax
movq (%rax,%rbx,8), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
jg 0x1df5
incq %rbx
jmp 0x1dcd
decl %eax
movl %eax, %ebx
jmp 0x1dfd
xorl %eax, %eax
subl $0x1, %ebx
cmovbl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_print
void bptn_print(bplus_tree_node *bptn) {
    if (bptn == NULL)
        return;
    printf("Node %p | num %d | leaf %d\n", bptn, bptn->num, bptn->is_leaf);
    for (int i = 0; i < bptn->num; ++i) {
        printf("\t%s(%p)  ", (char *)bptn->keys[i], bptn->pointers[i]);
    }
    printf("\n");
    if (!bptn->is_leaf) {
        for (int i = 0; i < bptn->num; ++i) {
            bptn_print(bptn->pointers[i]);
        }
    }
}

// Assembly:
testq %rdi, %rdi
je 0x1f98
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x4(%rdi), %edx
leaq 0x215a(%rip), %rdi      # 0x40a4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x2165(%rip), %r14      # 0x40c0
xorl %r15d, %r15d
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jge 0x1f86
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
incq %r15
jmp 0x1f5e
pushq $0xa
popq %rdi
callq 0x1030
cmpl $0x0, (%rbx)
je 0x1f99
popq %rbx
popq %r14
popq %r15
retq
xorl %r14d, %r14d
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jge 0x1f93
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1f31
incq %r14
jmp 0x1f9c
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/bplus_tree/bplus_tree_node.c
// Function: bptn_exist
boolean bptn_exist(bplus_tree_node *bptn, void *value,
                   compare_function compare) {
    ++compare_number;
    int index = bptn_search_index(bptn, value, compare);
    if (compare(bptn->keys[index], value) == 0) {
        return T;
    } else if (bptn->is_leaf) {
        return F;
    }
    return bptn_exist(bptn->pointers[index], value, compare);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x519e(%rip), %r13      # 0x7170
leaq 0x20c3(%rip), %r12      # 0x409c
incq (%r13)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1dba
movq 0x8(%r15), %rcx
movslq %eax, %rbp
movq (%rcx,%rbp,8), %rdi
movq %r14, %rsi
callq *%rbx
testl %eax, %eax
je 0x2016
cmpl $0x0, (%r15)
jne 0x200f
movq 0x10(%r15), %rax
movq (%rax,%rbp,8), %r15
jmp 0x1fd9
leaq 0x208a(%rip), %r12      # 0x40a0
movl (%r12), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/compare/compare.c
// Function: compare_string
int compare_string(char *a, char *b) {
    char *ptr_a = a, *ptr_b = b;
    while (*ptr_a != '\0' && *ptr_b != '\0') {
        int res = compare_char_macro(*ptr_a, *ptr_b);
        if (res != 0) {
            return res;
        }
        ++ptr_a;
        ++ptr_b;
    }
    if (*ptr_a != '\0') {
        return 1;
    } else if (*ptr_b != '\0') {
        return -1;
    } else {
        return 0;
    }
}

// Assembly:
movq 0x50fc(%rip), %rcx      # 0x7170
incq %rcx
xorl %edx, %edx
pushq $0x1
popq %r8
cmpb $0x0, (%rdi,%rdx)
movb (%rsi,%rdx), %r9b
je 0x20a9
testb %r9b, %r9b
je 0x20b1
leaq (%rcx,%rdx), %rax
movq %rax, 0x50d9(%rip)      # 0x7170
movsbl (%rdi,%rdx), %eax
movsbl (%rsi,%rdx), %r9d
incq %rdx
subl %r9d, %eax
je 0x207d
retq
xorl %eax, %eax
negb %r9b
sbbl %eax, %eax
retq
movl %r8d, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/file/file.c
// Function: open_file
FILE *open_file(const char *filename, const char *type) {
    FILE *f = fopen(filename, type);
    if (f == 0) {
        printf("Error: Can not open file %s.", filename);
        exit(1);
    }
    return f;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1180
testq %rax, %rax
je 0x20c8
popq %rbx
retq
leaq 0x2009(%rip), %rdi      # 0x40d8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
pushq $0x1
popq %rdi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/file/file.c
// Function: read_file
int read_file(FILE *f, char *s) {
    int   length = 0;
    char *ptr = s;
    char  c;

    while (1) {
        c = fgetc(f);
        if (c == EOF) {
            if (ptr == s) {
                return 0;
            } else {
                *(ptr) = '\0';
                return length;
            }
        }
        if (c == '\n') {
            if (ptr == s) {
                // continue;
                *(ptr++) = '\n';
                *(ptr++) = '\0';
                return 1;
            } else {
                *(ptr) = '\0';
                return length;
            }
        }
        *(ptr++) = c;
        ++length;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x10d0
cmpb $0xa, %al
je 0x2117
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x210e
movb %al, (%r14,%rbx)
incq %rbx
jmp 0x20ee
testq %rbx, %rbx
jne 0x211c
xorl %ebx, %ebx
jmp 0x212f
testq %rbx, %rbx
je 0x2121
addq %rbx, %r14
jmp 0x212b
movb $0xa, (%r14)
incq %r14
pushq $0x1
popq %rbx
movb $0x0, (%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/free/free.c
// Function: mp_init
void mp_init(size_type_big max_pool_length, void (*error_callback)()) {
    mp.bucket_number = max_pool_length / (1 << 30) + 1;
    size_type_big left = max_pool_length;

    mp.head = malloc(mp.bucket_number * sizeof(void *));
    mp.length = malloc(mp.bucket_number * sizeof(size_type_small *));
    mp.max_length = malloc(mp.bucket_number * sizeof(size_type_small *));

    for (int i = 0; i < mp.bucket_number; ++i) {
        mp.length[i] = 0;
        if (left < (1 << 30)) {
            mp.head[i] = malloc(left);
            mp.max_length[i] = left;
            break;
        } else {
            mp.head[i] = malloc((1 << 30));
            left -= (1 << 30);
            mp.max_length[i] = (1 << 30);
        }
        if (mp.head[i] == NULL) {
            printf("init error. need " SIZE_TYPE_BIG_FORMAT " bytes\n",
                   max_pool_length);
            error_callback();
        }
    }

    // mp.head = malloc(mp.max_length);
    // mp.length = 0;
    mp.error_callback = error_callback;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %rbx
movq %rdi, %rbp
shrq $0x1e, %rbp
incl %ebp
movl %ebp, 0x5032(%rip)      # 0x7194
movslq %ebp, %r15
shlq $0x3, %r15
movq %r15, %rdi
callq 0x1150
movq %rax, 0x5000(%rip)      # 0x7178
movq %r15, %rdi
callq 0x1150
movq %rax, 0x4ff9(%rip)      # 0x7180
movq %r15, %rdi
callq 0x1150
movq %rax, 0x4ff2(%rip)      # 0x7188
leaq 0x1f63(%rip), %r15      # 0x4100
xorl %r13d, %r13d
movq %rbx, %r14
movslq %ebp, %rax
cmpq %rax, %r13
jge 0x2237
movq 0x4fca(%rip), %rax      # 0x7180
andl $0x0, (%rax,%r13,4)
movq %r14, %r12
subq $0x40000000, %r12       # imm = 0x40000000
jb 0x2219
movl $0x40000000, %edi       # imm = 0x40000000
callq 0x1150
movq 0x4fa0(%rip), %rcx      # 0x7178
movq %rax, (%rcx,%r13,8)
movq 0x4fa5(%rip), %rax      # 0x7188
movl $0x40000000, (%rax,%r13,4) # imm = 0x40000000
movq 0x4f86(%rip), %rax      # 0x7178
cmpq $0x0, (%rax,%r13,8)
jne 0x220b
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
xorl %eax, %eax
callq *(%rsp)
incq %r13
movl 0x4f80(%rip), %ebp      # 0x7194
movq %r12, %r14
jmp 0x21a3
movq %r14, %rdi
callq 0x1150
movq 0x4f50(%rip), %rcx      # 0x7178
movq %rax, (%rcx,%r13,8)
movq 0x4f55(%rip), %rax      # 0x7188
movl %r14d, (%rax,%r13,4)
movq (%rsp), %rax
movq %rax, 0x4f56(%rip)      # 0x7198
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/free/free.c
// Function: mp_info
void mp_info() {
    for (int i = 0; i < mp.bucket_number; ++i) {
        printf("bucket %3d, usage " SIZE_TYPE_SMALL_FORMAT
               "/" SIZE_TYPE_SMALL_FORMAT " %.2f%%, " SIZE_TYPE_SMALL_FORMAT
               " left\n",
               i, mp.length[i], mp.max_length[i],
               (mp.max_length[i] == 0
                    ? 100
                    : (double)mp.length[i] / mp.max_length[i] * 100),
               mp.max_length[i] - mp.length[i]);
    }
    printf("total: max_length: " SIZE_TYPE_BIG_FORMAT
           "  now_length: " SIZE_TYPE_BIG_FORMAT "\n",
           mp_get_max_length(), mp_get_length());
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x1ebe(%rip), %r14      # 0x411c
movslq 0x4f2f(%rip), %rax      # 0x7194
cmpq %rax, %rbx
jge 0x22b5
movq 0x4f0f(%rip), %rax      # 0x7180
movl (%rax,%rbx,4), %edx
movq 0x4f0d(%rip), %rax      # 0x7188
movl (%rax,%rbx,4), %ecx
movsd 0x1e72(%rip), %xmm0     # 0x40f8
testl %ecx, %ecx
je 0x229e
cvtsi2sd %edx, %xmm0
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
mulsd 0x1e5a(%rip), %xmm0     # 0x40f8
movl %ecx, %r8d
subl %edx, %r8d
movq %r14, %rdi
movl %ebx, %esi
movb $0x1, %al
callq 0x10b0
incq %rbx
jmp 0x225e
callq 0x2305
movq %rax, %rbx
callq 0x22dd
leaq 0x1e7c(%rip), %rdi      # 0x4145
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/free/free.c
// Function: mp_get_length
size_type_big mp_get_length() {
    size_type_big now_length = 0;
    for (int i = 0; i < mp.bucket_number; ++i) {
        now_length += mp.length[i];
    }
    return now_length;
}

// Assembly:
movl 0x4eb1(%rip), %ecx      # 0x7194
movq 0x4e96(%rip), %rdx      # 0x7180
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x2304
movslq (%rdx,%rsi,4), %rdi
addq %rdi, %rax
incq %rsi
jmp 0x22f3
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/free/free.c
// Function: mp_get_max_length
size_type_big mp_get_max_length() {
    size_type_big max_length = 0;
    for (int i = 0; i < mp.bucket_number; ++i) {
        max_length += mp.max_length[i];
    }
    return max_length;
}

// Assembly:
movl 0x4e89(%rip), %ecx      # 0x7194
movq 0x4e76(%rip), %rdx      # 0x7188
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x232c
movslq (%rdx,%rsi,4), %rdi
addq %rdi, %rax
incq %rsi
jmp 0x231b
retq
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/free/free.c
// Function: mp_new
void *mp_new(size_type_small length) {
    int bucket;
    for (bucket = 0; bucket < mp.bucket_number; ++bucket) {
        if (mp.length[bucket] + length <= mp.max_length[bucket]) {
            void *ptr = mp.head[bucket] + mp.length[bucket];
            mp.length[bucket] += length;
            return ptr;
        }
    }

    printf("Can not make more memory. The memory pool is "
           "only " SIZE_TYPE_BIG_FORMAT " bytes, "
           "and " SIZE_TYPE_BIG_FORMAT
           " used, can not make more " SIZE_TYPE_SMALL_FORMAT " bytes\n",
           mp_get_max_length(), mp_get_length(), length);
    mp.error_callback();
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
movl 0x4e5a(%rip), %ecx      # 0x7194
movq 0x4e3f(%rip), %rax      # 0x7180
movq 0x4e40(%rip), %rdx      # 0x7188
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
cmpq %rsi, %rcx
je 0x237b
movslq (%rax,%rsi,4), %r14
leal (%r14,%rbx), %edi
leaq 0x1(%rsi), %r8
cmpl (%rdx,%rsi,4), %edi
movq %r8, %rsi
jg 0x234f
movq 0x4e09(%rip), %rcx      # 0x7178
addq -0x8(%rcx,%r8,8), %r14
movl %edi, -0x4(%rax,%r8,4)
jmp 0x23a9
callq 0x2305
movq %rax, %r15
callq 0x22dd
leaq 0x1ddf(%rip), %rdi      # 0x416e
xorl %r14d, %r14d
movq %r15, %rsi
movq %rax, %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10b0
xorl %eax, %eax
callq *0x4def(%rip)           # 0x7198
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/http/http.c
// Function: get_page
int get_page(char *prefix, char *url, char *ip, uint16_t port, char *reponse,
             int reponse_size) {
    int sock = socket(AF_INET, SOCK_STREAM, 0);

    struct sockaddr_in serv_addr;
    serv_addr.sin_family = AF_INET;
    serv_addr.sin_addr.s_addr = inet_addr(ip);
    serv_addr.sin_port = htons(port);

    int con = connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
    if (con != 0) {
        return F;
    }

    char request[MAX_REQUEST_LENGTH] = "\0";
    strcat(request, "GET ");
    strcat(request, prefix);
    strcat(request, url);
    strcat(request, " HTTP/1.1\r\n");
    strcat(request, "Host:");
    strcat(request, ip);
    strcat(request, "\r\nConnection:Keep-alive\r\n\r\n");

    write(sock, request, sizeof(request));

    int read_length = 0;
    while (1) {
        int ret =
            read(sock, reponse + read_length, reponse_size - read_length - 1);
        if (ret <= 0) {
            break;
        }
        read_length += ret;
    }

    close(sock);
    return read_length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movl %r9d, %ebx
movq %r8, %r14
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x1210
movl %eax, %ebp
leaq 0x20(%rsp), %rax
movw $0x2, (%rax)
movq %r15, 0x18(%rsp)
movq %r15, %rdi
callq 0x1100
leaq 0x20(%rsp), %rsi
movl %eax, 0x4(%rsi)
rolw $0x8, %r13w
movw %r13w, 0x2(%rsi)
pushq $0x10
popq %rdx
movl %ebp, %edi
callq 0x11d0
testl %eax, %eax
je 0x2433
leaq 0x1c75(%rip), %rax      # 0x40a0
movl (%rax), %r15d
jmp 0x2511
leaq 0x30(%rsp), %r13
movl $0x800, %edx            # imm = 0x800
movq %r13, %rdi
xorl %esi, %esi
callq 0x10c0
movq %r13, %rdi
callq 0x10a0
movl $0x20544547, 0x30(%rsp,%rax) # imm = 0x20544547
movb $0x0, 0x34(%rsp,%rax)
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x11b0
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0x11b0
movq %r13, %rdi
callq 0x10a0
movabsq $0x2e312f5054544820, %rcx # imm = 0x2E312F5054544820
movq %rcx, 0x30(%rsp,%rax)
movl $0xa0d31, 0x38(%rsp,%rax) # imm = 0xA0D31
movq %r13, %rdi
callq 0x10a0
movl $0x74736f48, 0x30(%rsp,%rax) # imm = 0x74736F48
movw $0x3a, 0x34(%rsp,%rax)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
callq 0x11b0
movq %r13, %rdi
callq 0x10a0
movups 0x1d24(%rip), %xmm0     # 0x41ec
movups %xmm0, 0x30(%rsp,%rax)
movups 0x1d24(%rip), %xmm0     # 0x41f8
movups %xmm0, 0x3c(%rsp,%rax)
movl $0x800, %edx            # imm = 0x800
movl %ebp, %edi
movq %r13, %rsi
callq 0x1070
movl %r12d, %r15d
movl %r12d, %esi
addq %r14, %rsi
movl %r12d, %eax
notl %eax
addl %ebx, %eax
movslq %eax, %rdx
movl %ebp, %edi
callq 0x10f0
leal (%r15,%rax), %r12d
testl %eax, %eax
jg 0x24e8
movl %ebp, %edi
callq 0x10e0
movl %r15d, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/kmp/kmp.c
// Function: kmp_get_next
void kmp_get_next(char *s, int *next) {
    next[0] = -1;

    for (int i = 1;; ++i) {
        if (s[i] == '\0')
            break;
        int t = next[i - 1];
        while (t != -1 && s[t] != s[i - 1])
            t = next[t];
        next[i] = (s[i - 1] == s[t] ? t + 1 : 0);
    }
}

// Assembly:
orl $-0x1, (%rsi)
pushq $0x1
popq %rax
xorl %ecx, %ecx
cmpb $0x0, (%rdi,%rax)
je 0x256a
leaq -0x1(%rax), %rdx
movb -0x1(%rdi,%rax), %r8b
movslq (%rsi,%rdx,4), %rdx
cmpq $-0x1, %rdx
je 0x2556
cmpb %r8b, (%rdi,%rdx)
jne 0x253f
incl %edx
movl %r8d, %r9d
jmp 0x255c
movb -0x1(%rdi), %r9b
xorl %edx, %edx
cmpb %r9b, %r8b
cmovnel %ecx, %edx
movl %edx, (%rsi,%rax,4)
incq %rax
jmp 0x2530
retq