LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/unitig.c
// Function: main_assemble
int main_assemble(int argc, char *argv[])
{
	int c, use_mmap = 0, n_threads = 1, min_match = 31, min_merge_len = 0;
	rld_t *e;
	while ((c = getopt(argc, argv, "Ml:t:r:m:")) >= 0) {
		switch (c) {
			case 'l': min_match = atoi(optarg); break;
			case 'm': min_merge_len = atoi(optarg); break;
			case 'M': use_mmap = 1; break;
			case 't': n_threads = atoi(optarg); break;
		}
	}
	if (optind + 1 > argc) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:   fermi2 assemble [options] <reads.rld>\n\n");
		fprintf(stderr, "Options: -l INT      min match [%d]\n", min_match);
		fprintf(stderr, "         -m INT      min merge length [%d]\n", min_merge_len);
		fprintf(stderr, "         -t INT      number of threads [1]\n");
		fprintf(stderr, "\n");
		return 1;
	}
	e = use_mmap? rld_restore_mmap(argv[optind]) : rld_restore(argv[optind]);
	fm6_unitig(e, min_match, min_merge_len, n_threads);
	rld_destroy(e);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movl %edi, %r12d
movl $0x0, 0x4(%rsp)
pushq $0x1f
popq %rbp
pushq $0x1
popq %r14
movb $0x1, %bl
leaq 0x66e6(%rip), %r13      # 0x1aac2
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x22f0
testl %eax, %eax
js 0x14442
cmpl $0x4d, %eax
je 0x14415
cmpl $0x74, %eax
je 0x14419
cmpl $0x6d, %eax
je 0x1442d
cmpl $0x6c, %eax
jne 0x143dc
movq 0xdbcf(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, %ebp
jmp 0x143dc
xorl %ebx, %ebx
jmp 0x143dc
movq 0xdbb8(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, %r14d
jmp 0x143dc
movq 0xdba4(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x4(%rsp)
jmp 0x143dc
movq 0xdb87(%rip), %rax      # 0x21fd0
movslq (%rax), %rax
cmpl %r12d, %eax
jge 0x14493
movq (%r15,%rax,8), %rdi
testb $0x1, %bl
je 0x14461
callq 0x2f1e
jmp 0x14466
callq 0x32b2
movq %rax, %r15
movq %rax, %rdi
movl %ebp, %esi
movl 0x4(%rsp), %edx
movl %r14d, %ecx
callq 0x13d22
movq %r15, %rdi
callq 0x26e6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xdb5e(%rip), %rbx      # 0x21ff8
movq (%rbx), %rsi
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x2170
movq (%rbx), %rcx
leaq 0x6619(%rip), %rdi      # 0x1aacc
pushq $0x30
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
callq 0x2310
movq (%rbx), %rdi
leaq 0x6631(%rip), %rsi      # 0x1aafd
movl %ebp, %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x6643(%rip), %rsi      # 0x1ab22
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rcx
leaq 0x665a(%rip), %rdi      # 0x1ab4e
pushq $0x2b
popq %rsi
movq %r15, %rdx
callq 0x2310
movq (%rbx), %rsi
movl %r14d, %edi
callq 0x2170
pushq $0x1
popq %rax
jmp 0x14484
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/bubble.c
// Function: mag_g_pop_simple
void mag_g_pop_simple(mag_t *g, float max_cov, float max_frac, int min_merge_len, int aggressive)
{
	int64_t i, n_examined = 0, n_popped = 0;
	int ret;
	double t;

	t = cputime();
	for (i = 0; i < g->v.n; ++i) {
		ret = mag_vh_pop_simple(g, i<<1|0, max_cov, max_frac, aggressive);
		if (ret >= 1) ++n_examined;
		if (ret >= 2) ++n_popped;
		ret = mag_vh_pop_simple(g, i<<1|1, max_cov, max_frac, aggressive);
		if (ret >= 1) ++n_examined;
		if (ret >= 2) ++n_popped;
	}
	if (fm_verbose >= 3)
		fprintf(stderr, "[M::%s] examined %ld bubbles and popped %ld in %.3f sec\n", __func__, (long)n_examined, (long)n_popped, cputime() - t);
	mag_g_merge(g, 0, min_merge_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm0, (%rsp)
movq %rdi, %rbx
pushq $0x1
popq %r13
movq $0x0, 0x8(%rsp)
callq 0x3b2e
movsd %xmm0, 0x18(%rsp)
xorl %r12d, %r12d
xorl %eax, %eax
movl 0x14(%rsp), %r15d
cmpq (%rbx), %rax
jae 0x156bb
leaq -0x1(%r13), %rsi
movq %rbx, %rdi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movl %r15d, %edx
movq %rax, 0x20(%rsp)
callq 0x151cf
xorl %r14d, %r14d
testl %eax, %eax
setg %r14b
xorl %ebp, %ebp
cmpl $0x2, %eax
setge %bpl
movq %rbx, %rdi
movq %r13, %rsi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movl %r15d, %edx
callq 0x151cf
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
movq 0x8(%rsp), %rdx
addq %rcx, %rdx
addq %r14, %rdx
movq %rdx, 0x8(%rsp)
xorl %ecx, %ecx
cmpl $0x2, %eax
movq 0x20(%rsp), %rax
setge %cl
addq %rcx, %r12
addq %rbp, %r12
incq %rax
addq $0x2, %r13
jmp 0x15632
leaq 0xcb9e(%rip), %rax      # 0x22260
cmpl $0x3, (%rax)
jge 0x156e3
movq %rbx, %rdi
xorl %esi, %esi
movl 0x10(%rsp), %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfae0
movq 0xc90e(%rip), %rax      # 0x21ff8
movq (%rax), %r13
callq 0x3b2e
subsd 0x18(%rsp), %xmm0
leaq 0x5581(%rip), %rsi      # 0x1ac80
leaq 0x55b3(%rip), %rdx      # 0x1acb9
movq %r13, %rdi
movq 0x8(%rsp), %rcx
movq %r12, %r8
movb $0x1, %al
callq 0x21c0
jmp 0x156c7
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/bubble.c
// Function: mag_g_pop_open
void mag_g_pop_open(mag_t *g, int min_elen)
{
	int64_t i;
	double t;
	t = cputime();
	for (i = 0; i < g->v.n; ++i)
		mag_v_pop_open(g, &g->v.a[i], min_elen);
	if (fm_verbose >= 3)
		fprintf(stderr, "[M:%s] popped open bubbles in %.3f sec\n", __func__, cputime() - t);
	mag_g_merge(g, 0, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
callq 0x3b2e
movsd %xmm0, (%rsp)
xorl %r15d, %r15d
cmpq (%rbx), %r15
jae 0x15b2c
movq 0x10(%rbx), %rsi
addq %r14, %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1571a
incq %r15
addq $0x68, %r14
jmp 0x15b0d
leaq 0xc72d(%rip), %rax      # 0x22260
cmpl $0x3, (%rax)
jge 0x15b4e
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xfae0
movq 0xc4a3(%rip), %rax      # 0x21ff8
movq (%rax), %r14
callq 0x3b2e
subsd (%rsp), %xmm0
leaq 0x5161(%rip), %rsi      # 0x1acca
leaq 0x5182(%rip), %rdx      # 0x1acf2
movq %r14, %rdi
movb $0x1, %al
callq 0x21c0
jmp 0x15b38
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: fm_sa_gen
fmsa_t *fm_sa_gen(const rld_t *e, int ssa_shift, int n_threads)
{
	extern void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n);
	fmsa_t *sa;
	worker_t *w;
	int i;

	sa = calloc(1, sizeof(fmsa_t));
	sa->ss = ssa_shift;
	sa->m = e->mcnt[1];
	for (sa->ms = 1; 1LL<<sa->ms < sa->m; ++sa->ms);
	sa->n_ssa = (e->mcnt[0] - e->mcnt[1] + (1<<sa->ss) - 1) >> sa->ss;
	sa->r2i = calloc(sa->m, 8);
	sa->ssa = calloc(sa->n_ssa, 8);

	w = calloc(1, sizeof(worker_t));
	w->buf = calloc(n_threads, sizeof(uint64_v));
	w->sa = sa;
	w->e = e;

	kt_for(n_threads, worker, w, sa->m);

	for (i = 0; i < n_threads; ++i) free(w->buf[i].a);
	free(w->buf); free(w);
	return sa;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
pushq $0x1
popq %r13
pushq $0x28
popq %rsi
movq %r13, %rdi
callq 0x2190
movq %rax, %rbx
movl %r12d, 0x4(%rax)
movq 0x28(%r14), %rdx
movq 0x8(%rdx), %r15
movq %r15, 0x8(%rax)
xorl %eax, %eax
incq %rax
movq %r13, %rsi
movl %eax, %ecx
shlq %cl, %rsi
cmpq %r15, %rsi
jl 0x15bb3
pushq $0x1
popq %rsi
movl %r12d, %ecx
shll %cl, %esi
movl %eax, (%rbx)
movslq %esi, %rax
addq (%rdx), %rax
movq %r15, %r13
notq %r13
addq %rax, %r13
shrq %cl, %r13
movq %r13, 0x10(%rbx)
pushq $0x8
popq %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, 0x18(%rbx)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, 0x20(%rbx)
pushq $0x1
popq %rdi
pushq $0x18
popq %r13
movq %r13, %rsi
callq 0x2190
movq %rax, %r12
movslq %ebp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2190
movq %rax, 0x10(%r12)
movq %rbx, 0x8(%r12)
movq %r14, (%r12)
leaq 0x53(%rip), %rsi        # 0x15c8d
movl %ebp, %edi
movq %r12, %rdx
movq %r15, %rcx
callq 0x247c
xorl %r14d, %r14d
testl %ebp, %ebp
cmovlel %r14d, %ebp
imulq $0x18, %rbp, %r15
movq 0x10(%r12), %rdi
cmpq %r14, %r15
je 0x15c6e
movq 0x10(%rdi,%r14), %rdi
callq 0x2040
addq $0x18, %r14
jmp 0x15c54
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: fm_sa
int64_t fm_sa(const rld_t *e, const fmsa_t *sa, int64_t k, int64_t *si)
{
	int c, mask = (1<<sa->ss) - 1;
	int64_t x = 0;
	uint64_t ok[e->asize1];
	*si = -1;
	if (k >= e->mcnt[0]) return -1;
	while (k < e->mcnt[1] || ((k - e->mcnt[1]) & mask)) {
		++x;
		c = rld_rank1a(e, k + 1, ok);
		k = e->cnt[c] + ok[c] - 1;
		if (c == 0) {
			*si = sa->r2i[k];
			return x - 1;
		}
	}
	k = (k - e->mcnt[1]) >> sa->ss;
	*si = sa->ssa[k] & ((1ULL<<sa->ms) - 1);
	return x + (sa->ssa[k] >> sa->ms);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r8
movl 0x4(%rsi), %ecx
movzbl 0x1(%rdi), %eax
leal 0xf(,%rax,8), %eax
andl $-0x10, %eax
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
orq $-0x1, (%r8)
movq 0x28(%rdi), %rax
cmpq %rdx, (%rax)
jbe 0x15d6c
movq %rsi, %r14
movq %rdi, %r12
movq %r8, -0x30(%rbp)
pushq $-0x1
popq %rbx
shll %cl, %ebx
notl %ebx
xorl %r15d, %r15d
movq 0x28(%r12), %rax
movq %rdx, %rsi
subq 0x8(%rax), %rsi
jb 0x15d2a
testl %ebx, %esi
je 0x15d72
incq %r15
incq %rdx
movq %r12, %rdi
movq %rdx, %rsi
movq %r13, %rdx
callq 0x346c
movq 0x20(%r12), %rcx
cltq
movq (%rcx,%rax,8), %rcx
movq (%r13,%rax,8), %rdx
addq %rcx, %rdx
decq %rdx
testl %eax, %eax
jne 0x15d18
movq 0x18(%r14), %rax
movq (%rax,%rdx,8), %rax
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
decq %r15
jmp 0x15da2
pushq $-0x1
popq %r15
jmp 0x15da2
movb (%r14), %al
movb 0x4(%r14), %cl
shrq %cl, %rsi
pushq $-0x1
popq %rdx
movl %eax, %ecx
shlq %cl, %rdx
movq 0x20(%r14), %rcx
notq %rdx
andq (%rcx,%rsi,8), %rdx
movq -0x30(%rbp), %rdi
movq %rdx, (%rdi)
movq (%rcx,%rsi,8), %rdx
movl %eax, %ecx
shrq %cl, %rdx
addq %rdx, %r15
movq %r15, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: fm_sa_dump
int fm_sa_dump(const fmsa_t *sa, const char *fn)
{
	uint32_t y;
	FILE *fp;
	fp = fn && strcmp(fn, "-")? fopen(fn, "wb") : fdopen(fileno(stdout), "wb");
	if (fp == 0) return -1;
	y = sa->ss; fwrite(&y, 4, 1, fp);
	y = sa->ms; fwrite(&y, 4, 1, fp);
	fwrite(&sa->m, 8, 1, fp);
	fwrite(&sa->n_ssa, 8, 1, fp);
	fwrite(sa->r2i, 8, sa->m, fp);
	fwrite(sa->ssa, 8, sa->n_ssa, fp);
	fclose(fp);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
je 0x15de8
cmpb $0x2d, (%rsi)
jne 0x15dd4
cmpb $0x0, 0x1(%rsi)
je 0x15de8
leaq 0x327e(%rip), %rax      # 0x19059
movq %rsi, %rdi
movq %rax, %rsi
callq 0x22d0
jmp 0x15e05
movq 0xc1d1(%rip), %rax      # 0x21fc0
movq (%rax), %rdi
callq 0x2200
leaq 0x325b(%rip), %rsi      # 0x19059
movl %eax, %edi
callq 0x2270
movq %rax, %r14
testq %rax, %rax
je 0x15ea5
movl 0x4(%rbx), %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
pushq $0x4
popq %r12
pushq $0x1
popq %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2310
movl (%rbx), %eax
movl %eax, (%r15)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2310
leaq 0x8(%rbx), %rdi
pushq $0x8
popq %r15
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2310
leaq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2310
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2310
movq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2310
movq %r14, %rdi
callq 0x20d0
xorl %eax, %eax
jmp 0x15ea8
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: fm_sa_restore
fmsa_t *fm_sa_restore(const char *fn)
{
	FILE *fp;
	uint32_t y;
	fmsa_t *sa;
	fp = fn && strcmp(fn, "-")? fopen(fn, "rb") : fdopen(fileno(stdin), "rb");
	if (fp == 0) return 0;
	sa = calloc(1, sizeof(fmsa_t));
	fread(&y, 4, 1, fp); sa->ss = y;
	fread(&y, 4, 1, fp); sa->ms = y;
	fread(&sa->m, 8, 1, fp);
	fread(&sa->n_ssa, 8, 1, fp);
	sa->r2i = calloc(sa->m, 8);
	sa->ssa = calloc(sa->n_ssa, 8);
	if (sa->ssa == 0 || sa->r2i == 0) {
		free(sa->r2i); free(sa->ssa); free(sa);
		return 0;
	}
	fread(sa->r2i, 8, sa->m, fp);
	fread(sa->ssa, 8, sa->n_ssa, fp);
	fclose(fp);
	return sa;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x15edf
cmpb $0x2d, (%rdi)
jne 0x15ed1
cmpb $0x0, 0x1(%rdi)
je 0x15edf
leaq 0x3189(%rip), %rsi      # 0x19061
callq 0x22d0
jmp 0x15efc
movq 0xc0e2(%rip), %rax      # 0x21fc8
movq (%rax), %rdi
callq 0x2200
leaq 0x316c(%rip), %rsi      # 0x19061
movl %eax, %edi
callq 0x2270
movq %rax, %r14
testq %rax, %rax
je 0x15fce
pushq $0x1
popq %r15
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x2190
movq %rax, %rbx
leaq 0x4(%rsp), %r12
pushq $0x4
popq %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2090
movl (%r12), %eax
movl %eax, 0x4(%rbx)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2090
movl (%r12), %eax
movl %eax, (%rbx)
leaq 0x8(%rbx), %rdi
pushq $0x8
popq %r13
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2090
leaq 0x10(%rbx), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2090
movq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x2190
movq %rax, %rbp
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2190
movq %rax, %r13
movq %rax, 0x20(%rbx)
testq %rax, %rax
setne %al
testq %rbp, %rbp
setne %cl
testb %al, %cl
jne 0x15fd2
movq %rbp, %rdi
callq 0x2040
movq %r13, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0x15fff
pushq $0x8
popq %rsi
movq %rbp, %rdi
movq %rsi, %rbp
movq %r15, %rdx
movq %r14, %rcx
callq 0x2090
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2090
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: main_sa
int main_sa(int argc, char *argv[])
{
	int c, n_threads = 1, ssa_shift = 6;
	fmsa_t *sa;
	rld_t *e;
	char *fn = 0;

	while ((c = getopt(argc, argv, "t:s:o:")) >= 0) {
		if (c == 't') n_threads = atoi(optarg);
		else if (c == 's') ssa_shift = atoi(optarg);
		else if (c == 'o') fn = optarg;
	}
	if (argc == optind) {
		fprintf(stderr, "Usage: fermi2 sa [-t nThreads=%d] [-s stepShift=%d] <in.fmd>\n", n_threads, ssa_shift);
		return 1;
	}
	e = rld_restore(argv[optind]);
	if (e == 0) {
		fprintf(stderr, "[E::%s] failed to load the FM-index\n", __func__);
		return 1;
	}
	sa = fm_sa_gen(e, ssa_shift, n_threads);
	//{int64_t i;for (i = 0; i < sa->n_ssa; ++i) fprintf(stderr, "S(%lld)=%lld\n", (i<<sa->ss) + e->mcnt[1], sa->ssa[i]>>sa->ms);}

	fm_sa_dump(sa, fn);
	rld_destroy(e);
	fm_sa_destroy(sa);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movl %edi, %r12d
pushq $0x1
popq %rbx
pushq $0x6
popq %rbp
xorl %r14d, %r14d
leaq 0x4ccf(%rip), %r13      # 0x1ad01
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x22f0
testl %eax, %eax
js 0x16085
cmpl $0x6f, %eax
je 0x16066
cmpl $0x73, %eax
je 0x16072
cmpl $0x74, %eax
jne 0x16032
movq 0xbf7e(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, %ebx
jmp 0x16032
movq 0xbf6b(%rip), %rax      # 0x21fd8
movq (%rax), %r14
jmp 0x16032
movq 0xbf5f(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, %ebp
jmp 0x16032
movq 0xbf44(%rip), %rax      # 0x21fd0
movslq (%rax), %rax
cmpl %r12d, %eax
je 0x160e0
movq (%r15,%rax,8), %rdi
callq 0x2f1e
testq %rax, %rax
je 0x160fe
movq %rax, %r15
movq %rax, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x15b7c
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x15db4
movq %r15, %rdi
callq 0x26e6
movq %rbx, %rdi
callq 0x15cad
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xbf11(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x4c17(%rip), %rsi      # 0x1ad08
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21c0
jmp 0x1611d
movq 0xbef3(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x4c37(%rip), %rsi      # 0x1ad46
leaq 0x4c55(%rip), %rdx      # 0x1ad6b
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x160d1
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/sa.c
// Function: sa_gen1
static void sa_gen1(const rld_t *e, fmsa_t *sa, int64_t k, uint64_v *buf)
{
	int c, mask = (1<<sa->ss) - 1;
	uint64_t ok[e->asize1], k0 = k, l = 0;
	size_t i;
	buf->n = 0;
	do {
		++l;
		c = rld_rank1a(e, k + 1, ok);
		k = e->cnt[c] + ok[c] - 1;
		if (c) {
			if (((k - e->mcnt[1]) & mask) == 0) {
				int64_t x = (k - e->mcnt[1]) >> sa->ss;
				sa->ssa[x] = l;
				kv_push(uint64_t, *buf, x);
			}
		} else sa->r2i[k] = k0;
	} while (c);
	for (i = 0; i < buf->n; ++i)
		sa->ssa[buf->a[i]] = (l - 1 - sa->ssa[buf->a[i]]) << sa->ms | k0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdi, %r12
movq %rsi, -0x30(%rbp)
movb 0x4(%rsi), %cl
pushq $-0x1
popq %rax
shll %cl, %eax
notl %eax
movq %rax, -0x40(%rbp)
movzbl 0x1(%rdi), %eax
leal 0xf(,%rax,8), %eax
andl $-0x10, %eax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
andq $0x0, (%rbx)
movq %rdx, -0x38(%rbp)
leaq 0x1(%rdx), %r14
xorl %r15d, %r15d
movq %r12, %rdi
movq %r14, %rsi
movq -0x48(%rbp), %r14
movq %r14, %rdx
callq 0x346c
movq 0x20(%r12), %rcx
movslq %eax, %rdx
movq (%rcx,%rdx,8), %rax
movq (%r14,%rdx,8), %rcx
leaq (%rcx,%rax), %r14
testl %edx, %edx
je 0x1620c
incq %r15
leaq (%rcx,%rax), %r13
decq %r13
movq 0x28(%r12), %rax
subq 0x8(%rax), %r13
testl %r13d, -0x40(%rbp)
jne 0x16175
movq -0x30(%rbp), %rax
movb 0x4(%rax), %cl
shrq %cl, %r13
movq 0x20(%rax), %rax
movq %r15, (%rax,%r13,8)
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x161fc
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2260
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r13, (%rax,%rcx,8)
jmp 0x16175
movq -0x30(%rbp), %r9
movq 0x18(%r9), %rax
movq -0x38(%rbp), %r8
movq %r8, -0x8(%rax,%r14,8)
xorl %eax, %eax
cmpq (%rbx), %rax
jae 0x16249
movq 0x20(%r9), %rdx
movq 0x10(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
subq (%rdx,%rsi,8), %rdi
movb (%r9), %cl
shlq %cl, %rdi
orq %r8, %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rax
jmp 0x1621f
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/match.c
// Function: fmd_smem
int fmd_smem(const rld_t *e, const uint8_t *q, fmdsmem_v *mem, int min_occ, rldintv_v *curr, rldintv_v *prev)
{
	int x = 0, len;
	mem->n = 0;
	len = strlen((char*)q);
	do {
		x = fmd_smem1_core(e, min_occ, len, q, x, mem, curr, prev);
	} while (x < len);
	return mem->n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
andq $0x0, (%rdx)
movq %rsi, %rdi
callq 0x20e0
movq %rax, %rbx
xorl %eax, %eax
movq %r13, %rdi
movl %ebp, %esi
movl %ebx, %edx
movq %r12, %rcx
movl %eax, %r8d
movq %r15, %r9
pushq (%rsp)
pushq %r14
callq 0x1638c
addq $0x10, %rsp
cmpl %ebx, %eax
jl 0x168d9
movl (%r15), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/match.c
// Function: fm_exact
void fm_exact(const rld_t *e, const char *s, int64_t *_l, int64_t *_u)
{
	extern unsigned char seq_nt6_table[128];
	int64_t i, l = 0, u = e->mcnt[0];
	for (i = strlen(s) - 1; i >= 0; --i) {
		int c = (uint8_t)s[i];
		c = c < 6? c : c < 128? seq_nt6_table[c] : 5;
		l = e->cnt[c] + rld_rank11(e, l, c);
		u = e->cnt[c] + rld_rank11(e, u, c);
		if (l >= u) break;
	}
	*_l = l, *_u = u;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, (%rsp)
movq %rdi, 0x10(%rsp)
movq 0x28(%rdi), %rax
movq (%rax), %r15
movq %rsi, 0x18(%rsp)
movq %rsi, %rdi
callq 0x20e0
movq %rax, %rbx
decq %rbx
xorl %ebp, %ebp
movq 0x10(%rsp), %r13
testq %rbx, %rbx
js 0x169c3
movq 0x18(%rsp), %rax
movzbl (%rax,%rbx), %eax
cmpq $0x6, %rax
jb 0x16970
testb %al, %al
js 0x1696e
leaq 0xb877(%rip), %rcx      # 0x221e0
movb (%rcx,%rax), %al
jmp 0x16970
movb $0x5, %al
movzbl %al, %r14d
movq 0x20(%r13), %rax
leal (,%r14,8), %r12d
movq (%rax,%r12), %rax
movq %rax, 0x20(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movl %r14d, %edx
callq 0x342b
movq %rax, %rbp
addq 0x20(%rsp), %rbp
movq 0x20(%r13), %rax
movq (%rax,%r12), %r12
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x342b
movq %rax, %r15
addq %r12, %r15
decq %rbx
cmpq %r15, %rbp
jl 0x1694a
movq (%rsp), %rax
movq %rbp, (%rax)
movq 0x8(%rsp), %rax
movq %r15, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/profk.c
// Function: fm_extend_to
int fm_extend_to(const rld_t *e, const char *s, int x, int min_ext, int sat_occ, int *occ)
{
	extern unsigned char seq_nt6_table[128];
	int i, k;
	uint64_t l = 0, u = e->mcnt[0];
	*occ = 0;
	if (x + 1 - min_ext < 0) return 0;
	for (i = x, k = 0; i >= 0; --i) {
		int c = (uint8_t)s[i];
		uint64_t l0 = l, u0 = u;
		c = c < 6? c : c < 128? seq_nt6_table[c] : 5;
		l = e->cnt[c] + rld_rank11(e, l, c);
		u = e->cnt[c] + rld_rank11(e, u, c);
		if (l >= u) break; // can't be extended
		++k;
		if (sat_occ > 0) {
			if (k > min_ext && u - l < sat_occ) {
				--k, l = l0, u = u0;
				break;
			}
		} else if (k == min_ext) {
			break;
		}
	}
	if (l < u) *occ = u - l;
	return k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rdi), %rax
movq (%rax), %r12
movq %r9, 0x18(%rsp)
andl $0x0, (%r9)
movq %rsi, 0x30(%rsp)
leal 0x1(%rdx), %eax
xorl %esi, %esi
cmpl %ecx, %eax
jl 0x17c67
movl %r8d, %eax
movq %rax, 0x20(%rsp)
leal -0x1(%rcx), %eax
movl %eax, (%rsp)
xorl %esi, %esi
xorl %ebp, %ebp
movq %rcx, 0x8(%rsp)
movl %r8d, 0x4(%rsp)
movq 0x28(%rsp), %r13
testl %edx, %edx
js 0x17c57
movl %edx, %eax
movq 0x30(%rsp), %rcx
movzbl (%rcx,%rax), %eax
cmpq $0x6, %rax
movq %rsi, 0x10(%rsp)
movq %rdx, 0x38(%rsp)
movq %r12, 0x40(%rsp)
jb 0x17bbc
testb %al, %al
js 0x17bba
leaq 0xa62b(%rip), %rcx      # 0x221e0
movb (%rcx,%rax), %al
jmp 0x17bbc
movb $0x5, %al
movzbl %al, %r15d
movq 0x20(%r13), %rax
leal (,%r15,8), %r12d
movq (%rax,%r12), %r14
movq %r13, %rdi
movq %rbp, %rbx
movq %rbp, %rsi
movl %r15d, %edx
callq 0x342b
movq %rax, %rbp
addq %r14, %rbp
movq 0x20(%r13), %rax
movq (%rax,%r12), %r14
movq %r13, %rdi
movq 0x40(%rsp), %r12
movq %r12, %rsi
movl %r15d, %edx
callq 0x342b
addq %r14, %rax
movq %rax, %rcx
subq %rbp, %rcx
jbe 0x17c43
cmpl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rsi
movq 0x38(%rsp), %rdx
jle 0x17c2d
cmpl 0x8(%rsp), %esi
jl 0x17c37
cmpq 0x20(%rsp), %rcx
jae 0x17c37
jmp 0x17c4d
cmpl %esi, (%rsp)
movq 0x8(%rsp), %rcx
je 0x17c52
decl %edx
incl %esi
movq %rax, %r12
jmp 0x17b82
movq %rax, %r12
movq 0x10(%rsp), %rsi
jmp 0x17c57
movq %rbx, %rbp
jmp 0x17c57
movl %ecx, %esi
movq %rax, %r12
cmpq %rbp, %r12
jbe 0x17c67
subl %ebp, %r12d
movq 0x18(%rsp), %rax
movl %r12d, (%rax)
movl %esi, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/profk.c
// Function: fm_kprof
fm_icnt_t *fm_kprof(const rld_t *e, const char *s, int min_ext, int sat_occ, int *n_)
{
	int i, x, len, k = 0;
	fm_icnt_t *a;
	len = strlen(s);
	MALLOC(a, len);
	for (x = len - 1; x >= min_ext - 1;) {
		int y, occ;
		y = fm_extend_to(e, s, x, min_ext, sat_occ, &occ);
		a[k].st = x + 1 - (y >= min_ext? y : min_ext);
		a[k].en = x + 1;
		a[k++].occ = occ;
		x -= (y >= min_ext? y - min_ext : 0) + 1;
	}
	*n_ = k;
	for (i = 0; i < k>>1; ++i) {
		fm_icnt_t t = a[i];
		a[i] = a[k - i - 1]; a[k - i - 1] = t;
	}
	return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, 0x20(%rsp)
movq %rsi, %rdi
callq 0x20e0
movslq %eax, %r14
imulq $0xc, %r14, %rdi
callq 0x2220
decl %r14d
leal -0x1(%r15), %ebp
movq %rax, 0x18(%rsp)
leaq 0x8(%rax), %r13
xorl %ebx, %ebx
cmpl %ebp, %r14d
jl 0x17d1d
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %r15d, %ecx
movl 0xc(%rsp), %r8d
movq %rsp, %r9
callq 0x17b2c
leal 0x1(%r14), %ecx
movl %eax, %edx
notl %edx
addl %r15d, %edx
cmpl %r15d, %eax
cmovlel %r15d, %eax
pushq $-0x1
popq %rsi
cmovll %esi, %edx
negl %eax
addl %r14d, %eax
incl %eax
movl %eax, -0x8(%r13)
movl %ecx, -0x4(%r13)
movl (%rsp), %eax
incq %rbx
movl %eax, (%r13)
addl %r14d, %edx
addq $0xc, %r13
movl %edx, %r14d
jmp 0x17cc0
movq 0x10(%rsp), %rax
movl %ebx, (%rax)
movq %rbx, %rdi
shrq %rdi
movslq %ebx, %rcx
imulq $0xc, %rcx, %rcx
movq 0x18(%rsp), %rax
addq %rax, %rcx
addq $-0xc, %rcx
movq %rax, %rdx
subq $0x1, %rdi
jb 0x17d78
movl 0x8(%rdx), %esi
movl %esi, 0x8(%rsp)
movq (%rdx), %rsi
movq %rsi, (%rsp)
movl 0x8(%rcx), %esi
movl %esi, 0x8(%rdx)
movq (%rcx), %rsi
movq %rsi, (%rdx)
movl 0x8(%rsp), %esi
movl %esi, 0x8(%rcx)
movq (%rsp), %rsi
movq %rsi, (%rcx)
addq $-0xc, %rcx
addq $0xc, %rdx
jmp 0x17d40
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/algodesigner[P]z80/console.c
// Function: console_init
void _console_init(void) {
    tcgetattr(0, &_old_term);
    
    _new_term = _old_term;
    
    _new_term.c_lflag &= ~ICANON; /* Input available immediately (no EOL needed) */
    _new_term.c_lflag &= ~ECHO; /* Do not echo input characters */
    _new_term.c_lflag &= ~ISIG; /* ^C and ^Z do not generate signals */
    _new_term.c_iflag &= INLCR; /* Translate NL to CR on input */
    
    tcsetattr(0, TCSANOW, &_new_term); /* Apply changes immediately */
    
    setvbuf(stdout, (char *)NULL, _IONBF, 0); /* Disable stdout buffering */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xeeb1(%rip), %rsi      # 0x18078
xorl %edi, %edi
callq 0x9090
movups 0xeea3(%rip), %xmm0     # 0x18078
movups %xmm0, 0xeed8(%rip)     # 0x180b4
movups 0xeea5(%rip), %xmm0     # 0x18088
movups %xmm0, 0xeeda(%rip)     # 0x180c4
movups 0xeea7(%rip), %xmm0     # 0x18098
movups %xmm0, 0xeedc(%rip)     # 0x180d4
movups 0xeea5(%rip), %xmm0     # 0x180a4
movups %xmm0, 0xeeda(%rip)     # 0x180e0
andb $-0xc, 0xeeb3(%rip)     # 0x180c0
leaq 0xeea0(%rip), %rdx      # 0x180b4
andl $0x40, 0xee99(%rip)     # 0x180b4
xorl %edi, %edi
xorl %esi, %esi
callq 0x90a0
movq 0xedb5(%rip), %rax      # 0x17fe0
movq (%rax), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
xorl %ecx, %ecx
popq %rbp
jmp 0x9080
// File: /workspace/github_c_makefile_star2_O2/algodesigner[P]z80/z80.c
// Function: z80_new
z80 *z80_new() {
    _console_init();
    z80 *cpu = calloc(1, sizeof(z80));
    z80_reset(cpu);
    return cpu;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x91bc
pushq $0x1
popq %rdi
movl $0x10060, %esi          # imm = 0x10060
callq 0x9060
orq $-0x1, 0x44(%rax)
orl $-0x1, 0x4c(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/algodesigner[P]z80/z80.c
// Function: watchprint
void watchprint(z80 *cpu, uint16_t pos) {
    uint8_t I, J;
    _puts("\r\n");
    _puts("  Watch : "); _puthex16(cpu->watch);
    _puts(" = "); _puthex8(_RamRead(cpu->watch)); _putcon(':'); _puthex8(_RamRead(cpu->watch + 1));
    _puts(" / ");
    for (J = 0, I = _RamRead(cpu->watch); J < 8; ++J, I <<= 1) _putcon(I & 0x80 ? '1' : '0');
    _putcon(':');
    for (J = 0, I = _RamRead(cpu->watch + 1); J < 8; ++J, I <<= 1) _putcon(I & 0x80 ? '1' : '0');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x84c7(%rip), %rdi      # 0x11840
callq 0x927a
leaq 0x838b(%rip), %rdi      # 0x11710
callq 0x927a
movzwl 0x4c(%rbx), %edi
callq 0x92eb
leaq 0x8381(%rip), %rdi      # 0x1171b
callq 0x927a
movslq 0x4c(%rbx), %rax
movzbl 0x60(%rbx,%rax), %edi
callq 0x929d
pushq $0x3a
popq %rdi
callq 0x9265
movslq 0x4c(%rbx), %rax
movzbl 0x61(%rax,%rbx), %edi
callq 0x929d
leaq 0x8355(%rip), %rdi      # 0x1171f
callq 0x927a
movslq 0x4c(%rbx), %rax
movb 0x60(%rbx,%rax), %r14b
movb $0x8, %r15b
subb $0x1, %r15b
jb 0x93f7
xorl %edi, %edi
testb %r14b, %r14b
setns %dil
xorl $0x31, %edi
callq 0x9265
addb %r14b, %r14b
jmp 0x93db
pushq $0x3a
popq %rdi
callq 0x9265
movslq 0x4c(%rbx), %rax
movb 0x61(%rbx,%rax), %bl
movb $0x8, %r14b
subb $0x1, %r14b
jb 0x9424
xorl %edi, %edi
testb %bl, %bl
setns %dil
xorl $0x31, %edi
callq 0x9265
addb %bl, %bl
jmp 0x940a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/algodesigner[P]z80/z80.c
// Function: memdump
void memdump(z80 *cpu, uint16_t pos) {
    uint16_t h = pos;
    uint16_t c = pos;
    uint8_t l, i;
    uint8_t ch = pos & 0xff;

    _puts("       ");
    for (i = 0; i < 16; ++i) {
        _puthex8(ch++ & 0x0f);
        _puts(" ");
    }
    _puts("\r\n");
    _puts("       ");
    for (i = 0; i < 16; ++i)
        _puts("---");
    _puts("\r\n");
    for (l = 0; l < 16; ++l) {
        _puthex16(h);
        _puts(" : ");
        for (i = 0; i < 16; ++i) {
            _puthex8(_RamRead(h++));
            _puts(" ");
        }
        for (i = 0; i < 16; ++i) {
            ch = _RamRead(c++);
            _putcon(ch > 31 && ch < 127 ? ch : '.');
        }
        _puts("\r\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r12d
movq %rdi, %r14
leaq 0x82d6(%rip), %rdi      # 0x11723
callq 0x927a
xorl %ebx, %ebx
leaq 0x82ce(%rip), %r15      # 0x11729
cmpb $0x10, %bl
je 0x947a
leal (%r12,%rbx), %eax
andb $0xf, %al
movzbl %al, %edi
callq 0x929d
movq %r15, %rdi
callq 0x927a
incb %bl
jmp 0x945b
leaq 0x83bf(%rip), %rdi      # 0x11840
callq 0x927a
leaq 0x8296(%rip), %rdi      # 0x11723
callq 0x927a
movb $0x10, %bl
leaq 0x8290(%rip), %r15      # 0x1172b
subb $0x1, %bl
jb 0x94aa
movq %r15, %rdi
callq 0x927a
jmp 0x949b
leaq 0x838f(%rip), %rdi      # 0x11840
callq 0x927a
xorl %ecx, %ecx
leaq 0x826a(%rip), %r13      # 0x11729
movq %r12, -0x30(%rbp)
cmpb $0x10, %cl
je 0x9560
movl %ecx, -0x34(%rbp)
movzwl -0x30(%rbp), %r15d
movl %r15d, %edi
callq 0x92eb
leaq 0x829b(%rip), %rdi      # 0x1177e
callq 0x927a
xorl %ebx, %ebx
cmpb $0x10, %bl
je 0x950d
leal (%r15,%rbx), %eax
movzwl %ax, %eax
movzbl 0x60(%r14,%rax), %edi
callq 0x929d
movq %r13, %rdi
callq 0x927a
incl %ebx
jmp 0x94ea
movq -0x30(%rbp), %rax
addl %ebx, %eax
movq %rax, -0x30(%rbp)
xorl %r15d, %r15d
pushq $0x2e
popq %rbx
cmpb $0x10, %r15b
je 0x9547
leal (%r12,%r15), %eax
movzwl %ax, %eax
movzbl 0x60(%r14,%rax), %eax
leal -0x20(%rax), %ecx
cmpb $0x5f, %cl
jb 0x953a
movl %ebx, %eax
movzbl %al, %edi
callq 0x9265
incl %r15d
jmp 0x951d
leaq 0x82f2(%rip), %rdi      # 0x11840
callq 0x927a
movl -0x34(%rbp), %ecx
incb %cl
addl %r15d, %r12d
jmp 0x94c3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/algodesigner[P]z80/main.c
// Function: main
int main(int argc, char *argv[])
{
    /*
     * Instantiate the CPU, activate the debug mode, set the intercept
     * function and run the virtual CPU until the termination criteria
     * set by the intercept function, if any, are met.
     */
    z80 *cpu = z80_new();
    cpu->debug = 1;
    z80_set_intercept(cpu, cpu, intercept);
    z80_run(cpu);
    z80_destroy(cpu);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %eax, %eax
callq 0x931c
movq %rax, %rbx
movl $0x1, 0x40(%rax)
leaq 0x24(%rip), %rdx        # 0xdf66
movq %rax, %rdi
movq %rax, %rsi
callq 0x9357
movq %rbx, %rdi
callq 0x9c30
movq %rbx, %rdi
callq 0xdf12
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/seabug.c
// Function: linear_gradient_colors
static void linear_gradient_colors(scg_pixel_t *out, int stops,
                                   scg_pixel_t start, scg_pixel_t end) {
    float32_t step_factor = 1.0f / (float32_t)(stops - 1);

    for (int i = 0; i < stops; i++) {
        float32_t t = step_factor * (float32_t)i;
        out[i] = scg_pixel_lerp_rgb(start, end, t);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
xorl %r15d, %r15d
cmpq $0x20, %r15
je 0x5760
cvtsi2ss %r15d, %xmm0
mulss 0x90a(%rip), %xmm0      # 0x6058
movl %ebp, %edi
movl %ebx, %esi
callq 0x27b2
movl %eax, (%r14,%r15,4)
incq %r15
jmp 0x573b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pyk[P]simple-nn/deps/pcg/sample/pcg32x2-demo.c
// Function: pcg32x2_boundedrand_r
uint64_t pcg32x2_boundedrand_r(pcg32x2_random_t* rng, uint64_t bound)
{
    uint64_t threshold = -bound % bound;
    for (;;) {
        uint64_t r = pcg32x2_random_r(rng);
        if (r >= threshold)
            return r % bound;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
negq %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r15
movq %r14, %rdi
callq 0x1202
cmpq %r15, %rax
jb 0x126c
xorl %edx, %edx
divq %rbx
movq %rdx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: cas_prof
UNUSED static uint64_t
cas_prof(cache_line_t* cl, const size_t reps, mctop_prof_t* profiler)
{
  volatile uint64_t c = 0;
  MCTOP_PROF_START(profiler, ticks_start);
  c = CAS_U64(cl->word, 0, 1);
  MCTOP_PROF_STOP(profiler, ticks_start, reps);
  return c;
}

// Assembly:
movq %rdx, %rcx
movq $0x0, -0x8(%rsp)
rdtsc
movl %eax, %r9d
movl %edx, %r8d
movabsq $0x1, %rdx
xorl %eax, %eax
lock
cmpxchgq %rdx, (%rdi)
movl %r9d, %edi
negl %r8d
shlq $0x20, %r8
movq %rax, -0x8(%rsp)
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
addq %rax, %rdx
addq 0x8(%rcx), %rdi
subq %rdi, %r8
addq %rdx, %r8
movq %r8, 0x40(%rcx,%rsi,8)
movq -0x8(%rsp), %rax
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: is_smt
void*
is_smt(void* param)
{
  tld_t* tld = (tld_t*) param;
  const int tid = tld->id;
  const int hwc = tld->hw_context;
  barrier2_t* barrier2 = tld->barrier2;
  pthread_barrier_t* barrier = tld->barrier;

  mctop_set_cpu(NULL, hwc);
  spin_time(test_num_smt_reps >> 8);
  barrier2_cross_explicit(barrier2, tid, 0);

  const int n_smt = 5;
  int is_smt_n = 0;
  for (int i = 0; i < 5; i++)
    {
      barrier2_cross_explicit(barrier2, tid, 2);
      ticks times[2];
      if (tid == 0)
	{
	  times[0] = spin_time(test_num_smt_reps);
	  pthread_barrier_wait(barrier);
	}
      else
	{
	  pthread_barrier_wait(barrier);
	}

      pthread_barrier_wait(barrier);
      barrier2_cross_explicit(barrier2, tid, 1);
      times[1] = spin_time(test_num_smt_reps);
      if (tid == 0)
	{
	  is_smt_n += (times[0] < (times[1] * test_smt_ratio));
	}
    }

  if (tid == 0)
    {
      int* smt = malloc_assert(sizeof(smt));
      *smt = (is_smt_n > (n_smt - is_smt_n));
      return smt;
    }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %ebx
movl 0x8(%rdi), %esi
movq 0x10(%rdi), %r14
movq 0x18(%rdi), %r15
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x841d
movl $0x9896, %edi           # imm = 0x9896
callq 0x5632
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x5857
pushq $0x5
popq %r13
subl $0x1, %r13d
jb 0x2f59
movq %r14, %rdi
movl %ebx, %esi
pushq $0x2
popq %rdx
callq 0x5857
testl %ebx, %ebx
jne 0x2ed3
movl $0x989680, %edi         # imm = 0x989680
callq 0x5632
movq %rax, %rbp
movq %r15, %rdi
callq 0x2090
movq %r15, %rdi
callq 0x2090
movq %r14, %rdi
movl %ebx, %esi
pushq $0x1
popq %rdx
callq 0x5857
movl $0x989680, %edi         # imm = 0x989680
callq 0x5632
testl %ebx, %ebx
jne 0x2eab
movq %rbp, %xmm0
movq 0x7145(%rip), %xmm2     # 0xa050
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x7149(%rip), %xmm3     # 0xa060
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x70e0(%rip), %xmm2     # 0xa028
xorl %eax, %eax
ucomisd %xmm1, %xmm2
seta %al
addl %eax, %r12d
jmp 0x2eab
testl %ebx, %ebx
je 0x2f61
xorl %eax, %eax
jmp 0x2f79
pushq $0x8
popq %rdi
callq 0x2b8e
pushq $0x5
popq %rcx
subl %r12d, %ecx
xorl %edx, %edx
cmpl %ecx, %r12d
setg %dl
movl %edx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: mem_bw_estimate
double
mem_bw_estimate(volatile cache_line_t* mem, const uint do_read, const size_t n, const size_t reps)
{
  volatile uint64_t* m0 = (volatile uint64_t*) mem;
  size_t sum = 0;
  volatile size_t suma = 0;

  const size_t n_warmup = n >> 2;
  for (size_t i = 0; i < n_warmup; i++)
    {
      sum = m0[i];
    }

  struct timespec start, stop;
  clock_gettime(CLOCK_REALTIME, &start);
  if (do_read == BW_READ)
    {
      for (uint r = 0; r < reps; r++)
	{
	  for (size_t i = 0; i < n; i++)
	    {
	      sum = m0[i];
	    }
	}
    }
  else if (do_read == BW_WRITE)
    {
      for (uint r = 0; r < reps; r++)
	{
	  for (size_t i = 0; i < n; i++)
	    {
	      m0[i] = 0xAAAAFFFF;
	    }
	}
    }
  clock_gettime(CLOCK_REALTIME, &stop);

  for (size_t i = 0; i < n_warmup; i++)
    {
      sum = m0[i];
    }


  struct timespec dur = timespec_diff(start, stop);
  double dur_s = dur.tv_sec + (dur.tv_nsec / 1e9);
  if (dur_s == 9)
    {
      printf("%p%zu%zu", m0, sum, suma);
    }

  double bw = (reps * n * sizeof(uint64_t)) / (1e9 * dur_s);
  return bw;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq $0x0, 0x10(%rsp)
movq %rdx, %r13
shrq $0x2, %r13
xorl %eax, %eax
xorl %r12d, %r12d
cmpq %rax, %r13
je 0x2fc4
movq (%r15,%rax,8), %r12
incq %rax
jmp 0x2fb6
leaq 0x28(%rsp), %rsi
xorl %edi, %edi
callq 0x20b0
testl %ebp, %ebp
je 0x300d
cmpl $0x1, %ebp
jne 0x3014
xorl %eax, %eax
movl $0xaaaaffff, %ecx       # imm = 0xAAAAFFFF
movl %eax, %edx
cmpq %r14, %rdx
jae 0x3014
xorl %edx, %edx
cmpq %rdx, %rbx
je 0x2ff7
movq %rcx, (%r15,%rdx,8)
incq %rdx
jmp 0x2fe9
incl %eax
jmp 0x2fe0
xorl %eax, %eax
cmpq %rax, %rbx
je 0x300b
movq (%r15,%rax,8), %r12
incq %rax
jmp 0x2ffd
incl %ebp
movl %ebp, %eax
cmpq %r14, %rax
jb 0x2ffb
xorl %ebp, %ebp
leaq 0x18(%rsp), %rsi
xorl %edi, %edi
callq 0x20b0
cmpq %rbp, %r13
je 0x3030
movq (%r15,%rbp,8), %r12
incq %rbp
jmp 0x3022
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x54cc
cvtsi2sd %rax, %xmm0
cvtsi2sd %rdx, %xmm2
divsd 0x6fd5(%rip), %xmm2     # 0xa030
addsd %xmm0, %xmm2
ucomisd 0x6fd1(%rip), %xmm2     # 0xa038
jne 0x3090
jp 0x3090
movq 0x10(%rsp), %rcx
leaq 0x726f(%rip), %rdi      # 0xa2e6
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
movsd %xmm2, 0x8(%rsp)
callq 0x2100
movsd 0x8(%rsp), %xmm2
imulq %r14, %rbx
shlq $0x3, %rbx
movq %rbx, %xmm1
punpckldq 0x6fab(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x6fb3(%rip), %xmm1     # 0xa060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x6f6f(%rip), %xmm2     # 0xa030
divsd %xmm2, %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: lat_table_normalized_create
ticks**
lat_table_normalized_create(ticks* lat_table, const size_t n, cdf_cluster_t* cc)
{
  ticks** lat_table_norm = malloc_assert(n * sizeof(ticks*));
  for (int i = 0; i < n ; i++)
    {
      lat_table_norm[i] = malloc_assert(n * sizeof(ticks));
    }

  for (size_t x = 0; x < n; x++)
    {
      for (size_t y = 0; y < n; y++)
	{
	  ticks lat = lat_table_2d_get(lat_table, n, x, y);
	  lat_table_norm[x][y] = cdf_cluster_value_to_cluster_median(cc, lat);
	}
    }

  return lat_table_norm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq (,%rsi,8), %r13
movq %r13, %rdi
callq 0x2b8e
movq %rax, %r12
xorl %ebx, %ebx
cmpq %rbx, %r14
je 0x45a0
movq %r13, %rdi
callq 0x2b8e
movq %rax, (%r12,%rbx,8)
incq %rbx
jmp 0x458a
movq %r14, %rax
shlq $0x20, %rax
movq %rax, (%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq %r14, %rbp
je 0x45fe
movq %r13, 0x8(%rsp)
xorl %ebx, %ebx
cmpq %rbx, %r14
je 0x45f0
movq %r13, %rax
sarq $0x1d, %rax
movq (%r15,%rax), %rsi
movq 0x10(%rsp), %rdi
callq 0x5e1e
movq (%r12,%rbp,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r13
jmp 0x45bc
incq %rbp
movq 0x8(%rsp), %r13
addq (%rsp), %r13
jmp 0x45b0
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: lat_table_get_hwc_with_lat
int
lat_table_get_hwc_with_lat(ticks** lat_table, const size_t n, ticks target_lat, int* hwcs)
{
  for (int x = 0; x < n; x++)
    {
      for (int y = 0; y < n; y++)
	{
	  if (lat_table[x][y] == target_lat)
	    {
	      hwcs[0] = x;
	      hwcs[1] = y;
	      return 1;
	    }
	}
    }
  return 0;
}

// Assembly:
xorl %r8d, %r8d
cmpq %rsi, %r8
je 0x4639
xorl %eax, %eax
cmpq %rax, %rsi
je 0x462e
movq (%rdi,%r8,8), %r9
cmpq %rdx, (%r9,%rax,8)
je 0x4633
incq %rax
jmp 0x461a
incq %r8
jmp 0x4613
movl %r8d, (%rcx)
movl %eax, 0x4(%rcx)
xorl %eax, %eax
cmpq %rsi, %r8
setb %al
retq
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop.c
// Function: print_cache_info
void 
print_cache_info(mctop_cache_info_t* mci, test_format_t test_format, const char* hostname)
{
  if (test_format == MCT_FILE)
    {
      printf("## Cache info ############################################################\n");
      char out_file[50];
      sprintf(out_file, "./desc/%s.mct", hostname);
      printf("## MCTOP output in: %s\n", out_file);

      int ofp_open = 1;
      FILE* ofp = fopen(out_file, "a");
      if (ofp == NULL) 
	{
	  ofp_open = 0;
	  fprintf(stderr, "MCTOP Error: Cannot open output file %s! Using stderr instead.\n", out_file);
	  ofp = stderr;
	}

      fprintf(ofp, "#Cache_levels %d\n", mci->n_levels);
      for (int i = 0; i < mci->n_levels; i++)
	{
	  fprintf(ofp, "Cache_level %d   Latency %-5zu  SizeOS %-5zu SizeEst %-5zu\n",
		  i, mci->latencies[i], mci->sizes_OS[i], mci->sizes_estimated[i]);
	}
      if (ofp_open)
	{
	  fclose(ofp);
	}
      printf("##########################################################################\n");
    }
}

// Assembly:
cmpl $0x3, %esi
jne 0x4ed8
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x687b(%rip), %rdi      # 0xb695
callq 0x2080
leaq 0x5946(%rip), %rsi      # 0xa76c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x22b0
leaq 0x593d(%rip), %rdi      # 0xa77a
movq %r15, %rsi
xorl %eax, %eax
callq 0x2100
leaq 0x59b7(%rip), %rsi      # 0xa805
movq %r15, %rdi
callq 0x2240
movq %rax, %r14
movq %rax, %r15
testq %rax, %rax
je 0x4ed9
movl (%rbx), %edx
leaq 0x599d(%rip), %rsi      # 0xa807
movq %r15, %rdi
xorl %eax, %eax
callq 0x2170
leaq 0x599e(%rip), %r12      # 0xa819
xorl %r13d, %r13d
movl (%rbx), %eax
cmpq %rax, %r13
jae 0x4eb2
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
movq (%rax,%r13,8), %rcx
movq (%rdx,%r13,8), %r8
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %r9
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2170
incq %r13
jmp 0x4e7e
testq %r14, %r14
je 0x4ebf
movq %r15, %rdi
callq 0x20e0
leaq 0x6865(%rip), %rdi      # 0xb72b
callq 0x2080
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xb110(%rip), %r15      # 0xfff0
movq (%r15), %rdi
leaq 0x58ab(%rip), %rsi      # 0xa795
movq %rsp, %rdx
xorl %eax, %eax
callq 0x2170
movq (%r15), %r15
jmp 0x4e61
// File: /workspace/github_c_makefile_star2_O2/LPD-EPFL[P]mctop/src/mctop_profiler.c
// Function: mctop_prof_create
mctop_prof_t*
mctop_prof_create(size_t num_entries)
{
  mctop_prof_t* prof = malloc_assert(sizeof(mctop_prof_t) + (num_entries * sizeof(ticks)));

  prof->size = num_entries;
  prof->correction = 0;
  prof->correction = mctop_prof_correction_calc(prof, num_entries);
  return prof;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x40(,%rdi,8), %rdi
callq 0x21d0
testq %rax, %rax
je 0x5278
movq %rax, %r14
movq %rbx, (%rax)
andq $0x0, 0x8(%rax)
movsd 0x65e5(%rip), %xmm0     # 0xb7b0
movl $0xf4240, %edi          # imm = 0xF4240
xorl %esi, %esi
callq 0x5684
pushq $0x8
popq %r12
leaq 0x10(%rsp), %r15
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq %rbx, %rax
jae 0x5225
rdtsc
movl %edx, %ecx
movl %eax, %esi
negl %ecx
shlq $0x20, %rcx
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
addq %rax, %rdx
addq 0x8(%r14), %rsi
subq %rsi, %rcx
addq %rdx, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%r14,%rax,8)
incq 0x8(%rsp)
jmp 0x51e9
movq %r14, %rdi
movq %r15, %rsi
callq 0x529a
movsd 0x30(%rsp), %xmm0
movq %r12, %xmm1
incq %r12
punpckldq 0x4e0a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4e12(%rip), %xmm1     # 0xa060
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x51e0
movq 0x18(%rsp), %rax
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x70c9(%rip), %rdi      # 0xc348
leaq 0x5879(%rip), %rsi      # 0xaaff
leaq 0x588b(%rip), %rcx      # 0xab18
pushq $0x59
popq %rdx
callq 0x2110