LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/kthread.c
// Function: kt_pipeline
void kt_pipeline(int n_threads, void *(*func)(void*, int, void*), void *shared_data, int n_steps)
{
	ktp_t aux;
	pthread_t *tid;
	int i;

	if (n_threads < 1) n_threads = 1;
	aux.n_workers = n_threads;
	aux.n_steps = n_steps;
	aux.func = func;
	aux.shared = shared_data;
	pthread_mutex_init(&aux.mutex, 0);
	pthread_cond_init(&aux.cv, 0);

	aux.workers = alloca(n_threads * sizeof(ktp_worker_t));
	for (i = 0; i < n_threads; ++i) {
		ktp_worker_t *w = &aux.workers[i];
		w->step = w->running = 0; w->pl = &aux; w->data = 0;
	}

	tid = alloca(n_threads * sizeof(pthread_t));
	for (i = 0; i < n_threads; ++i) pthread_create(&tid[i], 0, ktp_worker, &aux.workers[i]);
	for (i = 0; i < n_threads; ++i) pthread_join(tid[i], 0);

	pthread_mutex_destroy(&aux.mutex);
	pthread_cond_destroy(&aux.cv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
cmpl $0x2, %edi
movl $0x1, %r15d
cmovgel %edi, %r15d
leaq -0x88(%rbp), %rdi
movl %r15d, -0x10(%rdi)
movl %ecx, -0xc(%rdi)
movq %rsi, -0x18(%rdi)
movq %rdx, -0x20(%rdi)
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2270
leaq -0x60(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x2180
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r14
leaq (%rax,%rax,2), %rax
addq $0xf, %rax
movabsq $0x1ffffffff0, %rcx     # imm = 0x1FFFFFFFF0
andq %rax, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x30(%r12)
xorps %xmm0, %xmm0
leaq -0xa8(%rbp), %rcx
movups %xmm0, 0x8(%rax,%rbx)
movq %rcx, (%rax,%rbx)
addq $0x18, %rbx
cmpq %rbx, %r14
jne 0x25c7
movq %rsp, %rbx
movq %r15, -0x30(%rbp)
leaq 0xf(,%r15,8), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
xorl %r13d, %r13d
leaq 0x65(%rip), %r15        # 0x2661
movq %rbx, %r12
movq -0x90(%rbp), %rcx
addq %r13, %rcx
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x21e0
addq $0x18, %r13
addq $0x8, %r12
cmpq %r13, %r14
jne 0x25ff
xorl %r14d, %r14d
movq -0x30(%rbp), %r15
movq (%rbx,%r14,8), %rdi
xorl %esi, %esi
callq 0x2250
incq %r14
cmpq %r14, %r15
jne 0x262a
leaq -0x88(%rbp), %rdi
callq 0x20f0
leaq -0x60(%rbp), %rdi
callq 0x2210
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/kthread.c
// Function: ktp_worker
static void *ktp_worker(void *data)
{
	ktp_worker_t *w = (ktp_worker_t*)data;
	ktp_t *p = w->pl;
	while (w->step < p->n_steps) {
		// test whether we can kick off the job with this worker
		pthread_mutex_lock(&p->mutex);
		for (;;) {
			int i;
			// test whether another worker is doing the same step
			for (i = 0; i < p->n_workers; ++i) {
				if (w == &p->workers[i]) continue; // ignore itself
				if (p->workers[i].running && p->workers[i].step == w->step)
					break;
			}
			if (i == p->n_workers) break; // no other workers doing w->step; then this worker will
			pthread_cond_wait(&p->cv, &p->mutex);
		}
		w->running = 1;
		pthread_mutex_unlock(&p->mutex);

		// working on w->step
		w->data = p->func(p->shared, w->step, w->step? w->data : 0); // for the first step, input is NULL

		// update step and let other workers know
		pthread_mutex_lock(&p->mutex);
		w->step = w->step == p->n_steps - 1 || w->data? (w->step + 1) % p->n_steps : p->n_steps;
		w->running = 0;
		pthread_cond_broadcast(&p->cv);
		pthread_mutex_unlock(&p->mutex);
	}
	pthread_exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r12
movl 0x8(%rdi), %eax
cmpl 0x14(%r12), %eax
jge 0x274e
movq %rdi, %rbx
leaq 0x20(%r12), %r14
leaq 0x48(%r12), %r15
movq %r14, %rdi
callq 0x2280
movslq 0x10(%r12), %rax
testq %rax, %rax
jle 0x26c1
movq 0x18(%r12), %rdx
xorl %ecx, %ecx
cmpq %rbx, %rdx
je 0x26b3
cmpl $0x0, 0xc(%rdx)
je 0x26b3
movl 0x8(%rdx), %esi
cmpl 0x8(%rbx), %esi
je 0x26c3
incq %rcx
addq $0x18, %rdx
cmpq %rcx, %rax
jne 0x26a0
jmp 0x26d4
xorl %ecx, %ecx
cmpl %eax, %ecx
je 0x26d4
movq %r15, %rdi
movq %r14, %rsi
callq 0x20c0
jmp 0x268f
movl $0x1, 0xc(%rbx)
movq %r14, %rdi
callq 0x2190
movq (%r12), %rdi
movq 0x8(%r12), %rax
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x26f9
movq 0x10(%rbx), %rdx
jmp 0x26fb
xorl %edx, %edx
callq *%rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x2280
movl 0x8(%rbx), %eax
movl 0x14(%r12), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, %eax
je 0x271f
cmpq $0x0, 0x10(%rbx)
je 0x2726
incl %eax
cltd
idivl %ecx
movl %edx, %ecx
movl %ecx, 0x8(%rbx)
movl $0x0, 0xc(%rbx)
movq %r15, %rdi
callq 0x2080
movq %r14, %rdi
callq 0x2190
movl 0x8(%rbx), %eax
cmpl 0x14(%r12), %eax
jl 0x2687
xorl %edi, %edi
callq 0x21a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_sc_gen
lt_seqcloud_t *lt_sc_gen(const char *s)
{
	lt_seqcloud_t *sc;
	uint64_t x = 0;
	int i;
	sc = lt_sc_init();
	sc->l = strlen(s);
	for (i = 0; s[i] && i < sc->l; ++i) {
		int c = seq_nt4_table[(uint8_t)s[i]];
		if (c > 3) {
			lt_sc_destroy(sc);
			return 0;
		}
		x = x << 2 | c;
	}
	lt_sc_add_core(sc, x);
	return sc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x18, %esi
callq 0x2120
movq %rax, %rbx
movl $0x1, %edi
movl $0x28, %esi
callq 0x2120
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x20d0
movl %eax, (%rbx)
movb (%r14), %cl
xorl %esi, %esi
testb %cl, %cl
je 0x2c46
testl %eax, %eax
cmovlel %esi, %eax
leaq 0x554e(%rip), %rdx      # 0x8170
xorl %edi, %edi
cmpq %rdi, %rax
je 0x2c46
movzbl %cl, %ecx
movzbl (%rcx,%rdx), %ecx
cmpq $0x4, %rcx
jae 0x2c50
leaq (%rcx,%rsi,4), %rsi
movb 0x1(%r14,%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x2c24
movq %rbx, %rdi
callq 0x279a
jmp 0x2c5a
movq %rbx, %rdi
callq 0x2758
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_sc_test
int lt_sc_test(const lt_seqcloud_t *sc, const char *seq, int max_hits, lt_sc_hit_t *hits)
{
	int i, l, n = 0;
	uint64_t x = 0, mask = (1ULL << sc->l*2) - 1;
	for (i = l = 0; seq[i]; ++i) {
		int c = seq_nt4_table[(uint8_t)seq[i]];
		if (c < 4) {
			x = (x << 2 | c) & mask;
			if (++l >= sc->l) {
				if (x == sc->s || kh_get(s64, sc->mm, x) != kh_end(sc->mm)) {
					hits[n].pos = i - (sc->l - 1);
					hits[n++].type = x == sc->s? 0 : 1;
					if (n == max_hits) return n;
				}
			}
		} else l = 0, x = 0;
	}
	return n;
}

// Assembly:
movq %rcx, %r8
movb (%rdi), %cl
addb %cl, %cl
movq $-0x1, %r9
shlq %cl, %r9
movb (%rsi), %cl
testb %cl, %cl
je 0x2e35
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl %edx, %ebx
notq %r9
xorl %r10d, %r10d
leaq 0x54d4(%rip), %r12      # 0x8170
movl $0xc0000000, %r13d      # imm = 0xC0000000
xorl %r11d, %r11d
xorl %eax, %eax
xorl %ebp, %ebp
movq %r8, -0x10(%rsp)
movq %r9, -0x18(%rsp)
movq %rdi, -0x20(%rsp)
movq %rsi, -0x28(%rsp)
movzbl %cl, %ecx
movzbl (%rcx,%r12), %ecx
cmpq $0x3, %rcx
ja 0x2d9e
leaq (%rcx,%r11,4), %r11
andq %r9, %r11
incl %ebp
movl (%r14), %r15d
cmpl %r15d, %ebp
jl 0x2e1a
cmpq 0x8(%r14), %r11
je 0x2de3
movl %eax, -0x2c(%rsp)
movq 0x10(%r14), %rdi
movl (%rdi), %ecx
testl %ecx, %ecx
je 0x2dd9
movl %ebx, %esi
movq %rcx, -0x8(%rsp)
leal -0x1(%rcx), %r8d
movq %r11, %r14
shrq $0x21, %r14
movl %r11d, %ecx
shll $0xb, %ecx
xorl %ecx, %r14d
xorl %r11d, %r14d
movl %r8d, %ebx
andl %r14d, %ebx
movl %r14d, %ecx
shrl $0x3, %ecx
shll $0x3, %r14d
xorl %ecx, %r14d
orl $0x1, %r14d
andl %r8d, %r14d
movq 0x10(%rdi), %r9
movl %ebx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r13d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %r13d, %r12d
shrl %cl, %r12d
testb $0x2, %r12b
jne 0x2da5
testb $0x1, %r12b
jne 0x2d6b
movq 0x18(%rdi), %r12
movl %edx, %eax
cmpq %r11, (%r12,%rax,8)
je 0x2da5
addl %r14d, %edx
andl %r8d, %edx
cmpl %ebx, %edx
jne 0x2d3e
movq -0x10(%rsp), %r8
movq -0x18(%rsp), %r9
movl %esi, %ebx
movq -0x20(%rsp), %r14
movq -0x28(%rsp), %rsi
leaq 0x53de(%rip), %r12      # 0x8170
movl $0xc0000000, %r13d      # imm = 0xC0000000
movl -0x2c(%rsp), %eax
jmp 0x2e1a
xorl %r11d, %r11d
xorl %ebp, %ebp
jmp 0x2e1a
shrl %cl, %r13d
testb $0x3, %r13b
movq -0x8(%rsp), %rcx
cmovnel %ecx, %edx
movq -0x10(%rsp), %r8
movq -0x18(%rsp), %r9
movl %esi, %ebx
movq -0x20(%rsp), %r14
movq -0x28(%rsp), %rsi
leaq 0x539f(%rip), %r12      # 0x8170
movl $0xc0000000, %r13d      # imm = 0xC0000000
jmp 0x2ddb
xorl %edx, %edx
movl -0x2c(%rsp), %eax
cmpl %ecx, %edx
je 0x2e1a
movl %r10d, %edi
subl %r15d, %edi
incl %edi
movslq %eax, %rcx
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
movl (%r8,%rcx,4), %edx
andl %r13d, %edx
orl %edi, %edx
movl %edx, (%r8,%rcx,4)
xorl %edx, %edx
cmpq 0x8(%r14), %r11
setne %dl
leal 0x1(%rcx), %eax
shll $0x1e, %edx
orl %edi, %edx
movl %edx, (%r8,%rcx,4)
cmpl %ebx, %eax
je 0x2e2a
movb 0x1(%rsi,%r10), %cl
incq %r10
testb %cl, %cl
jne 0x2cbd
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_seq_rev
void lt_seq_rev(int l, const char *f, char *r)
{
	int i;
	for (i = 0; i < l; ++i)
		r[l - i - 1] = f[i];
	r[l] = 0;
}

// Assembly:
testl %edi, %edi
jle 0x2e53
movl %edi, %eax
movq %rax, %rcx
movb (%rsi), %dil
movb %dil, -0x1(%rdx,%rcx)
incq %rsi
decq %rcx
jne 0x2e41
jmp 0x2e56
movslq %edi, %rax
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_seq_revcomp
void lt_seq_revcomp(int l, const char *f, char *r)
{
	int i;
	for (i = 0; i < l; ++i)
		r[l - i - 1] = (uint8_t)f[i] >= 128? 'N' : comp_tab[(uint8_t)f[i]];
	r[l] = 0;
}

// Assembly:
testl %edi, %edi
jle 0x2e8c
movl %edi, %eax
leaq 0x5408(%rip), %rcx      # 0x8270
movq %rax, %rdi
movsbq (%rsi), %r8
testq %r8, %r8
js 0x2e7a
movb (%r8,%rcx), %r8b
jmp 0x2e7d
movb $0x4e, %r8b
movb %r8b, -0x1(%rdx,%rdi)
incq %rsi
decq %rdi
jne 0x2e6b
jmp 0x2e8f
movslq %edi, %rax
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_ue_for1
int lt_ue_for1(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int min_len, int max_pen)
{
	int i, pen = 0;
	for (i = 0; i < l1 && i < l2; ++i) {
		if (s1[i] != s2[i]) {
			pen += q1[i] >= LT_QUAL_THRES && (q2 == 0 || q2[i] >= LT_QUAL_THRES)? LT_HIGH_PEN : LT_LOW_PEN;
			if (i <= min_len && pen > max_pen) break;
			if (i > min_len && pen * min_len > i * max_pen) break; // in effect: pen > max_pen * ((double)i / min_len)
		}
	}
	return i;
}

// Assembly:
movl %ecx, %eax
cmpl %ecx, %edi
cmovll %edi, %eax
testl %eax, %eax
jle 0x2f3e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x40(%rsp), %r10
movslq 0x38(%rsp), %r11
movl %eax, %ebx
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %ebp, %ebp
movb (%rsi,%r14), %r12b
cmpb (%r8,%r14), %r12b
jne 0x2ed0
movl %ebp, %r12d
jmp 0x2f2e
testq %r9, %r9
sete %dil
xorl %r12d, %r12d
cmpb $0x35, (%rdx,%r14)
setge %r13b
setl %cl
orb %dil, %cl
je 0x2ef8
movb %r13b, %r12b
leal 0x1(,%r12,2), %r12d
jmp 0x2f0a
xorl %ecx, %ecx
cmpb $0x35, (%r9,%r14)
setge %cl
leal 0x1(,%rcx,2), %r12d
addl %ebp, %r12d
cmpq %r11, %r14
jg 0x2f19
cmpl 0x40(%rsp), %r12d
jg 0x2f41
cmpq %r11, %r14
jle 0x2f2e
movl %r12d, %ecx
imull 0x38(%rsp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r15
jl 0x2f41
incq %r14
addq %r10, %r15
movl %r12d, %ebp
cmpq %r14, %rbx
jne 0x2ec1
jmp 0x2f44
xorl %eax, %eax
retq
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_ue_rev1
int lt_ue_rev1(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int min_len, int max_pen)
{
	int i, pen = 0;
	for (i = 0; i < l1 && i < l2; ++i) {
		if (s1[l1-1-i] != s2[l2-1-i]) {
			pen += q1[l1-1-i] >= LT_QUAL_THRES && (q2 == 0 || q2[l2-1-i] >= LT_QUAL_THRES)? LT_HIGH_PEN : LT_LOW_PEN;
			if (i <= min_len && pen > max_pen) break;
			if (i > min_len && pen * min_len > i * max_pen) break;
		}
	}
	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
cmpl %ecx, %edi
movl %ecx, %eax
cmovll %edi, %eax
testl %eax, %eax
jle 0x3023
movslq 0x40(%rsp), %r8
movslq 0x38(%rsp), %r14
movl %eax, -0x14(%rsp)
movl %eax, %r15d
decl %edi
decl %ecx
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq %edi, %rbx
movb (%rsi,%rbx), %r10b
movslq %ecx, %r11
movq -0x8(%rsp), %rax
cmpb (%rax,%r11), %r10b
jne 0x2fa9
movl %ebp, %r11d
jmp 0x3007
testq %r9, %r9
sete %al
xorl %r10d, %r10d
movq -0x10(%rsp), %rdx
cmpb $0x35, (%rdx,%rbx)
setge %bl
setl %dl
orb %al, %dl
je 0x2fd2
movb %bl, %r10b
leal 0x1(,%r10,2), %r11d
jmp 0x2fe4
xorl %eax, %eax
cmpb $0x35, (%r9,%r11)
setge %al
leal 0x1(,%rax,2), %r11d
addl %ebp, %r11d
cmpq %r14, %r13
jg 0x2ff3
cmpl 0x40(%rsp), %r11d
jg 0x3027
cmpq %r14, %r13
jle 0x3007
movl %r11d, %eax
imull 0x38(%rsp), %eax
cltq
cmpq %rax, %r12
jl 0x3027
incq %r13
decl %edi
decl %ecx
addq %r8, %r12
movl %r11d, %ebp
cmpq %r13, %r15
jne 0x2f8f
movl -0x14(%rsp), %eax
jmp 0x302a
xorl %eax, %eax
jmp 0x302a
movl %r13d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_ue_for
int lt_ue_for(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int min_len, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = min_len; i <= l1; ++i) {
		int l;
		l = lt_ue_for1(i, s1 + l1 - i, q1 + l1 - i, l2, s2, q2, min_len, max_pen);
		if (l >= min_len && (l == i || l == l2)) {
			pos[n++] = (uint64_t)(l1 - i) << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movl %ecx, %ebx
movl 0x58(%rsp), %ecx
movl $0x0, (%rsp)
cmpl %edi, %ecx
jg 0x3116
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %eax
movl %edi, %edx
cltq
movl 0x58(%rsp), %ecx
movq %rcx, %rsi
movslq %esi, %rcx
incl %edx
movl %edx, 0x4(%rsp)
movq %rax, %r13
shlq $0x20, %r13
subq %rcx, %rax
shlq $0x20, %rcx
subq %rcx, %r13
addq %rax, %r15
addq %rax, %r12
movl $0x0, (%rsp)
movl %esi, %r14d
movl %r14d, %edi
movq %r12, %rsi
movq %r15, %rdx
movl %ebx, %ecx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
movl 0x50(%rsp), %eax
pushq %rax
movl 0x60(%rsp), %ebp
pushq %rbp
callq 0x2e94
addq $0x10, %rsp
cmpl %ebp, %eax
jl 0x30f9
cmpl %eax, %r14d
setne %cl
cmpl %ebx, %eax
setne %dl
testb %dl, %cl
jne 0x30f9
cltq
orq %r13, %rax
movl (%rsp), %esi
movslq %esi, %rcx
incl %esi
movq 0x68(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
movl %esi, (%rsp)
cmpl 0x60(%rsp), %esi
je 0x3116
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r13
incl %r14d
decq %r15
decq %r12
cmpl %r14d, 0x4(%rsp)
jne 0x309f
movl (%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_ue_rev
int lt_ue_rev(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int min_len, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = min_len; i <= l1; ++i) {
		int l;
		l = lt_ue_rev1(i, s1, q1, l2, s2, q2, min_len, max_pen);
		if (l >= min_len && (l == i || l == l2)) {
			pos[n++] = (uint64_t)(l1 - i) << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl 0x68(%rsp), %r15d
xorl %ebx, %ebx
cmpl %edi, %r15d
jg 0x31e3
movl %ecx, %ebp
movl %edi, %r13d
movl %edi, %r12d
incl %r13d
shlq $0x20, %r12
movq %r15, %rax
shlq $0x20, %rax
subq %rax, %r12
xorl %ebx, %ebx
movl %r15d, %r14d
movl %r14d, %edi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
movl 0x60(%rsp), %eax
pushq %rax
pushq %r15
callq 0x2f4f
addq $0x10, %rsp
cmpl %r15d, %eax
jl 0x31ce
cmpl %eax, %r14d
setne %cl
cmpl %ebp, %eax
setne %dl
testb %dl, %cl
jne 0x31ce
cltq
orq %r12, %rax
movslq %ebx, %rcx
incl %ebx
movq 0x78(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
cmpl 0x70(%rsp), %ebx
je 0x31e3
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r12
incl %r14d
cmpl %r14d, %r13d
jne 0x3178
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: lt_ue_contained
int lt_ue_contained(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = 1; i < l2 - l1; ++i) {
		int l;
		l = lt_ue_for1(l1, s1, q1, l2 - i, s2 + i, q2 + i, l1, max_pen);
		if (l == l1) {
			pos[n++] = (uint64_t)i << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %ecx, %eax
movq %rdi, 0x8(%rsp)
subl %edi, %eax
movl $0x0, 0x4(%rsp)
cmpl $0x2, %eax
jl 0x32c5
movq %r9, %rbx
movq %r8, %r14
movl %ecx, %ebp
movabsq $0x100000000, %r13      # imm = 0x100000000
movl %eax, %r12d
movslq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
decl %ebp
incq %rbx
incq %r14
decq %r12
movl $0x0, 0x4(%rsp)
movq 0x8(%rsp), %r15
movl %r15d, %edi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl %ebp, %ecx
movq %r14, %r8
movq %rbx, %r9
movl 0x60(%rsp), %eax
pushq %rax
pushq %r15
callq 0x2e94
addq $0x10, %rsp
cmpl %r15d, %eax
jne 0x32ab
movq %r13, %rax
orq 0x10(%rsp), %rax
movl 0x4(%rsp), %esi
movslq %esi, %rcx
incl %esi
movq 0x70(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
movl %esi, 0x4(%rsp)
cmpl 0x68(%rsp), %esi
je 0x32c5
decl %ebp
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r13
incq %rbx
incq %r14
decq %r12
jne 0x325d
movl 0x4(%rsp), %eax
addq $0x28, %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/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %r15b
movsbl %r15b, %esi
xorl %edi, %edi
callq 0x2424
testl %eax, %eax
je 0x15e7
leaq 0x2b7e(%rip), %rax      # 0x40bc
movl (%rax), %ebp
incq %r14
movsbl %r15b, %eax
leal 0x100(%rax), %ecx
testb %al, %al
cmovgl %eax, %ecx
movq (%rbx), %rax
movslq %ecx, %r12
cmpq $0x0, (%rax,%r12,8)
jne 0x15a3
movl $0x20, %edi
callq 0x2740
movq %rax, %r15
movl $0x800, %edi            # imm = 0x800
callq 0x2740
movq %rax, (%r15)
movl %ebp, 0x18(%r15)
movl $0x0, 0x1c(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movl $0x800, %edx            # imm = 0x800
movq %rax, %rdi
xorl %esi, %esi
callq 0x10c0
movq (%rbx), %rax
movq %r15, (%rax,%r12,8)
movsbl (%r14), %esi
xorl %edi, %edi
callq 0x2424
testl %eax, %eax
je 0x15d4
movq (%rbx), %rax
movq (%rax,%r12,8), %rbx
movb (%r14), %r15b
movsbl %r15b, %esi
xorl %edi, %edi
callq 0x2424
incq %r14
testl %eax, %eax
jne 0x1543
jmp 0x15e7
leaq 0x2add(%rip), %rax      # 0x40b8
movl (%rax), %eax
movq (%rbx), %rcx
movq (%rcx,%r12,8), %rbx
movl %eax, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
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/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 0x2a18
movq %rax, 0x8(%rbx)
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2a66
movq 0x8(%rbx), %rdi
callq 0x2ac4
testl %eax, %eax
jne 0x16a9
leaq 0x2a85(%rip), %rax      # 0x40b8
movl (%rax), %ebp
movq 0x8(%rbx), %rdi
movq (%rdi), %rsi
movq (%rsi), %r15
callq 0x2ad8
xorl %r12d, %r12d
movq (%r15), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x1690
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x2a66
movq %r15, %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x1677
cmpq %r14, %rax
jne 0x167f
movq %rcx, %rax
cmpq (%rbx), %rcx
jne 0x1662
movq %rax, 0x8(%r14)
cmpl %ebp, 0x18(%rax)
je 0x168c
movq 0x10(%rax), %rax
movq %rax, 0x10(%r14)
incq %r12
cmpq $0x100, %r12            # imm = 0x100
jne 0x1647
movq 0x8(%rbx), %rdi
callq 0x2ac4
testl %eax, %eax
je 0x1635
popq %rbx
popq %r12
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/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, %r8
leaq 0x5aa8(%rip), %rax      # 0x7170
movq (%rax), %rcx
movq (%rdi), %rdx
movq 0x10(%rdi), %r9
incq %rcx
movq (%r9), %rsi
movq (%rsi,%r8,8), %rsi
testq %rsi, %rsi
jne 0x16f0
cmpq %rdx, %r9
je 0x170b
movq 0x8(%r9), %r9
movq %r9, 0x10(%rdi)
jmp 0x16d2
movq %rcx, (%rax)
movq %rsi, 0x10(%rdi)
cmpq %rdx, %rsi
je 0x170e
incl 0x1c(%rsi)
movq 0x10(%rsi), %rsi
incq %rcx
cmpq %rdx, %rsi
jne 0x16fc
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1769
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r9
movq %rdi, %rbx
movq 0x8(%rdi), %r8
leaq 0x28eb(%rip), %rdi      # 0x4020
xorl %r14d, %r14d
movl %edx, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10b0
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x171b
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x1744
addq $0x8, %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/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 0x59d1(%rip)            # 0x7144
addl $0x10, 0x59ce(%rip)     # 0x7148
movl $0x10, %edi
callq 0x2740
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14d
movl %esi, %r12d
incl 0x58ec(%rip)            # 0x7144
movq %rdi, (%rsp)
addl $0x10, 0x58e5(%rip)     # 0x7148
movl $0x10, %edi
callq 0x2740
movq %rax, %rbx
xorps %xmm0, %xmm0
leal 0x7(%r12), %r13d
testl %r12d, %r12d
cmovnsl %r12d, %r13d
movl %r13d, %r15d
sarl $0x3, %r15d
leal 0x7(%r14), %ebp
testl %r14d, %r14d
cmovnsl %r14d, %ebp
movups %xmm0, (%rax)
sarl $0x3, %ebp
movl %r14d, %eax
andl $0x7, %eax
subl %r15d, %ebp
cmpl $0x1, %eax
sbbl $-0x1, %ebp
movl %ebp, %edi
callq 0x2740
movq %rax, (%rbx)
andl $-0x8, %r13d
subl %r13d, %r12d
movl %r12d, 0x8(%rbx)
subl %r13d, %r14d
movl %r14d, 0xc(%rbx)
movslq %r15d, %rsi
movq (%rsp), %rcx
addq (%rcx), %rsi
movslq %ebp, %r14
movq %rax, %rdi
movq %r14, %rdx
callq 0x1130
addl %r14d, 0x585f(%rip)     # 0x7140
incl 0x5855(%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_O3/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 0x194d
movl %esi, %ebp
addl %esi, %eax
cmpl %ecx, %eax
jge 0x194d
movq %rdi, %r14
incl 0x5827(%rip)            # 0x7144
addl $0x10, 0x5824(%rip)     # 0x7148
movl $0x10, %edi
callq 0x2740
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
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 0x26ef(%rip), %rdi      # 0x4043
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/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 0x1989
testl %esi, %esi
js 0x1989
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 0x26cf(%rip), %rdi      # 0x4060
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/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 0xc(%rdi), %eax
movq %rdi, 0x10(%rsp)
subl 0x8(%rdi), %eax
movl 0xc(%rsi), %ecx
movq %rsi, 0x8(%rsp)
subl 0x8(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x4(%rsp)
testl %ecx, %ecx
jle 0x1a3c
movl %edx, %ebx
xorl %r12d, %r12d
movl $0x1, %r15d
movl $0x0, %r14d
testl %ebx, %ebx
jle 0x1a28
xorl %r14d, %r14d
leal (%r12,%r14), %ebp
movq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x1965
movl %eax, %r13d
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x1965
cmpl %eax, %r13d
jne 0x1a28
leal (%r15,%r14), %eax
incl %r14d
cmpl 0x4(%rsp), %eax
jge 0x1a28
cmpl %ebx, %r14d
jl 0x19f2
cmpl %ebx, %r14d
jne 0x1a3f
addl %ebx, %r12d
addl %ebx, %r15d
cmpl 0x4(%rsp), %r12d
jl 0x19e5
jmp 0x1a3f
xorl %r12d, %r12d
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_O3/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
movl $0x10, %edi
callq 0x2740
movq $0x0, (%rax)
movq %rbx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5640(%rip)            # 0x714c
movl %esi, %edi
callq 0x2740
movq %rax, %r15
movslq %ebx, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1130
incl 0x562b(%rip)            # 0x7158
addl %ebx, 0x561d(%rip)      # 0x7150
movl $0x20, %edi
callq 0x2740
addl $0x20, 0x5610(%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_O3/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
testq %rdi, %rdi
je 0x1b99
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x55f8(%rip), %r12      # 0x7170
incq (%r12)
movq (%rbx), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
je 0x1b9b
setle %al
movzbl %al, %eax
movq 0x8(%rbx,%rax,8), %rbx
testq %rbx, %rbx
jne 0x1b78
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1c19
movq %rcx, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
movq %r15, %rsi
callq *%rcx
testl %eax, %eax
jle 0x1c44
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x1baa
movq %rax, 0x8(%rbx)
xorl %ecx, %ecx
movl $0x0, %edx
testq %rax, %rax
je 0x1bf1
movl 0x18(%rax), %edx
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x1bfd
movl 0x18(%rax), %ecx
movl %edx, %eax
subl %ecx, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl $0x1, %esi
ja 0x1c2d
cmpl %ecx, %edx
cmovgl %edx, %ecx
incl %ecx
movl %ecx, 0x18(%rbx)
jmp 0x1c46
movq %r15, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1afc
movq %rbx, %rdi
addq $0x8, %rsp
cmpl $0x2, %eax
jl 0x1c54
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1c7d
js 0x1c5f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1cf8
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x1baa
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rax
jmp 0x1be2
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_right
avl_tree_node *avl_tn_right(avl_tree_node *avl_tn) {
    // printf("%s r\n", (char *)avl_tn->value);
    avl_tree_node *a = avl_tn;
    avl_tree_node *b = a->left;
    avl_tree_node *c = b->right;

    avl_tree_node *root = b;
    // b->parent = a->parent;

    b->right = a;
    // a->parent = b;

    a->left = c;
    // if (c)
    // c->parent = a;

    avl_tn_update_deep(c);
    avl_tn_update_deep(a);
    avl_tn_update_deep(b);

    return root;
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rsi
movq %rdi, 0x10(%rax)
movq %rsi, 0x8(%rdi)
xorl %ecx, %ecx
movl $0x0, %edx
testq %rsi, %rsi
je 0x1cc7
movq 0x8(%rsi), %r9
xorl %edx, %edx
movl $0x0, %r8d
testq %r9, %r9
je 0x1cae
movl 0x18(%r9), %r8d
movq 0x10(%rsi), %r9
testq %r9, %r9
je 0x1cbb
movl 0x18(%r9), %edx
cmpl %edx, %r8d
cmovgl %r8d, %edx
incl %edx
movl %edx, 0x18(%rsi)
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
je 0x1cd3
movl 0x18(%rsi), %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
incl %ecx
movl %ecx, 0x18(%rdi)
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x1ceb
movl 0x18(%rdx), %edx
jmp 0x1ced
xorl %edx, %edx
cmpl %ecx, %edx
cmovgl %edx, %ecx
incl %ecx
movl %ecx, 0x18(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/hash_search/array_search/../../utils/blanced_binary_tree/tree_node.c
// Function: avl_tn_left
avl_tree_node *avl_tn_left(avl_tree_node *avl_tn) {
    // printf("%s l\n", (char *)avl_tn->value);
    avl_tree_node *a = avl_tn;
    avl_tree_node *b = a->right;
    avl_tree_node *c = b->left;

    avl_tree_node *root = b;
    // b->parent = a->parent;

    b->left = a;
    // a->parent = b;

    a->right = c;
    // if (c)
    // c->parent = a;

    avl_tn_update_deep(c);
    avl_tn_update_deep(a);
    avl_tn_update_deep(b);

    return root;
}

// Assembly:
movq 0x10(%rdi), %rax
movq 0x8(%rax), %rcx
movq %rdi, 0x8(%rax)
movq %rcx, 0x10(%rdi)
testq %rcx, %rcx
je 0x1d38
movq 0x8(%rcx), %r8
xorl %edx, %edx
movl $0x0, %esi
testq %r8, %r8
je 0x1d21
movl 0x18(%r8), %esi
movq 0x10(%rcx), %r8
testq %r8, %r8
je 0x1d2e
movl 0x18(%r8), %edx
cmpl %edx, %esi
cmovgl %esi, %edx
incl %edx
movl %edx, 0x18(%rcx)
movq 0x8(%rdi), %r8
xorl %edx, %edx
movl $0x0, %esi
testq %r8, %r8
je 0x1d4c
movl 0x18(%r8), %esi
testq %rcx, %rcx
je 0x1d54
movl 0x18(%rcx), %edx
cmpl %edx, %esi
cmovgl %esi, %edx
incl %edx
movl %edx, 0x18(%rdi)
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x1d6c
movl 0x18(%rcx), %ecx
jmp 0x1d6e
xorl %ecx, %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
incl %ecx
movl %ecx, 0x18(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1dbb
movq %rdi, %r14
movq (%rdi), %rbx
movq 0x8(%rdi), %rdi
callq 0x1d79
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x1d79
movl 0x18(%r14), %edx
leaq 0x22e7(%rip), %rdi      # 0x4090
movq %rbx, %rsi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x10b0
jmp 0x1dc2
leaq 0x22c9(%rip), %rbx      # 0x408b
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/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 0x1df9
movq 0x8(%rdi), %rdx
xorl %eax, %eax
movl $0x0, %ecx
testq %rdx, %rdx
je 0x1de3
movl 0x18(%rdx), %ecx
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x1def
movl 0x18(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
incl %eax
movl %eax, 0x18(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x18, %edi
callq 0x2740
movl %ebp, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1e9f
movl (%rbx), %edx
movq 0x10(%rbx), %rcx
movq %r14, %rsi
callq 0x216b
testq %rax, %rax
je 0x1efb
movq %rax, %r15
movl (%rbx), %edi
callq 0x1f2c
movq %rax, %r14
movq 0x8(%rbx), %rdi
callq 0x2163
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq 0x8(%rbx), %rax
movq 0x10(%r14), %rcx
movq %rax, (%rcx)
movq %r15, %rdi
callq 0x2163
movq 0x8(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%r14), %rax
movq %r15, 0x8(%rax)
movl $0x2, %eax
leaq 0x221f(%rip), %rcx      # 0x40bc
jmp 0x1eee
movl %edx, %ebp
movl %edx, %edi
callq 0x2740
movq %rax, %r15
movslq %ebp, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1130
leaq 0x52a1(%rip), %rax      # 0x7164
addl %r12d, (%rax)
movl (%rbx), %edi
callq 0x1f2c
movq %rax, %r14
movq 0x8(%rax), %rax
movq %r15, (%rax)
movq 0x10(%r14), %rax
movq $0x0, (%rax)
movl $0x1, %eax
leaq 0x21ca(%rip), %rcx      # 0x40b8
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_O3/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 0x5222(%rip)            # 0x715c
movl $0x18, %edi
callq 0x2740
movq %rax, %rbx
movslq %r14d, %rax
shll $0x4, %r14d
leaq 0x8(,%rax,8), %r15
movl %r15d, %edi
callq 0x2740
movq %rax, 0x8(%rbx)
movl %r15d, %edi
callq 0x2740
movq %rax, 0x10(%rbx)
movl 0x51ec(%rip), %ecx      # 0x7160
addl %r14d, %ecx
addl $0x28, %ecx
movl %ecx, 0x51e0(%rip)      # 0x7160
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10c0
movl $0x0, 0x4(%rbx)
leaq 0x211d(%rip), %rax      # 0x40b8
movl (%rax), %eax
movl %eax, (%rbx)
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/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl 0x4(%rdi), %r14d
leaq 0x8(%rdi), %r13
testl %r14d, %r14d
jle 0x205c
movq %rdx, %r12
xorl %ebp, %ebp
movq (%r13), %rax
movq (%rax,%rbp,8), %rsi
movq %r15, %rdi
callq *%r12
testl %eax, %eax
je 0x207b
incq %rbp
movslq 0x4(%rbx), %r14
cmpq %r14, %rbp
jl 0x1fd7
leaq 0x8(%rbx), %r13
testl %r14d, %r14d
jle 0x205c
movq (%r13), %rax
movq -0x8(%rax,%r14,8), %rsi
movq %r15, %rdi
callq *%r12
testl %eax, %eax
jg 0x203f
movq 0x8(%rbx), %rax
movq -0x8(%rax,%r14,8), %rcx
movq %rcx, (%rax,%r14,8)
movq 0x10(%rbx), %rax
movq -0x8(%rax,%r14,8), %rcx
movq %rcx, (%rax,%r14,8)
decq %r14
leaq 0x1(%r14), %rax
cmpq $0x1, %rax
ja 0x2002
xorl %r14d, %r14d
movl 0x4(%rbx), %eax
movq 0x8(%rbx), %rdx
movslq %r14d, %rcx
movq %r15, (%rdx,%rcx,8)
cmpl %eax, %ecx
je 0x206a
movq 0x10(%rbx), %rdx
movq 0x8(%rdx,%rcx,8), %rsi
jmp 0x2070
movq (%r13), %rax
movslq %r14d, %rcx
movq %r15, (%rax,%rcx,8)
movl %r14d, %eax
movq 0x10(%rbx), %rdx
xorl %esi, %esi
movq %rsi, (%rdx,%rcx,8)
incl %eax
movl %eax, 0x4(%rbx)
jmp 0x2081
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %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/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 0x210a
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %edi
callq 0x1f2c
leal 0x1(%r14), %edx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %r14d, %ecx
incl %ecx
sarl %ecx
subl %ecx, %edx
movl %edx, 0x4(%rbx)
subl %edx, %r14d
leal 0x1(%r14), %edx
movl %edx, 0x4(%rax)
testl %r14d, %r14d
js 0x2102
negl %ecx
movslq 0x4(%rbx), %rdx
negl %ecx
xorl %esi, %esi
movq 0x8(%rbx), %rdi
movq (%rdi,%rdx,8), %rdi
movq 0x8(%rax), %r8
movq %rdi, (%r8,%rsi,8)
movq 0x10(%rbx), %rdi
movq (%rdi,%rdx,8), %rdi
movq 0x10(%rax), %r8
movq %rdi, (%r8,%rsi,8)
incq %rsi
incq %rdx
cmpq %rsi, %rcx
jne 0x20d7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
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_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
movl 0x4(%rdi), %ebx
testl %ebx, %ebx
jle 0x2149
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movq 0x8(%r12), %rax
movq (%rax,%rbx,8), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
jg 0x214d
incq %rbx
movslq 0x4(%r12), %rax
cmpq %rax, %rbx
jl 0x2127
movl %eax, %ebx
decl %ebx
jmp 0x2155
xorl %eax, %eax
subl $0x1, %ebx
cmovbl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq