LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_parse.c
// Function: expand_single_string
static int expand_single_string(struct token *tok, struct token *next,
				struct string **string_ret)
{
	int ret;
	LIST_HEAD(string_list);
	ret = expand_params_and_word_split(tok, next, &string_list);
	if (ret)
		goto out_free_string_list;
	ret = glue_strings(&string_list);
	if (ret)
		goto out_free_string_list;
	if (!mysh_filename_expansion_disabled) {
		ret = do_filename_expansion(&string_list);
		if (ret)
			goto out_free_string_list;
	}
	if (list_empty(&string_list))
		*string_ret = NULL;
	else if (list_is_singular(&string_list))
		*string_ret = list_entry(string_list.next, struct string, list);
	else {
		ret = -1;
		goto out_free_string_list;
	}
out:
	return ret;
out_free_string_list:
	free_string_list(&string_list);
	goto out;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsp, %r14
movq %r14, (%r14)
movq %r14, 0x8(%r14)
movq %r14, %rdx
callq 0x5638
movq %r14, %rdi
callq 0x5892
leaq 0x56e0(%rip), %rax      # 0xb230
cmpl $0x0, (%rax)
je 0x5b6a
movq (%rsp), %rax
cmpq %r14, %rax
je 0x5b82
cmpq 0x8(%rsp), %rax
je 0x5b88
pushq $-0x1
popq %rbp
jmp 0x5b78
movq %rsp, %rdi
callq 0x598d
movl %eax, %ebp
testl %eax, %eax
je 0x5b55
movq %rsp, %rdi
callq 0x61ae
jmp 0x5b91
andq $0x0, (%rbx)
jmp 0x5b8f
addq $-0x18, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_parse.c
// Function: add_stderr_to_stdout_redirection
static void add_stderr_to_stdout_redirection(struct list_head *redirs)
{
	struct redirection *redir;

	redir = xmalloc(sizeof(*redir));
	redir->is_file = false;
	redir->src_fd = 1;
	redir->dest_fd = 2;
	list_add_tail(&redir->list, redirs);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x30
popq %rdi
callq 0x6099
movb $0x0, (%rax)
movl $0x1, 0x8(%rax)
movl $0x2, 0x18(%rax)
leaq 0x20(%rax), %rcx
movq 0x8(%rbx), %rdx
movq %rcx, 0x8(%rbx)
movq %rbx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rcx, (%rdx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_redir.c
// Function: undo_redirections
int undo_redirections(const struct orig_fds *orig)
{
	int ret = 0;
	int i;
	for (i = 0; i < ARRAY_SIZE(orig->fds); i++) {
		if (orig->fds[i] >= 0) {
			if (dup2(orig->fds[i], i) < 0)
				ret = -1;
			if (close(orig->fds[i]) < 0)
				ret = -1;
		}
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $-0x1
popq %r12
xorl %ebp, %ebp
cmpq $0x3, %r14
je 0x5dca
movl (%rbx,%r14,4), %edi
testl %edi, %edi
js 0x5dc5
movl %r14d, %esi
callq 0x2120
movl %eax, %r15d
movl (%rbx,%r14,4), %edi
callq 0x21c0
orl %r15d, %eax
cmovsl %r12d, %ebp
incq %r14
jmp 0x5d9c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_redir.c
// Function: do_redirections
int do_redirections(const struct list_head *redirs, struct orig_fds *orig)
{
	int i;
	int ret;
	struct redirection *redir;

	if (orig)
		for (i = 0; i < ARRAY_SIZE(orig->fds); i++)
			orig->fds[i] = -1;
	list_for_each_entry(redir, redirs, list) {
		int src_fd;
		if (redir->is_file) {
			src_fd = open(redir->src_filename, redir->open_flags, 0666);
			if (src_fd < 0) {
				mysh_error_with_errno("can't open %s for %s",
						      redir->src_filename,
						      (redir->open_flags & O_WRONLY)
						      ? "writing" : "reading");
				ret = -1;
				goto out_undo_redirections;
			}
		} else {
			src_fd = redir->src_fd;
		}

		if (orig &&
		    redir->dest_fd < ARRAY_SIZE(orig->fds) &&
		    orig->fds[redir->dest_fd] < 0)
		{
			ret = dup(redir->dest_fd);
			if (ret < 0) {
				mysh_error_with_errno("failed to duplicate "
						      "file descriptor");
				goto out_undo_redirections;
			}
			orig->fds[redir->dest_fd] = ret;
		}
		ret = dup2(src_fd, redir->dest_fd);
		if (redir->is_file)
			close(src_fd);
		if (ret < 0) {
			mysh_error_with_errno("can't perform redirection");
			goto out_undo_redirections;
		}
	}
	ret = 0;
	goto out;
out_undo_redirections:
	if (orig)
		(void)undo_redirections(orig);
out:
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, %r12
testq %rsi, %rsi
je 0x5dff
xorl %eax, %eax
cmpq $0x3, %rax
je 0x5dfc
orl $-0x1, (%rbx,%rax,4)
incq %rax
jmp 0x5ded
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x5e9c
cmpb $0x1, -0x20(%r12)
jne 0x5e33
movq -0x18(%r12), %rdi
movl -0x10(%r12), %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22c0
movl %eax, %r15d
testl %eax, %eax
jns 0x5e38
jmp 0x5ea0
movl -0x18(%r12), %r15d
testq %rbx, %rbx
je 0x5e65
movl -0x8(%r12), %edi
cmpq $0x2, %rdi
ja 0x5e65
cmpl $0x0, (%rbx,%rdi,4)
jns 0x5e65
callq 0x2150
movl %eax, %ebp
testl %eax, %eax
js 0x5ee6
movslq -0x8(%r12), %rax
movl %ebp, (%rbx,%rax,4)
movl -0x8(%r12), %esi
movl %r15d, %edi
callq 0x2120
movl %eax, %ebp
cmpb $0x1, -0x20(%r12)
jne 0x5e84
movl %r15d, %edi
callq 0x21c0
testl %ebp, %ebp
jns 0x5dff
leaq 0x2077(%rip), %rdi      # 0x7f0a
xorl %eax, %eax
callq 0x5fb7
jmp 0x5ece
xorl %ebp, %ebp
jmp 0x5edb
movq -0x18(%r12), %rsi
testb $0x1, -0x10(%r12)
leaq 0x202c(%rip), %rax      # 0x7ede
leaq 0x201d(%rip), %rdx      # 0x7ed6
cmoveq %rax, %rdx
leaq 0x1ffd(%rip), %rdi      # 0x7ec1
xorl %eax, %eax
callq 0x5fb7
pushq $-0x1
popq %rbp
testq %rbx, %rbx
je 0x5edb
movq %rbx, %rdi
callq 0x5d88
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ff9(%rip), %rdi      # 0x7ee6
xorl %eax, %eax
callq 0x5fb7
jmp 0x5ed3
nop
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: mysh_error
void mysh_error(const char *fmt, ...)
{
	va_list va;
	va_start(va, fmt);
	fputs(SHELL_NAME ": error: ", stderr);
	vfprintf(stderr, fmt, va);
	fputc('\n', stderr);
	va_end(va);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5f5b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0x506e(%rip), %r15      # 0xaff0
movq (%r15), %rsi
leaq 0x1f98(%rip), %rdi      # 0x7f24
callq 0x2170
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22e0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x21f0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: mysh_error_with_errno
void mysh_error_with_errno(const char *fmt, ...)
{
	va_list va;
	va_start(va, fmt);
	fputs(SHELL_NAME ": error: ", stderr);
	vfprintf(stderr, fmt, va);
	fprintf(stderr, ": %s", strerror(errno));
	fputc('\n', stderr);
	va_end(va);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x601a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0x4faf(%rip), %r15      # 0xaff0
movq (%r15), %rsi
leaq 0x1ed9(%rip), %rdi      # 0x7f24
callq 0x2170
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22e0
movq (%r15), %rbx
callq 0x2060
movl (%rax), %edi
callq 0x2380
leaq 0x121b(%rip), %rsi      # 0x728f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2240
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x21f0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: xmalloc
void *xmalloc(size_t size)
{
	void *p = malloc(size);
	if (!p) {
		mysh_error("out of memory");
		exit(-1);
	}
	return p;
}

// Assembly:
pushq %rax
callq 0x2280
testq %rax, %rax
je 0x60a6
popq %rcx
retq
leaq 0x1d1b(%rip), %rdi      # 0x7dc8
xorl %eax, %eax
callq 0x5ef8
pushq $-0x1
popq %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: xrealloc
void *xrealloc(void *ptr, size_t size)
{
	void *p = realloc(ptr, size);
	if (!p) {
		mysh_error("out of memory");
		exit(-1);
	}
	return p;
}

// Assembly:
pushq %rax
callq 0x2290
testq %rax, %rax
je 0x60c9
popq %rcx
retq
leaq 0x1cf8(%rip), %rdi      # 0x7dc8
xorl %eax, %eax
callq 0x5ef8
pushq $-0x1
popq %rdi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: xstrdup
char *xstrdup(const char *s)
{
	if (!s)
		return NULL;
	char *p = strdup(s);
	if (!p) {
		mysh_error("out of memory");
		exit(-1);
	}
	return p;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x611c
callq 0x2370
testq %rax, %rax
jne 0x611e
leaq 0x1cbb(%rip), %rdi      # 0x7dc8
xorl %eax, %eax
callq 0x5ef8
pushq $-0x1
popq %rdi
callq 0x2350
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: new_string
struct string *
new_string(size_t len)
{
	struct string *s = xmalloc(sizeof(struct string));
	s->chars = xzalloc(len + 1);
	s->len = len;
	s->flags = 0;
	return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x6099
movq %rax, %r14
leaq 0x1(%rbx), %rdi
callq 0x60df
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
andl $0x0, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: free_string_list
void
free_string_list(struct list_head *string_list)
{
	struct string *s, *tmp;
	list_for_each_entry_safe(s, tmp, string_list, list) {
		list_del(&s->list);
		free_string(s);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rbx, %rax
je 0x61d9
leaq -0x18(%rax), %rdi
movq (%rax), %r14
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rax)
callq 0x6193
movq %r14, %rax
jmp 0x61b8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_util.c
// Function: join_strings
struct string *
join_strings(struct list_head *strings)
{
	struct string *s, *new, *tmp;
	size_t len = 0;
	char *p;

	mysh_assert(!list_empty(strings));
	if (list_is_singular(strings)) /* no-op */
		return list_entry(strings->next, struct string, list);
	list_for_each_entry(s, strings, list)
		len += s->len;
	new = new_string(len);
	p = new->chars;
	list_for_each_entry_safe(s, tmp, strings, list) {
		p = mempcpy(p, s->chars, s->len);
		free_string(s);
	}
	return new;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
cmpq %rdi, %rbx
je 0x6260
movq %rdi, %r14
cmpq 0x8(%rdi), %rbx
je 0x624a
xorl %edi, %edi
cmpq %r14, %rbx
je 0x620d
addq -0x10(%rbx), %rdi
movq (%rbx), %rbx
jmp 0x61ff
callq 0x6120
movq %rax, %rbx
movq (%rax), %r15
movq (%r14), %rax
cmpq %r14, %rax
je 0x624e
leaq -0x18(%rax), %r12
movq (%rax), %rbp
movq -0x18(%rax), %rsi
movq -0x10(%rax), %r13
movq %r15, %rdi
movq %r13, %rdx
callq 0x2260
addq %r13, %r15
movq %r12, %rdi
callq 0x6193
movq %rbp, %rax
jmp 0x621b
addq $-0x18, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ccb(%rip), %rdi      # 0x7f32
leaq 0x1cd9(%rip), %rsi      # 0x7f47
leaq 0x1cde(%rip), %rcx      # 0x7f53
movl $0x86, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/client.c
// Function: parse_result
void parse_result(char *args[], char *message) {
    char *p = strtok (message, "\n");
    int i = 0;
    while (p != NULL)
    {
        args[i++] = p;
        p = strtok (NULL, "\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xdd9(%rip), %r14       # 0x206d
movq %rsi, %rdi
movq %r14, %rsi
callq 0x10e0
testq %rax, %rax
je 0x12af
movq %rax, (%rbx)
addq $0x8, %rbx
xorl %esi, %esi
jmp 0x1294
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MAGI003769[P]EE450-Socket-Project/client.c
// Function: print_result
void print_result(char *src, char *target, char *args[]) {
    printf("The client has received results from AWS: \n");
    printf("-------------------------------------------------------------------------------\n");
    printf("Source\tDestination\tMin Length\tTt\tTp\tDelay\n");
    printf("-------------------------------------------------------------------------------\n");
    printf("%s\t\t%s\t%s\t%s\t%s\t%s\n", src, target, args[0], args[1], args[2], args[3]);
    printf("-------------------------------------------------------------------------------\n");
    printf("%s\n", args[4]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0xe7a(%rip), %rdi       # 0x214d
callq 0x1050
leaq 0xec3(%rip), %r15       # 0x21a2
movq %r15, %rdi
callq 0x1050
leaq 0xe8a(%rip), %rdi       # 0x2178
callq 0x1050
movq %r15, %rdi
callq 0x1050
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
movq 0x10(%rbx), %r9
movq 0x18(%rbx), %rax
movq %rax, (%rsp)
leaq 0xcef(%rip), %rdi       # 0x2004
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1080
movq %r15, %rdi
callq 0x1050
movq 0x20(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/nmmmnu[P]HM2/test_hm_memtable.c
// Function: main
int main(int argc, char **argv){
	if (argc < 2){
		printf("Usage:\n");
		printf("\t%s filename [key to find]\n", argv[0]);
		exit(1);
	}

	const char *filename = argv[1];


	hm_memtable_t *v = hm_memtable_createa();


	printf("Load file\n");
	_loadfile(v, filename, 0);
	printf("Done...\n");


	if (argc > 2){
		// Find the key
		const char *findkey = argv[2];
		_findkey(v, findkey);
	}


	//getchar();


	// Free list

	printf("Free file\n");
	hm_memtable_removeall(v);
	printf("Done...\n");

	printf("Destroy file\n");
	hm_memtable_destroy(v);
	free(v);
	printf("Done...\n");


	//getchar();


	printf("main() end...\n");

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movl %edi, 0x4(%rsp)
cmpl $0x1, %edi
jle 0x1411
movq %rbx, 0x8(%rsp)
movq 0x8(%rbx), %r14
xorl %eax, %eax
callq 0x1ab2
movq %rax, %rbx
leaq 0xe03(%rip), %rdi       # 0x206a
callq 0x1040
leaq 0xdad(%rip), %rsi       # 0x2020
movq %r14, %rdi
callq 0x10c0
movq %rax, %r15
leaq 0x10(%rsp), %r12
xorl %r14d, %r14d
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x1090
testq %rax, %rax
je 0x132f
movq %rax, %rbp
movq %rax, %rdi
callq 0x1060
addq %rbp, %rax
decq %rax
movq %rax, %r13
cmpq %rbp, %rax
jbe 0x12d0
callq 0x1120
movq (%rax), %rcx
movzbl (%r13), %edx
leaq -0x1(%r13), %rax
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x12b0
movb $0x0, 0x1(%r13)
movq %rbp, %rdi
callq 0x1060
movq %rbp, %rdi
movq %rbp, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x1438
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1aca
incl %r14d
movl %r14d, %eax
xorl %edx, %edx
movl $0x2710, %ecx           # imm = 0x2710
divl %ecx
testl %edx, %edx
jne 0x1286
movq %rbx, %rdi
callq 0x1ade
leaq 0xd05(%rip), %rdi       # 0x2022
movl %r14d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1070
jmp 0x1286
movq %r15, %rdi
callq 0x1050
leaq 0xd4d(%rip), %rdi       # 0x208b
callq 0x1040
cmpl $0x2, 0x4(%rsp)
je 0x13aa
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1acf
testq %rax, %rax
je 0x1399
movq %rax, %r15
leaq 0xcef(%rip), %rdi       # 0x205c
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xd2a(%rip), %rdi       # 0x20a8
callq 0x1040
movq %r15, %rdi
callq 0x15fb
leaq 0xd22(%rip), %rdi       # 0x20b4
callq 0x1040
jmp 0x13aa
leaq 0xcaa(%rip), %rdi       # 0x204a
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xcc3(%rip), %rdi       # 0x2074
callq 0x1040
movq %rbx, %rdi
callq 0x1ac5
leaq 0xcc6(%rip), %r14       # 0x208b
movq %r14, %rdi
callq 0x1040
leaq 0xcaa(%rip), %rdi       # 0x207e
callq 0x1040
movq %rbx, %rdi
callq 0x1ac0
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1040
leaq 0xc9b(%rip), %rdi       # 0x2093
callq 0x1040
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc89(%rip), %rdi       # 0x20a1
callq 0x1040
movq (%rbx), %rsi
leaq 0xbdd(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rdi
callq 0x10f0
nop
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: place
void place(pool_t *pool, int fd) {

    pthread_mutex_lock(&mtx);

    while (pool->count >= POOL_SIZE){
        pthread_cond_wait(&cond_nonfull, &mtx);
    }

    pool->end = (pool->end + 1) % POOL_SIZE;
    pool->fd[pool->end] = fd;
    pool->count++;

    pthread_mutex_unlock(&mtx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x2b84(%rip), %r15      # 0x41a8
movq %r15, %rdi
callq 0x1290
leaq 0x2bf5(%rip), %r12      # 0x4228
movl 0x20(%rbx), %ecx
cmpl $0x6, %ecx
jl 0x1648
movq %r12, %rdi
movq %r15, %rsi
callq 0x1090
jmp 0x1633
movl 0x1c(%rbx), %eax
incl %eax
pushq $0x6
popq %rsi
cltd
idivl %esi
movl %edx, 0x1c(%rbx)
movslq %edx, %rax
movl %r14d, (%rbx,%rax,4)
incl %ecx
movl %ecx, 0x20(%rbx)
leaq 0x2b3f(%rip), %rdi      # 0x41a8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1170
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: obtain
int obtain(pool_t *pool) {
    int fd = 0;

    pthread_mutex_lock(&mtx);

    while (pool->count <= 0){
        pthread_cond_wait(&cond_nonempty, &mtx);
    }
    fd = pool->fd[pool->start];
    pool->start = (pool->start + 1) % POOL_SIZE;
    pool->count--;
    pthread_mutex_unlock(&mtx);

    return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2b1e(%rip), %r14      # 0x41a8
movq %r14, %rdi
callq 0x1290
leaq 0x2b5f(%rip), %r15      # 0x41f8
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
jg 0x16ad
movq %r15, %rdi
movq %r14, %rsi
callq 0x1090
jmp 0x1699
movslq 0x18(%rbx), %rax
movl (%rbx,%rax,4), %r14d
incl %eax
pushq $0x6
popq %rsi
cltd
idivl %esi
movl %edx, 0x18(%rbx)
decl %ecx
movl %ecx, 0x20(%rbx)
leaq 0x2adc(%rip), %rdi      # 0x41a8
callq 0x1170
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: producer
void *producer(void *ptr) {
    struct sockaddr_in myaddr;
    int lsock, csock, serving_port;

    serving_port = *((int *) ptr);
    time (&start);

    if((lsock = socket( AF_INET, SOCK_STREAM, 0)) < 0)
        perror_exit("socket");

    myaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    myaddr.sin_port = htons(serving_port);
    myaddr.sin_family = AF_INET;

    // Resolve address already in use
    if (setsockopt(lsock, SOL_SOCKET, SO_REUSEADDR, &myaddr, sizeof(myaddr)) == -1) {
        perror("setsockopt");
        exit(1);
    }

    if(bind(lsock, (struct sockaddr *)&myaddr, sizeof(myaddr)))
        perror_exit("bind");

    if(listen(lsock, 5) != 0)
        perror_exit("listen");

    printf("Server is ready. Awaiting client connections on port %d\n", serving_port);
    while(1){
        if((csock = accept(lsock, NULL, NULL)) < 0)
            perror_exit("accept");

        place(&pool, csock);
        pthread_cond_signal(&cond_nonempty);
    }
    close(csock);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %r14d
leaq 0x2b6a(%rip), %rdi      # 0x4260
callq 0x1150
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x12a0
testl %eax, %eax
jns 0x1718
leaq 0xa3d(%rip), %rdi       # 0x2150
callq 0x17e2
movl %eax, %ebx
leaq -0x28(%rbp), %rcx
andl $0x0, 0x4(%rcx)
movl %r14d, %eax
rolw $0x8, %ax
movw %ax, 0x2(%rcx)
movw $0x2, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x10
popq %r8
movl %ebx, %edi
callq 0x1070
cmpl $-0x1, %eax
jne 0x175c
leaq 0xa08(%rip), %rdi       # 0x2157
callq 0x11f0
pushq $0x1
popq %rdi
callq 0x1260
leaq -0x28(%rbp), %rsi
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x11a0
testl %eax, %eax
jne 0x17be
pushq $0x5
popq %rsi
movl %ebx, %edi
callq 0x1190
testl %eax, %eax
jne 0x17ca
leaq 0x9eb(%rip), %rdi       # 0x216e
movl %r14d, %esi
xorl %eax, %eax
callq 0x10b0
leaq 0x29ec(%rip), %r14      # 0x4180
leaq 0x2a5d(%rip), %r15      # 0x41f8
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1210
testl %eax, %eax
js 0x17d6
movq %r14, %rdi
movl %eax, %esi
callq 0x160c
movq %r15, %rdi
callq 0x1110
jmp 0x179b
leaq 0x99d(%rip), %rdi       # 0x2162
callq 0x17e2
leaq 0x996(%rip), %rdi       # 0x2167
callq 0x17e2
leaq 0x9ca(%rip), %rdi       # 0x21a7
callq 0x17e2
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: getFormattedTime
char *getFormattedTime(void) {
    time_t rawtime;
    struct tm* timeinfo;

    time(&rawtime);
    timeinfo = localtime(&rawtime);

    static char timeStamp[200];
    strftime(timeStamp, sizeof(timeStamp), "%a, %d %b %Y %H:%M:%S GMT", timeinfo);

    return timeStamp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0x10(%rbp), %rbx
movq %rbx, %rdi
callq 0x1150
movq %rbx, %rdi
callq 0x1040
leaq 0x27be(%rip), %rbx      # 0x4270
leaq 0x8e8(%rip), %rdx       # 0x23a1
movl $0xc8, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x11c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: customRead
int customRead(int fd, char *payload, int remaining){
    int received = 0, b = 0;

    while (remaining > 0){
        b = read(fd, payload + received, remaining);    // Advance pointer by bytes read
        if(b < 0)
            perror_exit("customRead");
        received += b;
        remaining -= b;
    }

    return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
xorl %eax, %eax
testl %ebx, %ebx
jle 0x1b68
movslq %r12d, %rsi
addq %r14, %rsi
movl %ebx, %edx
movl %r15d, %edi
callq 0x1100
testl %eax, %eax
js 0x1b71
addl %eax, %r12d
subl %eax, %ebx
jmp 0x1b49
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x843(%rip), %rdi       # 0x23bb
callq 0x17e2
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: customWrite
int customWrite(int fd, char *payload, int remaining) {
    int sent = 0, b = 0;

    while (remaining > 0){
        b = write(fd, payload + sent, remaining);       // Advance pointer by sent bytes
        if(b < 0)
            perror_exit("customWrite");
        sent += b;
        remaining -= b;
    }

    return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
xorl %eax, %eax
testl %ebx, %ebx
jle 0x1bb4
movslq %r12d, %rsi
addq %r14, %rsi
movl %ebx, %edx
movl %r15d, %edi
callq 0x1080
testl %eax, %eax
js 0x1bbd
addl %eax, %r12d
subl %eax, %ebx
jmp 0x1b95
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x802(%rip), %rdi       # 0x23c6
callq 0x17e2
// File: /workspace/github_c_makefile_star2_O2/devkot[P]SearchEngine/functions.c
// Function: getRunTime
char *getRunTime(char *runTime, time_t start){
    int min, sec, hr, n, ms;
    time_t end;
    double dif;
    time (&end);
    dif = difftime (end,start);
    n = floor(dif);

    if(dif>3600){                               // If the server has been running for over an hour
        min = n/60;
        sec = n%60;
        hr = min/60;
        min = min%60;
        ms = sec%60;
        sprintf(runTime, "%.2d:%.2d:%.2d.%.2d", hr, min, sec, ms);
        return runTime;
    }
    else{                                       // If the server has been running for under an hour
        min = n/60;
        sec = n%60;
        ms = sec%60;
        sprintf(runTime, "%.2d:%.2d.%.2d", min, sec, ms);
        return runTime;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x28(%rbp), %r15
movq %r15, %rdi
callq 0x1150
movq (%r15), %rdi
movq %r14, %rsi
callq 0x10c0
movsd %xmm0, -0x20(%rbp)
callq 0x1220
cvttsd2si %xmm0, %esi
pushq $0x3c
popq %rdi
movl %esi, %eax
cltd
idivl %edi
movl %eax, %ecx
movl %edx, %r8d
movsd -0x20(%rbp), %xmm0
ucomisd 0x2c4(%rip), %xmm0      # 0x2148
jbe 0x1eb5
movl $0xe10, %r9d            # imm = 0xE10
movl %esi, %eax
cltd
idivl %r9d
movl %eax, %r9d
movl %ecx, %eax
cltd
idivl %edi
movl %edx, %ecx
leaq 0x52f(%rip), %rsi       # 0x23d2
movq %rbx, %rdi
movl %r9d, %edx
movl %r8d, %r9d
xorl %eax, %eax
callq 0x1250
jmp 0x1ecb
leaq 0x51b(%rip), %rsi       # 0x23d7
movq %rbx, %rdi
movl %ecx, %edx
movl %r8d, %ecx
xorl %eax, %eax
callq 0x1250
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: ram_limit
void ram_limit(long *total, long *avail)
{
    long t, a, a1;
    struct rlimit lim;
    getrlimit(RLIMIT_RSS, &lim);
    a = lim.rlim_cur;
    getrlimit(RLIMIT_AS, &lim);
    a = MAX(a, (long) lim.rlim_cur);
    // a1 = (long) (sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE));
    a1 = physmem_avail();
    a = a > 0? MIN(a, a1) : a1;
    // t = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
    t = physmem_total();
    *avail = a;
    *total = t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x5
popq %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x2390
movq (%r15), %r12
pushq $0x9
popq %rdi
movq %r15, %rsi
callq 0x2390
movq (%r15), %r15
cmpq %r15, %r12
cmovgq %r12, %r15
callq 0x25ff
cmpq %rax, %r15
movq %rax, %r12
cmovlq %r15, %r12
testq %r15, %r15
cmovleq %rax, %r12
callq 0x25d6
movq %r12, (%r14)
movq %rax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: file_copy
int file_copy(char *fin, char *fout)
{
    FILE *fptr1, *fptr2;
    int c;
    fptr1 = fopen(fin, "r");
    fptr2 = fopen(fout, "w");
    c = fgetc(fptr1);
    while (c != EOF) {
        fputc(c, fptr2);
        c = fgetc(fptr1);
    }
    fclose(fptr1);
    fclose(fptr2);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x73e0(%rip), %rsi      # 0x9a7c
callq 0x22c0
movq %rax, %rbx
leaq 0x6965(%rip), %rsi      # 0x9010
movq %r14, %rdi
callq 0x22c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
cmpl $-0x1, %eax
je 0x26cf
movl %eax, %edi
movq %r14, %rsi
callq 0x21a0
jmp 0x26b6
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: is_read_pair
int8_t is_read_pair(const char *rname0, const char *rname1)
{
    int n = strlen(rname0);
    if (n == 0 || n != strlen(rname1))
          return 0;
    if (!strcmp(rname0, rname1) || 
            (n > 2 &&
             !strncmp(rname0, rname1, n - 1) &&
             rname0[n - 2] == '/' &&
             rname1[n - 2] == '/' &&
             rname0[n - 1] != rname1[n - 1]))
        return 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2110
movq %rax, %r15
testl %r15d, %r15d
je 0x2762
movslq %r15d, %r12
movq %rbx, %rdi
callq 0x2110
cmpq %rax, %r12
jne 0x2762
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21e0
movb $0x1, %bpl
testl %eax, %eax
je 0x2764
cmpl $0x3, %r15d
jl 0x2762
leal -0x1(%r15), %r12d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
jne 0x2762
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addl %eax, %r15d
cmpb $0x2f, (%r14,%r15)
jne 0x2762
cmpb $0x2f, (%rbx,%r15)
jne 0x2762
movb (%r14,%r12), %al
cmpb (%rbx,%r12), %al
jne 0x2764
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: is_empty_line
int is_empty_line(char *line)
{
    while (isspace(*line))
        line++;
    if(*line == '\0')
        return 1;
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x23e0
movq (%rax), %rax
movsbq (%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x2897
xorl %eax, %eax
testb %cl, %cl
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: iostream_open
iostream_t *iostream_open(const char *spath)
{
    iostream_t *iostream;
    iostream = (iostream_t *) calloc(1, sizeof(iostream_t));
    if (iostream == NULL)
        return NULL;
    iostream->koaux = kopen(spath, &iostream->fd);
    if (iostream->koaux == 0) {
        free(iostream);
        return NULL;
    }
    iostream->fp = gzdopen(iostream->fd, "r");
    if (iostream->fp == Z_NULL) {
        kclose(iostream->koaux);
        free(iostream);
        return NULL;
    }
    iostream->stream = ks_init(iostream->fp);
    iostream->buffer = kstring_init(BUFF_SIZE);

    return iostream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x21d0
testq %rax, %rax
je 0x2969
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2f94
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x2961
movl (%rbx), %edi
leaq 0x718f(%rip), %rsi      # 0x9a7c
callq 0x20f0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2958
movq %rax, %r14
pushq $0x1
popq %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x21d0
movq %rax, %r12
movq %r14, 0x10(%rax)
movl $0x4000, 0x8(%rax)      # imm = 0x4000
movl $0x1000, %edi           # imm = 0x1000
callq 0x2250
movq %rax, 0x18(%r12)
movq %r12, 0x10(%rbx)
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x21d0
movq %rax, %r14
movq $0x1000, 0x8(%rax)      # imm = 0x1000
movl $0x1000, %edi           # imm = 0x1000
callq 0x2250
movq %rax, 0x10(%r14)
movq %r14, 0x18(%rbx)
jmp 0x296b
movq 0x20(%rbx), %rdi
callq 0x38e9
movq %rbx, %rdi
callq 0x2050
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: iostream_close
void iostream_close(iostream_t *iostream)
{
    if (!iostream) return;
    ks_destroy(iostream->stream);
    kstring_destroy(iostream->buffer);
    gzclose(iostream->fp);
    kclose(iostream->koaux);
    free(iostream);
}

// Assembly:
testq %rdi, %rdi
je 0x29db
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x29a0
movq 0x18(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x29ba
movq 0x10(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq 0x8(%rbx), %rdi
callq 0x2040
movq 0x20(%rbx), %rdi
callq 0x38e9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/asset.c
// Function: iostream_getline
char *iostream_getline(iostream_t *iostream)
{
    int len;
    kstring_t *buffer;
    buffer = (kstring_t *) (iostream->buffer);
    len = ks_getuntil(iostream->stream, KS_SEP_LINE, buffer, 0);
    if (len >= 0) {
        iostream->nline += 1;
        return buffer->s;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movq 0x18(%rdi), %r14
andq $0x0, (%r14)
movl (%r15), %ecx
movl 0x4(%r15), %eax
cmpl %eax, %ecx
jl 0x2a09
testb $0x3, 0x8(%r15)
jne 0x2b78
cmpl %eax, %ecx
jl 0x2a53
movl 0x8(%r15), %edx
testb $0x3, %dl
jne 0x2b28
andl $0x0, (%r15)
movq 0x10(%r15), %rdi
movq 0x18(%r15), %rsi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%r15)
movl 0x8(%r15), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x2a48
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r15)
testl %eax, %eax
je 0x2b28
movl (%r15), %ecx
movslq %ecx, %rsi
cltq
cmpl %esi, %eax
movl %esi, %r12d
cmovgl %eax, %r12d
movq %rsi, %rdx
cmpq %rax, %rdx
jge 0x2a7b
movq 0x18(%r15), %rdi
cmpb $0xa, (%rdi,%rdx)
je 0x2a78
incq %rdx
jmp 0x2a64
movl %edx, %r12d
movq (%r14), %rdi
movq 0x8(%r14), %r8
subq %rdi, %r8
movl %r12d, %edx
subl %ecx, %edx
leal 0x1(%rdx), %eax
movslq %eax, %rcx
movq 0x10(%r14), %rax
cmpq %rcx, %r8
jae 0x2af8
movslq %edx, %rcx
addq %rcx, %rdi
movq %rdi, %rcx
shrq %rcx
orq %rdi, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x10, %rcx
orq %rdx, %rcx
movq %rcx, %rsi
shrq $0x20, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%r14)
movq %rax, %rdi
callq 0x2290
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movslq (%r15), %rsi
movl %r12d, %edx
subl %esi, %edx
addq %rax, %rdi
addq 0x18(%r15), %rsi
movslq %edx, %rdx
callq 0x2220
movslq (%r15), %rax
movslq %r12d, %rcx
subq %rax, %rcx
addq %rcx, (%r14)
leal 0x1(%r12), %ecx
movl %ecx, (%r15)
movl 0x4(%r15), %eax
cmpl %eax, %r12d
jge 0x2a09
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x2b49
movq (%r14), %rcx
cmpq $0x2, %rcx
jb 0x2b63
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x2b63
decq %rcx
movq %rcx, (%r14)
jmp 0x2b63
movq $0x1, 0x8(%r14)
pushq $0x1
popq %rdi
movq %rdi, %rsi
callq 0x21d0
movq %rax, 0x10(%r14)
movq (%r14), %rcx
movb $0x0, (%rax,%rcx)
testb $-0x80, 0x3(%r14)
jne 0x2b78
incq 0x28(%rbx)
movq 0x10(%r14), %rax
jmp 0x2b7a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/kalloc.c
// Function: km_init2
void *km_init2(void *km_par, size_t min_core_size)
{
	kmem_t *km;
	km = (kmem_t*)kcalloc(km_par, 1, sizeof(kmem_t));
	km->par = km_par;
	km->min_core_size = min_core_size > 0? min_core_size : 0x80000;
	return (void*)km;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rsi
pushq $0x30
popq %rdx
callq 0x2bb8
movq %r14, (%rax)
testq %rbx, %rbx
movl $0x80000, %ecx          # imm = 0x80000
cmovneq %rbx, %rcx
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_init
sdict_t *sd_init(void)
{
    sdict_t *d;
    d = (sdict_t *) calloc(1, sizeof(sdict_t));
    d->n = 0;
    d->m = 16;
    d->s = (sd_seq_t *) malloc(d->m * sizeof(sd_seq_t));
    d->h = kh_init(sdict);
    return d;
}

// Assembly:
pushq %rbx
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x21d0
movq %rax, %rbx
movl $0x10, 0x4(%rax)
movl $0x180, %edi            # imm = 0x180
callq 0x2250
movq %rax, 0x8(%rbx)
callq 0x3c96
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: asm_init
asm_dict_t *asm_init(sdict_t *sdict)
{
    asm_dict_t *d;
    d = (asm_dict_t *) calloc(1, sizeof(asm_dict_t));
    d->n = 0;
    d->m = 16;
    d->s = (sd_aseq_t *) malloc(d->m * sizeof(sd_aseq_t));
    d->h = kh_init(sdict);
    d->u = 0;
    d->v = 16;
    d->seg = (sd_seg_t *) malloc(d->v * sizeof(sd_seg_t));
    d->a = (uint64_t *) malloc(sdict->n * sizeof(uint64_t));
    d->index = 0;
    d->sdict = sdict;
    return d;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x21d0
movq %rax, %r14
pushq $0x10
popq %rbp
movl %ebp, 0x4(%rax)
movl $0x580, %edi            # imm = 0x580
callq 0x2250
movq %rax, 0x8(%r14)
callq 0x3c96
movq %rax, 0x10(%r14)
movl %ebp, 0x1c(%r14)
movl $0x300, %edi            # imm = 0x300
callq 0x2250
movq %rax, 0x20(%r14)
movl (%rbx), %edi
shlq $0x3, %rdi
callq 0x2250
movq %rax, 0x28(%r14)
movq %rbx, 0x38(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_destroy
void sd_destroy(sdict_t *d)
{
    if (!d) return;
    uint32_t i;
    if (d == 0)
        return;
    if (d->h)
        kh_destroy(sdict, d->h);
    if(d->s) {
        for (i = 0; i < d->n; ++i) {
            free(d->s[i].name);
            if (d->s[i].seq)
                free(d->s[i].seq);
        }
        free(d->s);
    }
    free(d);
}

// Assembly:
testq %rdi, %rdi
je 0x3d67
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3d1d
callq 0x3d68
cmpq $0x0, 0x8(%rbx)
je 0x3d5a
xorl %r14d, %r14d
xorl %r15d, %r15d
movl (%rbx), %eax
movq 0x8(%rbx), %rdi
cmpq %rax, %r15
jae 0x3d55
movq (%rdi,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x2050
incq %r15
addq $0x18, %r14
jmp 0x3d2a
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: asm_destroy
void asm_destroy(asm_dict_t *d)
{
    if (!d) return;
    uint32_t i;
    if (d == 0)
        return;
    if (d->s) {
        for (i = 0; i < d->n; ++i) {
            free(d->s[i].name);
            free(d->s[i].gs);
            free(d->s[i].gsize);
            free(d->s[i].gcomp);
            free(d->s[i].gtype);
            free(d->s[i].glink);
            free(d->s[i].gevid);
        }
        free(d->s);
    }
    if (d->seg)
        free(d->seg);
    if (d->a)
        free(d->a);
    if (d->index)
        free(d->index);
    if (d->h)
        kh_destroy(sdict, d->h);
    free(d);
}

// Assembly:
testq %rdi, %rdi
je 0x3e62
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3e2c
xorl %r14d, %r14d
xorl %r15d, %r15d
movl (%rbx), %eax
movq 0x8(%rbx), %rdi
cmpq %rax, %r15
jae 0x3e27
movq (%rdi,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x30(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x40(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x48(%rax,%r14), %rdi
callq 0x2050
movq 0x8(%rbx), %rax
movq 0x50(%rax,%r14), %rdi
callq 0x2050
incq %r15
addq $0x58, %r14
jmp 0x3db6
callq 0x2050
movq 0x20(%rbx), %rdi
callq 0x2050
movq 0x28(%rbx), %rdi
callq 0x2050
movq 0x30(%rbx), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x3e55
callq 0x3d68
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_put
uint32_t sd_put(sdict_t *d, const char *name, uint32_t len)
{
    if (!name)
        return UINT32_MAX;
    sdhash_t *h = d->h;
    khint_t k;
    int absent;
    k = kh_put(sdict, h, name, &absent);
    if (absent) {
        sd_seq_t *s;
        if (d->n == d->m) {
            d->m = d->m? d->m<<1 : 16;
            d->s = (sd_seq_t *) realloc(d->s, d->m * sizeof(sd_seq_t));
        }
        s = &d->s[d->n];
        s->len = len;
        s->seq = 0;
        kh_key(h, k) = s->name = strdup(name);
        kh_val(h, k) = d->n++;
    }
    return kh_val(h, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x3ed7
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %r14
leaq 0x14(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x3f3b
cmpl $0x0, (%r12)
je 0x3edd
movl %eax, 0xc(%rsp)
movl (%rbx), %r13d
cmpl 0x4(%rbx), %r13d
movl %ebp, 0x10(%rsp)
jne 0x3ee9
leal (,%r13,2), %eax
testl %r13d, %r13d
pushq $0x10
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
imulq $0x18, %rcx, %rsi
callq 0x2290
movq %rax, %r12
movq %rax, 0x8(%rbx)
movl (%rbx), %r13d
jmp 0x3eed
pushq $-0x1
popq %r13
jmp 0x3f29
movq 0x20(%r14), %rdx
movl %eax, %ecx
movl (%rdx,%rcx,4), %r13d
jmp 0x3f29
movq 0x8(%rbx), %r12
movl %r13d, %eax
imulq $0x18, %rax, %rbp
movl 0x10(%rsp), %eax
movl %eax, 0x10(%r12,%rbp)
andq $0x0, 0x8(%r12,%rbp)
movq %r15, %rdi
callq 0x23b0
movq %rax, (%r12,%rbp)
movq 0x18(%r14), %rcx
movl 0xc(%rsp), %edx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%r13), %eax
movl %eax, (%rbx)
movq 0x20(%r14), %rax
movl %r13d, (%rax,%rdx,4)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_get
uint32_t sd_get(sdict_t *d, const char *name)
{
    sdhash_t *h = d->h;
    khint_t k;
    k = kh_get(sdict, h, name);
    return k == kh_end(h)? UINT32_MAX : kh_val(h, k);
}

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x4173
cmpl (%rbx), %eax
jne 0x4168
pushq $-0x1
popq %rax
jmp 0x4171
movq 0x20(%rbx), %rcx
movl %eax, %eax
movl (%rcx,%rax,4), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: sd_hash
void sd_hash(sdict_t *d)
{
    uint32_t i;
    sdhash_t *h;
    if (d->h)
        return;
    d->h = h = kh_init(sdict);
    for (i = 0; i < d->n; ++i) {
        int absent;
        khint_t k;
        k = kh_put(sdict, h, d->s[i].name, &absent);
        kh_val(h, k) = i;
    }
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x423c
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x3c96
movq %rax, %r14
movq %rax, 0x10(%rbx)
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
xorl %r13d, %r13d
movl (%rbx), %eax
cmpq %rax, %r13
jae 0x4290
movq 0x8(%rbx), %rax
movq (%rax,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3f3b
movq 0x20(%r14), %rcx
movl %eax, %eax
movl %r13d, (%rcx,%rax,4)
incq %r13
addq $0x18, %r12
jmp 0x4263
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: make_sdict_from_index
sdict_t *make_sdict_from_index(const char *f, uint32_t min_len)
{
    iostream_t *fp;
    char *line;
    char name[4096];
    int64_t len;

    fp = iostream_open(f);
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }
    
    sdict_t *d;
    d = sd_init();
    while ((line = iostream_getline(fp)) != NULL) {
        if (is_empty_line(line))
            continue;
        sscanf(line, "%s %ld", name, &len);
        if (len > UINT32_MAX) {
            fprintf(stderr, "[E::%s] >4G sequence chunks are not supported: %s [%ld]\n", __func__, name, len);
            exit(EXIT_FAILURE);
        }
        if (len >= min_len)
            sd_put(d, name, len);
    }

    iostream_close(fp);
    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %esi, %ebp
movq %rdi, %r14
callq 0x28ae
testq %rax, %rax
je 0x46d9
movq %rax, %rbx
callq 0x3c64
movq %rax, %r14
movl %ebp, %r15d
leaq 0x10(%rsp), %r12
movabsq $0x100000000, %r13      # imm = 0x100000000
movq %rbx, %rdi
callq 0x29dc
testq %rax, %rax
je 0x4690
movq %rax, %rbp
movq %rax, %rdi
callq 0x288b
testl %eax, %eax
jne 0x463c
movq %rbp, %rdi
leaq 0x4d61(%rip), %rsi      # 0x93c3
movq %r12, %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x2260
movq 0x8(%rsp), %r8
cmpq %r13, %r8
jge 0x46ad
cmpq %r15, %r8
jl 0x463c
movq %r14, %rdi
movq %r12, %rsi
movl %r8d, %edx
callq 0x3e63
jmp 0x463c
movq %rbx, %rdi
callq 0x297a
movq %r14, %rax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x893c(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x4cb6(%rip), %rsi      # 0x9374
leaq 0x4ce8(%rip), %rdx      # 0x93ad
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x2200
pushq $0x1
popq %rdi
callq 0x2360
movq 0x8910(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x4c4e(%rip), %rsi      # 0x9338
leaq 0x4cbc(%rip), %rdx      # 0x93ad
movq %r14, %rcx
xorl %eax, %eax
callq 0x2200
jmp 0x46d1
// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/sdict.c
// Function: make_sdict_from_gfa
sdict_t *make_sdict_from_gfa(const char *f, uint32_t min_len)
{
    iostream_t *fp;
    char *line;
    char name[4096], lens[4096];
    uint64_t len;

    fp = iostream_open(f);
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }

    sdict_t *d;
    d = sd_init();
    while ((line = iostream_getline(fp)) != NULL) {
        if (is_empty_line(line))
            continue;
        if (line[0] == 'S') {
            sscanf(line, "%*s %s %*s %s", name, lens);
            len = strtoul(lens + 5, NULL, 10);
            if (len > UINT32_MAX) {
                fprintf(stderr, "[E::%s] >4G sequence chunks are not supported: %s [%ld]\n", __func__, name, len);
                exit(EXIT_FAILURE);
            }
            if (len >= min_len)
                sd_put(d, name, len);
        }
    }
    iostream_close(fp);

    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movl %esi, %ebp
movq %rdi, %r14
callq 0x28ae
testq %rax, %rax
je 0x47ef
movq %rax, %rbx
callq 0x3c64
movq %rax, %r14
movl %ebp, %ebp
leaq 0x1000(%rsp), %r13
pushq $0xa
popq %r15
movq %rbx, %rdi
callq 0x29dc
testq %rax, %rax
je 0x47a0
movq %rax, %r12
movq %rax, %rdi
callq 0x288b
testl %eax, %eax
jne 0x473a
cmpb $0x53, (%r12)
jne 0x473a
movq %r12, %rdi
leaq 0x4c77(%rip), %rsi      # 0x93de
movq %r13, %rdx
movq %rsp, %rcx
xorl %eax, %eax
callq 0x2260
leaq 0x5(%rsp), %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x2320
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x47bd
cmpq %rbp, %rax
jb 0x473a
movq %r14, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x3e63
jmp 0x473a
movq %rbx, %rdi
callq 0x297a
movq %r14, %rax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x882c(%rip), %rcx      # 0xcff0
movq (%rcx), %rdi
leaq 0x4ba6(%rip), %rsi      # 0x9374
leaq 0x4bf5(%rip), %rdx      # 0x93ca
leaq 0x1000(%rsp), %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2200
pushq $0x1
popq %rdi
callq 0x2360
movq 0x87fa(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x4b38(%rip), %rsi      # 0x9338
leaq 0x4bc3(%rip), %rdx      # 0x93ca
movq %r14, %rcx
xorl %eax, %eax
callq 0x2200
jmp 0x47e7