LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/hit.c
// Function: mp_collate_a
uint64_t *mp_collate_a(void *km, int32_t n_reg, mp_reg1_t *reg)
{
	uint64_t *a;
	int64_t n_a;
	int32_t i;
	for (i = 0, n_a = 0; i < n_reg; ++i)
		n_a += reg[i].cnt;
	a = Kmalloc(km, uint64_t, n_a);
	for (i = 0, n_a = 0; i < n_reg; ++i) {
		mp_reg1_t *r = &reg[i];
		r->off = n_a;
		memcpy(&a[n_a], r->a, r->cnt * sizeof(uint64_t));
		kfree(km, r->a);
		r->a = &a[n_a];
		n_a += r->cnt;
	}
	return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %esi, %r12d
testl %esi, %esi
jle 0xe97e
imulq $0x68, %r12, %rax
xorl %ecx, %ecx
xorl %esi, %esi
movslq 0x4(%rbx,%rcx), %rdx
addq %rdx, %rsi
addq $0x68, %rcx
cmpq %rcx, %rax
jne 0xe967
shlq $0x3, %rsi
jmp 0xe980
xorl %esi, %esi
movq %rdi, (%rsp)
callq 0x80a1
movq %rax, %r15
testl %ebp, %ebp
jle 0xe9db
imulq $0x68, %r12, %r13
xorl %ebp, %ebp
xorl %r14d, %r14d
movl %r14d, (%rbx,%rbp)
leaq (%r15,%r14,8), %r12
movq 0x50(%rbx,%rbp), %rsi
movslq 0x4(%rbx,%rbp), %rdx
shlq $0x3, %rdx
movq %r12, %rdi
callq 0x21e0
movq 0x50(%rbx,%rbp), %rsi
movq (%rsp), %rdi
callq 0x7fd6
movq %r12, 0x50(%rbx,%rbp)
movslq 0x4(%rbx,%rbp), %rax
addq %rax, %r14
addq $0x68, %rbp
cmpq %rbp, %r13
jne 0xe999
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/hit.c
// Function: mp_sort_reg
void mp_sort_reg(void *km, int *n_regs, mp_reg1_t *r)
{
	int32_t i, n_aux, n = *n_regs, has_cigar = 0, no_cigar = 0;
	mp128_t *aux;
	mp_reg1_t *t;

	if (n <= 1) return;
	aux = (mp128_t*)kmalloc(km, n * 16);
	t = (mp_reg1_t*)kmalloc(km, n * sizeof(mp_reg1_t));
	for (i = n_aux = 0; i < n; ++i) {
		if (r[i].cnt > 0) { // squeeze out elements with cnt==0 (soft deleted)
			int score;
			if (r[i].p) score = r[i].p->dp_max, has_cigar = 1;
			else score = r[i].chn_sc, no_cigar = 1;
			aux[n_aux].x = (uint64_t)score << 32 | r[i].hash;
			aux[n_aux++].y = i;
		} else if (r[i].p) {
			free(r[i].p); free(r[i].feat);
			r[i].p = 0;
		}
	}
	assert(has_cigar + no_cigar == 1);
	radix_sort_mp128x(aux, aux + n_aux);
	for (i = n_aux - 1; i >= 0; --i)
		t[n_aux - 1 - i] = r[aux[i].y];
	memcpy(r, t, sizeof(mp_reg1_t) * n_aux);
	*n_regs = n_aux;
	kfree(km, aux);
	kfree(km, t);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq (%rsi), %r13
cmpq $0x2, %r13
jge 0xea13
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, 0x18(%rsp)
movl %r13d, %esi
shll $0x4, %esi
callq 0x80a1
movq %rax, (%rsp)
imulq $0x68, %r13, %rsi
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
callq 0x80a1
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
addq $0x60, %r14
xorl %ebx, %ebx
movl $0x1, %esi
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpl $0x0, -0x5c(%r14)
movq (%r14), %rdi
jle 0xeaa4
leaq 0x4(%rdi), %rax
leaq -0x3c(%r14), %rcx
testq %rdi, %rdi
cmovnel %esi, %r12d
cmovel %esi, %r15d
cmoveq %rcx, %rax
movl (%rax), %eax
shlq $0x20, %rax
movl -0x34(%r14), %ecx
orq %rax, %rcx
movslq %ebp, %rbp
movq %rbp, %rax
shlq $0x4, %rax
movq (%rsp), %rdx
movq %rcx, (%rdx,%rax)
incl %ebp
movq %rbx, 0x8(%rdx,%rax)
jmp 0xeac3
testq %rdi, %rdi
je 0xeac3
callq 0x2050
movq -0x8(%r14), %rdi
callq 0x2050
movl $0x1, %esi
movq $0x0, (%r14)
incq %rbx
addq $0x68, %r14
cmpq %rbx, %r13
jne 0xea5b
addl %r12d, %r15d
cmpl $0x1, %r15d
jne 0xeb90
movslq %ebp, %rbx
movq %rbx, %rsi
shlq $0x4, %rsi
movq (%rsp), %rdi
addq %rdi, %rsi
callq 0x4928
testl %ebx, %ebx
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r14
jle 0xeb50
leal -0x1(%rbp), %eax
movl %ebp, %ecx
cltq
leaq 0x1(%rcx), %rdx
imulq $0x68, %rax, %rax
imulq $0x68, %rcx, %rsi
subq %rsi, %rax
addq %r14, %rax
addq $0x68, %rax
shlq $0x4, %rcx
movq (%rsp), %rsi
leaq (%rsi,%rcx), %r8
addq $-0x8, %r8
imulq $0x68, (%r8), %rsi
addq %r9, %rsi
movl $0xd, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
decq %rdx
addq $0x68, %rax
addq $-0x10, %r8
cmpq $0x1, %rdx
jg 0xeb2d
imulq $0x68, %rbx, %rdx
movq %r9, %rdi
movq %r14, %rsi
callq 0x21e0
movq 0x18(%rsp), %rax
movl %ebp, (%rax)
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x7fd6
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7fd6
leaq 0x5650(%rip), %rdi      # 0x141e7
leaq 0x55c6(%rip), %rsi      # 0x14164
leaq 0x565c(%rip), %rcx      # 0x14201
movl $0x76, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/hit.c
// Function: mp_sync_regs
void mp_sync_regs(void *km, int n_regs, mp_reg1_t *regs) // keep mp_reg1_t::{id,parent} in sync; also reset id
{
	int *tmp, i, max_id = -1, n_tmp;
	if (n_regs <= 0) return;
	for (i = 0; i < n_regs; ++i) // NB: doesn't work if mp_reg1_t::id is negative
		max_id = max_id > regs[i].id? max_id : regs[i].id;
	n_tmp = max_id + 1;
	tmp = (int*)kmalloc(km, n_tmp * sizeof(int));
	for (i = 0; i < n_tmp; ++i) tmp[i] = -1;
	for (i = 0; i < n_regs; ++i)
		if (regs[i].id >= 0) tmp[regs[i].id] = i;
	for (i = 0; i < n_regs; ++i) {
		mp_reg1_t *r = &regs[i];
		r->id = i;
		if (r->parent == MP_PARENT_TMP_PRI)
			r->parent = i;
		else if (r->parent >= 0 && tmp[r->parent] >= 0)
			r->parent = tmp[r->parent];
		else r->parent = MP_PARENT_UNSET;
	}
	kfree(km, tmp);
}

// Assembly:
testl %esi, %esi
jle 0xf067
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %eax
imulq $0x68, %rax, %rax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %r12d, %edx
movl 0x8(%rbx,%rcx), %r12d
cmpl %r12d, %edx
cmovgl %edx, %r12d
addq $0x68, %rcx
cmpq %rcx, %rax
jne 0xef9f
leal 0x1(%r12), %esi
shlq $0x2, %rsi
movq %r14, %rdi
callq 0x80a1
movq %rax, %r15
testl %r12d, %r12d
js 0xefe8
movl %r12d, %eax
leaq 0x4(,%rax,4), %rdx
movq %r15, %rdi
movl $0xff, %esi
callq 0x2160
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
leaq 0x8(%rbx), %rcx
xorl %edx, %edx
movslq (%rcx), %rsi
testq %rsi, %rsi
js 0xf005
movl %edx, (%r15,%rsi,4)
incq %rdx
addq $0x68, %rcx
cmpq %rdx, %rax
jne 0xeff9
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
addq $0xc, %rbx
xorl %ecx, %ecx
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl %ecx, -0x4(%rbx)
movl (%rbx), %esi
cmpq %rdx, %rsi
jne 0xf035
movl %ecx, %esi
jmp 0xf046
testl %esi, %esi
js 0xf041
movl (%r15,%rsi,4), %esi
testl %esi, %esi
jns 0xf046
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %esi, (%rbx)
incq %rcx
addq $0x68, %rbx
cmpq %rcx, %rax
jne 0xf027
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7fd6
retq
// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/hit.c
// Function: mp_select_multi_exon
void mp_select_multi_exon(int32_t n, mp_reg1_t *r, int32_t single_penalty)
{
	int32_t i;
	mp_reg1_t t;
	if (n < 2 || r[0].n_exon != 1) return;
	for (i = 1; i < n; ++i)
		if (r[i].n_exon >= 2)
			break;
	if (i == n) return;
	if (r[0].p == 0 || r[i].p == 0) return;
	if (r[0].p->dp_max < r[i].p->dp_max + single_penalty)
		t = r[0], r[0] = r[i], r[i] = t;
}

// Assembly:
cmpl $0x2, %edi
jl 0xf372
movq %rsi, %rax
cmpl $0x1, 0x20(%rsi)
jne 0xf372
movl %edi, %esi
leaq 0x88(%rax), %r8
movl $0x1, %ecx
cmpl $0x1, (%r8)
jg 0xf31b
incq %rcx
addq $0x68, %r8
cmpq %rcx, %rsi
jne 0xf307
movl %esi, %ecx
cmpl %edi, %ecx
je 0xf372
movq 0x60(%rax), %rsi
testq %rsi, %rsi
je 0xf372
movl %ecx, %ecx
imulq $0x68, %rcx, %r8
movq 0x60(%rax,%r8), %rcx
testq %rcx, %rcx
je 0xf372
addl 0x4(%rcx), %edx
cmpl %edx, 0x4(%rsi)
jge 0xf372
addq %rax, %r8
leaq -0x68(%rsp), %rdx
movl $0xd, %ecx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0xd, %ecx
movq %rax, %rdi
movq %r8, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0xd, %ecx
movq %r8, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/main.c
// Function: main
int main(int argc, char *argv[])
{
	struct icn *icn = NULL;
	unsigned int width;
	unsigned int height;
	unsigned char *dataimg = NULL;
	unsigned char *pal = NULL;
	char outputname[4096];
	unsigned int i;

	if (argc != 3)
	{
		fprintf(stderr, "%s <*.icn> <*.pal>\n", argv[0]);
		return EXIT_FAILURE;
	}
	if ((icn = openicn(argv[1])))
	{
		if (!(pal = open_palette(argv[2])))
			return EXIT_FAILURE;
		printicninfo(icn);
		width = icngetmaxwidth(icn);
		height = icngetmaxheight(icn);
		printf("Width = %X (%d)\n", width, width);
		printf("Height = %X (%d)\n", height, height);
		for (i = 0; i < icn->numentry; i++)
		{
			sprintf(outputname, "./extract/%s_%d.png", "TESTO", i);
			if (strstr(argv[1], "font.icn"))
				dataimg = icnmakeimg(icn, i, width, height, pal, 0);
			else
				dataimg = icnmakeimg(icn, i, width, height, pal, 1);
			if (dataimg)
			{
				writeImage(outputname, width, height, dataimg, "LOL");
				free(dataimg);
			}
		}
		closeicn(icn);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rsi, %rbx
cmpl $0x3, %edi
jne 0x1743
movq 0x8(%rbx), %rdi
callq 0x1764
testq %rax, %rax
je 0x173f
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0x1c20
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x174b
movq %r14, %rdi
callq 0x194b
movq %r14, %rdi
callq 0x19ec
movl %eax, %ebp
movq %r14, %rdi
callq 0x1a1e
movl %eax, %r15d
leaq 0xa2c(%rip), %rdi       # 0x208c
movl %ebp, %esi
movl %ebp, 0x4(%rsp)
movl %ebp, %edx
xorl %eax, %eax
callq 0x1090
leaq 0xa27(%rip), %rdi       # 0x209d
movl %r15d, %esi
movl %r15d, (%rsp)
movl %r15d, %edx
xorl %eax, %eax
callq 0x1090
cmpw $0x0, (%r14)
je 0x1737
movzwl 0x4(%rsp), %ebp
movzwl (%rsp), %r12d
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdi
leaq 0xa04(%rip), %rsi       # 0x20af
leaq 0xa11(%rip), %rdx       # 0x20c3
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1190
movq %rbx, %r13
movq 0x8(%rbx), %rdi
leaq 0x9ff(%rip), %rsi       # 0x20c9
callq 0x11c0
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %r12d, %ecx
testq %rax, %rax
je 0x16e9
movq 0x8(%rsp), %r8
xorl %r9d, %r9d
jmp 0x16f4
movq 0x8(%rsp), %r8
movl $0x1, %r9d
callq 0x1a50
movq %rax, %rbx
testq %rax, %rax
je 0x1724
leaq 0x10(%rsp), %rdi
movl 0x4(%rsp), %esi
movl (%rsp), %edx
movq %rbx, %rcx
leaq 0x9bb(%rip), %r8        # 0x20d2
callq 0x13d6
movq %rbx, %rdi
callq 0x1040
incl %r15d
movzwl (%r14), %eax
cmpl %eax, %r15d
movq %r13, %rbx
jb 0x169f
movq %r14, %rdi
callq 0x191c
xorl %eax, %eax
jmp 0x1750
movq %rbx, %rdi
callq 0x125e
movl $0x1, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: openicn
struct icn *openicn(char *filename)
{
	struct icn *newicn = NULL;
	FILE *fin = NULL;

	if (!filename)
		return NULL;

	if (!(fin = fopen(filename, "rb")))
	{
		perror("fopen()");
		return NULL;
	}
	if (!(newicn = malloc(sizeof (struct icn))))
	{
		perror("malloc()");
		fclose(fin);
		return NULL;
	}
	fseek(fin, 0, SEEK_END);
        newicn->filesize = ftell(fin);
        fseek(fin, 0, SEEK_SET);
	if (!(newicn->data = malloc(sizeof (char) * newicn->filesize)))
	{
		perror("malloc()");
		fclose(fin);
		free(newicn);
		return NULL;
	}
	if (fread(newicn->data, 1, newicn->filesize, fin) != newicn->filesize)
	{
		perror("fread()");
		fclose(fin);
		free(newicn);
		free(newicn->data);
		return NULL;
	}
	if (((*(unsigned int*)newicn->data + 2) != newicn->filesize) && !icnfillentry(newicn))
	{
		fclose(fin);
		free(newicn);
		free(newicn->data);
		return NULL;
	}
	fclose(fin);
	return newicn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1880
leaq 0x95a(%rip), %rsi       # 0x20d6
callq 0x1160
testq %rax, %rax
je 0x1840
movq %rax, %r14
movl $0x20, %edi
callq 0x1130
testq %rax, %rax
je 0x184e
movq %rax, %rbx
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1140
movq %r14, %rdi
callq 0x10f0
movl %eax, 0x18(%rbx)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1140
movl 0x18(%rbx), %r12d
movq %r12, %rdi
callq 0x1130
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1864
movq %rbx, %r15
addq $0x10, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1050
movl 0x18(%rbx), %ecx
cmpq %rcx, %rax
jne 0x1891
movq (%r15), %rax
movl (%rax), %eax
addl $0x2, %eax
cmpl %ecx, %eax
je 0x1820
movq %rbx, %rdi
callq 0x18a1
testl %eax, %eax
je 0x182a
movq %r14, %rdi
callq 0x1070
jmp 0x1882
movq %r14, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1040
movq 0x10(%rbx), %rdi
jmp 0x187b
leaq 0x7c0(%rip), %rdi       # 0x2007
callq 0x1170
jmp 0x1880
leaq 0x884(%rip), %rdi       # 0x20d9
callq 0x1170
movq %r14, %rdi
callq 0x1070
jmp 0x1880
leaq 0x86e(%rip), %rdi       # 0x20d9
callq 0x1170
movq %r14, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x127c
jmp 0x1880
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: icnfillentry
int icnfillentry(struct icn *icn)
{
	unsigned int i;

	if (!icn)
		return 0;

	icn->numentry = *(unsigned short*)icn->data;
	if (!(icn->entry = malloc(sizeof (struct icn) * icn->numentry)))
	{
		perror("malloc()");
		return 0;
	}
	for (i = 0; i < icn->numentry; i++)
	{
		memcpy(&icn->entry[i], icn->data + 2 + 4 + i * sizeof (struct icnentry), sizeof (struct icnentry));
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x1904
movq %rdi, %r14
movq 0x10(%rdi), %rax
movzwl (%rax), %edi
movw %di, (%r14)
shll $0x5, %edi
callq 0x1130
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x190e
movl $0x1, %ebx
cmpw $0x0, (%r14)
je 0x1904
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rsi
movl 0xe(%rsi,%rax), %edi
movl %edi, 0x8(%rdx,%rax)
movq 0x6(%rsi,%rax), %rsi
movq %rsi, (%rdx,%rax)
incq %rcx
movzwl (%r14), %edx
addq $0xc, %rax
cmpq %rdx, %rcx
jb 0x18db
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7c4(%rip), %rdi       # 0x20d9
callq 0x1170
jmp 0x1904
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: closeicn
void closeicn(struct icn *icn)
{
	if (icn)
	{
		if (icn->entry)
			free(icn->entry);
		if (icn->data)
			free(icn->data);
		free(icn);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x194a
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x1933
callq 0x1040
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1941
callq 0x1040
movq %rbx, %rdi
popq %rbx
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: printicninfo
void printicninfo(struct icn *icn)
{
	unsigned int i;

	if (!icn)
		return;

	printf("NumEntry = %X\n", icn->numentry);
	for (i = 0; i < icn->numentry; i++)
	{
		printf("Width = %X\n", icn->entry[i].width);
		printf("Height = %X\n", icn->entry[i].height);
		printf("Offset = %X\n", icn->entry[i].offset);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x19eb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl (%rdi), %esi
leaq 0x77e(%rip), %rdi       # 0x20ea
xorl %eax, %eax
callq 0x1090
cmpw $0x0, (%rbx)
je 0x19dd
leaq 0x779(%rip), %r14       # 0x20f9
leaq 0x77e(%rip), %r15       # 0x2105
leaq 0x784(%rip), %r12       # 0x2112
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movzwl 0x4(%rax,%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x8(%rbx), %rax
movzwl 0x6(%rax,%r13), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x8(%rbx), %rax
movl 0x8(%rax,%r13), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
incq %rbp
movzwl (%rbx), %eax
addq $0xc, %r13
cmpq %rax, %rbp
jb 0x1993
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: icngetmaxwidth
int icngetmaxwidth(struct icn *icn)
{
	unsigned int width = 0;
	unsigned int i;

	if (!icn)
		return width;

	for (i = 0; i < icn->numentry; i++)
	{
		if (icn->entry[i].width > width)
			width = icn->entry[i].width;
	}
	return width;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x1a1d
movzwl (%rdi), %edx
testq %rdx, %rdx
je 0x1a1d
movq 0x8(%rdi), %rcx
shll $0x2, %edx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
xorl %eax, %eax
movzwl 0x4(%rcx,%rsi), %edi
cmpl %edi, %eax
cmovbel %edi, %eax
addq $0xc, %rsi
cmpq %rsi, %rdx
jne 0x1a0a
retq
// File: /workspace/github_c_makefile_star2_O1/w4kfu[P]HommI/Icn/icn.c
// Function: icngetmaxheight
int icngetmaxheight(struct icn *icn)
{
	unsigned int height = 0;
	unsigned int i;

	if (!icn)
		return height;

	for (i = 0; i < icn->numentry; i++)
	{
		if (icn->entry[i].height > height)
			height = icn->entry[i].height;
	}
	return height;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x1a4f
movzwl (%rdi), %edx
testq %rdx, %rdx
je 0x1a4f
movq 0x8(%rdi), %rcx
shll $0x2, %edx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
xorl %eax, %eax
movzwl 0x6(%rcx,%rsi), %edi
cmpl %edi, %eax
cmovbel %edi, %eax
addq $0xc, %rsi
cmpq %rsi, %rdx
jne 0x1a3c
retq
// File: /workspace/github_c_makefile_star2_O1/cirocosta[P]stress/src/epoll-tcp-server.c
// Function: make_socket_non_blocking
static void
make_socket_non_blocking(int sfd)
{
	int flags;
	int s;

	_STRESS_MUST_P((flags = fcntl(sfd, F_GETFL, 0)) != -1,
	               "fcntl",
	               "Couldn't retrieve flags from socket file descriptor");

	flags |= O_NONBLOCK;
	_STRESS_MUST_P(
	  (s = fcntl(sfd, F_SETFL, flags)) != -1,
	  "fcntl",
	  "Couldn't set nonblocking flags on socket file descriptor");
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1070
cmpl $-0x1, %eax
je 0x234a
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x1070
cmpl $-0x1, %eax
je 0x234f
popq %rbx
retq
callq 0x1579
callq 0x147c
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_MaxFlow
void fTCPStream_MaxFlow(u32 MaxFlow)
{
	s_StreamMax = MaxFlow;
	s_Stream    = (TCPStream_t**)malloc( s_StreamMax * sizeof(TCPStream_t*));
	memset(s_Stream, 0, s_StreamMax * sizeof(TCPStream_t*));
	fprintf(stderr, "TCP Flow Max: %i\n", MaxFlow);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, 0xbec6(%rip)      # 0xd140
movslq %edi, %rbx
leaq (,%rbx,8), %r14
movq %r14, %rdi
callq 0x11a0
movq %rax, 0xbeec(%rip)      # 0xd180
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1120
movq 0xbd50(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x7d96(%rip), %rsi      # 0x9048
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1160
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/fProfile.c
// Function: fProfile_Dump
void fProfile_Dump(u32 Index)
{
	double oot = 1.0 / g_ProfileTotal[Index];
	for (int i=0; i < 16; i++)
	{
		fprintf(stderr, "    [%2i] %016llx %20lli : (%.4f) : %s\n", 
				i,
				g_ProfileTotal[i],
				g_ProfileTotal[i],
				g_ProfileTotal[i] * oot,
				g_ProfileDesc[i]);
	}
	fProfile_Reset();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq 0xd089(%rip), %r15      # 0xefb0
movsd (%r15,%rax,8), %xmm0
unpcklps 0x70ec(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x70f4(%rip), %xmm0     # 0x9030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x77a8(%rip), %xmm0     # 0x96f8
divsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
movq 0xb095(%rip), %r13      # 0xcff8
leaq 0xd146(%rip), %rbp      # 0xf0b0
leaq 0x8bae(%rip), %rbx      # 0xab1f
xorl %r14d, %r14d
movq (%r13), %rdi
movq (%r12,%r15), %rcx
movq %rcx, %xmm1
punpckldq 0x7097(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x709f(%rip), %xmm1     # 0x9030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd (%rsp), %xmm0
movq (%r12,%rbp), %r9
movq %rbx, %rsi
movl %r14d, %edx
movq %rcx, %r8
movb $0x1, %al
callq 0x1160
incq %r14
addq $0x8, %r12
cmpq $0x10, %r14
jne 0x1f74
xorpd %xmm0, %xmm0
movapd %xmm0, 0xce51(%rip)     # 0xee20
movapd %xmm0, 0xce39(%rip)     # 0xee10
movapd %xmm0, 0xce21(%rip)     # 0xee00
movapd %xmm0, 0xce09(%rip)     # 0xedf0
movapd %xmm0, 0xcdf1(%rip)     # 0xede0
movapd %xmm0, 0xcdd9(%rip)     # 0xedd0
movapd %xmm0, 0xcdc1(%rip)     # 0xedc0
movapd %xmm0, 0xcda9(%rip)     # 0xedb0
movapd %xmm0, 0xcea1(%rip)     # 0xeeb0
movapd %xmm0, 0xcea9(%rip)     # 0xeec0
movapd %xmm0, 0xceb1(%rip)     # 0xeed0
movapd %xmm0, 0xceb9(%rip)     # 0xeee0
movapd %xmm0, 0xcec1(%rip)     # 0xeef0
movapd %xmm0, 0xcec9(%rip)     # 0xef00
movapd %xmm0, 0xced1(%rip)     # 0xef10
movapd %xmm0, 0xced9(%rip)     # 0xef20
movapd %xmm0, 0xcf61(%rip)     # 0xefb0
movapd %xmm0, 0xcf69(%rip)     # 0xefc0
movapd %xmm0, 0xcf71(%rip)     # 0xefd0
movapd %xmm0, 0xcf79(%rip)     # 0xefe0
movapd %xmm0, 0xcf81(%rip)     # 0xeff0
movapd %xmm0, 0xcf89(%rip)     # 0xf000
movapd %xmm0, 0xcf91(%rip)     # 0xf010
movapd %xmm0, 0xcf99(%rip)     # 0xf020
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_Close
void fTCPStream_Close(struct TCPStream_t* S)
{
	if(!S) return;

	//close(S->fd);
	//fclose(S->File);
	fFile_Close(S->File);
	S->File = NULL;

//	printf("[%s] OOO PacketList: %i/%i\n", S->Path, S->BufferListPos, S->BufferListMax);

	memset(S, 0, sizeof(TCPStream_t));
	free(S);
}

// Assembly:
testq %rdi, %rdi
je 0x2342
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x8972
movl $0x2460, %edx           # imm = 0x2460
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
movq %rbx, %rdi
popq %rbx
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_OutputHeader
void fTCPStream_OutputHeader(TCPStream_t* S, TCPOutputHeader_t* Header) 
{
	// ensure file is open
	fTCPStream_Open(S);	

	fProfile_Start(13, "TCP PktAdd OutputHeader");

	//int wlen = write(S->fd, &Header, sizeof(Header));
	//int wlen = fwrite(&Header, sizeof(Header), 1, S->File);
	fFile_Write(S->File, Header, sizeof(TCPOutputHeader_t), false);

	S->WritePos += sizeof(TCPOutputHeader_t);

	S->LastTSC = rdtsc();

	fProfile_Stop(13);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x23db
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
leaq 0xca3c(%rip), %r15      # 0xedb0
movq %rax, 0x68(%r15)
leaq 0x6d77(%rip), %rax      # 0x90f6
leaq 0xcd2a(%rip), %rcx      # 0xf0b0
movq %rax, 0x68(%rcx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x87fe
addq $0x20, 0x2440(%rbx)
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
movq %rax, 0x2428(%rbx)
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
leaq 0xcbea(%rip), %rcx      # 0xefb0
subq 0x68(%r15), %rax
addq 0x68(%rcx), %rax
addq %rdx, %rax
movq %rax, 0x68(%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_Open
static void fTCPStream_Open(TCPStream_t* S)
{
	fProfile_Start(10, "TCP PktAdd Open");

	if (S->File == NULL)
	{
		fProfile_Start(15, "TCP IO Open");

		//S->File = fopen64(S->Path, "w+"); 
		S->File = fFile_Open(S->Path, NULL); 
		fProfile_Stop(15);

		if (S->File == NULL) 
		{
			fprintf(stderr, "failed to create output file [%s] errno:%i (%s)\n", S->Path, errno, strerror(errno));
			exit(-1);
		}
	}
	fProfile_Stop(10);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
leaq 0xc9be(%rip), %r15      # 0xedb0
movq %rax, 0x50(%r15)
leaq 0x70fd(%rip), %rax      # 0x94fa
leaq 0xccac(%rip), %rcx      # 0xf0b0
movq %rax, 0x50(%rcx)
cmpq $0x0, 0x8(%rdi)
jne 0x2466
movq %rdi, %rbx
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
movq %rax, 0x78(%r15)
leaq 0x70e2(%rip), %rax      # 0x950a
movq %rax, 0x78(%rcx)
leaq 0x2028(%rdi), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x874c
movq %rax, 0x8(%rbx)
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
leaq 0xcb60(%rip), %rcx      # 0xefb0
subq 0x78(%r15), %rax
addq 0x78(%rcx), %rax
addq %rdx, %rax
movq %rax, 0x78(%rcx)
cmpq $0x0, 0x8(%rbx)
je 0x248a
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
leaq 0xcb3b(%rip), %rcx      # 0xefb0
subq 0x50(%r15), %rax
addq 0x50(%rcx), %rax
addq %rdx, %rax
movq %rax, 0x50(%rcx)
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x1541
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_OutputPayload
void fTCPStream_OutputPayload(TCPStream_t* S, u64 TS, u32 Length, u8* Payload, u32 Flag, u32 SeqNo, u32 AckNo, u32 WindowSize)
{

	// ensure file is open 
	fTCPStream_Open(S);	

	fProfile_Start(12, "TCP PktAdd OutputPayload");
	S->SeqNo += Length;

	int rlen;
	if (g_EnableTCPHeader)
	{
		TCPOutputHeader_t Header;
		Header.TS 		= TS;
		Header.Length 	= Length;
		Header.StreamID	= S->FlowID;
		Header.SeqNo	= SeqNo; 
		Header.AckNo	= AckNo; 
		Header.Window	= WindowSize; 
		Header.Flag		= Flag; 
		Header.CRC		= 0;
		Header.CRC		+= Header.TS;
		Header.CRC		+= Header.Length;
		Header.CRC		+= Header.StreamID;
		Header.CRC		+= Header.SeqNo;
		Header.CRC		+= Header.AckNo;
		Header.CRC		+= Header.Window;
		Header.CRC		+= Header.Flag;

		//rlen = write(S->fd, &Header, sizeof(Header));
		//rlen = fwrite(&Header, sizeof(Header), 1, S->File);
		fFile_Write(S->File, &Header, sizeof(TCPOutputHeader_t), false);

		S->WritePos += sizeof(TCPOutputHeader_t);
	}

	/*
	if (S->IsTrace)
	{
		for (int i=0; i < Length; i++)
		{
			if (i % 16 == 0) printf("\n");
			printf("%02x ", Payload[i]);
		}
		printf("\n");
	}
	*/


	//rlen = write(S->fd, Payload, Length);
	//rlen = fwrite(Payload, Length, 1, S->File);
	fFile_Write(S->File, Payload, Length, true);

	S->WritePos += Length; 

	S->LastTSC = rdtsc();

	// total TCP bytes output
	s_TotalByte += Length;
	s_TotalPkt	+= 1;

	fProfile_Stop(12);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %r12d
movl %r8d, %r15d
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
callq 0x23db
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
leaq 0xc8e8(%rip), %rcx      # 0xedb0
movq %rax, 0x60(%rcx)
leaq 0x6c3b(%rip), %rax      # 0x910e
leaq 0xcbd6(%rip), %rcx      # 0xf0b0
movq %rax, 0x60(%rcx)
addl %ebp, 0x18(%rbx)
leaq 0xbd14(%rip), %rax      # 0xe1fc
cmpl $0x0, (%rax)
je 0x2544
movl 0x68(%rsp), %eax
movl 0x60(%rsp), %ecx
leaq 0x8(%rsp), %rsi
movq %r13, (%rsi)
movw %bp, 0x8(%rsi)
movl 0x10(%rbx), %edx
movw %dx, 0xa(%rsi)
movl %r12d, 0xc(%rsi)
movl %ecx, 0x10(%rsi)
movl %eax, 0x14(%rsi)
movw %r15w, 0x18(%rsi)
addl %ebp, %r13d
addl %r12d, %r15d
addl %r13d, %r15d
addl %ecx, %r15d
addl %edx, %eax
addl %r15d, %eax
movw %ax, 0x1a(%rsi)
movq 0x8(%rbx), %rdi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x87fe
addq $0x20, 0x2440(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x87fe
movl %ebp, %ecx
addq %rcx, 0x2440(%rbx)
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
orq %rdx, %rax
movq %rax, 0x2428(%rbx)
addq %rcx, 0xac17(%rip)      # 0xd190
incq 0xac18(%rip)            # 0xd198
rdtsc
shlq $0x20, %rdx
movl %eax, %eax
leaq 0xca21(%rip), %rcx      # 0xefb0
leaq 0xc81a(%rip), %rsi      # 0xedb0
subq 0x60(%rsi), %rax
addq 0x60(%rcx), %rax
addq %rdx, %rax
movq %rax, 0x60(%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/./fTypes.h
// Function: FormatTS
static inline char* FormatTS(u64 ts)
{
	u64 usec = ts / 1000ULL;
	u64 msec = usec / 1000ULL;
	u64 sec = msec / 1000ULL;
	u64 min = sec / 60ULL;
	u64 hour = min / 60ULL;

	u64 nsec = ts - usec*1000ULL;
	usec = usec - msec*1000ULL;
	msec = msec - sec*1000ULL;
	sec = sec - min*60ULL;
	min = min - hour*60ULL;

	static char List[16][128];
	static int Pos = 0;

	char* S = List[Pos];
	Pos = (Pos + 1) & 0xf;

	sprintf(S, "%02lli:%02lli:%02lli.%03lli.%03lli.%03lli", hour % 24, min, sec, msec,usec, nsec);

	return S;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rax
shrq $0x3, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
mulq %rcx
movq %rdx, %rsi
shrq $0x4, %rsi
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rdi, %rax
mulq %rcx
movq %rdx, %rcx
shrq $0x12, %rcx
movq %rdi, %rax
shrq $0x9, %rax
movabsq $0x44b82fa09b5a53, %rdx # imm = 0x44B82FA09B5A53
mulq %rdx
movq %rdx, %r11
shrq $0xb, %r11
movq %rdi, %rax
shrq $0xb, %rax
movabsq $0x9299ff347e9e9, %rdx  # imm = 0x9299FF347E9E9
mulq %rdx
movq %rdx, %rbx
shrq $0xc, %rbx
movabsq $-0x63a000d9128a12ab, %rdx # imm = 0x9C5FFF26ED75ED55
movq %rdi, %rax
mulq %rdx
movq %rdx, %r10
shrq $0x29, %r10
imulq $-0x3e8, %rsi, %r14     # imm = 0xFC18
addq %rdi, %r14
imulq $-0x3e8, %rcx, %r15     # imm = 0xFC18
addq %rsi, %r15
imulq $-0x3e8, %r11, %r9      # imm = 0xFC18
addq %rcx, %r9
imulq $-0x3c, %rbx, %r8
addq %r11, %r8
imulq $-0x3c, %r10, %rcx
addq %rbx, %rcx
movslq 0xa776(%rip), %rax      # 0xd9c0
leal 0x1(%rax), %edx
shlq $0x7, %rax
leaq 0x9f68(%rip), %rbx      # 0xd1c0
addq %rax, %rbx
andl $0xf, %edx
movl %edx, 0xa75c(%rip)      # 0xd9c0
movabsq $0xaaaaaaaaaaaaaab, %rdx # imm = 0xAAAAAAAAAAAAAAB
movq %r10, %rax
mulq %rdx
shll $0x3, %edx
leaq (%rdx,%rdx,2), %rax
subq %rax, %r10
leaq 0x62c2(%rip), %rsi      # 0x9547
movq %rbx, %rdi
movq %r10, %rdx
xorl %eax, %eax
pushq %r14
pushq %r15
callq 0x1220
addq $0x10, %rsp
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/tcpstream.c
// Function: fTCPStream_FlowStats
void fTCPStream_FlowStats(TCPStream_t* S, FILE* Out)
{
	if (!S) return;

	fprintf(Out, " BufPos: %8i WritePos:%8i PktTotal:%8i PktOOO:%8i PktDrop:%8i", 
					S->BufferListPos, 
					S->WritePos,
					S->PktTotal,
					S->PktOOO,
					S->PktDrop

	);
}

// Assembly:
testq %rdi, %rdi
je 0x384e
pushq %rax
movl 0x1c(%rdi), %edx
movq 0x2440(%rdi), %rcx
movl 0x2458(%rdi), %r8d
movl 0x2454(%rdi), %r9d
movl 0x2450(%rdi), %eax
movl %eax, (%rsp)
leaq 0x5c7c(%rip), %rax      # 0x94bc
movq %rsi, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1160
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/udpstream.c
// Function: fUDPStream_Add
void fUDPStream_Add(UDPStream_t* Stream, u64 TS, PCAPPacket_t* Pkt, UDPHeader_t* UDPHeader)
{
	// output in PCAP format
	if (g_OutputPCAP)
	{
		fFile_Write(Stream->F, Pkt, sizeof(PCAPPacket_t) + Pkt->LengthCapture, true);
		return;
	}

	// write only the UDP payload
	u32 Length = swap16(UDPHeader->Length);	
	if (Length >= 16*1024)
	{
		fprintf(stderr, "udp packet length invalid UDP Length:%i PacketLength:%i\n", Length, Pkt->Length);
		return;
	}

	// ensure its caped at the packet length
	if (Length > Pkt->Length)
	{
		fprintf(stderr, "udp packet length truncated: Header %i Capture %i\n", Length, Pkt->Length);
		Length = Pkt->Length;
	}	

	if (g_EnableUDPHeader)
	{
		OutputHeader_t Header;
		Header.TS 		= TS;
		Header.Length 	= sizeof(UDPHeader_t) + Length; 
		Header.StreamID	= Stream->FlowID;
		fFile_Write(Stream->F, &Header, sizeof(Header), false );
	}

	// write the UDP header + payload 
	fFile_Write(Stream->F, UDPHeader, sizeof(UDPHeader_t) + Length, true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r13
movq %rdi, %r14
leaq 0xa7a1(%rip), %rax      # 0xe214
cmpl $0x0, (%rax)
je 0x3a9c
movq (%r14), %rdi
movl 0x8(%r13), %edx
addl $0x10, %edx
movq %r13, %rsi
movl $0x1, %ecx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x87fe
movq %rcx, %rbx
movzwl 0x4(%rcx), %eax
rolw $0x8, %ax
movzwl %ax, %r15d
cmpl $0x4000, %r15d          # imm = 0x4000
jae 0x3b1e
movq %rsi, %r12
movl 0xc(%r13), %ecx
cmpl %r15d, %ecx
jb 0x3b4a
leaq 0xa735(%rip), %rax      # 0xe200
cmpl $0x0, (%rax)
je 0x3af9
movq %rsp, %rsi
movq %r12, (%rsi)
leal 0x8(%r15), %eax
movw %ax, 0x8(%rsi)
movzwl 0x408(%r14), %eax
movw %ax, 0xa(%rsi)
movq (%r14), %rdi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x87fe
movq (%r14), %rdi
addl $0x8, %r15d
movq %rbx, %rsi
movl %r15d, %edx
movl $0x1, %ecx
callq 0x87fe
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x94d3(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movl 0xc(%r13), %ecx
leaq 0x5b21(%rip), %rsi      # 0x9654
movl %r15d, %edx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1160
movq 0x94a7(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x5b32(%rip), %rsi      # 0x968d
movl %r15d, %edx
xorl %eax, %eax
callq 0x1160
movl 0xc(%r13), %r15d
jmp 0x3ac4
nop
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/main.c
// Function: FlowAlloc
static void FlowAlloc(u32 FlowMax)
{
	s_FlowListMax 		= FlowMax;

	if (s_FlowExtract)		free(s_FlowExtract);
	if (s_ExtractTCPFlow)	free(s_ExtractTCPFlow);
	if (s_ExtractTCP) 		free(s_ExtractTCP);
	if (s_ExtractUDP) 		free(s_ExtractUDP);

	s_FlowExtract 		= (u8*)malloc( s_FlowListMax * sizeof(u8) );
	s_ExtractTCPFlow 	= (u8*)malloc( s_FlowListMax * sizeof(u8) );
	s_ExtractTCP	 	= (struct TCPStream_t**)malloc( s_FlowListMax * sizeof(void*) );
	s_ExtractUDP	 	= (struct UDPStream_t**)malloc( s_FlowListMax * sizeof(void*) );

	memset(s_FlowExtract,		0, s_FlowListMax * sizeof(u8) );
	memset(s_ExtractTCPFlow,	0, s_FlowListMax * sizeof(u8) );
	memset(s_ExtractTCP, 		0, s_FlowListMax * sizeof(void*) );
	memset(s_ExtractUDP, 		0, s_FlowListMax * sizeof(void*) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, 0x7d3d(%rip)      # 0xe550
movq 0x79fe(%rip), %rdi      # 0xe218
testq %rdi, %rdi
je 0x6824
callq 0x1030
movq 0x7a15(%rip), %rdi      # 0xe240
testq %rdi, %rdi
je 0x6835
callq 0x1030
movq 0x7d24(%rip), %rdi      # 0xe560
testq %rdi, %rdi
je 0x6846
callq 0x1030
movq 0x7d1b(%rip), %rdi      # 0xe568
testq %rdi, %rdi
je 0x6857
callq 0x1030
movl %ebx, %ebx
movq %rbx, %rdi
callq 0x11a0
movq %rax, %r15
movq %rax, 0x79ad(%rip)      # 0xe218
movq %rbx, %rdi
callq 0x11a0
movq %rax, %r12
movq %rax, 0x79c3(%rip)      # 0xe240
leaq (,%rbx,8), %r14
movq %r14, %rdi
callq 0x11a0
movq %rax, %r13
movq %rax, 0x7cc9(%rip)      # 0xe560
movq %r14, %rdi
callq 0x11a0
movq %rax, %rbp
movq %rax, 0x7cbf(%rip)      # 0xe568
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1120
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1120
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1120
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1120
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/main.c
// Function: PrintHumanFlows
static void PrintHumanFlows(void)
{
	u64 PktMax = 0;
	/*
	for (int i=1; i < s_FlowListPos; i++)
	{
		FlowHash_t* F = &s_FlowList[i];
		if (PktMax < F->PktCnt) PktMax = F->PktCnt;
	}
	*/

	u32 FlowCnt = 0;
	s32 Remain = s_FlowListPos-1;
	while (Remain > 0)
	{
		u64 NextMax = 1e16;
		for (int i=1; i < s_FlowListPos; i++)
		{
			FlowHash_t* F = &s_FlowList[i];
			if (F->PktCnt == PktMax)
			{
				if (F->PktCnt >= s_FlowListPacketMin)
				{
					switch (F->Type)
					{
					case FLOW_TYPE_TCP: PrintFlowTCP(stdout, F, i, FlowCnt); break;
					case FLOW_TYPE_UDP: PrintFlowUDP(stdout, F, i, FlowCnt); break;
					}
				}
				
				Remain--;
				FlowCnt++;
				assert(Remain >= 0);
			}
			else if (F->PktCnt > PktMax)
			{
				if (NextMax > F->PktCnt) NextMax = F->PktCnt;
			}
		}

		//printf("%i -> %i : %i\n", PktMax, NextMax, Remain);
		PktMax = NextMax;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x685c(%rip), %ebp      # 0xd158
decl %ebp
testl %ebp, %ebp
jle 0x69cc
xorl %r13d, %r13d
xorl %ebx, %ebx
cmpl $0x2, 0x6846(%rip)      # 0xd158
jb 0x69b7
movl $0x1, %r14d
movl $0x70, %r12d
movabsq $0x2386f26fc10000, %r15 # imm = 0x2386F26FC10000
movq 0x7c23(%rip), %rsi      # 0xe558
movq 0x48(%rsi,%r12), %rax
cmpq %r13, %rax
jne 0x6970
cmpq 0x7b4a(%rip), %rax      # 0xe490
jb 0x6997
movl 0x44(%rsi,%r12), %eax
addq %r12, %rsi
cmpl $0x2, %eax
je 0x6983
cmpl $0x1, %eax
jne 0x6997
movq 0x666f(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x69fa
jmp 0x6997
cmpq %rax, %r15
movq %rax, %rcx
cmovbq %r15, %rcx
cmpq %r13, %rax
cmovaq %rcx, %r15
jmp 0x699f
movq 0x6646(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x6f5b
testl %ebp, %ebp
jle 0x69db
decl %ebp
incl %ebx
incq %r14
movl 0x67b0(%rip), %eax      # 0xd158
addq $0x70, %r12
cmpq %rax, %r14
jb 0x692e
jmp 0x69c1
movabsq $0x2386f26fc10000, %r15 # imm = 0x2386F26FC10000
movq %r15, %r13
testl %ebp, %ebp
jg 0x690b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4116(%rip), %rdi      # 0xaaf8
leaq 0x2f01(%rip), %rsi      # 0x98ea
leaq 0x4114(%rip), %rcx      # 0xab04
movl $0x28f, %edx            # imm = 0x28F
callq 0x1110
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/fFile.c
// Function: fFile_Open
struct fFile_t* fFile_Open(u8* Path, u8* Mode)
{
	fFile_t* F = (fFile_t*)malloc( sizeof(fFile_t) );
	memset(F, 0, sizeof(fFile_t));

	strncpy(F->Path, Path, sizeof(F->Path));

	// initial output buffer 
	F->IsBuffer		= true;
	F->BufferMax	= s_FileSizeMin;
	F->BufferPos	= 0;
	F->Buffer		= malloc( F->BufferMax );		
	memset(F->Buffer, 0, F->BufferMax );

	F->TotalByte	= 0;

	// if file existed before get total length
	struct stat fstat;	
	if (stat(F->Path, &fstat) >= 0) 
	{
		F->TotalByte = fstat.st_size;
	}

	// new file allocated 
	s_TotalFile++;

	return F;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r14
movl $0x438, %edi            # imm = 0x438
callq 0x11a0
movq %rax, %rbx
xorl %r15d, %r15d
movl $0x438, %edx            # imm = 0x438
movq %rax, %rdi
xorl %esi, %esi
callq 0x1120
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1050
movl $0x1, 0x408(%rbx)
movq 0x49c5(%rip), %r14      # 0xd160
movq %r14, 0x420(%rbx)
movq %r15, 0x418(%rbx)
movq %r14, %rdi
callq 0x11a0
movq %rax, 0x410(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1120
movq %r15, 0x428(%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1170
testl %eax, %eax
js 0x87e7
movq 0x30(%rsp), %rax
movq %rax, 0x428(%rbx)
incq 0x69c2(%rip)            # 0xf1b0
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/fFile.c
// Function: fFile_Write
void fFile_Write(struct fFile_t* F, void* Buffer, u32 Length, bool IsPayload)
{
	// should never write with a null file handle
	assert(F != NULL);

	// need to create a file 
	if (F->IsBuffer)
	{
		if (F->BufferPos + Length > F->BufferMax)
		{
			F->File = fopen(F->Path, "a");
			assert(F->File != NULL);

			fwrite(F->Buffer, 1, F->BufferPos, F->File);
			F->TotalByte	+= F->BufferPos;

			F->IsBuffer 	= false;
			F->BufferPos	= 0;

			s_TotalFileActive++;
		}
	}

	// buffer it
	if (F->IsBuffer)
	{
		memcpy(F->Buffer + F->BufferPos, Buffer, Length);
		F->BufferPos += Length;
	}
	else
	{
		assert(F->File != NULL);

		fwrite(Buffer, 1, Length, F->File);
		if (s_ForceFlush) fflush(F->File);
		F->TotalByte	+= Length; 
	}

	// if this is payload
	if (IsPayload) F->TotalPayload += Length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x8915
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x0, 0x408(%rdi)
movl %edx, %r14d
je 0x889a
movq 0x418(%rbx), %rax
addq %r14, %rax
cmpq 0x420(%rbx), %rax
jbe 0x889a
leaq 0x2348(%rip), %rsi      # 0xab85
movq %rbx, %rdi
callq 0x1200
movq %rax, 0x400(%rbx)
testq %rax, %rax
je 0x8953
movq 0x410(%rbx), %rdi
movq 0x418(%rbx), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x1240
movq 0x418(%rbx), %rax
addq %rax, 0x428(%rbx)
movl $0x0, 0x408(%rbx)
movq $0x0, 0x418(%rbx)
incq 0x691e(%rip)            # 0xf1b8
cmpl $0x0, 0x408(%rbx)
je 0x88c5
movq 0x410(%rbx), %rdi
leaq 0x418(%rbx), %r12
addq 0x418(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1180
jmp 0x88fd
movq 0x400(%rbx), %rcx
testq %rcx, %rcx
je 0x8934
movl $0x1, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x1240
cmpb $0x1, 0x68d8(%rip)      # 0xf1c0
jne 0x88f6
movq 0x400(%rbx), %rdi
callq 0x11b0
leaq 0x428(%rbx), %r12
addq %r14, (%r12)
testl %ebp, %ebp
je 0x890c
addq %r14, 0x430(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f0e(%rip), %rdi      # 0xa82a
leaq 0x2224(%rip), %rsi      # 0xab47
leaq 0x2225(%rip), %rcx      # 0xab4f
movl $0x5d, %edx
callq 0x1110
leaq 0x224c(%rip), %rdi      # 0xab87
leaq 0x2205(%rip), %rsi      # 0xab47
leaq 0x2206(%rip), %rcx      # 0xab4f
movl $0x79, %edx
callq 0x1110
leaq 0x222d(%rip), %rdi      # 0xab87
leaq 0x21e6(%rip), %rsi      # 0xab47
leaq 0x21e7(%rip), %rcx      # 0xab4f
movl $0x65, %edx
callq 0x1110
// File: /workspace/github_c_makefile_star2_O1/fmadio[P]pcap_flow/fFile.c
// Function: fFile_Close
void fFile_Close(struct fFile_t* F)
{
	if (!F) return;

	// flush buffer contents if not written to disk
	if (F->IsBuffer && (F->BufferPos > 0))
	{
		// if theres real substational data the flush it
		if (F->TotalPayload > s_FileSizeMin)
		{
			F->File = fopen(F->Path, "a");
			assert(F->File != NULL);

			fwrite(F->Buffer, 1, F->BufferPos, F->File);
			F->BufferPos = 0;
		}
	}

	// close
	if (F->File)
	{
		fclose(F->File);
		s_TotalFileActive--;
	}

	if (F->Buffer)
	{
		free(F->Buffer);
		F->Buffer = NULL;
	}
	memset(F, 0, sizeof(fFile_t));
	free(F);

	s_TotalFileClose++;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x8a35
movq %rdi, %rbx
cmpl $0x0, 0x408(%rdi)
je 0x89e3
cmpq $0x0, 0x418(%rbx)
je 0x89e3
movq 0x430(%rbx), %rax
cmpq 0x47c0(%rip), %rax      # 0xd160
jbe 0x89e3
leaq 0x21dc(%rip), %rsi      # 0xab85
movq %rbx, %rdi
callq 0x1200
movq %rax, 0x400(%rbx)
testq %rax, %rax
je 0x8a37
movq 0x410(%rbx), %rdi
movq 0x418(%rbx), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x1240
movq $0x0, 0x418(%rbx)
movq 0x400(%rbx), %rdi
testq %rdi, %rdi
je 0x89fb
callq 0x10d0
decq 0x67bd(%rip)            # 0xf1b8
movq 0x410(%rbx), %rdi
testq %rdi, %rdi
je 0x8a17
callq 0x1030
movq $0x0, 0x410(%rbx)
movl $0x438, %edx            # imm = 0x438
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
movq %rbx, %rdi
callq 0x1030
incq 0x6793(%rip)            # 0xf1c8
popq %rbx
retq
leaq 0x2149(%rip), %rdi      # 0xab87
leaq 0x2102(%rip), %rsi      # 0xab47
leaq 0x214b(%rip), %rcx      # 0xab97
movl $0x91, %edx
callq 0x1110
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: main
int main(int argc, char *argv[])
{
  if (!parse_arg_list(argc, argv))
  {
    puts("Error: invalid arguments.");
    return EXIT_FAILURE;
  }

  int n;
  struct list_node *list_root = NULL;
  char word[MAX_WORD_LEN];

  while (get_word(word, MAX_WORD_LEN) != EOF)
  {
    if ((n = bin_search(word, data_types, NR_OF_TYPES)) >= 0)
    {
      do
      {
        // NOTE: This approach takes into consideration both variable and function names.
        if (get_word(word, MAX_WORD_LEN) != EOF && (isalpha(word[0]) || word[0] == '_'))
        {
          list_root = add_to_list(list_root, word);
        }
      } while (get_word(word, MAX_WORD_LEN) == ',');
    }
  }

  print_list(list_root);

  return EXIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
callq 0x12b8
testl %eax, %eax
je 0x1299
movq %rsp, %rdi
movl $0x64, %esi
callq 0x12fd
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpl $-0x1, %eax
je 0x128f
leaq 0x2e6a(%rip), %r15      # 0x4080
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movl $0x7, %edx
callq 0x1400
testl %eax, %eax
js 0x127d
movq %r12, %rdi
movl $0x64, %esi
callq 0x12fd
cmpl $-0x1, %eax
je 0x126b
callq 0x10d0
movsbq (%rsp), %rcx
cmpq $0x5f, %rcx
je 0x125d
movq (%rax), %rax
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
je 0x126b
movq %r14, %rdi
movq %r12, %rsi
callq 0x146d
movq %rax, %r14
movq %r12, %rdi
movl $0x64, %esi
callq 0x12fd
cmpl $0x2c, %eax
je 0x122d
movq %r12, %rdi
movl $0x64, %esi
callq 0x12fd
cmpl $-0x1, %eax
jne 0x1219
movq %r14, %rdi
callq 0x14d1
jmp 0x12aa
leaq 0xd8a(%rip), %rdi       # 0x202a
callq 0x1060
movl $0x1, %ebx
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: parse_arg_list
int parse_arg_list(int argc, char *argv[])
{
  if (argc > 2)
  {
    return 0;
  }

  if (argc == 2)
  {
    if (!isdigit(argv[1][0]))
    {
      return 0;
    }

    var_name_str_cmp_len = atoi(argv[1]);

    if (var_name_str_cmp_len < 0)
    {
      return 0;
    }
  }

  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x2, %edi
jg 0x12f3
jne 0x12ee
movq %rsi, %r14
callq 0x10d0
movq (%rax), %rax
movq 0x8(%r14), %rdi
movsbq (%rdi), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x12f3
callq 0x10b0
movl %eax, 0x2dce(%rip)      # 0x40b8
testl %eax, %eax
js 0x12f3
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: get_word
int get_word(char *word, int max_word_len)
{
  skip_blanks();
  skip_comments();
  skip_char_literal();
  skip_string_literal();

  int c = getc(stdin);
  size_t i = 0;

  if (c != EOF)
  {
    word[i++] = c;
  }

  if (!isalpha(c) && c != '_')
  {
    word[i] = '\0';
    return c;
  }

  while ((isalnum(c = getc(stdin)) || c == '_') && i < max_word_len)
  {
    word[i++] = c;
  }
  ungetc(c, stdin);
  word[i] = '\0';

  return word[0];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x1519
callq 0x1551
movl $0x27, %edi
movl $0x27, %esi
callq 0x15be
movl $0x22, %edi
movl $0x22, %esi
callq 0x15be
movq 0x2ca4(%rip), %r12      # 0x3fe0
movq (%r12), %rdi
callq 0x10c0
movl %eax, %r15d
cmpl $-0x1, %eax
je 0x1358
movb %r15b, (%rbx)
movl $0x1, %r13d
jmp 0x135b
xorl %r13d, %r13d
callq 0x10d0
movq %rax, %r14
cmpl $0x5f, %r15d
je 0x1381
movq (%r14), %rax
movslq %r15d, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
jne 0x1381
movb $0x0, (%rbx,%r13)
jmp 0x13ee
movq (%r14), %r15
movq (%r12), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x8, (%r15,%rcx,2)
sete %dl
cmpl $0x5f, %ecx
setne %cl
andb %dl, %cl
movslq %ebp, %r15
cmpq %r15, %r13
setae %dl
orb %cl, %dl
jne 0x13da
movb %al, (%rbx,%r13)
incq %r13
movq (%r14), %rbp
movq (%r12), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x8, (%rbp,%rcx,2)
sete %dl
cmpl $0x5f, %ecx
setne %cl
testb %dl, %cl
jne 0x13da
cmpq %r15, %r13
jb 0x13ad
movq (%r12), %rsi
movl %eax, %edi
callq 0x10a0
movb $0x0, (%rbx,%r13)
movsbl (%rbx), %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_02/var_group.c
// Function: bin_search
int bin_search(char *word, char *arr[], int arr_len)
{
  int low = 0;
  int high = arr_len - 1;
  int mid;

  while (low <= high)
  {
    mid = (low + high) / 2;

    int cond = strcmp(word, arr[mid]);
    if (cond < 0)
    {
      high = mid - 1;
    }
    else if (cond > 0)
    {
      low = mid + 1;
    }
    else
    {
      return mid;
    }
  }

  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
decl %r15d
xorl %r12d, %r12d
cmpl %r15d, %r12d
jg 0x1457
leal (%r12,%r15), %r13d
shrl %r13d
movq (%rbx,%r13,8), %rsi
movq %r14, %rdi
callq 0x1080
testl %eax, %eax
jns 0x1440
decl %r13d
movb $0x1, %al
movl %r13d, %r15d
jmp 0x1451
je 0x144c
incl %r13d
movb $0x1, %al
movl %r13d, %r12d
jmp 0x1451
xorl %eax, %eax
movl %r13d, %ebp
testb %al, %al
jne 0x141a
jmp 0x145c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq