LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x234a
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x4(%rdi), %edx
leaq 0x1dec(%rip), %rdi      # 0x40c0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
cmpl $0x0, 0x4(%rbx)
jle 0x2314
leaq 0x1df1(%rip), %r14      # 0x40dc
xorl %r15d, %r15d
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
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0x22ee
movl $0xa, %edi
callq 0x1030
cmpl $0x0, (%rbx)
jne 0x2345
cmpl $0x0, 0x4(%rbx)
jle 0x2345
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x22b7
incq %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jl 0x232c
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e0a(%rip), %r13      # 0x7170
xorl %ebp, %ebp
incq (%r13)
movl 0x4(%r15), %r12d
testl %r12d, %r12d
jle 0x2398
xorl %r12d, %r12d
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
callq *%rbx
testl %eax, %eax
jg 0x239d
incq %r12
movslq 0x4(%r15), %rax
cmpq %rax, %r12
jl 0x2378
movl %eax, %r12d
decl %r12d
jmp 0x23a5
subl $0x1, %r12d
cmovbl %ebp, %r12d
movq 0x8(%r15), %rax
movslq %r12d, %r12
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
callq *%rbx
testl %eax, %eax
je 0x23c9
cmpl $0x0, (%r15)
jne 0x23d2
movq 0x10(%r15), %rax
movq (%rax,%r12,8), %r15
jmp 0x2368
leaq 0x1ce8(%rip), %rax      # 0x40b8
jmp 0x23d9
leaq 0x1ce3(%rip), %rax      # 0x40bc
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x4d39(%rip), %rcx      # 0x7170
incq %rcx
xorl %edx, %edx
cmpb $0x0, (%rdi,%rdx)
movb (%rsi,%rdx), %r8b
je 0x2468
testb %r8b, %r8b
je 0x2470
leaq (%rcx,%rdx), %rax
movq %rax, 0x4d1a(%rip)      # 0x7170
movsbl (%rdi,%rdx), %eax
movsbl (%rsi,%rdx), %r8d
incq %rdx
subl %r8d, %eax
je 0x243c
retq
xorl %eax, %eax
negb %r8b
sbbl %eax, %eax
retq
movl $0x1, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x2488
popq %rbx
retq
leaq 0x1c61(%rip), %rdi      # 0x40f0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movl $0x1, %edi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O3/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 0x24d9
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x24d0
movb %al, (%r14,%rbx)
incq %rbx
jmp 0x24b0
testq %rbx, %rbx
jne 0x24de
xorl %ebx, %ebx
jmp 0x24f3
testq %rbx, %rbx
je 0x24e3
addq %rbx, %r14
jmp 0x24ef
movb $0xa, (%r14)
incq %r14
movl $0x1, %ebx
movb $0x0, (%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rdi, %r14
movq %rdi, %r12
shrq $0x1e, %r12
leal 0x1(%r12), %eax
movl %eax, 0x4c6a(%rip)      # 0x7194
movslq %eax, %r15
shlq $0x3, %r15
movq %r15, %rdi
callq 0x1150
movq %rax, 0x4c38(%rip)      # 0x7178
movq %r15, %rdi
callq 0x1150
movq %rax, 0x4c31(%rip)      # 0x7180
movq %r15, %rdi
callq 0x1150
movq %rax, 0x4c2a(%rip)      # 0x7188
cmpl $0x7ffffffe, %r12d      # imm = 0x7FFFFFFE
ja 0x2608
leaq 0x1ba6(%rip), %r15      # 0x4118
xorl %r13d, %r13d
movq %r14, %r12
movq %r14, %rbp
movq 0x4bfe(%rip), %rax      # 0x7180
movl $0x0, (%rax,%r13,4)
subq $0x40000000, %rbp       # imm = 0x40000000
jb 0x25ea
movl $0x40000000, %edi       # imm = 0x40000000
callq 0x1150
movq 0x4bd4(%rip), %rcx      # 0x7178
movq %rax, (%rcx,%r13,8)
movq 0x4bd9(%rip), %rax      # 0x7188
movl $0x40000000, (%rax,%r13,4) # imm = 0x40000000
movq 0x4bba(%rip), %rax      # 0x7178
cmpq $0x0, (%rax,%r13,8)
jne 0x25d6
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
xorl %eax, %eax
callq *%rbx
incq %r13
movslq 0x4bb4(%rip), %rax      # 0x7194
movq %rbp, %r12
cmpq %rax, %r13
jl 0x257b
jmp 0x2608
movq %r12, %rdi
callq 0x1150
movq 0x4b7f(%rip), %rcx      # 0x7178
movq %rax, (%rcx,%r13,8)
movq 0x4b84(%rip), %rax      # 0x7188
movl %r12d, (%rax,%r13,4)
movq %rbx, 0x4b89(%rip)      # 0x7198
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
cmpl $0x0, 0x4b6f(%rip)      # 0x7194
jle 0x26cd
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x1afc(%rip), %r14      # 0x4134
movq 0x4b41(%rip), %rax      # 0x7180
movl (%rax,%rbx,4), %edx
movq 0x4b3f(%rip), %rax      # 0x7188
movl (%rax,%rbx,4), %ecx
movsd 0x1abc(%rip), %xmm0     # 0x4110
testl %ecx, %ecx
je 0x2672
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
mulsd 0x1a9e(%rip), %xmm0     # 0x4110
movl %ecx, %r8d
subl %edx, %r8d
movq %r14, %rdi
movl %ebx, %esi
movb $0x1, %al
callq 0x10b0
incq %rbx
movslq 0x4b06(%rip), %rax      # 0x7194
cmpq %rax, %rbx
jl 0x2638
testl %eax, %eax
jle 0x26d3
movq 0x4aea(%rip), %rcx      # 0x7188
xorl %edx, %edx
xorl %esi, %esi
movslq (%rcx,%rdx,4), %rdi
addq %rdi, %rsi
incq %rdx
cmpq %rdx, %rax
jne 0x26a2
movq 0x4ac8(%rip), %rcx      # 0x7180
xorl %edi, %edi
xorl %edx, %edx
movslq (%rcx,%rdi,4), %r8
addq %r8, %rdx
incq %rdi
cmpq %rdi, %rax
jne 0x26bc
jmp 0x26d7
xorl %esi, %esi
xorl %edx, %edx
jmp 0x26de
xorl %esi, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
leaq 0x1a78(%rip), %rdi      # 0x415d
xorl %eax, %eax
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O3/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:
movslq 0x4aa1(%rip), %rcx      # 0x7194
testq %rcx, %rcx
jle 0x2713
movq 0x4a81(%rip), %rdx      # 0x7180
xorl %esi, %esi
xorl %eax, %eax
movslq (%rdx,%rsi,4), %rdi
addq %rdi, %rax
incq %rsi
cmpq %rsi, %rcx
jne 0x2703
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movslq 0x4a77(%rip), %rcx      # 0x7194
testq %rcx, %rcx
jle 0x273d
movq 0x4a5f(%rip), %rdx      # 0x7188
xorl %esi, %esi
xorl %eax, %eax
movslq (%rdx,%rsi,4), %rdi
addq %rdi, %rax
incq %rsi
cmpq %rsi, %rcx
jne 0x272d
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movl %edi, %ecx
movslq 0x4a4a(%rip), %rax      # 0x7194
testq %rax, %rax
jle 0x27b0
movq 0x4a2a(%rip), %rdx      # 0x7180
movq 0x4a2b(%rip), %rdi      # 0x7188
xorl %esi, %esi
movslq (%rdx,%rsi,4), %rbx
leal (%rbx,%rcx), %r8d
cmpl (%rdi,%rsi,4), %r8d
jle 0x27ce
incq %rsi
cmpq %rsi, %rax
jne 0x275f
testl %eax, %eax
jle 0x27b0
movq 0x4a08(%rip), %rdx      # 0x7188
xorl %edi, %edi
xorl %esi, %esi
movslq (%rdx,%rdi,4), %r8
addq %r8, %rsi
incq %rdi
cmpq %rdi, %rax
jne 0x2784
movq 0x49e6(%rip), %rdi      # 0x7180
xorl %r8d, %r8d
xorl %edx, %edx
movslq (%rdi,%r8,4), %r9
addq %r9, %rdx
incq %r8
cmpq %r8, %rax
jne 0x279f
jmp 0x27b4
xorl %esi, %esi
xorl %edx, %edx
leaq 0x19cb(%rip), %rdi      # 0x4186
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10b0
xorl %eax, %eax
callq *0x49cc(%rip)           # 0x7198
jmp 0x27dd
movq 0x49a3(%rip), %rax      # 0x7178
addq (%rax,%rsi,8), %rbx
movl %r8d, (%rdx,%rsi,4)
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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, %r12d
movq %rdx, %r15
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
xorl %r13d, %r13d
movl $0x2, %edi
movl $0x1, %esi
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, %r12w
movw %r12w, 0x2(%rsi)
movl %ebp, %edi
movl $0x10, %edx
callq 0x11d0
testl %eax, %eax
je 0x2869
leaq 0x185b(%rip), %rax      # 0x40bc
movl (%rax), %r15d
jmp 0x2947
leaq 0x30(%rsp), %r12
movl $0x800, %edx            # imm = 0x800
movq %r12, %rdi
xorl %esi, %esi
callq 0x10c0
movq %r12, %rdi
callq 0x10a0
movl $0x20544547, 0x30(%rsp,%rax) # imm = 0x20544547
movb $0x0, 0x34(%rsp,%rax)
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x11b0
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0x11b0
movq %r12, %rdi
callq 0x10a0
movabsq $0x2e312f5054544820, %rcx # imm = 0x2E312F5054544820
movq %rcx, 0x30(%rsp,%rax)
movl $0xa0d31, 0x38(%rsp,%rax) # imm = 0xA0D31
movq %r12, %rdi
callq 0x10a0
movl $0x74736f48, 0x30(%rsp,%rax) # imm = 0x74736F48
movw $0x3a, 0x34(%rsp,%rax)
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x11b0
movq %r12, %rdi
callq 0x10a0
movups 0x1906(%rip), %xmm0     # 0x4204
movups %xmm0, 0x30(%rsp,%rax)
movups 0x1906(%rip), %xmm0     # 0x4210
movups %xmm0, 0x3c(%rsp,%rax)
movl $0x800, %edx            # imm = 0x800
movl %ebp, %edi
movq %r12, %rsi
callq 0x1070
movl %r13d, %r15d
movl %r13d, %esi
addq %r14, %rsi
movl %r13d, %eax
notl %eax
addl %ebx, %eax
movslq %eax, %rdx
movl %ebp, %edi
callq 0x10f0
leal (%r15,%rax), %r13d
testl %eax, %eax
jg 0x291e
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
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
cmpb $0x0, 0x1(%rdi)
je 0x29a9
movl $0x1, %ecx
xorl %eax, %eax
leaq -0x1(%rcx), %rdx
movb -0x1(%rdi,%rcx), %r8b
movslq (%rsi,%rdx,4), %rdx
cmpq $-0x1, %rdx
je 0x298f
cmpb %r8b, (%rdi,%rdx)
jne 0x2978
incl %edx
movl %r8d, %r9d
jmp 0x2995
movb -0x1(%rdi), %r9b
xorl %edx, %edx
cmpb %r9b, %r8b
cmovnel %eax, %edx
movl %edx, (%rsi,%rcx,4)
cmpb $0x0, 0x1(%rdi,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x296f
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/kmp/kmp.c
// Function: kmp_char
void kmp_char(char c, char *pattern, int *pattern_pos, int *next, int *ans) {
    while (*pattern_pos != -1 && compare_char_macro(c, pattern[*pattern_pos])) {
        *pattern_pos = next[*pattern_pos];
    }
    if (!compare_char_macro(pattern[++(*pattern_pos)], '\0')) {
        ++(*ans);
        *pattern_pos =
            next[*pattern_pos - 1] + (next[*pattern_pos - 1] == 0 ? 0 : 1);
    }
}

// Assembly:
movl (%rdx), %r9d
leaq 0x47bc(%rip), %rax      # 0x7170
movq (%rax), %r10
cmpl $-0x1, %r9d
je 0x29ee
incq %r10
movq %r10, %r11
movq %r11, %r10
movq %r11, (%rax)
movslq %r9d, %r11
cmpb %dil, (%rsi,%r11)
je 0x29e9
movl (%rcx,%r11,4), %r9d
movl %r9d, (%rdx)
leaq 0x1(%r10), %r11
cmpl $-0x1, %r9d
jne 0x29c3
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
incl %r9d
jmp 0x29f1
xorl %r9d, %r9d
incq %r10
movq %r10, (%rax)
movl %r9d, (%rdx)
movslq %r9d, %rax
cmpb $0x0, (%rsi,%rax)
je 0x2a04
retq
incl (%r8)
movslq (%rdx), %rax
movl -0x4(%rcx,%rax,4), %eax
cmpl $0x1, %eax
sbbl $-0x1, %eax
movl %eax, (%rdx)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/link_list/link_list.c
// Function: lk_init
link_list *lk_init() {
    link_list *lk = mp_new(sizeof(link_list));
    lk->head = lk->tail = NULL;
    lk->length = 0;
    return lk;
}

// Assembly:
pushq %rax
movl $0x20, %edi
callq 0x2740
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x0, 0x10(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/link_list/link_list.c
// Function: lk_node
linked_node *lk_node(void *ptr) {
    linked_node *node = NULL;
    if (_link_node_unused == NULL) {
        node = mp_new(sizeof(linked_node));
    } else {
        node = _link_node_unused;
        _link_node_unused = _link_node_unused->next;
    }
    node->next = NULL;
    node->value = ptr;
    return node;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x4763(%rip), %rax      # 0x71a0
testq %rax, %rax
je 0x2a4f
movq 0x8(%rax), %rcx
movq %rcx, 0x4753(%rip)      # 0x71a0
jmp 0x2a59
movl $0x10, %edi
callq 0x2740
movq $0x0, 0x8(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/link_list/link_list.c
// Function: lk_add
void lk_add(link_list *lk, void *ptr) {
    linked_node *node = lk_node(ptr);
    if (lk_empty(lk)) {
        lk->head = lk->tail = node;
    } else {
        lk->tail->next = node;
        lk->tail = node;
    }
    ++lk->length;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4729(%rip), %rax      # 0x71a0
testq %rax, %rax
je 0x2a89
movq 0x8(%rax), %rcx
movq %rcx, 0x4719(%rip)      # 0x71a0
jmp 0x2a93
movl $0x10, %edi
callq 0x2740
movq $0x0, 0x8(%rax)
movq %r14, (%rax)
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movq (%rbx), %rsi
orq %rcx, %rsi
setne %dl
cmoveq %rbx, %rcx
movq %rax, 0x8(%rcx)
movq %rax, (%rbx,%rdx,8)
incl 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/link_list/link_list.c
// Function: lk_remove
void lk_remove(link_list *lk, linked_node *ptr) {
    linked_node *p = lk->head;

    if (p == ptr) {
        p = lk->head = ptr->next;
    } else {
        while (p != NULL && p->next != ptr) {
            p = p->next;
        }
        if (p != NULL && p->next == ptr) {
            p->next = ptr->next;
            --lk->length;
            ptr->next = _link_node_unused;
            _link_node_unused = ptr->next;
        }
    }
    if (lk->tail == ptr) {
        lk->tail = p;
    }
}

// Assembly:
movq (%rdi), %rcx
cmpq %rsi, %rcx
je 0x2b09
testq %rcx, %rcx
je 0x2b12
movq %rcx, %rax
movq 0x8(%rcx), %rcx
cmpq %rsi, %rcx
jne 0x2ae0
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rax)
decl 0x10(%rdi)
movq 0x469d(%rip), %rcx      # 0x71a0
movq %rcx, 0x8(%rsi)
jmp 0x2b14
movq 0x8(%rsi), %rax
movq %rax, (%rdi)
jmp 0x2b14
xorl %eax, %eax
cmpq %rsi, 0x8(%rdi)
je 0x2b1b
retq
movq %rax, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/link_list/link_list.c
// Function: lk_search
linked_node *lk_search(link_list *lk, void *target,
                       boolean (*compare)(void *value, void *target)) {
    if (lk_empty(lk)) {
        return NULL;
    }
    linked_node *ptr = lk->head;

    while (ptr != NULL) {
        if (compare(ptr->value, target)) {
            break;
        }
        ptr = ptr->next;
    }
    return ptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x2b49
movq %rdx, %r14
movq %rsi, %r15
movq (%rbx), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
jne 0x2b4b
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x2b33
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/print/print.c
// Function: print
int print(int c, char *fmt, ...) {
    va_list args; //定义一个va_list类型的变量，用来储存单个参数
    va_start(args, fmt); //使args指向可变参数的第一个参数
    begin(c);
    int ret = vprintf(fmt, args); //必须用vprintf等带V的
    end();
    va_end(args); //结束可变参数的获取
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2bdc
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, %r14
movq %rsi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
callq 0x2b54
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1160
movl %eax, %ebx
leaq 0x164b(%rip), %rdi      # 0x4260
xorl %eax, %eax
callq 0x10b0
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/print/print.c
// Function: print_ok
int print_ok(char *fmt, ...) {
    va_list args;
    va_start(args, fmt);
    begin(GREEN);
    int ret = vfprintf(stdout, fmt, args);
    end();
    va_end(args);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2c8a
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, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
leaq 0x157f(%rip), %rdi      # 0x4230
xorl %eax, %eax
callq 0x10b0
movq 0x4319(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11a0
movl %eax, %ebx
leaq 0x158a(%rip), %rdi      # 0x4260
xorl %eax, %eax
callq 0x10b0
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree.c
// Function: rt_init
radix_tree *rt_init(int k) {
    radix_tree *rt = mp_new(sizeof(radix_tree));
    rt->k = k;
    rt->temp = bits_init();
    return rt;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x18, %edi
callq 0x2740
movq %rax, %r14
movl %ebx, 0x8(%rax)
xorl %eax, %eax
callq 0x176c
movq %rax, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree.c
// Function: rt_add
void rt_add(radix_tree *rt, void *value, int size) {
    rt->temp->start = 0;
    rt->temp->end = size * 8;
    rt->temp->value = value;

    // printf("Add %s ", (char *)value);
    // bits_print(rt->temp);
    // printf("\n");

    rt->root = rtn_add(rt->root, rt->temp, rt->k, T);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movl $0x0, 0x8(%rax)
shll $0x3, %edx
movl %edx, 0xc(%rax)
movq %rsi, (%rax)
movq (%rdi), %rdi
movl 0x8(%rbx), %edx
leaq 0x137b(%rip), %rcx      # 0x40b8
movl (%rcx), %ecx
movq %rax, %rsi
callq 0x2e91
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree_node.c
// Function: rtn_get_child_key
int rtn_get_child_key(bits *value, int prefix, int k) {
    int l = bits_len(value);
    if (prefix > l) {
        print_err("Uncepted error: prefix %d and value is ", prefix);
        bits_print(value);
        print_err("\n");
        exit(1);
    }
    int key = 0;
    for (int i = 0; i < k && i + prefix < l; ++i) {
        key = (key << 1) | bits_get(value, i + prefix);
    }
    return key;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x19a2
cmpl %ebp, %eax
jl 0x2e17
testl %r14d, %r14d
jle 0x2e08
movl %eax, %r15d
xorl %r12d, %r12d
cmpl %ebp, %r15d
je 0x2e0b
addl %r12d, %r12d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1965
orl %eax, %r12d
incl %ebp
decl %r14d
jne 0x2dea
jmp 0x2e0b
xorl %r12d, %r12d
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x146a(%rip), %rdi      # 0x4288
movl %ebp, %esi
xorl %eax, %eax
callq 0x1230
movq %rbx, %rdi
callq 0x1a51
leaq 0x127d(%rip), %rdi      # 0x40b3
xorl %eax, %eax
callq 0x1230
movl $0x1, %edi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree_node.c
// Function: rtn_init
radix_tree_node *rtn_init(int k) {
    int m = pow2(k);
    ++_radix_node_number;
    _radix_nodemem += sizeof(radix_tree_node) + sizeof(radix_tree_node *) * m;
    radix_tree_node *rtn = mp_new(sizeof(radix_tree_node));
    rtn->children = mp_new(sizeof(radix_tree_node *) * m);
    return rtn;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x2d94
incl 0x4352(%rip)            # 0x71a8
movl 0x4354(%rip), %ecx      # 0x71b0
leal (,%rax,8), %ebx
leal (%rcx,%rax,8), %eax
addl $0x18, %eax
movl %eax, 0x4341(%rip)      # 0x71b0
movl $0x18, %edi
callq 0x2740
movq %rax, %r14
movl %ebx, %edi
callq 0x2740
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree_node.c
// Function: rtn_exist
boolean rtn_exist(radix_tree_node *rtn, bits *value, int k) {
    if (rtn == NULL) {
        return F;
    }
    ++compare_number;

    int prefix = bits_prefix(rtn->value, value, k);
    if (prefix != bits_len(rtn->value)) {
        return F;
    }

    if (prefix == bits_len(value) && rtn->end_of_value == T) {
        return T;
    }

    int key = rtn_get_child_key(value, prefix, k);
    value->start += prefix;

    return rtn_exist(rtn->children[key], value, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3050
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10c6(%rip), %rax      # 0x40b8
movl (%rax), %ebx
leaq 0x4175(%rip), %r13      # 0x7170
incq (%r13)
movq 0x10(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x19a9
movl %eax, %r12d
movq 0x10(%r15), %rdi
callq 0x19a2
cmpl %eax, %r12d
jne 0x3050
movq %r14, %rdi
callq 0x19a2
cmpl %eax, %r12d
jne 0x3031
cmpl %ebx, 0x8(%r15)
je 0x3059
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x2dc6
addl %r12d, 0x8(%r14)
movq (%r15), %rcx
cltq
movq (%rcx,%rax,8), %r15
testq %r15, %r15
jne 0x2ffb
leaq 0x1065(%rip), %rax      # 0x40bc
movl (%rax), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/radix_tree/radix_tree_node.c
// Function: rtn_print
void rtn_print(radix_tree_node *rtn, int m) {
    if (rtn == NULL) {
        return;
    }
    printf("%p %d ", rtn, rtn->end_of_value);
    bits_print(rtn->value);
    printf("\n\t");
    for (int i = 0; i < m; ++i) {
        printf("%p ", rtn->children[i]);
    }
    printf("\n");

    for (int i = 0; i < m; ++i) {
        rtn_print(rtn->children[i], m);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x30fd
movl %esi, %ebx
movq %rdi, %r14
movl 0x8(%rdi), %edx
leaq 0x1225(%rip), %rdi      # 0x42b0
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movq 0x10(%r14), %rdi
callq 0x1a51
leaq 0x1212(%rip), %rdi      # 0x42b7
xorl %eax, %eax
callq 0x10b0
testl %ebx, %ebx
jle 0x3107
movl %ebx, %r12d
leaq 0x1200(%rip), %r15      # 0x42ba
xorl %r13d, %r13d
movq (%r14), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x10b0
incq %r13
cmpq %r13, %r12
jne 0x30bd
movl $0xa, %edi
callq 0x1030
testl %ebx, %ebx
jle 0x30fd
xorl %r15d, %r15d
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x306a
incq %r15
cmpq %r15, %r12
jne 0x30e7
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0xa, %edi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1030
nop
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/sort/sort.c
// Function: sort
void sort(int l, int r, void *args, sort_compare_function compare,
          sort_swap_function swap) {
    if (l < r) {
        int left = l;
        int right = r;
        int mid = l;

        int a = compare(args, l, r), b = compare(args, l, (l + r) / 2),
            c = compare(args, (l + r) / 2, r);
        if (a == b && b == c) {
            mid = (l + r) / 2;
        } else if (a == c) {
            mid = l;
        } else {
            mid = r;
        }

        while (left < right) {
            while (left < right && mid < right &&
                   compare(args, mid, right) < 0) {
                right--;
            }
            if (left < right && mid < right) {
                swap(args, left++, right);
                mid = right;
            }
            while (left < right && left < mid && compare(args, left, mid) < 0) {
                left++;
            }
            if (left < right && left < mid) {
                swap(args, left, right--);
                mid = left;
            }
        }
        // swap(left, mid);

        // 递归调用
        sort(l, mid - 1, args, compare, swap); // 排序mid左边
        sort(mid + 1, r, args, compare, swap); // 排序mid右边
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, (%rsp)
cmpl %esi, %edi
jge 0x324a
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebx
movl %edi, %r12d
movq %rbx, 0x10(%rsp)
movq %r15, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq *%r14
movl %eax, %r13d
leal (%r12,%rbx), %eax
movq %r12, %rsi
movq %r12, 0x8(%rsp)
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movq %r15, %rdi
movl %r12d, %edx
callq *%r14
movl %eax, %ebp
movq %r15, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq *%r14
movl %r13d, %ecx
xorl %ebp, %ecx
xorl %eax, %ebp
cmpl %eax, %r13d
movl %ebx, %r13d
movq 0x8(%rsp), %rax
cmovel %eax, %r13d
orl %ecx, %ebp
cmovel %r12d, %r13d
movl %eax, %r12d
movl %ebx, %ebp
cmpl %r13d, %r12d
movl %r13d, %ebx
cmovgl %r12d, %ebx
cmpl %ebx, %ebp
jle 0x31db
movq %r15, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq *%r14
testl %eax, %eax
jns 0x31c5
decl %ebp
jmp 0x31ae
leal 0x1(%r12), %ebx
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq *(%rsp)
movl %ebp, %r13d
movl %ebx, %r12d
cmpl %r13d, %ebp
movl %r13d, %ebx
cmovll %ebp, %ebx
cmpl %ebx, %r12d
jge 0x3219
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq *%r14
testl %eax, %eax
jns 0x3206
incl %r12d
cmpl %r12d, %ebx
jne 0x31e9
movl %ebx, %r12d
jmp 0x3219
leal -0x1(%rbp), %ebx
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq *(%rsp)
movl %r12d, %r13d
movl %ebx, %ebp
cmpl %ebp, %r12d
jl 0x31a4
leal -0x1(%r13), %esi
movq 0x8(%rsp), %rdi
movq %r15, %rdx
movq %r14, %rcx
movq (%rsp), %r8
callq 0x311c
incl %r13d
movl %r13d, %r12d
movq 0x10(%rsp), %rbx
cmpl %ebx, %r13d
jl 0x3146
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/thread/thread.c
// Function: tp_new
thread_pool *tp_new(int thread_number, int mutex_number, thread_function tf) {
    thread_pool *tp = mp_new(sizeof(thread_pool));
    tp->thread_number = thread_number;
    tp->mutex_number = mutex_number;

    tp->thread_list = mp_new(sizeof(pthread_t) * thread_number);

    tp->mutex = mp_new(sizeof(pthread_mutex_t *) * mutex_number);
    for (int i = 0; i < tp->mutex_number; ++i) {
        tp->mutex[i] = mp_new(sizeof(pthread_mutex_t));
        pthread_mutex_init(tp->mutex[i], NULL);
    }

    for (int i = 0; i < tp->thread_number; ++i) {
        int ret = pthread_create(&tp->thread_list[i], NULL, tf, tp);
        if (ret != 0) {
            perror("pthread_create error:" + ret);
            exit(EXIT_FAILURE);
        }
    }

    return tp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r15d
movl $0x18, %edi
callq 0x2740
movq %rax, %r14
movl %r15d, (%rax)
movl %ebp, 0x4(%rax)
shll $0x3, %r15d
movl %r15d, %edi
callq 0x2740
movq %rax, 0x8(%r14)
shll $0x3, %ebp
movl %ebp, %edi
callq 0x2740
movq %rax, 0x10(%r14)
cmpl $0x0, 0x4(%r14)
jle 0x32d4
xorl %r15d, %r15d
movl $0x28, %edi
callq 0x2740
movq 0x10(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
callq 0x11f0
incq %r15
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jl 0x32a7
cmpl $0x0, (%r14)
jle 0x3307
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1170
testl %eax, %eax
jne 0x3313
incq %r12
movslq (%r14), %rax
addq $0x8, %r15
cmpq %rax, %r12
jl 0x32e0
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x12f1
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/thread/thread.c
// Function: tp_wait
void tp_wait(thread_pool *tp) {
    for (int i = 0; i < tp->thread_number; ++i) {
        int ret = pthread_join(tp->thread_list[i], NULL);
        if (ret != 0) {
            perror("pthread_join error: " + ret);
            exit(EXIT_FAILURE);
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, (%rdi)
jle 0x3347
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x11e0
testl %eax, %eax
jne 0x334f
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x3329
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x130c
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/thread/thread.c
// Function: tp_lock
void tp_lock(thread_pool *tp, int idx) {
    int ret = pthread_mutex_lock(tp->mutex[idx]);
    if (ret != 0) {
        perror("pthread_mutex_lock error: " + ret);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rax
movq 0x10(%rdi), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1200
testl %eax, %eax
jne 0x336d
popq %rax
retq
movl %eax, %edi
callq 0x1327
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/thread/thread.c
// Function: tp_unlock
void tp_unlock(thread_pool *tp, int idx) {
    int ret = pthread_mutex_unlock(tp->mutex[idx]);
    if (ret != 0) {
        perror("pthread_mutex_unlock error: " + ret);
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rax
movq 0x10(%rdi), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1140
testl %eax, %eax
jne 0x338b
popq %rax
retq
movl %eax, %edi
callq 0x1342
nop
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/pattern_match/strstr/strstr.c
// Function: rollback
void rollback(int index) {
    // pos[index] = 0;
    // return;
    int     temp = 2;
    boolean end = F;
    while (!end) {
        for (int i = pos[index] - temp, p = 0;; --i, ++p) {
            if (i <= 0) {
                // match
                pos[index] = compare_char(string[i], patterns[index][p]) == 0
                                 ? p + 1
                                 : 0;
                end = T;
                break;
            }
            if (compare_char(string[i], patterns[index][p]) != 0) {
                ++temp;
                break;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xd16(%rip), %rax       # 0x40bc
cmpl $0x0, (%rax)
je 0x33ba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %edi, %rbx
leaq 0xcf4(%rip), %rax       # 0x40b8
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x2, %r14d
movslq %r14d, %r12
movq 0x3dde(%rip), %rax      # 0x71b8
movslq (%rax,%rbx,4), %r13
subq %r12, %r13
testl %r13d, %r13d
jle 0x341b
movl %r13d, %r15d
xorl %ebp, %ebp
movq 0x3dce(%rip), %rax      # 0x71c0
movsbl (%rax,%r15), %edi
movq 0x3dca(%rip), %rax      # 0x71c8
movq (%rax,%rbx,8), %rax
movsbl (%rax,%rbp), %esi
callq 0x2424
testl %eax, %eax
jne 0x346c
incq %rbp
decq %r15
jne 0x33eb
xorl %eax, %eax
jmp 0x3421
movq %r13, %rax
xorl %r13d, %r13d
movq 0x3d98(%rip), %rcx      # 0x71c0
movsbl (%rcx,%rax), %edi
movq 0x3d95(%rip), %rax      # 0x71c8
movq (%rax,%rbx,8), %rax
movl %r13d, %ecx
movsbl (%rax,%rcx), %esi
callq 0x2424
incl %r13d
testl %eax, %eax
movl $0x0, %eax
cmovnel %eax, %r13d
movq 0x3d60(%rip), %rax      # 0x71b8
movl %r13d, (%rax,%rbx,4)
cmpl $0x0, 0x4(%rsp)
je 0x33d3
jmp 0x33ab
incl %r14d
jmp 0x33d0
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/pattern_match/strstr/strstr.c
// Function: match
void match(char c, int index) {
    if (compare_char(c, patterns[index][pos[index]++]) == 0) {
        if (compare_char('\0', patterns[index][pos[index]]) == 0) {
            ++count[index];
            rollback(index);
        }
    } else {
        rollback(index);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x3d47(%rip), %rax      # 0x71c8
movslq %esi, %r14
movq (%rax,%r14,8), %rax
movq 0x3d29(%rip), %rcx      # 0x71b8
movslq (%rcx,%r14,4), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rcx,%r14,4)
movsbl (%rax,%rdx), %esi
callq 0x2424
testl %eax, %eax
je 0x34b5
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3394
movq 0x3d0c(%rip), %rax      # 0x71c8
movq (%rax,%r14,8), %rax
movq 0x3cf1(%rip), %rcx      # 0x71b8
movslq (%rcx,%r14,4), %rcx
movsbl (%rax,%rcx), %esi
xorl %edi, %edi
callq 0x2424
testl %eax, %eax
je 0x34e2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3ce7(%rip), %rax      # 0x71d0
incl (%rax,%r14,4)
jmp 0x34a7
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/pattern_match/strstr/strstr.c
// Function: compare
int compare(void *args, int i, int j) {
    char **args_patterns = (char **)(((void **)args)[0]);
    int *  args_count = (int *)(((void **)args)[1]);

    int res = args_count[j] - args_count[i];
    if (res == 0) {
        res = compare_string(args_patterns[i], args_patterns[j]);
    }
    return res;
}

// Assembly:
movq 0x8(%rdi), %r8
movslq %edx, %rcx
movl (%r8,%rcx,4), %eax
movslq %esi, %rdx
subl (%r8,%rdx,4), %eax
je 0x3504
retq
movq (%rdi), %rax
movq (%rax,%rdx,8), %rdi
movq (%rax,%rcx,8), %rsi
jmp 0x2430
// File: /workspace/github_c_makefile_star2_O3/eridanhq[P]miraclelib/miraclelib.c
// Function: ad9173_freq_calc
void ad9173_freq_calc(uint64_t fLO, uint64_t *A, uint64_t *B, uint64_t *X)
{
	uint64_t fDAC, c1, c2, M, N, Y; // need 64-bit computation

	fDAC = (uint64_t) 9.6e9; // needs to match AD9173 DAC frequency
	c1 = gcd(fLO,fDAC); // compute GCD of fLO and fDAC

	/* DDS modulus works using following equation:
	 * fLO/fDAC = M/N
	 *          = (X + A/B)/(2^48)
	 */

	M =  fLO/c1; // compute rational fraction M/N
	N = fDAC/c1;

	*X = (M << 48)/N; // Computer integer X
	Y = (M << 48) - (*X)*N; // Compute remainder y
	c2 = gcd(Y,N);
	*A = Y/c2; // Compute A/B modulus
	*B = N/c2;

	//printf("X=0x%" PRIX64 "\n", *X);
	//printf("A=0x%" PRIX64 "\n", *A);
	//printf("B=0x%" PRIX64 "\n", *B);
}

// Assembly:
movq %rdx, %r8
movabsq $0x23c346000, %rdx      # imm = 0x23C346000
movq %rdi, %r10
movq %r10, %rax
movq %rdx, %r10
xorl %edx, %edx
divq %r10
testq %rdx, %rdx
jne 0x180b
movq %rdi, %rax
xorl %edx, %edx
divq %r10
movq %rax, %r9
movabsq $0x23c346000, %rax      # imm = 0x23C346000
xorl %edx, %edx
divq %r10
movq %rax, %rdi
shlq $0x30, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rdi
movq %rdx, %r9
movq %rax, (%rcx)
movq %rdi, %rdx
movq %r9, %rcx
movq %rcx, %rax
movq %rdx, %rcx
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x1850
movq %r9, %rax
xorl %edx, %edx
divq %rcx
movq %rax, (%rsi)
movq %rdi, %rax
xorl %edx, %edx
divq %rcx
movq %rax, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/eridanhq[P]miraclelib/miraclelib.c
// Function: init_tx
int init_tx(void *mapped_base)
{
	int jesd_phase; // jesd phase readback value
	int done = 0; // done flag
	ad9173_resync(mapped_base); // Sync AD9173 subclass 1
	usleep(100000); //100 msec pause
	write_reg_tx(32,1,mapped_base); // CS to AD9173
	write_reg_tx(33,0x830200,mapped_base); // readback LMFC delay
	jesd_phase = read_reg_tx(34, mapped_base);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1a61
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x1130
movl $0x830200, 0xcc(%rbx)   # imm = 0x830200
movl $0x22, (%rbx)
movl $0xfa, %edi
popq %rbx
jmp 0x1130
// File: /workspace/github_c_makefile_star2_O3/eridanhq[P]miraclelib/miraclelib.c
// Function: set_pwr_tx
void set_pwr_tx(int pwr_ctrl_reg, void *mapped_base)
{
	// Handle boundaries
	if (pwr_ctrl_reg > 32767) 
	{
		printf("Input is too large.\n\r");
		pwr_ctrl_reg = 32767;
	}
	else if(pwr_ctrl_reg < 0)
	{
		printf("Input is too small.\n\r");
		pwr_ctrl_reg = 0;
	}

	write_reg_tx(66, pwr_ctrl_reg, mapped_base); // set power level
	printf("Power is set to: %d\n", pwr_ctrl_reg);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpl $0x7fff, %edi           # imm = 0x7FFF
jle 0x1b20
movl $0x7fff, %ebx           # imm = 0x7FFF
leaq 0x63c(%rip), %rdi       # 0x215a
jmp 0x1b2f
movl %edi, %ebx
testl %edi, %edi
jns 0x1b36
xorl %ebx, %ebx
leaq 0x641(%rip), %rdi       # 0x2170
xorl %eax, %eax
callq 0x10a0
movl $0x80000042, (%r14)     # imm = 0x80000042
movl %ebx, 0xcc(%r14)
leaq 0x63b(%rip), %rdi       # 0x2186
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O3/eridanhq[P]miraclelib/miraclelib.c
// Function: on_tx
void on_tx(void *mapped_base)
{
	int pwr_supp_reg;
	// Check state of power supplies
	pwr_supp_reg = read_reg_tx(36,mapped_base);
	if (pwr_supp_reg == 14)
	{
		write_reg_tx(66,32767,mapped_base); // signal gain max
	}
	else
	{
		printf("Supplies not in proper condition\n");
	}

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x24, (%rdi)
movl $0xfa, %edi
callq 0x1130
cmpl $0xe, (%rbx)
jne 0x1b86
movl $0x80000042, (%rbx)     # imm = 0x80000042
movl $0x7fff, 0xcc(%rbx)     # imm = 0x7FFF
popq %rbx
retq
leaq 0x70d(%rip), %rdi       # 0x229a
popq %rbx
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O3/eridanhq[P]miraclelib/miraclelib.c
// Function: set_freq_tx
void set_freq_tx(double fLO_in, void *mapped_base)
{
	int tab_line, fLO_mhz;
	char cmd_buff[50];
	uint64_t fLO;

	fLO = (uint64_t) fLO_in;

	if (fLO > 3700e6) // if input freq is too high, set to 3000
	{
		printf("Freq is too large, calibrating to 3700\n");
		fLO = 3700e6;
	}
	else if (fLO < 600e6) // if input freq is too low, set to 200
	{
		printf("Freq is too small, calibrating to 600\n");
		fLO = 600e6;
	}
	fLO_mhz = (int) (fLO/1e6);
	tab_line = (fLO_mhz+12)/25-24; // calculate line in air param matrix 

	//printf("fLO_mhz: %d\n", fLO_mhz);
	//printf("tab_line: %d\n", tab_line);

	write_reg_tx(64, tab_line, mapped_base); // calibrate
	ad9173_freq(fLO, mapped_base);

	//printf("A=0x%" PRIx64 "\n", A);
	sprintf(cmd_buff, "echo %lf > FLO", fLO_in);
	system(cmd_buff);
	return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0xdc898500, %r14d      # imm = 0xDC898500
cvttsd2si %xmm0, %rax
movq %rax, %rcx
movapd %xmm0, (%rsp)
subsd 0x474(%rip), %xmm0      # 0x2078
cvttsd2si %xmm0, %rdi
sarq $0x3f, %rcx
andq %rcx, %rdi
orq %rax, %rdi
cmpq %r14, %rdi
jbe 0x1c21
leaq 0x6c2(%rip), %rdi       # 0x22e1
jmp 0x1c37
cmpq $0x23c345ff, %rdi       # imm = 0x23C345FF
ja 0x1c3f
movl $0x23c34600, %r14d      # imm = 0x23C34600
leaq 0x684(%rip), %rdi       # 0x22bb
callq 0x1060
movq %r14, %rdi
xorps %xmm0, %xmm0
cvtsi2sd %rdi, %xmm0
divsd 0x431(%rip), %xmm0      # 0x2080
cvttsd2si %xmm0, %eax
addl $0xc, %eax
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
sarq $0x23, %rcx
shrq $0x3f, %rax
addl %ecx, %eax
addl $-0x18, %eax
movl $0x80000040, (%rbx)     # imm = 0x80000040
movl %eax, 0xcc(%rbx)
movq %rbx, %rsi
callq 0x1877
leaq 0x517(%rip), %rsi       # 0x21a1
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movaps (%rsp), %xmm0
movb $0x1, %al
callq 0x1110
movq %rbx, %rdi
callq 0x1090
addq $0x48, %rsp
popq %rbx
popq %r14
retq