LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]mysh/mysh_parse.c
// Function: do_filename_expansion
static int do_filename_expansion(struct list_head *string_list)
{
	struct string *s, *tmp;
	int ret = 0;

	LIST_HEAD(new_list);
	list_for_each_entry_safe(s, tmp, string_list, list)
		ret |= string_do_filename_expansion(s, &new_list);
	INIT_LIST_HEAD(string_list);
	if (ret)
		free_string_list(&new_list);
	else
		list_splice_tail(&new_list, string_list);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r13
movq %r13, (%r13)
movq %r13, 0x8(%r13)
movq (%rdi), %r15
cmpq %rdi, %r15
je 0x6350
leaq 0x20(%rsp), %r14
xorl %ebp, %ebp
movq %rbx, 0x18(%rsp)
movq %r15, %r12
movq (%r15), %r15
movq -0x18(%r12), %rdi
movl $0x1440, %esi           # imm = 0x1440
xorl %edx, %edx
movq %r14, %rcx
callq 0x2330
testl %eax, %eax
je 0x62b0
cmpl $0x3, %eax
je 0x6293
cmpl $0x1, %eax
je 0x6397
leaq 0x1b54(%rip), %rdi      # 0x7dd6
xorl %eax, %eax
callq 0x249f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6343
movq 0x10(%rsp), %rax
movq %r12, 0x10(%rsp)
movq %r13, (%r12)
movq %rax, 0x8(%r12)
movq %r12, (%rax)
xorl %eax, %eax
jmp 0x6343
movl -0x8(%r12), %r14d
addq $-0x18, %r12
cmpq $0x1, 0x20(%rsp)
ja 0x62d6
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%r12), %rsi
callq 0x2230
testl %eax, %eax
je 0x62da
orl $0x40, %r14d
movq %r12, %rdi
callq 0x6870
cmpq $0x0, 0x20(%rsp)
je 0x632f
xorl %ebx, %ebx
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %r12
movq %r12, %rdi
callq 0x2100
movq %r12, %rdi
movq %rax, %rsi
callq 0x67fa
movl %r14d, 0x10(%rax)
leaq 0x18(%rax), %rcx
movq 0x10(%rsp), %rdx
movq %rcx, 0x10(%rsp)
movq %r13, 0x18(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, (%rdx)
incq %rbx
cmpq 0x20(%rsp), %rbx
jb 0x62ec
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2040
xorl %eax, %eax
movq 0x18(%rsp), %rbx
orl %eax, %ebp
cmpq %rbx, %r15
jne 0x624f
jmp 0x6352
xorl %ebp, %ebp
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
testl %ebp, %ebp
je 0x6369
leaq 0x8(%rsp), %rdi
callq 0x688b
jmp 0x6386
movq 0x8(%rsp), %rax
cmpq %r13, %rax
je 0x6386
movq 0x10(%rsp), %rcx
movq %rbx, 0x8(%rax)
movq %rax, (%rbx)
movq %rbx, (%rcx)
movq %rcx, 0x8(%rbx)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a2a(%rip), %rdi      # 0x7dc8
xorl %eax, %eax
callq 0x249f
movl $0x1, %edi
callq 0x2350
// File: /workspace/github_c_makefile_star2_O1/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 0x5e6d
movq %r14, %rdi
callq 0x6115
leaq 0x4e55(%rip), %rax      # 0xb230
cmpl $0x0, (%rax)
je 0x63fe
movq (%rsp), %rax
cmpq %r14, %rax
je 0x6416
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq 0x8(%rsp), %rax
jne 0x640c
addq $-0x18, %rax
movq %rax, (%rbx)
jmp 0x641d
movq %rsp, %rdi
callq 0x6219
movl %eax, %ebp
testl %eax, %eax
je 0x63e0
movq %rsp, %rdi
callq 0x688b
jmp 0x641f
movq $0x0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ebp, %ebp
movl (%rbx,%r14,4), %edi
testl %edi, %edi
js 0x6619
movl %r14d, %esi
callq 0x2120
movl %eax, %r15d
movl (%rbx,%r14,4), %edi
callq 0x21c0
orl %r15d, %eax
cmovsl %r12d, %ebp
incq %r14
cmpq $0x3, %r14
jne 0x65f6
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
je 0x6651
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movq $-0x1, (%rbx)
leaq 0x18b2(%rip), %r12      # 0x7f0a
movq %r15, %r14
movq (%r14), %r14
cmpq %r15, %r14
je 0x672f
cmpb $0x1, -0x20(%r14)
jne 0x66bc
movq -0x18(%r14), %rdi
movl -0x10(%r14), %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22c0
movl %eax, %r13d
testl %eax, %eax
jns 0x66c0
testb $0x1, -0x10(%r14)
movq -0x18(%r14), %rsi
leaq 0x183d(%rip), %rdx      # 0x7ed6
leaq 0x183e(%rip), %rax      # 0x7ede
cmoveq %rax, %rdx
xorl %r13d, %r13d
leaq 0x1813(%rip), %rdi      # 0x7ec1
xorl %eax, %eax
callq 0x249f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x6718
movl -0x18(%r14), %r13d
testq %rbx, %rbx
je 0x66e7
movl -0x8(%r14), %edi
cmpq $0x2, %rdi
ja 0x66e7
cmpl $0x0, (%rbx,%rdi,4)
jns 0x66e7
callq 0x2150
movl %eax, %ebp
testl %eax, %eax
js 0x6723
movslq -0x8(%r14), %rax
movl %ebp, (%rbx,%rax,4)
movl -0x8(%r14), %esi
movl %r13d, %edi
callq 0x2120
movl %eax, %ebp
cmpb $0x1, -0x20(%r14)
jne 0x6704
movl %r13d, %edi
callq 0x21c0
movb $0x1, %r13b
testl %ebp, %ebp
jns 0x6718
xorl %r13d, %r13d
movq %r12, %rdi
xorl %eax, %eax
callq 0x249f
testb %r13b, %r13b
jne 0x665b
jmp 0x6733
xorl %r13d, %r13d
leaq 0x17b9(%rip), %rdi      # 0x7ee6
jmp 0x6711
xorl %ebp, %ebp
jmp 0x6740
testq %rbx, %rbx
je 0x6740
movq %rbx, %rdi
callq 0x65e0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x67a4
callq 0x2370
testq %rax, %rax
jne 0x67a6
callq 0x25af
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x28, %edi
callq 0x6754
movq %rax, %r14
leaq 0x1(%rbx), %r15
movq %r15, %rdi
callq 0x6754
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2180
movq %r12, (%r14)
movq %rbx, 0x8(%r14)
movl $0x0, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq (%rdi), %rax
cmpq %rdi, %rax
je 0x68cb
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq -0x18(%rax), %r14
movq (%rax), %r15
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq %r15, (%rcx)
movq -0x18(%rax), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movq %r15, %rax
cmpq %rbx, %r15
jne 0x689b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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), %r14
cmpq %rdi, %r14
je 0x699b
movq %rdi, %rbx
cmpq 0x8(%rdi), %r14
je 0x6985
movq (%rbx), %rax
xorl %r13d, %r13d
cmpq %rbx, %rax
je 0x6904
addq -0x10(%rax), %r13
movq (%rax), %rax
jmp 0x68f6
movl $0x28, %edi
callq 0x6754
movq %rax, %r14
leaq 0x1(%r13), %r12
movq %r12, %rdi
callq 0x6754
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2180
movq %r15, (%r14)
movq %r13, 0x8(%r14)
movl $0x0, 0x10(%r14)
movq (%rbx), %rbp
cmpq %rbx, %rbp
je 0x6989
movq %r14, (%rsp)
leaq -0x18(%rbp), %r12
movq (%rbp), %r14
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %r13
movq %r15, %rdi
movq %r13, %rdx
callq 0x2260
addq %r13, %r15
movq -0x18(%rbp), %rdi
callq 0x2050
movq %r12, %rdi
callq 0x2050
movq %r14, %rbp
cmpq %rbx, %r14
jne 0x6948
movq (%rsp), %r14
jmp 0x6989
addq $-0x18, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1590(%rip), %rdi      # 0x7f32
leaq 0x159e(%rip), %rsi      # 0x7f47
leaq 0x15a3(%rip), %rcx      # 0x7f53
movl $0x86, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %rax
movq %rdi, %rbx
leaq 0xd26(%rip), %rsi       # 0x206d
movq %rax, %rdi
callq 0x10e0
testq %rax, %rax
je 0x1371
leaq 0xd12(%rip), %r14       # 0x206d
movq %rax, (%rbx)
xorl %edi, %edi
movq %r14, %rsi
callq 0x10e0
addq $0x8, %rbx
testq %rax, %rax
jne 0x135b
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xdb8(%rip), %rdi       # 0x214d
callq 0x1050
leaq 0xe01(%rip), %r15       # 0x21a2
movq %r15, %rdi
callq 0x1050
leaq 0xdc8(%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 0xc2d(%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_O1/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 0x3b0d(%rip), %rdi      # 0x51a8
callq 0x1290
movl 0x20(%rbx), %eax
cmpl $0x6, %eax
jl 0x16c9
leaq 0x3b79(%rip), %r15      # 0x5228
leaq 0x3af2(%rip), %r12      # 0x51a8
movq %r15, %rdi
movq %r12, %rsi
callq 0x1090
movl 0x20(%rbx), %eax
cmpl $0x5, %eax
jg 0x16b6
movl 0x1c(%rbx), %ecx
movl %ecx, %edx
incl %edx
movslq %edx, %rdx
imulq $0x2aaaaaab, %rdx, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rdx
addl %esi, %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %edx
negl %edx
addl %edx, %ecx
incl %ecx
movl %ecx, 0x1c(%rbx)
movslq %ecx, %rcx
movl %r14d, (%rbx,%rcx,4)
incl %eax
movl %eax, 0x20(%rbx)
leaq 0x3aa0(%rip), %rdi      # 0x51a8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1170
// File: /workspace/github_c_makefile_star2_O1/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 0x3a7f(%rip), %rdi      # 0x51a8
callq 0x1290
movl 0x20(%rbx), %eax
testl %eax, %eax
jg 0x1755
leaq 0x3abc(%rip), %r14      # 0x51f8
leaq 0x3a65(%rip), %r15      # 0x51a8
movq %r14, %rdi
movq %r15, %rsi
callq 0x1090
movl 0x20(%rbx), %eax
testl %eax, %eax
jle 0x1743
movslq 0x18(%rbx), %rcx
movl (%rbx,%rcx,4), %r14d
incl %ecx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rdx
addl %esi, %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %ecx
movl %ecx, 0x18(%rbx)
decl %eax
movl %eax, 0x20(%rbx)
leaq 0x3a1c(%rip), %rdi      # 0x51a8
callq 0x1170
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3aaa(%rip), %rdi      # 0x5260
callq 0x1150
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x12a0
testl %eax, %eax
jns 0x17dc
leaq 0x1989(%rip), %rdi      # 0x3160
jmp 0x18ad
movl %eax, %ebx
leaq -0x28(%rbp), %rcx
movl $0x0, 0x4(%rcx)
movl %r14d, %eax
rolw $0x8, %ax
movw %ax, 0x2(%rcx)
movw $0x2, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x10, %r8d
callq 0x1070
cmpl $-0x1, %eax
jne 0x1821
leaq 0x194b(%rip), %rdi      # 0x3167
jmp 0x18ad
leaq -0x28(%rbp), %rsi
movl %ebx, %edi
movl $0x10, %edx
callq 0x11a0
testl %eax, %eax
jne 0x189d
movl %ebx, %edi
movl $0x5, %esi
callq 0x1190
testl %eax, %eax
jne 0x18a6
leaq 0x1932(%rip), %rdi      # 0x317e
movl %r14d, %esi
xorl %eax, %eax
callq 0x10b0
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1210
testl %eax, %eax
js 0x1894
leaq 0x3914(%rip), %r14      # 0x5180
leaq 0x3985(%rip), %r15      # 0x51f8
movq %r14, %rdi
movl %eax, %esi
callq 0x1683
movq %r15, %rdi
callq 0x1110
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1210
testl %eax, %eax
jns 0x1873
leaq 0x191c(%rip), %rdi      # 0x31b7
jmp 0x18ad
leaq 0x18ce(%rip), %rdi      # 0x3172
jmp 0x18ad
leaq 0x18ca(%rip), %rdi      # 0x3177
callq 0x11f0
movl $0x1, %edi
callq 0x1260
// File: /workspace/github_c_makefile_star2_O1/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 0x3649(%rip), %rbx      # 0x5270
leaq 0x1783(%rip), %rdx      # 0x33b1
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_O1/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
testl %edx, %edx
jle 0x1cd8
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
movslq %r12d, %rsi
addq %r14, %rsi
movl %ebx, %edx
movl %r15d, %edi
callq 0x1100
testl %eax, %eax
js 0x1ce3
addl %eax, %r12d
subl %eax, %ebx
jg 0x1cbb
jmp 0x1cda
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x12d8
// File: /workspace/github_c_makefile_star2_O1/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
testl %edx, %edx
jle 0x1d1f
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
movslq %r12d, %rsi
addq %r14, %rsi
movl %ebx, %edx
movl %r15d, %edi
callq 0x1080
testl %eax, %eax
js 0x1d2a
addl %eax, %r12d
subl %eax, %ebx
jg 0x1d02
jmp 0x1d21
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x12f0
// File: /workspace/github_c_makefile_star2_O1/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, %eax
movslq %eax, %rdx
imulq $-0x77777777, %rdx, %rcx # imm = 0x88888889
shrq $0x20, %rcx
addl %edx, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
sarl $0x5, %ecx
addl %eax, %ecx
imull $0x3c, %ecx, %eax
movl %edx, %r8d
subl %eax, %r8d
movsd -0x20(%rbp), %xmm0
ucomisd 0x112d(%rip), %xmm0     # 0x3158
jbe 0x2079
imulq $-0x6e5d4c3b, %rdx, %rax # imm = 0x91A2B3C5
shrq $0x20, %rax
addl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
sarl $0xb, %edx
addl %eax, %edx
movslq %ecx, %rax
imulq $-0x77777777, %rax, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %ecx, %eax
movl %eax, %esi
shrl $0x1f, %esi
sarl $0x5, %eax
addl %esi, %eax
imull $0x3c, %eax, %eax
subl %eax, %ecx
leaq 0x1378(%rip), %rsi      # 0x33e2
movq %rbx, %rdi
movl %r8d, %r9d
xorl %eax, %eax
callq 0x1250
jmp 0x208f
leaq 0x1367(%rip), %rsi      # 0x33e7
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_O1/ArchLuke[P]YouSuck/Engine.c
// Function: MaterialDraw
int MaterialDraw(const S_BOARD *pos) {
        if (!pos->pceNum[wR] && !pos->pceNum[bR] && !pos->pceNum[wQ] && !pos->pceNum[bQ]) {
      if (!pos->pceNum[bB] && !pos->pceNum[wB]) {
          if (pos->pceNum[wN] < 3 && pos->pceNum[bN] < 3) {  return TRUE; }
      } else if (!pos->pceNum[wN] && !pos->pceNum[bN]) {
         if (abs(pos->pceNum[wB] - pos->pceNum[bB]) < 2) { return TRUE; }
      } else if ((pos->pceNum[wN] < 3 && !pos->pceNum[wB]) || (pos->pceNum[wB] == 1 && !pos->pceNum[wN])) {
        if ((pos->pceNum[bN] < 3 && !pos->pceNum[bB]) || (pos->pceNum[bB] == 1 && !pos->pceNum[bN]))  { return TRUE; }
      }
    }
    return FALSE;
}

// Assembly:
cmpl $0x0, 0x238(%rdi)
jne 0x12b7
cmpl $0x0, 0x250(%rdi)
jne 0x12b7
cmpl $0x0, 0x23c(%rdi)
jne 0x12b7
cmpl $0x0, 0x254(%rdi)
je 0x12ba
xorl %eax, %eax
retq
movl 0x24c(%rdi), %ecx
testl %ecx, %ecx
jne 0x12cd
cmpl $0x0, 0x234(%rdi)
je 0x1321
movl 0x230(%rdi), %eax
testl %eax, %eax
jne 0x12e0
cmpl $0x0, 0x248(%rdi)
je 0x1341
cmpl $0x2, %eax
jg 0x12ee
cmpl $0x0, 0x234(%rdi)
je 0x12fb
testl %eax, %eax
jne 0x12b7
cmpl $0x1, 0x234(%rdi)
jne 0x12b7
testl %ecx, %ecx
sete %sil
movl 0x248(%rdi), %edx
cmpl $0x3, %edx
setl %dil
movl $0x1, %eax
testb %dil, %sil
jne 0x12b9
xorl $0x1, %ecx
orl %edx, %ecx
jne 0x12b7
jmp 0x12b9
cmpl $0x2, 0x230(%rdi)
jg 0x12b7
movl $0x1, %eax
cmpl $0x3, 0x248(%rdi)
jge 0x12b7
jmp 0x12b9
movl 0x234(%rdi), %eax
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl $0x1, %eax
cmpl $0x2, %ecx
jae 0x12b7
jmp 0x12b9
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: PrintBitBoard
void PrintBitBoard(U64 bb) {

    U64 shiftMe = 1ULL;
    
    int rank = 0;
    int file = 0;
    int sq = 0;
    int sq64 = 0;
    
    printf("\n");
    for(rank = RANK_1; rank <= RANK_8; ++rank) {
        for(file = FILE_A; file <= FILE_H; ++file) {
            sq = FR2SQ(file,rank);    // 120 based        
            sq64 = SQ64(sq); // 64 based
            
            if((shiftMe << sq64) & bb)
                printf("X");
            else
                printf("-");
                
        }
        printf("\n");
    }  
    printf("\n\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xa, %edi
callq 0x1040
leaq 0xa5a5(%rip), %r14      # 0xb924
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%r14,%r12,4), %eax
btq %rax, %rbx
movl $0x2d, %edi
jae 0x1399
movl $0x58, %edi
callq 0x1040
incq %r12
cmpq $0x8, %r12
jne 0x1385
movl $0xa, %edi
callq 0x1040
incq %r15
addq $0x28, %r14
cmpq $0x8, %r15
jne 0x1382
leaq 0x6bfa(%rip), %rdi      # 0x7fbf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: PrintBoard
void PrintBoard(const S_BOARD *pos) {
    
    int sq,file,rank,piece;

    printf("\nGame Board:\n\n");
    
    for(rank = RANK_8; rank >= RANK_1; rank--) {
        printf("%d  ",rank+1);
        for(file = FILE_A; file <= FILE_H; file++) {
            sq = FR2SQ(file,rank);
            piece = pos->pieces[sq];
            printf("%3c",PceChar[piece]);
        }
        printf("\n");
    }
    
    printf("\n   ");
    for(file = FILE_A; file <= FILE_H; file++) {
        printf("%3c",'a'+file);    
    }
    printf("\n");
    printf("side:%c\n",SideChar[pos->side]);
    printf("enPas:%d\n",pos->enPas);
    printf("castle:%c%c%c%c\n",
            pos->castlePerm & WKCA ? 'K' : '-',
            pos->castlePerm & WQCA ? 'Q' : '-',
            pos->castlePerm & BKCA ? 'k' : '-',
            pos->castlePerm & BQCA ? 'q' : '-'    
            );
    printf("PosKey:%llX\n",pos->posKey);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6be6(%rip), %rdi      # 0x7fd0
callq 0x1060
movq %rbx, (%rsp)
leaq 0x16c(%rbx), %r12
movl $0x7, %r13d
leaq 0x67d1(%rip), %r14      # 0x7bd8
leaq 0x652f(%rip), %rbp      # 0x793d
leaq 0x67c8(%rip), %r15      # 0x7bdd
leal 0x1(%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
xorl %ebx, %ebx
movslq (%r12,%rbx,4), %rax
movsbl (%rax,%rbp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
incq %rbx
cmpq $0x8, %rbx
jne 0x1425
movl $0xa, %edi
callq 0x1040
addq $-0x28, %r12
subq $0x1, %r13
jae 0x1415
leaq 0x6786(%rip), %rdi      # 0x7be1
xorl %eax, %eax
callq 0x1080
movl $0x61, %ebp
leaq 0x676f(%rip), %r14      # 0x7bdd
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1080
incl %ebp
cmpl $0x69, %ebp
jne 0x146e
movl $0xa, %edi
callq 0x1040
movq (%rsp), %rbx
movslq 0x200(%rbx), %rax
leaq 0x64b7(%rip), %rcx      # 0x7954
movsbl (%rax,%rcx), %esi
leaq 0x673e(%rip), %rdi      # 0x7be6
xorl %eax, %eax
callq 0x1080
movl 0x204(%rbx), %esi
leaq 0x6733(%rip), %rdi      # 0x7bef
xorl %eax, %eax
callq 0x1080
movd 0x214(%rbx), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x5b38(%rip), %xmm0     # 0x7010
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %eax
testb $0x8, %al
movl $0x2d, %edi
movl $0x4b, %esi
cmovnel %edi, %esi
testb $0x4, %al
movl $0x51, %edx
cmovnel %edi, %edx
testb $0x2, %al
movl $0x6b, %ecx
cmovnel %edi, %ecx
testb $0x1, %al
movl $0x71, %r8d
cmovnel %edi, %r8d
leaq 0x66e0(%rip), %rdi      # 0x7bf9
xorl %eax, %eax
callq 0x1080
movq 0x220(%rbx), %rsi
leaq 0x66dc(%rip), %rdi      # 0x7c0a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: AddPawnMove
static void AddPawnMove( const S_BOARD *pos, const int from, const int to, S_MOVELIST *list ) {
    int side=pos->side;
    if(RanksBrd[from] == (side?RANK_2:RANK_7)) {
        AddQuietMove(pos, MOVE(from,to,EMPTY,(side?bQ:wQ),0), list);
        AddQuietMove(pos, MOVE(from,to,EMPTY,(side?bR:wR),0), list);
        AddQuietMove(pos, MOVE(from,to,EMPTY,(side?bB:wB),0), list);
        AddQuietMove(pos, MOVE(from,to,EMPTY,(side?bN:wN),0), list);
    } else {
        AddQuietMove(pos, MOVE(from,to,EMPTY,EMPTY,0), list);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl 0x7aad(%rip), %eax      # 0xbea0
movslq %edi, %rcx
leaq 0x1fa43(%rip), %rdx     # 0x23e40
xorl %edi, %edi
testl %eax, %eax
sete %dil
leal (%rdi,%rdi,4), %edi
incl %edi
shll $0x7, %esi
movl %ecx, %ebp
orl %esi, %ebp
cmpl %edi, (%rdx,%rcx,4)
jne 0x447b
testl %eax, %eax
movl $0x500000, %eax         # imm = 0x500000
movl $0xb00000, %edi         # imm = 0xB00000
cmovel %eax, %edi
movl $0x400000, %eax         # imm = 0x400000
movl $0xa00000, %r14d        # imm = 0xA00000
cmovel %eax, %r14d
movl $0x300000, %eax         # imm = 0x300000
movl $0x900000, %r15d        # imm = 0x900000
cmovel %eax, %r15d
movl $0x200000, %eax         # imm = 0x200000
movl $0x800000, %r12d        # imm = 0x800000
cmovel %eax, %r12d
orl %ebp, %edi
movq %rbx, %rsi
callq 0x448a
orl %ebp, %r14d
movl %r14d, %edi
movq %rbx, %rsi
callq 0x448a
orl %ebp, %r15d
movl %r15d, %edi
movq %rbx, %rsi
callq 0x448a
orl %r12d, %ebp
movl %ebp, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x448a
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: AddQuietMove
static void AddQuietMove( const S_BOARD *pos, int move, S_MOVELIST *list ) {

    list->moves[list->count].move = move;
    
    if(pos->searchKillers[0][pos->ply] == move) {    
        list->moves[list->count].score = 900000;
    } else if(pos->searchKillers[1][pos->ply] == move) {    
        list->moves[list->count].score = 800000;
    } else {    
        list->moves[list->count].score = pos->searchHistory[pos->pieces[FROMSQ(move)]][TOSQ(move)];
    }
    list->count++;
}

// Assembly:
movslq 0x800(%rsi), %rax
movl %edi, (%rsi,%rax,8)
movslq 0x7a11(%rip), %r8       # 0xbeac
leaq 0x77fe(%rip), %rcx      # 0xbca0
movl $0xdbba0, %edx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%rcx,%r8,4)
je 0x44e3
movl $0xc3500, %edx          # imm = 0xC3500
cmpl %edi, 0xdf18(%rcx,%r8,4)
je 0x44e3
movl %edi, %edx
andl $0x7f, %edx
movslq (%rcx,%rdx,4), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rcx, %rdx
shrl $0x5, %edi
andl $0x1fc, %edi            # imm = 0x1FC
movl 0xc5b8(%rdi,%rdx), %edx
movl %edx, 0x4(%rsi,%rax,8)
incl %eax
movl %eax, 0x800(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: AddPawnCapMove
static void AddPawnCapMove( const S_BOARD *pos, const int from, const int to, const int cap, S_MOVELIST *list ) {    
    int side=pos->side;
    if(RanksBrd[from] == (side?RANK_2:RANK_7)) {
        AddCaptureMove(pos, MOVE(from,to,cap,(side?bQ:wQ),0), list);
        AddCaptureMove(pos, MOVE(from,to,cap,(side?bR:wR),0), list);
        AddCaptureMove(pos, MOVE(from,to,cap,(side?bB:wB),0), list);
        AddCaptureMove(pos, MOVE(from,to,cap,(side?bN:wN),0), list);
    } else {
        AddCaptureMove(pos, MOVE(from,to,cap,EMPTY,0), list);
    }
}

// Assembly:
movl 0x79aa(%rip), %eax      # 0xbea0
movslq %edi, %r8
leaq 0x1f940(%rip), %r9      # 0x23e40
xorl %r10d, %r10d
testl %eax, %eax
sete %r10b
leal (%r10,%r10,4), %r10d
incl %r10d
shll $0x7, %esi
shll $0xe, %edx
orl %esi, %edx
orl %edi, %edx
cmpl %r10d, (%r9,%r8,4)
jne 0x4619
pushq %rbp
pushq %r14
pushq %rbx
testl %eax, %eax
movl $0x500000, %eax         # imm = 0x500000
movl $0xb00000, %r10d        # imm = 0xB00000
cmovel %eax, %r10d
movl $0x400000, %eax         # imm = 0x400000
movl $0xa00000, %r9d         # imm = 0xA00000
cmovel %eax, %r9d
movl $0x300000, %eax         # imm = 0x300000
movl $0x900000, %r8d         # imm = 0x900000
cmovel %eax, %r8d
movl $0x200000, %eax         # imm = 0x200000
movl $0x800000, %esi         # imm = 0x800000
cmovel %eax, %esi
orl %edx, %r10d
movslq 0x800(%rcx), %rax
movl %r10d, (%rcx,%rax,8)
movl %edx, %r11d
shrl $0xe, %r11d
andl $0xf, %r11d
andl $0x7f, %edi
leaq 0x7719(%rip), %r10      # 0xbca0
movslq (%r10,%rdi,4), %r14
leaq 0x22c1e(%rip), %rbx     # 0x271b0
imulq $0x34, %r11, %r11
addq %rbx, %r11
movl $0xf4240, %ebx          # imm = 0xF4240
movl (%r11,%r14,4), %ebp
addl %ebx, %ebp
movl %ebp, 0x4(%rcx,%rax,8)
leaq 0x1(%rax), %r14
movl %r14d, 0x800(%rcx)
orl %edx, %r9d
movl %r9d, 0x8(%rcx,%rax,8)
movslq (%r10,%rdi,4), %r9
movl (%r11,%r9,4), %r9d
addl %ebx, %r9d
movl %r9d, 0xc(%rcx,%rax,8)
leaq 0x2(%rax), %r9
movl %r9d, 0x800(%rcx)
orl %edx, %r8d
movl %r8d, 0x10(%rcx,%rax,8)
movslq (%r10,%rdi,4), %r8
movl (%r11,%r8,4), %r8d
addl %ebx, %r8d
movl %r8d, 0x14(%rcx,%rax,8)
leaq 0x3(%rax), %r8
movl %r8d, 0x800(%rcx)
orl %edx, %esi
movl %esi, 0x18(%rcx,%rax,8)
movslq (%r10,%rdi,4), %rdx
addl (%r11,%rdx,4), %ebx
movl %ebx, 0x1c(%rcx,%rax,8)
addl $0x4, %eax
movl %eax, 0x800(%rcx)
popq %rbx
popq %r14
popq %rbp
retq
movslq 0x800(%rcx), %rax
movl %edx, (%rcx,%rax,8)
shrl $0xe, %edx
andl $0xf, %edx
andl $0x7f, %edi
leaq 0x766d(%rip), %rsi      # 0xbca0
movslq (%rsi,%rdi,4), %rsi
imulq $0x34, %rdx, %rdx
leaq 0x22b6e(%rip), %rdi     # 0x271b0
addq %rdx, %rdi
movl $0xf4240, %edx          # imm = 0xF4240
addl (%rdi,%rsi,4), %edx
movl %edx, 0x4(%rcx,%rax,8)
incl %eax
movl %eax, 0x800(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: ClearPiece
static void ClearPiece(const int sq, S_BOARD *pos) {

    
    int pce = pos->pieces[sq];
    
    
    int col = PieceCol[pce];
    int index = 0;
    int t_pceNum = -1;
    
    HASH_PCE(pce,sq);
    
    pos->pieces[sq] = EMPTY;
    pos->material[col] -= PieceVal[pce];
    
    if(PieceBig[pce]) {
        pos->bigPce[col]--;
        
    } else {
        CLRBIT(pos->pawns[col],SQ64(sq));
        CLRBIT(pos->pawns[BOTH],SQ64(sq));
    }
    
    for(index = 0; index < pos->pceNum[pce]; ++index) {
        if(pos->pList[pce][index] == sq) {
            t_pceNum = index;
            break;
        }
    }
    
    
    pos->pceNum[pce]--;        
    
    pos->pList[pce][t_pceNum] = pos->pList[pce][pos->pceNum[pce]];
 
}

// Assembly:
movslq %edi, %rdx
leaq 0x763c(%rip), %rax      # 0xbca0
movslq (%rax,%rdx,4), %rcx
imulq $0x3c0, %rcx, %rsi      # imm = 0x3C0
leaq 0x1fa2a(%rip), %r8      # 0x240a0
addq %rsi, %r8
movq (%r8,%rdx,8), %rsi
xorq %rsi, 0x783c(%rip)      # 0xbec0
leaq 0x2ce5(%rip), %rsi      # 0x7370
movslq (%rsi,%rcx,4), %rsi
movl $0x0, (%rax,%rdx,4)
leaq 0x2d13(%rip), %r8       # 0x73b0
movl (%r8,%rcx,4), %r8d
subl %r8d, 0x264(%rax,%rsi,4)
movl $0x83, %r8d
btq %rcx, %r8
jb 0x46be
decl 0x25c(%rax,%rsi,4)
jmp 0x46e3
leaq 0x720b(%rip), %r8       # 0xb8d0
movslq (%r8,%rdx,4), %rdx
leaq 0x1f270(%rip), %r8      # 0x23940
movq (%r8,%rdx,8), %rdx
andq %rdx, 0x1e0(%rax,%rsi,8)
andq %rdx, 0x77ad(%rip)      # 0xbe90
movslq 0x228(%rax,%rcx,4), %rdx
movq $-0x1, %rsi
leaq (%rcx,%rcx,4), %r8
testq %rdx, %rdx
jle 0x471c
leaq (%rax,%r8,8), %r10
addq $0xc270, %r10           # imm = 0xC270
xorl %r9d, %r9d
cmpl %edi, (%r10,%r9,4)
je 0x4719
incq %r9
cmpq %r9, %rdx
jne 0x4709
jmp 0x471c
movq %r9, %rsi
leal -0x1(%rdx), %edi
movl %edi, 0x228(%rax,%rcx,4)
leaq (%rax,%r8,8), %rax
movl 0xc26c(%rax,%rdx,4), %ecx
movl %ecx, 0xc270(%rax,%rsi,4)
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: MovePiece
static
void MovePiece(const int from, const int to, S_BOARD *pos) {

    int index = 0;
    int pce = pos->pieces[from];    
    int col = PieceCol[pce];
    
    int t_PieceNum = FALSE;

    HASH_PCE(pce,from);
    pos->pieces[from] = EMPTY;
    
    HASH_PCE(pce,to);
    pos->pieces[to] = pce;
    
    if(!PieceBig[pce]) {
        CLRBIT(pos->pawns[col],SQ64(from));
        CLRBIT(pos->pawns[BOTH],SQ64(from));
        SETBIT(pos->pawns[col],SQ64(to));
        SETBIT(pos->pawns[BOTH],SQ64(to));        
    }    
    
    for(index = 0; index < pos->pceNum[pce]; ++index) {
        if(pos->pList[pce][index] == from) {
            pos->pList[pce][index] = to;
            t_PieceNum = TRUE;
            break;
        }
    }
}

// Assembly:
movl %edi, %r8d
leaq 0x755d(%rip), %rax      # 0xbca0
movslq (%rax,%r8,4), %rcx
leaq 0x2c22(%rip), %rdx      # 0x7370
movslq (%rdx,%rcx,4), %rdx
imulq $0x3c0, %rcx, %r9       # imm = 0x3C0
leaq 0x1f940(%rip), %r10     # 0x240a0
addq %r9, %r10
movq 0x7756(%rip), %r11      # 0xbec0
xorq (%r10,%r8,8), %r11
movq %r11, 0x774b(%rip)      # 0xbec0
movl $0x0, (%rax,%r8,4)
movl %esi, %r9d
xorq (%r10,%r9,8), %r11
movq %r11, 0x7735(%rip)      # 0xbec0
movl %ecx, (%rax,%r9,4)
movl $0x83, %r10d
btq %rcx, %r10
jae 0x47de
leaq 0x712e(%rip), %r10      # 0xb8d0
movslq (%r10,%r8,4), %r8
leaq 0x1f193(%rip), %r11     # 0x23940
movq (%r11,%r8,8), %r8
andq %r8, 0x1e0(%rax,%rdx,8)
andq %r8, 0x76d0(%rip)       # 0xbe90
movslq (%r10,%r9,4), %r8
leaq 0x1f375(%rip), %r9      # 0x23b40
movq (%r9,%r8,8), %r8
orq %r8, 0x1e0(%rax,%rdx,8)
orq %r8, 0x76b2(%rip)       # 0xbe90
movslq 0x228(%rax,%rcx,4), %rdx
testq %rdx, %rdx
jle 0x480b
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %r9
addq $0xc270, %r9            # imm = 0xC270
xorl %r8d, %r8d
cmpl %edi, (%r9,%r8,4)
je 0x480c
incq %r8
cmpq %r8, %rdx
jne 0x47fd
retq
leaq (%rax,%rcx,8), %rax
movl %esi, 0xc270(%rax,%r8,4)
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: AddPiece
static void AddPiece(const int sq, S_BOARD *pos, const int pce) {

    
    int col = PieceCol[pce];

        HASH_PCE(pce,sq);
    
    pos->pieces[sq] = pce;

        if(PieceBig[pce]) {
        pos->bigPce[col]++;
    
    } else {
        SETBIT(pos->pawns[col],SQ64(sq));
        SETBIT(pos->pawns[BOTH],SQ64(sq));
    }
    
    pos->material[col] += PieceVal[pce];
    pos->pList[pce][pos->pceNum[pce]++] = sq;
    
}

// Assembly:
movl %esi, %eax
leaq 0x2b4e(%rip), %rcx      # 0x7370
movslq (%rcx,%rax,4), %rcx
movslq %edi, %r8
imulq $0x3c0, %rax, %rdx      # imm = 0x3C0
leaq 0x1f869(%rip), %r9      # 0x240a0
addq %rdx, %r9
movq (%r9,%r8,8), %rdx
xorq %rdx, 0x767b(%rip)      # 0xbec0
leaq 0x7454(%rip), %rdx      # 0xbca0
movl %esi, (%rdx,%r8,4)
movl $0x83, %r9d
btq %rsi, %r9
jb 0x4865
incl 0x25c(%rdx,%rcx,4)
jmp 0x488a
leaq 0x7064(%rip), %rsi      # 0xb8d0
movslq (%rsi,%r8,4), %rsi
leaq 0x1f2c9(%rip), %r8      # 0x23b40
movq (%r8,%rsi,8), %rsi
orq %rsi, 0x1e0(%rdx,%rcx,8)
orq %rsi, 0x7606(%rip)      # 0xbe90
leaq 0x2b1f(%rip), %rsi      # 0x73b0
movl (%rsi,%rax,4), %esi
addl %esi, 0x264(%rdx,%rcx,4)
movslq 0x228(%rdx,%rax,4), %rcx
leal 0x1(%rcx), %esi
movl %esi, 0x228(%rdx,%rax,4)
leaq (%rax,%rax,4), %rax
leaq (%rdx,%rax,8), %rax
movl %edi, 0xc270(%rax,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: PrMove
static
char *PrMove(const int move) {

    static char MvStr[6];
    
    int ff = FilesBrd[FROMSQ(move)];
    int rf = RanksBrd[FROMSQ(move)];
    int ft = FilesBrd[TOSQ(move)];
    int rt = RanksBrd[TOSQ(move)];
    
    int promoted = PROMOTED(move);
    
    if(promoted) {
        char pchar = 'q';
        if(IsKn(promoted)) {
            pchar = 'n';
        } else if(IsRQ(promoted) && !IsBQ(promoted))  {
            pchar = 'r';
        } else if(!IsRQ(promoted) && IsBQ(promoted))  {
            pchar = 'b';
        }
        sprintf(MvStr, "%c%c%c%c%c", ('a'+ff), ('1'+rf), ('a'+ft), ('1'+rt), pchar);
    } else {
        sprintf(MvStr, "%c%c%c%c", ('a'+ff), ('1'+rf), ('a'+ft), ('1'+rt));
    }
    return MvStr;
}

// Assembly:
movl %edi, %eax
andl $0x7f, %eax
shll $0x2, %eax
leaq 0x6ffd(%rip), %rcx      # 0xbab0
movl (%rax,%rcx), %edx
leaq 0x1f383(%rip), %rsi     # 0x23e40
movl (%rax,%rsi), %eax
movl %edi, %r9d
shrl $0x5, %r9d
andl $0x1fc, %r9d            # imm = 0x1FC
movl (%r9,%rcx), %r8d
movl (%r9,%rsi), %r9d
shrl $0x14, %edi
andl $0xf, %edi
je 0x4b09
movl $0x6e, %esi
cmpl $0x2, %edi
je 0x4b3f
cmpl $0x8, %edi
je 0x4b3f
movl $0x15d7, %esi           # imm = 0x15D7
movl %edi, %ecx
shrq %cl, %rsi
movl $0x13cf, %ecx           # imm = 0x13CF
btl %edi, %ecx
jb 0x4b2e
andl $0x1, %esi
addl $0x71, %esi
jmp 0x4b3f
addl $0x61, %edx
addl $0x31, %eax
addl $0x61, %r8d
addl $0x31, %r9d
leaq 0x22936(%rip), %rdi     # 0x27454
leaq 0x3249(%rip), %rsi      # 0x7d6e
movl %eax, %ecx
xorl %eax, %eax
jmp 0x1110
testb $0x1, %sil
movl $0x62, %ecx
movl $0x71, %esi
cmovel %ecx, %esi
pushq %rax
addl $0x61, %edx
addl $0x31, %eax
addl $0x61, %r8d
addl $0x31, %r9d
movl %esi, (%rsp)
leaq 0x228fc(%rip), %rdi     # 0x27454
leaq 0x320d(%rip), %rsi      # 0x7d6c
movl %eax, %ecx
xorl %eax, %eax
callq 0x1110
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: GetPvLine
static
int GetPvLine(const int depth, S_BOARD *pos) {


    int move = ProbePvTable(pos);
    int count = 0;
    
    while(move != NOMOVE && count < depth) {
    
    
        if( MoveExists(pos, move) ) {
            MakeMove(pos, move);
            pos->PvArray[count++] = move;
        } else {
            break;
        }        
        move = ProbePvTable(pos);    
    }
    
    while(pos->ply > 0) {
        TakeMove(pos);
    }
    
    return count;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq 0x6dc1(%rip), %rcx      # 0xbec0
movslq 0x1301a(%rip), %rsi     # 0x18120
xorl %ebx, %ebx
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq 0x13001(%rip), %rax     # 0x18118
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rdx
movl $0x0, %r14d
cmpq %rcx, (%rax,%rdx,8)
jne 0x5132
leaq (%rax,%rdx,8), %rax
movl 0x8(%rax), %r14d
testl %r14d, %r14d
sete %al
testl %edi, %edi
setle %cl
orb %al, %cl
jne 0x51fe
movl %edi, %eax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
movq %rdi, %r12
xorl %esi, %esi
callq 0x39ab
movslq 0x810(%rsp), %r13
testq %r13, %r13
jle 0x51fe
xorl %r15d, %r15d
movl 0x10(%rsp,%r15,8), %ebp
movl %ebp, %edi
callq 0x3701
testl %eax, %eax
je 0x518b
callq 0x48bd
cmpl %r14d, %ebp
je 0x5195
incq %r15
cmpq %r15, %r13
jne 0x5171
jmp 0x51fe
movl %r14d, %edi
callq 0x3701
leaq 0x6afc(%rip), %rax      # 0xbca0
movl %r14d, 0xc4b8(%rax,%rbx,4)
movq 0x6d0d(%rip), %rcx      # 0xbec0
movslq 0x12f66(%rip), %rsi     # 0x18120
xorl %r14d, %r14d
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq 0x12f4c(%rip), %rax     # 0x18118
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq %rcx, (%rax,%rdx,8)
jne 0x51e1
leaq (%rax,%rdx,8), %rax
movl 0x8(%rax), %r14d
incq %rbx
testl %r14d, %r14d
je 0x51fe
movq %r12, %rdi
cmpq 0x8(%rsp), %rbx
jb 0x5153
jmp 0x51fe
callq 0x48bd
cmpl $0x0, 0x6ca7(%rip)      # 0xbeac
jg 0x51f9
movl %ebx, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: CheckUp
static void CheckUp(S_SEARCHINFO *info) {
    // .. check if time up, or interrupt from GUI
    if(info->timeset == TRUE && GetTimeMs() > info->stoptime) {
        info->stopped = TRUE;
    }
        
    ReadInput(info);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
cmpl $0x1, 0x21d61(%rip)     # 0x2717c
jne 0x5461
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1090
imull $0x3e8, (%rbx), %ecx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %rdx
addl %eax, %edx
addl %ecx, %edx
cmpl %edx, 0x21d1f(%rip)     # 0x27174
jge 0x5461
movl $0x1, 0x21d2f(%rip)     # 0x27190
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x50(%rbx)
movaps %xmm0, 0x60(%rbx)
movaps %xmm0, 0x70(%rbx)
movq 0x5b39(%rip), %r14      # 0xafc8
movq (%r14), %rdi
callq 0x10d0
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $0xc0, %ecx
subl %ecx, %eax
movl $0x1, %r15d
movl %eax, %ecx
shlq %cl, %r15
movq (%r14), %rdi
callq 0x10d0
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rax
orq %r15, 0x10(%rsp,%rax,8)
movq %rsp, %r8
xorps %xmm0, %xmm0
movaps %xmm0, (%r8)
movl $0x10, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10e0
movq (%r14), %rdi
callq 0x10d0
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rax
movq 0x10(%rsp,%rax,8), %rbx
movq (%r14), %rdi
callq 0x10d0
btq %rax, %rbx
jae 0x551b
movl $0x1, 0x21c75(%rip)     # 0x27190
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: EvalPosition
static int EvalPosition(const S_BOARD *pos) {

    int pce;
    int pceNum;
    int sq;
    int score = pos->material[WHITE] - pos->material[BLACK];
    if(!pos->pceNum[wP] && !pos->pceNum[bP]) {
        if(MaterialDraw(pos))
            return 0;
    }
    if(pos->material[BLACK]>0)
    {
        
        if (!pos->isCastled[WHITE])
        {
            score -= 20;
        }

        score += EvalWhitePawns(pos);
        score += EvalWhiteKnight(pos);
        score += EvalWhiteBishop(pos);
        score += EvalWhiteRook(pos);
        score += EvalWhiteQueen(pos);

    }
    score += EvalWhiteKing(pos);
    if(pos->material[WHITE]>0)
    {
        if (!pos->isCastled[BLACK])
        {
            score += 20;
        }
        

        score += EvalBlackPawns(pos);
        score += EvalBlackKnight(pos);
        score += EvalBlackBishop(pos);
        score += EvalBlackRook(pos);
        score += EvalBlackQueen(pos);

    }
    
    score += EvalBlackKing(pos);

    if(pos->side == WHITE) {
        return score;
    } else {
        return -score;
    }        
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x69ce(%rip), %ebx      # 0xbf04
movl 0x69cc(%rip), %ebp      # 0xbf08
movl 0x69a2(%rip), %eax      # 0xbee4
orl 0x6984(%rip), %eax      # 0xbecc
jne 0x5562
leaq 0x674f(%rip), %rdi      # 0xbca0
callq 0x1293
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x564f
subl %ebp, %ebx
testl %ebp, %ebp
jle 0x55bb
leaq 0x6731(%rip), %r14      # 0xbca0
leal -0x14(%rbx), %r15d
cmpl $0x0, 0x693e(%rip)      # 0xbeb8
cmovnel %ebx, %r15d
movq %r14, %rdi
callq 0x63e8
movl %eax, %ebx
movq %r14, %rdi
callq 0x5f7c
movl %eax, %ebp
addl %ebx, %ebp
movq %r14, %rdi
callq 0x6118
movl %eax, %ebx
addl %ebp, %ebx
movq %r14, %rdi
callq 0x62e8
movl %eax, %ebp
addl %ebx, %ebp
movq %r14, %rdi
callq 0x5edc
movl %eax, %ebx
addl %ebp, %ebx
addl %r15d, %ebx
leaq 0x66de(%rip), %rdi      # 0xbca0
callq 0x655c
movl %eax, %r14d
addl %ebx, %r14d
cmpl $0x0, 0x6930(%rip)      # 0xbf04
jle 0x5630
leaq 0x66c3(%rip), %rbx      # 0xbca0
leal 0x14(%r14), %r12d
cmpl $0x0, 0x68d4(%rip)      # 0xbebc
cmovnel %r14d, %r12d
movq %rbx, %rdi
callq 0x6494
movl %eax, %ebp
movq %rbx, %rdi
callq 0x6048
movl %eax, %r14d
addl %ebp, %r14d
movq %rbx, %rdi
callq 0x621b
movl %eax, %ebp
addl %r14d, %ebp
movq %rbx, %rdi
callq 0x635e
movl %eax, %r15d
addl %ebp, %r15d
movq %rbx, %rdi
callq 0x5f29
movl %eax, %r14d
addl %r15d, %r14d
addl %r12d, %r14d
leaq 0x6669(%rip), %rdi      # 0xbca0
callq 0x65e1
movl %eax, %ecx
addl %r14d, %ecx
movl %ecx, %eax
negl %eax
cmpl $0x0, 0x6854(%rip)      # 0xbea0
cmovel %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq