LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xutils.c
// Function: xdl_hash_record
unsigned long xdl_hash_record(char const **data, char const *top, long flags) {
	unsigned long ha = 5381;
	char const *ptr = *data;

	if (flags & XDF_WHITESPACE_FLAGS)
		return xdl_hash_record_with_whitespace(data, top, flags);

	for (; ptr < top && *ptr != '\n'; ptr++) {
		ha += (ha << 5);
		ha ^= (unsigned long) *ptr;
	}
	*data = ptr < top ? ptr + 1: ptr;

	return ha;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r13
movl $0x1505, %r14d          # imm = 0x1505
testb $0x1c, %r12b
je 0x40a4
cmpq %r15, %r13
setb %al
jae 0x40ac
movzbl (%r13), %ebp
cmpq $0xa, %rbp
je 0x40ac
callq 0x1150
movq (%rax), %rdi
testb $0x20, 0x1(%rdi,%rbp,2)
jne 0x3ff1
imulq $0x21, %r14, %rax
movsbq %bpl, %r14
xorq %rax, %r14
movq %r13, %rax
jmp 0x4084
movq %r13, %rcx
negq %rcx
leaq 0x1(%r13), %r8
movq %r8, %r9
movq %r9, %rax
movq %r8, %rdx
cmpq %r15, %r9
jae 0x4033
movzbl (%rax), %r8d
cmpl $0xa, %r8d
sete %sil
je 0x4036
movzwl (%rdi,%r8,2), %r10d
andl $0x2000, %r10d          # imm = 0x2000
leaq 0x1(%rax), %r9
leaq 0x1(%rdx), %r8
testw %r10w, %r10w
jne 0x3ffe
jmp 0x4036
movb $0x1, %sil
decq %rax
testb $0x4, %r12b
jne 0x4084
testb $0x8, %r12b
sete %dil
orb %sil, %dil
je 0x407c
testb $0x10, %r12b
sete %dil
orb %sil, %dil
jne 0x4084
cmpq %rdx, %r15
cmovbq %r15, %rdx
addq %rdx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x4084
imulq $0x21, %r14, %rsi
movsbq (%r13,%rdx), %r14
xorq %rsi, %r14
incq %rdx
jmp 0x4065
imulq $0x21, %r14, %r14
xorq $0x20, %r14
incq %rax
movq %rax, %r13
jmp 0x3fb4
movsbq (%r13), %rcx
cmpq $0xa, %rcx
je 0x40ac
imulq $0x21, %r14, %r14
xorq %rcx, %r14
incq %r13
cmpq %r15, %r13
setb %al
jb 0x408f
movzbl %al, %eax
addq %r13, %rax
movq %rax, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xutils.c
// Function: xdl_num_out
int xdl_num_out(char *out, long val) {
	char *ptr, *str = out;
	char buf[32];

	ptr = buf + sizeof(buf) - 1;
	*ptr = '\0';
	if (val < 0) {
		*--ptr = '-';
		val = -val;
	}
	for (; val && ptr > buf; val /= 10)
		*--ptr = "0123456789"[val % 10];
	if (*ptr)
		for (; *ptr; ptr++, str++)
			*str = *ptr;
	else
		*str++ = '0';
	*str = '\0';

	return str - out;
}

// Assembly:
movq %rsi, %rax
movb $0x0, -0x9(%rsp)
testq %rsi, %rsi
js 0x40f8
leaq -0x9(%rsp), %rcx
xorl %edx, %edx
jmp 0x4105
leaq -0xa(%rsp), %rcx
movb $0x2d, (%rcx)
negq %rax
movb $0x2d, %dl
leaq -0x28(%rsp), %rsi
leaq 0x302d(%rip), %r8       # 0x713e
movabsq $0xa, %r9
cmpq %rsi, %rcx
seta %r10b
testq %rax, %rax
je 0x413d
testb %r10b, %r10b
je 0x413d
xorl %edx, %edx
divq %r9
movb (%rdx,%r8), %dl
movb %dl, -0x1(%rcx)
decq %rcx
jmp 0x411b
testb %dl, %dl
je 0x4158
xorl %eax, %eax
testb %dl, %dl
je 0x4153
movb %dl, (%rdi,%rax)
movb 0x1(%rcx,%rax), %dl
incq %rax
jmp 0x4143
addq %rdi, %rax
jmp 0x415f
leaq 0x1(%rdi), %rax
movb $0x30, (%rdi)
movb $0x0, (%rax)
subl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xutils.c
// Function: xdl_emit_hunk_hdr
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
		      const char *func, long funclen, xdemitcb_t *ecb) {
	int nb = 0;
	mmbuffer_t mb;
	char buf[128];

	memcpy(buf, "@@ -", 4);
	nb += 4;

	nb += xdl_num_out(buf + nb, c1 ? s1: s1 - 1);

	if (c1 != 1) {
		memcpy(buf + nb, ",", 1);
		nb += 1;

		nb += xdl_num_out(buf + nb, c1);
	}

	memcpy(buf + nb, " +", 2);
	nb += 2;

	nb += xdl_num_out(buf + nb, c2 ? s2: s2 - 1);

	if (c2 != 1) {
		memcpy(buf + nb, ",", 1);
		nb += 1;

		nb += xdl_num_out(buf + nb, c2);
	}

	memcpy(buf + nb, " @@", 3);
	nb += 3;
	if (func && funclen) {
		buf[nb++] = ' ';
		if (funclen > sizeof(buf) - nb - 1)
			funclen = sizeof(buf) - nb - 1;
		memcpy(buf + nb, func, funclen);
		nb += funclen;
	}
	buf[nb++] = '\n';

	mb.ptr = buf;
	mb.size = nb;
	if (ecb->outf(ecb->priv, &mb, 1) < 0)
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rsi
leaq 0x4(%rsp), %rdi
movl $0x2d204040, -0x4(%rdi) # imm = 0x2D204040
cmpq $0x1, %r13
sbbq $0x0, %rsi
callq 0x40e2
movslq %eax, %rbp
leaq 0x4(%rbp), %rax
cmpq $0x1, %r13
je 0x41ca
movb $0x2c, (%rsp,%rax)
movq %rsp, %rax
leaq (%rax,%rbp), %rdi
addq $0x5, %rdi
movq %r13, %rsi
callq 0x40e2
addl %ebp, %eax
addl $0x5, %eax
movslq %eax, %r13
leaq (%rsp,%r13), %rdi
addq $0x2, %rdi
movw $0x2b20, -0x2(%rdi)     # imm = 0x2B20
cmpq $0x1, %r15
sbbq $0x0, %r12
movq %r12, %rsi
callq 0x40e2
addl %r13d, %eax
addl $0x2, %eax
cmpq $0x1, %r15
je 0x4212
movslq %eax, %r12
leaq (%rsp,%r12), %rdi
incq %rdi
movb $0x2c, -0x1(%rdi)
movq %r15, %rsi
callq 0x40e2
addl %r12d, %eax
incl %eax
movq 0xd0(%rsp), %r12
movslq %eax, %r13
movb $0x40, 0x2(%rsp,%r13)
movw $0x4020, (%rsp,%r13)    # imm = 0x4020
leaq 0x3(%r13), %rax
testq %rbx, %rbx
sete %cl
testq %r14, %r14
sete %dl
orb %cl, %dl
jne 0x426d
movb $0x20, (%rsp,%rax)
pushq $0x7b
popq %r15
subq %r13, %r15
cmpq %r14, %r15
cmovaeq %r14, %r15
movq %rsp, %rax
leaq (%rax,%r13), %rdi
addq $0x4, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10e0
leal (%r15,%r13), %eax
addl $0x4, %eax
movslq %eax, %rcx
incl %eax
movb $0xa, (%rsp,%rcx)
movq %rsp, %rcx
leaq 0x88(%rsp), %rsi
movq %rcx, (%rsi)
cltq
movq %rax, 0x8(%rsi)
movq (%r12), %rdi
pushq $0x1
popq %rdx
callq *0x8(%r12)
sarl $0x1f, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xutils.c
// Function: xdl_fall_back_diff
int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
		int line1, int count1, int line2, int count2)
{
	/*
	 * This probably does not work outside Git, since
	 * we have a very simple mmfile structure.
	 *
	 * Note: ideally, we would reuse the prepared environment, but
	 * the libxdiff interface does not (yet) allow for diffing only
	 * ranges of lines instead of the whole files.
	 */
	mmfile_t subfile1, subfile2;
	xdfenv_t env;

	subfile1.ptr = (char *)diff_env->xdf1.recs[line1 - 1]->ptr;
	subfile1.size = diff_env->xdf1.recs[line1 + count1 - 2]->ptr +
		diff_env->xdf1.recs[line1 + count1 - 2]->size - subfile1.ptr;
	subfile2.ptr = (char *)diff_env->xdf2.recs[line2 - 1]->ptr;
	subfile2.size = diff_env->xdf2.recs[line2 + count2 - 2]->ptr +
		diff_env->xdf2.recs[line2 + count2 - 2]->size - subfile2.ptr;
	if (xdl_do_diff(&subfile1, &subfile2, xpp, &env) < 0)
		return -1;

	memcpy(diff_env->xdf1.rchg + line1 - 1, env.xdf1.rchg, count1);
	memcpy(diff_env->xdf2.rchg + line2 - 1, env.xdf2.rchg, count2);

	xdl_free_env(&env);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %r9d, %ebx
movl %ecx, %r15d
movl %edx, %eax
movq %rsi, %rdx
movq %rdi, %r14
movq 0x60(%rdi), %rcx
movslq %eax, %r12
movq -0x8(%rcx,%r12,8), %rax
movq 0x8(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
leal (%r12,%r15), %esi
movslq %esi, %rsi
movq -0x10(%rcx,%rsi,8), %rcx
movq 0x8(%rcx), %rsi
addq 0x10(%rcx), %rsi
subq %rax, %rsi
movq %rsi, 0x8(%rdi)
movq 0xe8(%r14), %rax
movslq %r8d, %r13
movq -0x8(%rax,%r13,8), %rcx
movq 0x8(%rcx), %rcx
movq %rsp, %rsi
movq %rcx, (%rsi)
leal (%r13,%rbx), %r8d
movslq %r8d, %r8
movq -0x10(%rax,%r8,8), %rax
movq 0x8(%rax), %r8
addq 0x10(%rax), %r8
subq %rcx, %r8
movq %r8, 0x8(%rsi)
leaq 0x20(%rsp), %rcx
callq 0x1a70
testl %eax, %eax
js 0x4386
movq 0x68(%r14), %rax
leaq (%rax,%r12), %rdi
decq %rdi
leaq 0x20(%rsp), %r12
movq 0x68(%r12), %rsi
movslq %r15d, %rdx
callq 0x10e0
movq 0xf0(%r14), %rax
leaq (%rax,%r13), %rdi
decq %rdi
movq 0xf0(%r12), %rsi
movslq %ebx, %rdx
callq 0x10e0
movq %r12, %rdi
callq 0x3a52
xorl %eax, %eax
jmp 0x4389
pushq $-0x1
popq %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xmerge.c
// Function: xdl_append_merge
static int xdl_append_merge(xdmerge_t **merge, int mode,
			    long i0, long chg0,
			    long i1, long chg1,
			    long i2, long chg2)
{
	xdmerge_t *m = *merge;
	if (m && (i1 <= m->i1 + m->chg1 || i2 <= m->i2 + m->chg2)) {
		if (mode != m->mode)
			m->mode = 0;
		m->chg0 = i0 + chg0 - m->i0;
		m->chg1 = i1 + chg1 - m->i1;
		m->chg2 = i2 + chg2 - m->i2;
	} else {
		m = xdl_malloc(sizeof(xdmerge_t));
		if (!m)
			return -1;
		m->next = NULL;
		m->mode = mode;
		m->i0 = i0;
		m->chg0 = chg0;
		m->i1 = i1;
		m->chg1 = chg1;
		m->i2 = i2;
		m->chg2 = chg2;
		if (*merge)
			(*merge)->next = m;
		*merge = m;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdi, %r12
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %rdi
movq (%r12), %r13
testq %r13, %r13
je 0x4d31
movq 0x10(%r13), %rax
movq 0x20(%r13), %rcx
addq %rax, %rcx
cmpq %r14, %rcx
jge 0x4d83
movq 0x28(%r13), %rcx
addq 0x18(%r13), %rcx
cmpq %rdi, %rcx
jge 0x4d83
movl %esi, 0xc(%rsp)
movq %rdx, 0x10(%rsp)
pushq $0x40
popq %rdi
callq 0x10f0
testq %rax, %rax
je 0x4dbf
andq $0x0, (%rax)
movl 0xc(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rax)
movq %r15, 0x38(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x20(%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq %rbp, 0x28(%rax)
testq %r13, %r13
je 0x4d7d
movq %rax, (%r13)
movq %rax, (%r12)
jmp 0x4dae
cmpl %esi, 0x8(%r13)
je 0x4d8e
andl $0x0, 0x8(%r13)
addq %rdx, %r15
subq 0x30(%r13), %r15
movq %r15, 0x38(%r13)
addq %r14, %rbx
subq %rax, %rbx
movq %rbx, 0x20(%r13)
addq %rdi, %rbp
subq 0x18(%r13), %rbp
movq %rbp, 0x28(%r13)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
jmp 0x4db0
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xmerge.c
// Function: xdl_cleanup_merge
static int xdl_cleanup_merge(xdmerge_t *c)
{
	int count = 0;
	xdmerge_t *next_c;

	/* were there conflicts? */
	for (; c; c = next_c) {
		if (c->mode == 0)
			count++;
		next_c = c->next;
		free(c);
	}
	return count;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x4de3
cmpl $0x1, 0x8(%rdi)
adcl $0x0, %ebx
movq (%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x4dca
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xmerge.c
// Function: is_cr_needed
static int is_cr_needed(xdfenv_t *xe1, xdfenv_t *xe2, xdmerge_t *m)
{
	int needs_cr;

	/* Match post-images' preceding, or first, lines' end-of-line style */
	needs_cr = is_eol_crlf(&xe1->xdf2, m->i1 ? m->i1 - 1 : 0);
	if (needs_cr)
		needs_cr = is_eol_crlf(&xe2->xdf2, m->i2 ? m->i2 - 1 : 0);
	/* Look at pre-image's first line, unless we already settled on LF */
	if (needs_cr)
		needs_cr = is_eol_crlf(&xe1->xdf1, 0);
	/* If still undecided, use LF-only */
	return needs_cr < 0 ? 0 : needs_cr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
addq $0x88, %rdi
movq 0x10(%rdx), %rax
leal -0x1(%rax), %esi
xorl %ebx, %ebx
testq %rax, %rax
cmovel %ebx, %esi
callq 0x53bf
movl $0x0, %ebp
testl %eax, %eax
je 0x52e9
addq $0x88, %r15
movq 0x18(%r12), %rax
leal -0x1(%rax), %esi
xorl %ebp, %ebp
testq %rax, %rax
cmovel %ebp, %esi
movq %r15, %rdi
callq 0x53bf
testl %eax, %eax
je 0x52e9
movq %r14, %rdi
xorl %esi, %esi
callq 0x53bf
movl %eax, %ebp
testl %ebp, %ebp
cmovgl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xmerge.c
// Function: xdl_recs_copy_0
static int xdl_recs_copy_0(int use_orig, xdfenv_t *xe, int i, int count, int needs_cr, int add_nl, char *dest)
{
	xrecord_t **recs;
	int size = 0;

	recs = (use_orig ? xe->xdf1.recs : xe->xdf2.recs) + i;

	if (count < 1)
		return 0;

	for (i = 0; i < count; size += recs[i++]->size)
		if (dest)
			memcpy(dest + size, recs[i]->ptr, recs[i]->size);
	if (add_nl) {
		i = recs[count - 1]->size;
		if (i == 0 || recs[count - 1]->ptr[i - 1] != '\n') {
			if (needs_cr) {
				if (dest)
					dest[size] = '\r';
				size++;
			}

			if (dest)
				dest[size] = '\n';
			size++;
		}
	}
	return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x60(%rsi), %rax
addq $0xe8, %rsi
testl %edi, %edi
cmovneq %rax, %rsi
testl %ecx, %ecx
jle 0x53ac
movl %r9d, %r14d
movl %r8d, 0x4(%rsp)
movslq %edx, %r12
shlq $0x3, %r12
addq (%rsi), %r12
movq 0x40(%rsp), %r15
movl %ecx, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
movslq %ebx, %rdi
cmpq %rbp, %r13
je 0x5368
testq %r15, %r15
je 0x535c
addq %r15, %rdi
movq (%r12,%rbp,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x10e0
movq (%r12,%rbp,8), %rax
incq %rbp
addl 0x10(%rax), %ebx
jmp 0x533b
testl %r14d, %r14d
je 0x53ae
movq -0x8(%r12,%r13,8), %rcx
movl 0x10(%rcx), %eax
testq %rax, %rax
je 0x5388
movq 0x8(%rcx), %rcx
decl %eax
cltq
cmpb $0xa, (%rcx,%rax)
je 0x53ae
cmpl $0x0, 0x4(%rsp)
je 0x539b
testq %r15, %r15
je 0x5399
movb $0xd, (%r15,%rdi)
incl %ebx
testq %r15, %r15
je 0x53a8
movslq %ebx, %rax
movb $0xa, (%r15,%rax)
incl %ebx
jmp 0x53ae
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xmerge.c
// Function: is_eol_crlf
static int is_eol_crlf(xdfile_t *file, int i)
{
	long size;

	if (i < file->nrec - 1)
		/* All lines before the last *must* end in LF */
		return (size = file->recs[i]->size) > 1 &&
			file->recs[i]->ptr[size - 2] == '\r';
	if (!file->nrec)
		/* Cannot determine eol style from empty file */
		return -1;
	if ((size = file->recs[i]->size) &&
			file->recs[i]->ptr[size - 1] == '\n')
		/* Last line; ends in LF; Is it CR/LF? */
		return size > 1 &&
			file->recs[i]->ptr[size - 2] == '\r';
	if (!i)
		/* The only line has no eol */
		return -1;
	/* Determine eol from second-to-last line */
	return (size = file->recs[i - 1]->size) > 1 &&
		file->recs[i - 1]->ptr[size - 2] == '\r';
}

// Assembly:
movslq %esi, %rdx
movq 0x38(%rdi), %rcx
leaq -0x1(%rcx), %rax
cmpq %rdx, %rax
jle 0x53e3
movq 0x60(%rdi), %rax
movq (%rax,%rdx,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x1, %rcx
jg 0x5426
jmp 0x5434
pushq $-0x1
popq %rax
testq %rcx, %rcx
je 0x5433
movq 0x60(%rdi), %rdi
movq (%rdi,%rdx,8), %rcx
movq 0x10(%rcx), %r8
testq %r8, %r8
je 0x5413
movq 0x8(%rcx), %rcx
cmpb $0xa, -0x1(%rcx,%r8)
jne 0x5413
cmpq $0x1, %r8
jle 0x5434
addq %r8, %rcx
jmp 0x542a
testl %esi, %esi
je 0x5433
movq -0x8(%rdi,%rdx,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x2, %rcx
jl 0x5434
addq 0x8(%rax), %rcx
xorl %eax, %eax
cmpb $0xd, -0x2(%rcx)
sete %al
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/xdiff/xhistogram.c
// Function: xdl_do_histogram_diff
int xdl_do_histogram_diff(mmfile_t *file1, mmfile_t *file2,
	xpparam_t const *xpp, xdfenv_t *env)
{
	if (xdl_prepare_env(file1, file2, xpp, env) < 0)
		return -1;

	return histogram_diff(xpp, env,
		env->xdf1.dstart + 1, env->xdf1.dend - env->xdf1.dstart + 1,
		env->xdf2.dstart + 1, env->xdf2.dend - env->xdf2.dstart + 1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
callq 0x31a8
testl %eax, %eax
js 0x547d
movl 0x50(%rbx), %edx
movl 0x58(%rbx), %ecx
subl %edx, %ecx
incl %edx
incl %ecx
movl 0xd8(%rbx), %r8d
movl 0xe0(%rbx), %r9d
subl %r8d, %r9d
incl %r8d
incl %r9d
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5488
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/main.c
// Function: xmalloc
void *
xmalloc(size_t len)
{
	void *p = malloc(len);

	if (!p)
		die("Out of memory\n");

	return p;
}

// Assembly:
pushq %rax
callq 0x10f0
testq %rax, %rax
je 0x5d95
popq %rcx
retq
leaq 0x13b1(%rip), %rdi      # 0x714d
xorl %eax, %eax
callq 0x5cf0
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/main.c
// Function: print_ed_cmd
void print_ed_cmd (char cmd, long s1, long e1, long s2, long e2)
{
        // XXX Coalesce all the writes to stdio ?
        if (s1 == e1) printf("%ld", s1); else printf("%ld,%ld", s1, e1);
        putchar(cmd);
        if (s2 == e2) printf("%ld", s2); else printf("%ld,%ld", s2, e2);
        putchar('\n');
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %r8, %r14
movq %rcx, %rbx
movl %edi, %ebp
cmpq %rdx, %rsi
jne 0x5dc4
leaq 0x13a5(%rip), %rdi      # 0x7160
xorl %eax, %eax
callq 0x1080
jmp 0x5dd2
leaq 0x1391(%rip), %rdi      # 0x715c
xorl %eax, %eax
callq 0x1080
movsbl %bpl, %edi
callq 0x1040
cmpq %r14, %rbx
jne 0x5df3
leaq 0x1379(%rip), %rdi      # 0x7160
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
jmp 0x5e07
leaq 0x1362(%rip), %rdi      # 0x715c
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1080
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/main.c
// Function: print_hunk
int print_hunk (long start_a, long count_a, long start_b, long count_b, void *cb_data)
{
        int s1, e1, s2, e2;

        // Adjust the start-end ranges
        s1 = count_a? start_a + 1: start_a;
        e1 = start_a + count_a;

        s2 = count_b? start_b + 1: start_b;
        e2 = start_b + count_b;

        if (count_b == 0)
                // Delete lines from a
                print_ed_cmd('d', s1, e1, e2, e2);
        else if (count_a == 0)
                // Add lines to a
                print_ed_cmd('a', e1, e1, s2, e2);
        else
                // Change lines
                print_ed_cmd('c', s1, e1, s2, e2);

        seen_hunk = 1;

        return 1;
}

// Assembly:
pushq %rax
cmpq $0x1, %rsi
movq %rdi, %r9
sbbq $-0x1, %r9
leaq (%rsi,%rdi), %r8
xorl %eax, %eax
testq %rcx, %rcx
setne %r10b
je 0x5e4c
movb %r10b, %al
addq %rdx, %rax
addq %rdx, %rcx
testq %rsi, %rsi
je 0x5e60
movslq %r9d, %rsi
movslq %r8d, %rdx
cltq
movslq %ecx, %r8
pushq $0x63
popq %rdi
jmp 0x5e6e
movslq %r9d, %rsi
movslq %r8d, %rax
movslq %edx, %rcx
pushq $0x64
popq %rdi
movq %rax, %rdx
movq %rcx, %r8
jmp 0x5e71
movslq %edi, %rdx
cltq
movslq %ecx, %r8
pushq $0x61
popq %rdi
movq %rdx, %rsi
movq %rax, %rcx
callq 0x5da3
movl $0x1, 0x4248(%rip)      # 0xa0c8
pushq $0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/main.c
// Function: read_mmfile
void read_mmfile (mmfile_t *mf, const char *path)
{
        FILE *fp;
        struct stat st;
        size_t size;

        if (stat(path, &st))
                die("Could not stat %s\n", path);

        size = st.st_size;

        fp = fopen(path, "r");
        if (fp == NULL)
                die("Could not open %s\n", path);

        mf->ptr = xmalloc(size);
        mf->size = size;

        fread(mf->ptr, 1, size, fp);
        fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10d0
testl %eax, %eax
jne 0x5efc
movq 0x38(%rsp), %r15
leaq 0x12c1(%rip), %rsi      # 0x7177
movq %rbx, %rdi
callq 0x1120
testq %rax, %rax
je 0x5f05
movq %rax, %r12
movq %r15, %rdi
callq 0x5d88
movq %rax, (%r14)
movq %r15, 0x8(%r14)
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1050
movq %r12, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1060
leaq 0x1261(%rip), %rdi      # 0x7164
jmp 0x5f0c
leaq 0x126d(%rip), %rdi      # 0x7179
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5cf0
// File: /workspace/github_c_makefile_star2_O2/LemonBoy[P]autobahn/main.c
// Function: main
int main (int argc, char **argv)
{
        xpparam_t param = { 0 };
        xdemitconf_t econf = { 0, 0, 0, NULL, NULL, print_hunk };
        xdemitcb_t ecb = { NULL, NULL, };

        param.flags = XDF_INDENT_HEURISTIC;

        ARGBEGIN {
        case '1':
        case '2':
                param.flags &= ~XDF_DIFF_ALGORITHM_MASK;
                param.flags |= (ARGC() == '1') ? XDF_PATIENCE_DIFF : XDF_HISTOGRAM_DIFF;
                break;
        case 'Z':
                param.flags |= XDF_IGNORE_WHITESPACE_AT_EOL;
                break;
        case 'b':
                param.flags |= XDF_IGNORE_WHITESPACE_CHANGE;
                break;
        case 'w':
                param.flags |= XDF_IGNORE_WHITESPACE;
                break;
        case 'd':
                param.flags |= XDF_NEED_MINIMAL;
                break;
        case 'B':
                param.flags |= XDF_IGNORE_BLANK_LINES;
                break;
        default:
                usage();
        } ARGEND;

        if (argc != 2)
                usage();

        mmfile_t f1, f2;
        read_mmfile(&f1, argv[0]);
        read_mmfile(&f2, argv[1]);

        seen_hunk = 0;
        xdl_diff(&f1, &f2, &param, &econf, &ecb);

        return (seen_hunk ? EXIT_FAILURE : EXIT_SUCCESS);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movups 0x3ea6(%rip), %xmm0     # 0x9de0
movaps %xmm0, 0x40(%rsp)
movups 0x3e8a(%rip), %xmm0     # 0x9dd0
movaps %xmm0, 0x30(%rsp)
movups 0x3e6e(%rip), %xmm0     # 0x9dc0
movaps %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x100, 0x8(%rsp)       # imm = 0x100
movq (%rsi), %rax
movq %rax, 0x415e(%rip)      # 0xa0d0
movl $0x100, %ecx            # imm = 0x100
leaq 0x8(%rsi), %r14
leal -0x1(%rdi), %eax
movq 0x8(%rsi), %r8
testq %r8, %r8
je 0x603f
cmpb $0x2d, (%r8)
jne 0x603f
leaq 0x1(%r8), %rdx
movzbl 0x1(%r8), %r9d
cmpl $0x2d, %r9d
je 0x5fae
testl %r9d, %r9d
jne 0x5ff8
jmp 0x603f
cmpb $0x0, 0x2(%r8)
jne 0x5ff8
jmp 0x6033
orq $0x4, %rcx
jmp 0x5ff0
andq $-0x61, %rcx
xorl %esi, %esi
cmpb $0x31, %dil
setne %sil
shll $0x5, %esi
addq %rsi, %rcx
addq $0x20, %rcx
jmp 0x5ff0
orq $0x10, %rcx
jmp 0x5ff0
orq $0x2, %rcx
jmp 0x5ff0
orq $0x80, %rcx
jmp 0x5ff0
orq $0x8, %rcx
movq %rcx, 0x8(%rsp)
incq %rdx
movq %rdx, (%r14)
movb (%rdx), %dil
movzbl %dil, %esi
leal -0x31(%rsi), %r8d
cmpl $0x2, %r8d
jb 0x5fbd
cmpl $0x42, %esi
je 0x5fe3
cmpl $0x5a, %esi
je 0x5fd7
cmpl $0x62, %esi
je 0x5fec
cmpl $0x64, %esi
je 0x5fdd
cmpl $0x77, %esi
je 0x5fb7
testl %esi, %esi
jne 0x609a
movq %r14, %rsi
movl %eax, %edi
jmp 0x5f77
addq $0x10, %rsi
addl $-0x2, %edi
movq %rsi, %r14
movl %edi, %eax
cmpl $0x2, %eax
jne 0x609a
movq (%r14), %rsi
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x5e85
movq 0x8(%r14), %rsi
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x5e85
andl $0x0, 0x405c(%rip)      # 0xa0c8
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2253
xorl %eax, %eax
cmpl $0x0, 0x4039(%rip)      # 0xa0c8
setne %al
addq $0x78, %rsp
popq %rbx
popq %r14
retq
callq 0x5f16
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/pthread_mutex1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	while (1) {
		pthread_mutex_lock(&mutex);
		pthread_mutex_unlock(&mutex);

		(*iterations)++;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xa5da(%rip), %r14      # 0xc1a8
movq %r14, %rdi
callq 0x1290
movq %r14, %rdi
callq 0x11b0
incq (%rbx)
jmp 0x1bce
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/main_scc_para.c
// Function: generate_graph
t_graph *generate_graph()
{
	t_graph *new = (t_graph*)malloc(sizeof(t_graph));
	new->head = NULL;
	new->tail = NULL;
	new->components = 0;
	if (!get_dimensions(new))
		error(WRONG_INPUT);
	if (!get_edges(new))
		error(WRONG_EDGE);
	new->scc = (int*)malloc(sizeof(int)*new->vertx);
	new->vis = (int*)malloc(sizeof(int)*new->vertx);
	memset(new->scc, -1, sizeof(int) * new->vertx);
	memset(new->vis, 0, sizeof(int) * new->vertx);
	return (new);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x40
popq %rdi
callq 0x10b0
movq %rax, %rbx
andl $0x0, 0x30(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rax, %rdi
callq 0x1916
testl %eax, %eax
jne 0x124f
xorl %edi, %edi
callq 0x1afc
movq %rbx, %rdi
callq 0x1a29
testl %eax, %eax
jne 0x1263
pushq $0x1
popq %rdi
callq 0x1afc
movslq 0x34(%rbx), %r14
shlq $0x2, %r14
movq %r14, %rdi
callq 0x10b0
movq %rax, %r15
movq %rax, 0x28(%rbx)
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x1090
movq %rax, 0x20(%rbx)
movq %r15, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x1080
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/main_scc_para.c
// Function: init_resource
t_resource	*init_resource(pthread_mutex_t *m, t_vect *v)
{
	t_resource *new = (t_resource*)malloc(sizeof(t_resource));
	new->mtx = m;
	new->list = v;
	return new;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x10b0
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/main_scc_para.c
// Function: find
int		find(t_vect *v, int r)
{
	int low = 0;
	int hi = v->used;
	while (low <= hi)
	{
		int mid = (low+hi)/2;
		if (v->tab[mid] == r)
			return 1;
		else if (v->tab[mid] > r)
			hi = mid-1;
		else
			low = mid+1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x10(%rdi), %edx
xorl %eax, %eax
movl $0x1, %ecx
xorl %r8d, %r8d
cmpl %edx, %r8d
jg 0x1305
leal (%rdx,%r8), %r9d
shrl %r9d
movq (%rdi), %r10
movl (%r10,%r9,4), %r10d
cmpl %esi, %r10d
je 0x1303
jg 0x12fb
incl %r9d
movl %r9d, %r8d
jmp 0x12d9
decl %r9d
movl %r9d, %edx
jmp 0x12d9
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/main_scc_para.c
// Function: main
int main()
{
	pthread_t ol;
	pthread_mutex_t mutex;
	t_vect new;

	G = generate_graph();
	pthread_mutex_init(&mutex, NULL);
	//puts all vertices as the first problem
	initiate_vertices(&new);
	t_resource *res = init_resource(&mutex, &new);
	pthread_create(&ol, NULL, kernel, res);
	pthread_join(ol, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
callq 0x121c
movq %rax, 0x2891(%rip)      # 0x40a8
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1100
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x17cc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x12a7
leaq -0x53c(%rip), %rdx      # 0x1307
leaq -0x18(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x10c0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x10f0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/create_graph.c
// Function: init_adj
int	init_adj(t_graph *g)
{
	if(!(g->adj = (t_vect*)malloc(sizeof(t_vect)*g->vertx)))
		return 0;
	if(!(g->rev_adj = (t_vect*)malloc(sizeof(t_vect)*g->vertx)))
		return 0;
	for (int i = 0; i < g->vertx; i++)
		if (!(init_vector(&g->adj[i])))
			return 0;
	for (int i = 0; i < g->vertx; i++)
		if (!(init_vector(&g->rev_adj[i])))
			return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x34(%rdi), %rax
imulq $0x18, %rax, %r15
movq %r15, %rdi
callq 0x10b0
movq %rax, (%rbx)
xorl %r14d, %r14d
testq %rax, %rax
je 0x190a
movq %r15, %rdi
callq 0x10b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x190a
pushq $-0x1
popq %r14
xorl %edi, %edi
movslq 0x34(%rbx), %rax
incq %r14
cmpq %rax, %r14
jge 0x18da
leaq 0x18(%rdi), %r15
addq (%rbx), %rdi
callq 0x1ba8
movq %r15, %rdi
testl %eax, %eax
jne 0x18b6
xorl %r14d, %r14d
jmp 0x190a
pushq $-0x1
popq %r15
xorl %edi, %edi
movslq 0x34(%rbx), %r12
incq %r15
cmpq %r12, %r15
jge 0x1900
leaq 0x18(%rdi), %r14
addq 0x8(%rbx), %rdi
callq 0x1ba8
movq %r14, %rdi
testl %eax, %eax
jne 0x18e0
xorl %r14d, %r14d
cmpq %r12, %r15
setge %r14b
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/create_graph.c
// Function: get_dimensions
int		get_dimensions(t_graph *new)
{
	int n,m;

	scanf("%d %d", &n, &m);
	if (!valid_dimensions(n,m,new))
	{
		free(new);
		return 0;
	}
	if (!init_adj(new))
		return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x6f5(%rip), %rdi       # 0x2024
xorl %ebx, %ebx
leaq -0x28(%rbp), %r15
leaq -0x24(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10d0
movl (%r15), %edi
movl (%r12), %esi
movq %r14, %rdx
callq 0x1c90
movq %r14, %rdi
testl %eax, %eax
je 0x1965
callq 0x1876
movl %eax, %ebx
jmp 0x196a
callq 0x1030
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/stack.c
// Function: pop
void	pop(t_stack *stk)
{
	t_layer		*tmp;

	if (stk->size <= 0)
		return ;
	if (stk->size == 1)
	{
		free(stk->top);
		stk->size--;
		return ;
	}
	tmp = stk->top->prev;
	free(stk->top);
	stk->top = tmp;
	stk->top->next = NULL;
	stk->size--;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x1b66
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x1, %rax
jne 0x1b4b
movq (%rbx), %rdi
callq 0x1030
jmp 0x1b5e
movq (%rbx), %rdi
movq (%rdi), %r14
callq 0x1030
movq %r14, (%rbx)
andq $0x0, 0x8(%r14)
decq 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/stack.c
// Function: push
void	push(t_stack *stk, int val)
{
	t_layer *new = (t_layer*)malloc(sizeof(t_layer));
	
	new->val = val;
	if (stk->size == 0)
		stk->top = new;
	else
	{
		new->next = NULL;
		new->prev = stk->top;
		stk->top->next = new;
		stk->top = new;
	}
	stk->size++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x10b0
movl %r14d, 0x10(%rax)
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x1b98
andq $0x0, 0x8(%rax)
movq (%rbx), %rdx
movq %rdx, (%rax)
movq %rax, 0x8(%rdx)
movq %rax, (%rbx)
incq %rcx
movq %rcx, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jalalium[P]graph_algorithms_task/src_scc_para/validation.c
// Function: valid_edge
int		valid_edge(t_pair *got, int i, t_graph *g)
{
	got[i].x--;
	got[i].y--;
	if (got[i].x < 0 || got[i].x >= g->vertx)
	   return 0;
	if (got[i].y < 0 || got[i].y >= g->vertx)
		return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %esi, %rax
movl (%rdi,%rax,8), %esi
movl 0x4(%rdi,%rax,8), %ecx
leal -0x1(%rsi), %r8d
movl %r8d, (%rdi,%rax,8)
leal -0x1(%rcx), %r8d
movl %r8d, 0x4(%rdi,%rax,8)
xorl %eax, %eax
testl %esi, %esi
jle 0x1cea
movl 0x34(%rdx), %edx
cmpl %edx, %esi
jg 0x1cea
testl %ecx, %ecx
setg %al
cmpl %edx, %ecx
setle %cl
andb %al, %cl
movzbl %cl, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rouming[P]io/http-server.c
// Function: on_sock_connection
static int on_sock_connection(void *poller, struct poller_item *item)
{
	struct sockaddr addr;
	socklen_t len = sizeof(addr);
	struct loop_ctx *ctx = item->data;
	struct connection *conn;
	struct io_req *req;

	int rc, peer;

	peer = accept4(item->fd, &addr, &len, SOCK_CLOEXEC | SOCK_NONBLOCK);
	if (peer < 0) {
		switch (errno) {
		case EWOULDBLOCK:
			break;
		case EMFILE:
		case ENFILE:
		case ENOBUFS:
		case ENOMEM:
		default:
			err(EXIT_FAILURE, "accept4 failed: errno=%d\n", errno);

			return rc;
		}

		return 0;
	}

	conn = calloc(1, sizeof(*conn));
	assert(conn);

	conn->ctx = ctx;
	conn->sock = peer;
	io_queue_init(&conn->cli_q);

	rc = io_queue_bind(&conn->cli_q, poller, peer);
	assert(rc == 0);

	req = io_req_create(&conn->cli_q, REQ_RD, conn,
			    on_read__from_client);
	assert(req);

	req->buf = (struct io_buf){
		.iov_num  = 1,
		.is_vari_len = true
	};
	rc = io_queue_submit(req);
	assert(rc == 0);

	/* Do not propagate an error up to avoid IO loop exit */
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %rdx
movl $0x10, (%rdx)
movq 0x10(%rsi), %r15
movl (%rsi), %edi
leaq 0x8(%rsp), %rsi
movl $0x80800, %ecx          # imm = 0x80800
callq 0x10b0
testl %eax, %eax
js 0x18be
movl %eax, %ebp
pushq $0x1
popq %rdi
movl $0x198, %esi            # imm = 0x198
callq 0x1140
testq %rax, %rax
je 0x18d7
movq %rax, %r14
movq %r15, (%rax)
movl %ebp, 0x190(%rax)
movq %rax, %r15
addq $0x8, %r15
movq %r15, %rdi
callq 0x2b9b
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2c8a
testl %eax, %eax
jne 0x18f6
leaq 0x158(%rip), %rcx       # 0x199c
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3674
testq %rax, %rax
je 0x1915
movq %rax, %rbx
movq %rax, %rdi
addq $0x28, %rdi
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%rbx)
movb $0x1, 0x150(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x151(%rbx)
movups %xmm0, 0x160(%rbx)
movq %rbx, %rdi
callq 0x33e9
testl %eax, %eax
je 0x18ca
leaq 0x28b8(%rip), %rdi      # 0x415e
leaq 0x27c3(%rip), %rsi      # 0x4070
leaq 0x2875(%rip), %rcx      # 0x4129
movl $0xf5, %edx
callq 0x10d0
callq 0x1050
movl (%rax), %edx
cmpl $0xb, %edx
jne 0x1934
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2846(%rip), %rdi      # 0x4124
leaq 0x278b(%rip), %rsi      # 0x4070
leaq 0x283d(%rip), %rcx      # 0x4129
movl $0xe3, %edx
callq 0x10d0
leaq 0x2861(%rip), %rdi      # 0x415e
leaq 0x276c(%rip), %rsi      # 0x4070
leaq 0x281e(%rip), %rcx      # 0x4129
movl $0xea, %edx
callq 0x10d0
leaq 0x2927(%rip), %rdi      # 0x4243
leaq 0x274d(%rip), %rsi      # 0x4070
leaq 0x27ff(%rip), %rcx      # 0x4129
movl $0xee, %edx
callq 0x10d0
leaq 0x27cf(%rip), %rsi      # 0x410a
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1190
// File: /workspace/github_c_makefile_star2_O2/rouming[P]io/http-server.c
// Function: on_signal
static int on_signal(struct io_req *req, int err)
{
	struct signalfd_siginfo *siginfo;
	struct loop_ctx *ctx = req->data;

	if (err < 0)
		return err;

	assert(err == sizeof(struct signalfd_siginfo));
	siginfo = req->buf.iov[0].iov_base;
	assert(siginfo->ssi_signo == SIGINT);

	/* Graceful exit */
	ctx->shutdown = true;

	return err;
}

// Assembly:
pushq %rax
testl %esi, %esi
js 0x1962
cmpl $0x80, %esi
jne 0x1966
movq 0x28(%rdi), %rax
cmpl $0x2, (%rax)
jne 0x197f
movq 0x18(%rdi), %rax
movb $0x1, (%rax)
movl %esi, %eax
popq %rcx
retq
leaq 0x285d(%rip), %rdi      # 0x41ca
leaq 0x26fc(%rip), %rsi      # 0x4070
leaq 0x2876(%rip), %rcx      # 0x41f1
pushq $0x49
jmp 0x1996
leaq 0x288f(%rip), %rdi      # 0x4215
leaq 0x26e3(%rip), %rsi      # 0x4070
leaq 0x285d(%rip), %rcx      # 0x41f1
pushq $0x4b
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/rouming[P]io/http-server.c
// Function: on_read__from_client
static int on_read__from_client(struct io_req *req, int len)
{
	struct connection *conn = req->data;
	struct io_req *wr_req;
	int rc;

	if (len < 0) {
		io_req_put(req);
		list_add_tail(&conn->dead_entry, &conn->ctx->dead_conns);
		/* Propagate error up */
		return len;
	}
	if (!strnstr(req->buf.iov[0].iov_base, "\r\n\r\n", len)) {
		/* Not enough, continue */
		return 0;
	}
	io_req_put(req);

	wr_req = io_req_create(&conn->cli_q, REQ_WR, conn,
			       on_write__to_client);
	assert(wr_req);

	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = (void *)http_response,
			.iov_len  = strlen(http_response)
		},
		.iov_num  = 1,
	};
	rc = io_queue_submit(wr_req);
	assert(rc == 0);

	/* Request will be put by the queue */
	return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x19cd
movq 0x28(%rdi), %rcx
movl %ebx, %edx
xorl %eax, %eax
cmpq $0x4, %rdx
jb 0x1a80
cmpl $0xa0d0a0d, (%rcx)      # imm = 0xA0D0A0D
je 0x1a00
decq %rdx
incq %rcx
jmp 0x19b3
callq 0x3707
leaq 0x180(%r14), %rax
movq (%r14), %rcx
leaq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rsi
movq %rax, 0x10(%rcx)
movq %rdx, 0x180(%r14)
movq %rsi, 0x188(%r14)
movq %rax, (%rsi)
movl %ebx, %eax
jmp 0x1a80
testq %rcx, %rcx
je 0x1a80
callq 0x3707
leaq 0x8(%r14), %rdi
leaq 0xaf(%rip), %rcx        # 0x1ac4
pushq $0x1
popq %rsi
movq %r14, %rdx
callq 0x3674
testq %rax, %rax
je 0x1a86
movq %rax, %r14
movq 0x5701(%rip), %r15      # 0x7130
movq %r15, %rdi
callq 0x10a0
movq %r15, 0x28(%r14)
movq %rax, 0x30(%r14)
movq %r14, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r14)
movups %xmm0, 0x160(%r14)
movq %r14, %rdi
callq 0x33e9
movl %eax, %ecx
movl %ebx, %eax
testl %ecx, %ecx
jne 0x1aa5
popq %rbx
popq %r14
popq %r15
retq
leaq 0x26d9(%rip), %rdi      # 0x4166
leaq 0x25dc(%rip), %rsi      # 0x4070
leaq 0x26d2(%rip), %rcx      # 0x416d
movl $0xb6, %edx
callq 0x10d0
leaq 0x26b2(%rip), %rdi      # 0x415e
leaq 0x25bd(%rip), %rsi      # 0x4070
leaq 0x26b3(%rip), %rcx      # 0x416d
movl $0xc0, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/rouming[P]io/http-server.c
// Function: on_write__to_client
static int on_write__to_client(struct io_req *req, int len)
{
	struct connection *conn = req->data;
	int rc;

	io_req_put(req);
	if (len < 0) {
		list_add_tail(&conn->dead_entry, &conn->ctx->dead_conns);
	} else {
		req = io_req_create(&conn->cli_q, REQ_RD, conn,
				    on_read__from_client);
		assert(req);

		req->buf = (struct io_buf){
			.iov_num  = 1,
			.is_vari_len = true
		};
		rc = io_queue_submit(req);
		assert(rc == 0);
	}

	return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x18(%rdi), %r14
callq 0x3707
testl %ebx, %ebx
js 0x1b60
leaq 0x8(%r14), %rdi
leaq -0x14a(%rip), %rcx      # 0x199c
xorl %esi, %esi
movq %r14, %rdx
callq 0x3674
testq %rax, %rax
je 0x1b91
movq %rax, %r14
movq %rax, %rdi
addq $0x28, %rdi
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r14)
movb $0x1, 0x150(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x151(%r14)
movups %xmm0, 0x160(%r14)
movq %r14, %rdi
callq 0x33e9
testl %eax, %eax
je 0x1b87
leaq 0x2616(%rip), %rdi      # 0x415e
leaq 0x2521(%rip), %rsi      # 0x4070
leaq 0x2646(%rip), %rcx      # 0x419c
movl $0x96, %edx
callq 0x10d0
leaq 0x180(%r14), %rax
movq (%r14), %rcx
leaq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rsi
movq %rax, 0x10(%rcx)
movq %rdx, 0x180(%r14)
movq %rsi, 0x188(%r14)
movq %rax, (%rsi)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x26ab(%rip), %rdi      # 0x4243
leaq 0x24d1(%rip), %rsi      # 0x4070
leaq 0x25f6(%rip), %rcx      # 0x419c
movl $0x8f, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/psfrag.c
// Function: cmd_scan
char *cmd_scan(int argc, char **argv)
{
	__label__ out_return;
	struct MappedFile_s m;
	char *msg = NULL;
	int rc;

	if (argc < 3) {
		msg = "must specify a pokemon stadium rom";
		goto out_return;
	}

	rc = DB_Init(&db, ":memory:");
	if (rc != SQLITE_OK) {
		msg = "DB_Init oopsed";
		goto out_return;
	}

	m = MappedFile_Open(argv[2], false);
	if (m.data == NULL) {
		msg = "couldn't open rom";
		goto out_dbclose;
	}

	if (m.size < (1048576 + 4096)) {
		msg = "rom too small";
		goto out_unmap;
	}

	rc = DB_FragSearch(db, m.data, m.size);
	if (rc != SQLITE_OK) {
		msg = "DB_FragSearch oopsed";
		goto out_unmap;
	}

	dump_frags();

out_unmap:
	MappedFile_Close(m);
out_dbclose:
	DB_Close(db);
out_return:
	if (msg) {
		return msg;
	} else {
		return NULL;
	}
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpl $0x3, %edi
jge 0x84a2
leaq 0x6bedf(%rip), %rbx     # 0x7437c
jmp 0x8544
movq %rsi, %rbx
leaq 0x96d5c(%rip), %rdi     # 0x9f208
leaq 0x6beec(%rip), %rsi     # 0x7439f
callq 0x92a8
testl %eax, %eax
je 0x84c5
leaq 0x6bee5(%rip), %rbx     # 0x743a8
jmp 0x8544
movq 0x10(%rbx), %rsi
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x97bb
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x84f7
movq 0x20(%rsp), %rdx
cmpq $0x101000, %rdx         # imm = 0x101000
jae 0x8500
leaq 0x6bed4(%rip), %rbx     # 0x743c9
jmp 0x8520
leaq 0x6beb9(%rip), %rbx     # 0x743b7
jmp 0x8538
movq 0x96d01(%rip), %rdi     # 0x9f208
callq 0x959b
testl %eax, %eax
je 0x8519
leaq 0x6bec0(%rip), %rbx     # 0x743d7
jmp 0x8520
callq 0x8dc9
xorl %ebx, %ebx
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9845
movq 0x96cc9(%rip), %rdi     # 0x9f208
callq 0x92d4
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/psfrag.c
// Function: print_usage
void print_usage()
{
	fprintf(stderr, PROGRAM_NAME " version " VERSION_STRING
			", Copyright (C) 2019 jrra.\n"
			"A utility for code fragments in the Pokemon Stadium games.\n\n"
			"usage: " PROGRAM_NAME " <cmd>\n\n"
			"Commands:\n"
		);
	int cmds_index = 0;
	while (cmds[cmds_index].command) {
		fprintf(stderr, "\t%s\n", cmds[cmds_index].help);
		cmds_index++;
	}
	fprintf(stderr, "\nReport bugs to " URL_STRING "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x94283(%rip), %r14     # 0x9cff0
movq (%r14), %rcx
leaq 0x6b43a(%rip), %rdi     # 0x741b1
pushq $0x1
popq %rdx
movl $0x88, %esi
callq 0x82e0
leaq 0x9445d(%rip), %r15     # 0x9d1e8
leaq 0x6b4a8(%rip), %rbx     # 0x7423a
cmpq $0x0, -0x8(%r15)
movq (%r14), %rcx
je 0x8db2
movq (%r15), %rdx
movq %rcx, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x81b0
addq $0x18, %r15
jmp 0x8d92
leaq 0x6b486(%rip), %rdi     # 0x7423f
pushq $0x33
popq %rsi
pushq $0x1
popq %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x82e0
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/psfrag.c
// Function: main
int main(int argc, char **argv)
{
	__label__ out_return;
	char *msg = NULL;
	char *cmd_string = NULL;

	if (argc < 2) {
		print_usage();
		goto out_return;
	}

	cmd_string = argv[1];

	struct cmd_s *cmd = get_cmd_from_name(cmd_string);
	if (cmd != NULL) {
		if (cmd->handler)
			msg = cmd->handler(argc, argv);
		else
			msg = "command has no handler";
	} else {
		msg = "invalid command";
	}

out_return:
	if (msg) {
		fprintf(stderr, "%s: error: %s\n", argv[0], msg);
		return EXIT_FAILURE;
	} else {
		return EXIT_SUCCESS;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jg 0x923f
callq 0x8d61
xorl %ecx, %ecx
jmp 0x9269
movq %rsi, %rbx
movl %edi, %ebp
movq 0x8(%rsi), %rdi
callq 0x8d2b
testq %rax, %rax
je 0x9272
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x927b
movl %ebp, %edi
movq %rbx, %rsi
callq *%rax
xorl %ecx, %ecx
testq %rax, %rax
jne 0x9282
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x6b5b4(%rip), %rax     # 0x7482d
jmp 0x9282
leaq 0x6b594(%rip), %rax     # 0x74816
movq 0x93d67(%rip), %rcx     # 0x9cff0
movq (%rcx), %rdi
movq (%rbx), %rdx
leaq 0x6b5a7(%rip), %rsi     # 0x7483d
movq %rax, %rcx
xorl %eax, %eax
callq 0x81b0
pushq $0x1
popq %rcx
jmp 0x9269
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/db.c
// Function: DB_Init
int DB_Init(sqlite3 **db, char *filename) {
	int rc = SQLITE_OK;
	rc = sqlite3_open(filename, db);
	if (rc != SQLITE_OK) return rc;

	rc = sqlite3_exec(*db,
		"CREATE TABLE IF NOT EXISTS frags(pcode text, addr int, num int, entrypoint int, offset_code int, offset_relocs int, romsize int, ramsize int, vma int);",
		NULL, NULL, NULL
	);
	if (rc != SQLITE_OK) return rc;
	return SQLITE_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x17226
testl %eax, %eax
je 0x92bd
popq %rbx
retq
movq (%rbx), %rdi
leaq 0x6b5de(%rip), %rsi     # 0x748a5
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
popq %rbx
jmp 0x131ca
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/db.c
// Function: DB_GetRomSizeForNum
int DB_GetRomSizeForNum(sqlite3 *db, int num)
{
	__label__ out_finalize;
	char *zErr = NULL;
	int rc = SQLITE_OK;
	int size = -1;

	sqlite3_stmt *stmt;

	rc = sqlite3_prepare_v2(
		db,
		R"STATEMENT(
			select romsize from frags where num==:num limit 1;
		)STATEMENT",
		-1,
		&stmt,
		NULL
	);
	if (rc != SQLITE_OK) {
		zErr = "error in prepare";
		goto out_finalize;
	}

	rc = sqlite3_bind_int(stmt, 1, num);
	if (rc != SQLITE_OK) {
		zErr = "error in bind";
		goto out_finalize;
	}

	rc = sqlite3_step(stmt);
	switch(rc) {
	case SQLITE_DONE:
		size = -1;
		break;
	case SQLITE_ROW:
		size = sqlite3_column_int(stmt, 0);
		break;
	default:
		zErr = "error in step";
		break;
	}

out_finalize:
	if (zErr) fprintf(stderr, "DB_GetRomSizeForNum: %s\n", zErr);
	rc = sqlite3_finalize(stmt);
	if (rc != SQLITE_OK) fprintf(stderr,
		"DB_GetRomSizeForNum: error in finalize\n");
	return size;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
leaq 0x6b657(%rip), %rsi     # 0x74a8c
pushq $-0x1
popq %rbx
movq %rsp, %rcx
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x13571
testl %eax, %eax
jne 0x947d
movq (%rsp), %rdi
pushq $0x1
popq %rsi
movl %ebp, %edx
callq 0x11113
testl %eax, %eax
jne 0x9486
movq (%rsp), %rdi
callq 0xfe1e
cmpl $0x65, %eax
je 0x94ae
cmpl $0x64, %eax
jne 0x948f
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x10cc5
movl %eax, %ebx
jmp 0x94ae
leaq 0x6b5f7(%rip), %rdx     # 0x74a7b
jmp 0x9496
leaq 0x6b36b(%rip), %rdx     # 0x747f8
jmp 0x9496
leaq 0x6b5d7(%rip), %rdx     # 0x74a6d
movq 0x93b53(%rip), %rax     # 0x9cff0
movq (%rax), %rdi
leaq 0x6b61f(%rip), %rsi     # 0x74ac6
xorl %eax, %eax
callq 0x81b0
movq (%rsp), %rdi
callq 0xf24e
testl %eax, %eax
jne 0x94c4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x93b25(%rip), %rax     # 0x9cff0
movq (%rax), %rcx
leaq 0x6b60a(%rip), %rdi     # 0x74adf
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x82e0
jmp 0x94bb
// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/db.c
// Function: DB_GetAddrForNum
int DB_GetAddrForNum(sqlite3 *db, int num)
{
	__label__ out_finalize;
	char *zErr = NULL;
	int rc = SQLITE_OK;
	int addr = -1;

	sqlite3_stmt *stmt;

	rc = sqlite3_prepare_v2(
		db,
		R"STATEMENT(
			select addr from frags where num==:num limit 1;
		)STATEMENT",
		-1,
		&stmt,
		NULL
	);
	if (rc != SQLITE_OK) {
		zErr = "error in prepare";
		goto out_finalize;
	}

	rc = sqlite3_bind_int(stmt, 1, num);
	if (rc != SQLITE_OK) {
		zErr = "error in bind";
		goto out_finalize;
	}

	rc = sqlite3_step(stmt);
	switch(rc) {
	case SQLITE_DONE:
		addr = -1;
		break;
	case SQLITE_ROW:
		addr = sqlite3_column_int(stmt, 0);
		break;
	default:
		zErr = "error in step";
		break;
	}

out_finalize:
	if (zErr) fprintf(stderr, "DB_GetAddrForNum: %s\n", zErr);
	rc = sqlite3_finalize(stmt);
	if (rc != SQLITE_OK) fprintf(stderr,
		"DB_GetAddrForNum: error in finalize\n");
	return addr;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
leaq 0x6b619(%rip), %rsi     # 0x74b07
pushq $-0x1
popq %rbx
movq %rsp, %rcx
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x13571
testl %eax, %eax
jne 0x9536
movq (%rsp), %rdi
pushq $0x1
popq %rsi
movl %ebp, %edx
callq 0x11113
testl %eax, %eax
jne 0x953f
movq (%rsp), %rdi
callq 0xfe1e
cmpl $0x65, %eax
je 0x9567
cmpl $0x64, %eax
jne 0x9548
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x10cc5
movl %eax, %ebx
jmp 0x9567
leaq 0x6b53e(%rip), %rdx     # 0x74a7b
jmp 0x954f
leaq 0x6b2b2(%rip), %rdx     # 0x747f8
jmp 0x954f
leaq 0x6b51e(%rip), %rdx     # 0x74a6d
movq 0x93a9a(%rip), %rax     # 0x9cff0
movq (%rax), %rdi
leaq 0x6b5de(%rip), %rsi     # 0x74b3e
xorl %eax, %eax
callq 0x81b0
movq (%rsp), %rdi
callq 0xf24e
testl %eax, %eax
jne 0x957d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x93a6c(%rip), %rax     # 0x9cff0
movq (%rax), %rcx
leaq 0x6b5c6(%rip), %rdi     # 0x74b54
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x82e0
jmp 0x9574