LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/worker.c
// Function: parse_lock_statement
struct element* parse_lock_statement( struct element *elem,
	struct function *func, struct variables *vars, struct statement *prev, char *message ) {
	struct expression expr;
	struct element *next = elem->next;
	struct statement block = { 0 }, *stmt = calloc( 1, sizeof( struct block_statement ) );
	if( stmt ) {
		stmt->dispose = dispose_block_statement;
		prev->next = stmt;
		if( next->str.string[ 0 ] == '{' ) {
			expr.next = calloc( 1, sizeof( struct value_expression ) );
			if( expr.next ) {
				expr.next->line = elem->line;
				expr.next->evaluate = evaluate_number_literal_expression;
			} else {
				strcpy( message, OUT_OF_MEMORY );
			}
		} else {
			expr.next = NULL;
			next = parse_expression( next, func, vars, &expr, message );
		}
		if( message[ 0 ] == 0 ) {
			stmt->source = expr.next;
			stmt->execute = execute_lock_statement;
			if( next->child ) {
				block.next = NULL;
				parse_keywords_indexed( func->env->statements_index, next->child, func, vars, &block, message );
				( ( struct block_statement * ) stmt )->if_block = block.next;
			}
			if( message[ 0 ] == 0 ) {
				next = next->next;
			}
		}
	} else {
		strcpy( message, OUT_OF_MEMORY );
	}
	return next;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
movq 0x20(%rdi), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3130
testq %rax, %rax
je 0xef37
movq %rax, %r13
leaq -0xad21(%rip), %rax     # 0x41de
movq %rax, 0x18(%r13)
movq %r13, 0x20(%r15)
movq 0x8(%rbx), %rax
cmpb $0x7b, (%rax)
jne 0xef4e
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x3130
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xef70
movl 0x28(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xb566(%rip), %rcx     # 0x39cb
movq %rcx, 0x18(%rax)
jmp 0xef82
leaq 0x9232(%rip), %rax      # 0x18170
movq (%rax), %rsi
movq %r14, %rdi
callq 0x3070
jmp 0xefdd
leaq 0x10(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %r8
callq 0x4d6c
movq %rax, %rbx
jmp 0xef82
leaq 0x91f9(%rip), %rax      # 0x18170
movq (%rax), %rsi
movq %r14, %rdi
callq 0x3070
cmpb $0x0, (%r14)
jne 0xefdd
movq 0x20(%rsp), %rax
movq %rax, 0x8(%r13)
leaq 0x57(%rip), %rax        # 0xefef
movq %rax, 0x10(%r13)
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0xefd9
leaq 0x30(%rsp), %r15
andq $0x0, 0x20(%r15)
movq 0x40(%r12), %rdi
subq $-0x80, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x69a8
movq 0x20(%r15), %rax
movq %rax, 0x28(%r13)
cmpb $0x0, (%r14)
jne 0xefdd
movq 0x20(%rbx), %rbx
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/worker.c
// Function: execute_lock_statement
static enum result execute_lock_statement( struct statement *this,
	struct variables *vars, struct variable *result ) {
	struct statement *stmt = ( ( struct block_statement * ) this )->if_block;
	struct worker *work = ( struct worker * ) vars->func->env->worker;
	struct variable var = { 0, NULL };
	char *locked = NULL;
	enum result ret = this->source->evaluate( this->source, vars, &var );
	if( ret ) {
		if( is_custom_instance( var.string_value, &worker_type ) ) {
			work = ( struct worker * ) var.string_value;
			locked = &work->locked;
		} else if( work ) {
			locked = &work->worker_locked;
		} else {
			ret = throw( vars, this->source, 0, "Not a worker.");
		}
		if( locked ) {
			if( locked[ 0 ] == 0 && lock_worker( work ) ) {
				locked[ 0 ] = 1;
				while( stmt ) {
					ret = stmt->execute( stmt, vars, result );
					if( ret == OKAY ) {
						stmt = stmt->next;
					} else {
						break;
					}
				}
				locked[ 0 ] = 0;
				if( unlock_worker( work ) == 0 ) {
					locked[ 0 ] = 1;
					ret = throw( vars, this->source, 0, "Unable to unlock worker.");
				}
			} else {
				ret = throw( vars, this->source, 0, "Unable to lock worker.");
			}
		}
		dispose_temporary( &var );
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq 0x28(%rdi), %r15
movq 0x18(%rsi), %rax
movq 0x40(%rax), %rax
movq 0x3a0(%rax), %r13
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq 0x8(%rdi), %rdi
callq *0x18(%rdi)
testl %eax, %eax
je 0xf051
movl %eax, %ebp
movq 0x8(%rsp), %rdi
leaq 0x9f55(%rip), %rsi      # 0x18f90
callq 0x45df
testl %eax, %eax
je 0xf055
movl $0x3f8, %r13d           # imm = 0x3F8
addq 0x8(%rsp), %r13
jmp 0xf061
xorl %ebp, %ebp
jmp 0xf0c8
testq %r13, %r13
je 0xf0a8
addq $0x3f9, %r13            # imm = 0x3F9
cmpb $0x0, (%r13)
je 0xf076
movq 0x8(%r12), %rsi
leaq 0x32dd(%rip), %rcx      # 0x12351
jmp 0xf0b4
movb $0x1, (%r13)
pushq $0x1
popq %r12
testq %r15, %r15
je 0xf0a1
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x10(%r15)
cmpl $0x1, %eax
jne 0xf09f
movq 0x20(%r15), %r15
movl %r12d, %ebp
jmp 0xf07f
movl %eax, %ebp
movb $0x0, (%r13)
jmp 0xf0c0
movq 0x8(%r12), %rsi
leaq 0x328f(%rip), %rcx      # 0x12343
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3bb2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x3988
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/worker.c
// Function: dispose_worker
static void dispose_worker( struct string *str ) {
	int idx, len = 0;
	struct worker *work = ( struct worker * ) str;
	await_worker( work, 1 );
	if( work->env.entry_point ) {
		len = work->env.entry_point->num_parameters;
	}
	dispose_temporary( &work->result );
	dispose_temporary( &work->exception );
	dispose_environment( &work->env );
	for( idx = 0; idx < len; idx++ ) {
		dispose_temporary( &work->args[ idx ] );
	}
	free( work->args );
	free( work->strings );
	free( work->parameters );
	free( work );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq 0x3b8(%rdi), %rax
xorl %r15d, %r15d
movl $0x0, %r12d
testq %rax, %rax
je 0xf8af
movl 0x1c(%rax), %r12d
leaq 0x3d0(%rbx), %rdi
callq 0x3988
leaq 0x3e0(%rbx), %rdi
callq 0x3988
movq %r14, %rdi
callq 0x3aaf
testl %r12d, %r12d
cmovlel %r15d, %r12d
shlq $0x4, %r12
movq 0x3c8(%rbx), %rdi
cmpq %r15, %r12
je 0xf8f4
addq %r15, %rdi
callq 0x3988
addq $0x10, %r15
jmp 0xf8da
callq 0x3030
movq 0x400(%rbx), %rdi
callq 0x3030
movq 0x3f0(%rbx), %rdi
callq 0x3030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/ttasm.c
// Function: parse_asm_statement
struct element* parse_asm_statement( struct element *elem,
	struct function *func, struct variables *vars, struct statement *prev, char *message ) {
	struct element *next = elem->next;
	struct label labels = { 0 };
	struct asm_statement *stmt;
	int count;
	if( next->child ) {
		count = parse_instructions( next->child, func, NULL, &labels, message );
		if( count > 0 ) {
			stmt = calloc( 1, sizeof( struct asm_statement ) + sizeof( struct instruction ) * count );
			if( stmt ) {
				prev->next = &stmt->stmt;
				stmt->stmt.source = calloc( 1, sizeof( struct expression ) );
			}
			if( stmt && stmt->stmt.source ) {
				stmt->stmt.source->line = elem->line;
				stmt->instructions = ( struct instruction * ) &stmt[ 1 ];
				parse_instructions( next->child, func, stmt->instructions, &labels, message );
				stmt->stmt.execute = execute_asm_statement;
				next = next->next;
			} else {
				strcpy( message, OUT_OF_MEMORY );
			}
		}
		dispose_labels( labels.next );
	} else {
		sprintf( message, "Empty asm statement on line %d.", next->line );
	}
	return next;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rdi, %r12
movq 0x20(%rdi), %rbx
andq $0x0, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xf9d8
movq %rcx, %r13
movq %rsi, %r15
movq %rsp, %rcx
xorl %edx, %edx
movq %r14, %r8
callq 0xfa28
testl %eax, %eax
jle 0xfa10
movl %eax, %eax
leaq 0x30(,%rax,8), %rsi
pushq $0x1
popq %rdi
callq 0x3130
testq %rax, %rax
je 0xf9fe
movq %rax, %rbp
movq %rax, 0x20(%r13)
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x3130
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0xf9fe
movl 0x28(%r12), %ecx
movl %ecx, (%rax)
movq %rbp, %rdx
addq $0x30, %rdx
movq %rdx, 0x28(%rbp)
movq 0x18(%rbx), %rdi
movq %rsp, %rcx
movq %r15, %rsi
movq %r14, %r8
callq 0xfa28
leaq 0xa96(%rip), %rax       # 0x10464
movq %rax, 0x10(%rbp)
movq 0x20(%rbx), %rbx
jmp 0xfa10
movl 0x28(%rbx), %edx
leaq 0x2a3e(%rip), %rsi      # 0x12420
movq %r14, %rdi
xorl %eax, %eax
callq 0x3200
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x876b(%rip), %rax      # 0x18170
movq (%rax), %rsi
movq %r14, %rdi
callq 0x3070
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xf9ec
movq 0x10(%rdi), %r14
callq 0x3030
movq %r14, %rdi
jmp 0xfa15
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/ttasm.c
// Function: validate_label
static int validate_label( char *name, int len ) {
	int chr = name[ 0 ], idx = 1, result = 1;
	if( alphachar( chr, "" ) ) {
		chr = name[ idx++ ];
		while( chr && idx <= len ) {
			if( alphachar( chr, "_0123456789" ) ) {
				chr = name[ idx++ ];
			} else {
				result = chr = 0;
			}
		}
	} else {
		result = 0;
	}
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movsbl (%rdi), %edi
leaq 0x5af(%rip), %rsi       # 0x11056
callq 0x10afe
testl %eax, %eax
je 0x10af1
pushq $0x1
popq %rbp
pushq $0x2
popq %r12
pushq $0x1
popq %rax
leaq 0x19fa(%rip), %r15      # 0x124bb
movsbl (%r14,%rax), %ecx
movl %ebp, %edx
movl %edx, %ebp
testl %ecx, %ecx
je 0x10af3
cmpl %ebx, %r12d
jg 0x10af3
movsbl %cl, %edi
movq %r15, %rsi
callq 0x10afe
xorl %ecx, %ecx
movl $0x0, %edx
testl %eax, %eax
je 0x10ac8
movl %r12d, %eax
incl %r12d
jmp 0x10ac1
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/ttasm.c
// Function: get_local_variable
static int get_local_variable( struct function *func, struct element *elem, char *suffix, char *message ) {
	int idx = 0;
	char *name = elem->str.string;
	size_t len = strlen( name ) - strlen( suffix );
	struct local_variable *local = func->variable_decls;
	if( len > 0 ) {
		while( local && ( strncmp( local->name, name, len ) || strlen( local->name ) != len ) ) {
			idx++;
			local = local->next;
		}
	}
	if( len <= 0 || local == NULL || idx > 127 ) {
		if( message ) {
			sprintf( message, "Invalid local variable '%.64s' on line %d.", name, elem->line );
		}
		idx = -1;
	}
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rdi, %rbp
movq %rsi, (%rsp)
movq 0x8(%rsi), %r14
movq %r14, %rdi
callq 0x30c0
movq %rax, %r12
movq %r15, %rdi
callq 0x30c0
movq %rax, %r13
movq %r12, 0x10(%rsp)
subq %rax, %r12
movq 0x48(%rbp), %rbx
setne %al
testq %rbx, %rbx
setne %cl
andb %al, %cl
xorl %ebp, %ebp
cmpb $0x1, %cl
jne 0x10bb2
xorl %ebp, %ebp
movq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3060
testl %eax, %eax
jne 0x10ba5
movq %r15, %rdi
callq 0x30c0
cmpq %r12, %rax
je 0x10bb2
incl %ebp
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x10b82
xorl %ebx, %ebx
cmpq %r13, 0x10(%rsp)
sete %al
testq %rbx, %rbx
sete %cl
cmpl $0x7f, %ebp
setg %dl
orb %cl, %dl
orb %al, %dl
cmpb $0x1, %dl
jne 0x10bf4
pushq $-0x1
popq %rbp
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10bf4
movq (%rsp), %rax
movl 0x28(%rax), %ecx
leaq 0x1906(%rip), %rsi      # 0x124f0
movq %r14, %rdx
xorl %eax, %eax
callq 0x3200
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/ttasm.c
// Function: get_asm_operator
static struct asm_operator* get_asm_operator( struct asm_operator *operators, char *name ) {
	while( operators->name && strcmp( name, operators->name ) ) {
		operators++;
	}
	if( operators->name == NULL ) {
		operators = NULL;
	}
	return operators;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x10c29
movq %r14, %rdi
callq 0x3140
testl %eax, %eax
je 0x10c2b
addq $0x10, %rbx
jmp 0x10c0f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_01/unbuffered.c
// Function: main
int main(void)
{
	int n;
	char buf[DATA_SIZE];

        memset(buf, 0, DATA_SIZE);
	for (n = 0; n < DATA_SIZE; n++)
		if (write(STDOUT_FILENO, &buf[n], 1) != 1) {
			err("write error\n");
			break;
		}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20000, %rsp          # imm = 0x20000
movq %rsp, %rdi
xorl %r15d, %r15d
movl $0x20000, %edx          # imm = 0x20000
xorl %esi, %esi
callq 0x1040
pushq $0x1
popq %rbx
pushq $0x1
popq %r14
cmpq $0x20000, %r15          # imm = 0x20000
je 0x11a3
leaq (%rsp,%r15), %rsi
movl %ebx, %edi
movq %r14, %rdx
callq 0x1030
incq %r15
cmpq $0x1, %rax
je 0x1171
leaq 0xe6c(%rip), %rsi       # 0x2004
pushq $0x2
popq %rdi
pushq $0xd
popq %rdx
callq 0x1030
xorl %eax, %eax
addq $0x20000, %rsp          # imm = 0x20000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_fetch_inc.c
// Function: shmem_int_atomic_fetch_inc
int shmem_int_atomic_fetch_inc( int* ptr, int pe)
{
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe ); 
	long* x = (long*)shmem_ptr((void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	int r = *remote_ptr;
	*remote_ptr = r + 1;
	__clear_spin_lock(x);
	return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
callq 0x1b6c
movq %rax, %r14
leaq 0x33fe(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebx, %esi
callq 0x1b6c
movq %rax, %rbx
movq %rax, %rdi
callq 0x3088
movl (%r14), %r15d
leal 0x1(%r15), %eax
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x3078
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/erik[P]gamut/convolute.c
// Function: main
int main(int argc, char** argv)
{
    if (argc != 2) {
        fprintf(stderr, "usage: %s KERNEL\n", argv[0]);
        return 1;
    }

    const void *kernel = NULL;

    if (!strcmp("blur", argv[1]))
        kernel = &BLUR_KERNEL;
    else if (!strcmp("sharpen", argv[1]))
        kernel = &SHARPEN_KERNEL;
    else {
        fprintf(stderr, "unknown image kernel: %s\n", argv[1]);
        return 1;
    }

    return convolve(kernel);
}

// Assembly:
pushq %rbx
cmpl $0x2, %edi
jne 0x14ff
movq 0x8(%rsi), %rbx
leaq 0xbc5(%rip), %rdi       # 0x208f
movq %rbx, %rsi
callq 0x1060
testl %eax, %eax
je 0x14f2
leaq 0xbb7(%rip), %rdi       # 0x2094
movq %rbx, %rsi
callq 0x1060
testl %eax, %eax
jne 0x1515
leaq 0xb20(%rip), %rdi       # 0x2010
jmp 0x14f9
leaq 0xb47(%rip), %rdi       # 0x2040
popq %rbx
jmp 0x11ac
movq 0x2af2(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rsi), %rdx
leaq 0xb6a(%rip), %rsi       # 0x207d
jmp 0x1529
movq 0x2adc(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xb76(%rip), %rsi       # 0x209c
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nickglobal[P]usbloger/core.c
// Function: main
int main()
{
	// comment pushed via ssh
	int i,jj;
	printf("usb log core \n");
	printf("start count \n");
	jj = 0;
	for ( i=0; i<10; i++)
	{
		printf(" count rqqqqwerewrwe %d \n", i);
		if ( (jj++) == 5) {
		   printf("JJ\n");
		   jj = 123;
		} 	
	}
	if ( jj == 123 ) 
	{
		printf("remote branch added fix 1  \n");	
		printf("remote branch added fix 2  \n");
	
		printf("remote branch added fix 3  \n");	
		printf("remote branch added fix 4  \n");
		printf("commit once again \n");
		printf("count end\n");
	}
#ifdef USB_FEATURE
	printf("USB logger [ON]\n");
#endif
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xec3(%rip), %rdi       # 0x201e
callq 0x1030
leaq 0xec5(%rip), %rdi       # 0x202c
callq 0x1030
leaq 0xe91(%rip), %rbx       # 0x2004
leaq 0xf4c(%rip), %r14       # 0x20c6
pushq $0x7b
popq %r15
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpl $0xa, %ebp
je 0x11ae
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1040
cmpl $0x5, %r12d
je 0x119f
incl %r12d
jmp 0x11aa
movq %r14, %rdi
callq 0x1030
movl %r15d, %r12d
incl %ebp
jmp 0x1183
cmpl $0x7b, %r12d
jne 0x11fc
leaq 0xe7e(%rip), %rdi       # 0x2039
callq 0x1030
leaq 0xe8e(%rip), %rdi       # 0x2055
callq 0x1030
leaq 0xe9e(%rip), %rdi       # 0x2071
callq 0x1030
leaq 0xeae(%rip), %rdi       # 0x208d
callq 0x1030
leaq 0xebe(%rip), %rdi       # 0x20a9
callq 0x1030
leaq 0xec5(%rip), %rdi       # 0x20bc
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: sendKillSig()
void sendKillSig()
{
	int i;
	int sig = -1;
	for (i = 1; i < numProcs; i++) 
		COMM_WORLD.Send(&sig, 1, MPI_INT, i, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq -0x2c(%rbp), %rax
orl $-0x1, (%rax)
pushq $0x1
popq %r14
movq 0xa5da(%rip), %rbx      # 0xcfd8
movq 0xa5cb(%rip), %r15      # 0xcfd0
leaq -0x40(%rbp), %r12
movl %r14d, %r13d
cmpl 0xa7e9(%rip), %r13d     # 0xd1fc
jge 0x2a41
leaq 0xa20c(%rip), %rax      # 0xcc28
movq %rax, -0x40(%rbp)
movq %rbx, -0x38(%rbp)
movq %r15, %rdi
leaq -0x2c(%rbp), %rsi
movl %r14d, %edx
movq %r12, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x2f32
incl %r13d
jmp 0x2a0c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: enqueueMove(Move*)
void enqueueMove(Move* move)
{
	if (queueFull == TRUE)
		free(moveQueue[queueIndex]);
	
	moveQueue[queueIndex++] = move;
	if (queueIndex >= MQ_SIZE)
	{
		queueFull = TRUE;
		queueIndex = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, 0xa51f(%rip)      # 0xd20c
jne 0x2d06
movq 0xa50a(%rip), %rax      # 0xd200
movslq 0xa50b(%rip), %rcx      # 0xd208
movq (%rax,%rcx,8), %rdi
callq 0x2200
movq 0xa4f3(%rip), %rax      # 0xd200
movslq 0xa4f4(%rip), %rcx      # 0xd208
leal 0x1(%rcx), %edx
movl %edx, 0xa4eb(%rip)      # 0xd208
movq %rbx, (%rax,%rcx,8)
cmpq $0x13, %rcx
jl 0x2d38
movl $0x1, 0xa4db(%rip)      # 0xd20c
andl $0x0, 0xa4d0(%rip)      # 0xd208
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: moveLoopDetected()
int moveLoopDetected()
{
	// setup variables
	int i, j, type, len, dupCount;
	int duplicates[MQ_SIZE];
	if (queueFull == TRUE)
		len = MQ_SIZE;
	else
		len = queueIndex;
	
	// clear duplicate array
	for (i = 0; i < len; i++)
		duplicates[i] = 0;
	
	// check for duplicates
	type = 1;
	for (i = 0; i < len; i++)
	{
		// go to next move if this has been classified
		if (duplicates[i] != 0)
			continue;
		
		// classify
		duplicates[i] = type;
		
		// classify next moves
		for (j = i + 1; j < len; j++)
		{
			// skip if classified
			if (duplicates[j] != 0)
				continue;
		
			Move* a = moveQueue[i];
			Move* b = moveQueue[j];
			if (a->pieceId == b->pieceId && a->startRow == b->startRow &&
				a->startCol == b->startCol && a->endRow == b->endRow &&
				a->endCol == b->endCol)
			{
				// moves were the same
				duplicates[j] = type;
			}
		}
				
		// next type
		type++;
	}
	
	// count duplicates
	int playerDup = 0;
	for (i = 1; i <= type; i++)
	{
		dupCount = 0;
		for (j = 0; j < len; j++)
		{
			if (duplicates[j] == i)
				dupCount++;
		}
		
		if (dupCount > MAX_REPEATS)
		{
			playerDup++;
			if (playerDup > 1)
				return TRUE;
		}
	}
	
	return FALSE;
}

// Assembly:
cmpl $0x1, 0xa4c6(%rip)      # 0xd20c
je 0x2d50
movl 0xa4ba(%rip), %eax      # 0xd208
jmp 0x2d55
movl $0x14, %eax
pushq %rbp
movq %rsp, %rbp
pushq %rbx
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
cmpq %rdx, %rcx
je 0x2d75
andl $0x0, -0x60(%rbp,%rdx,4)
incq %rdx
jmp 0x2d66
movl $0x1, %edx
movabsq $0x1, %rsi
movq 0xa475(%rip), %rdi      # 0xd200
xorl %r8d, %r8d
cmpq %rcx, %r8
je 0x2dfc
cmpl $0x0, -0x60(%rbp,%r8,4)
jne 0x2df4
movl %edx, -0x60(%rbp,%r8,4)
movq %rsi, %r9
cmpl %r9d, %eax
jle 0x2df2
cmpl $0x0, -0x60(%rbp,%r9,4)
jne 0x2ded
movq (%rdi,%r8,8), %r10
movq (%rdi,%r9,8), %r11
movb (%r10), %bl
cmpb (%r11), %bl
jne 0x2ded
movb 0x1(%r10), %bl
cmpb 0x1(%r11), %bl
jne 0x2ded
movb 0x2(%r10), %bl
cmpb 0x2(%r11), %bl
jne 0x2ded
movb 0x3(%r10), %bl
cmpb 0x3(%r11), %bl
jne 0x2ded
movb 0x4(%r10), %r10b
cmpb 0x4(%r11), %r10b
jne 0x2ded
movl %edx, -0x60(%rbp,%r9,4)
incq %r9
jmp 0x2da3
incl %edx
incq %r8
incq %rsi
jmp 0x2d8e
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
incl %edx
movl $0x1, %esi
movl %esi, %edi
xorl %r8d, %r8d
cmpl %edx, %edi
je 0x2e46
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r9, %rcx
je 0x2e32
xorl %r11d, %r11d
cmpl %edi, -0x60(%rbp,%r9,4)
sete %r11b
addl %r11d, %r10d
incq %r9
jmp 0x2e19
cmpl $0x4, %r10d
jb 0x2e40
testl %r8d, %r8d
movl %esi, %r8d
jg 0x2e44
incl %edi
jmp 0x2e0f
movl %esi, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: logMove(char const*, Move*)
void logMove(const char* filename, Move* move)
{
	//Open file
	FILE* fp = fopen(filename, "a");
	
	//Log move
	char* moveStr = moveToString(move);
	fprintf(fp, "%s", moveStr);
	free(moveStr);
	
	//Close file
	fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x7202(%rip), %rsi      # 0xa05c
callq 0x21f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x8d61
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2200
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x21a0
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: movesEqual(Move*, Move*)
int movesEqual(Move* move1, Move* move2)
{
	if (move1->startRow == move2->startRow && move1->startCol == move2->startCol &&
		move1->endRow == move2->endRow && move1->endCol == move2->endCol)
		return TRUE;
	else
		return FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb 0x1(%rdi), %al
cmpb 0x1(%rsi), %al
jne 0x2eb7
movb 0x2(%rdi), %al
cmpb 0x2(%rsi), %al
jne 0x2eb7
movb 0x3(%rdi), %al
cmpb 0x3(%rsi), %al
jne 0x2eb7
movb 0x4(%rdi), %al
cmpb 0x4(%rsi), %al
jne 0x2eb7
movl $0x1, %eax
jmp 0x2eb9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/chess.c
// Function: printScore(int)
void printScore(int score)
{
	if (score > 0)
		printf("Board Score = %d (WHITE).\n", score);
	else if (score < 0)
		printf("Board Score = %d (BLACK).\n", -score);
	else
		printf("Board Score = EVEN.\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %esi
testl %edi, %edi
jle 0x2ed4
leaq 0x7158(%rip), %rdi      # 0xa024
xorl %eax, %eax
popq %rbp
jmp 0x2040
js 0x2ee3
leaq 0x7283(%rip), %rdi      # 0xa160
popq %rbp
jmp 0x22e0
negl %esi
leaq 0x7153(%rip), %rdi      # 0xa03f
jmp 0x2ecc
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/boardutil.c
// Function: totalPieces(char*)
int totalPieces(char* board)
{
	int i, count;
	for (i = 0, count = 0; i < 64; i++)
		if (board[i] != EMPTY)
			count++;
	return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
xorl %eax, %eax
cmpq $0x40, %rcx
je 0x35ce
cmpb $0x1, (%rdi,%rcx)
sbbl $-0x1, %eax
incq %rcx
jmp 0x35bc
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/boardutil.c
// Function: printBoard(char*)
void printBoard(char* board)
{
	char black = '#';
	char white = '@';
	char pieceId;
	int i, j;
	for (i = 7; i >= 0; i--)
	{
		printf("%d|", i + 1);
		for (j = 0; j < 8; j++)
		{
			pieceId = getPieceAt(board, i, j);
			if (pieceId == EMPTY)
			{
				//empty square
				printf("  ");
			} else if (pieceId > BLACK) {
				//black
				pieceId = (char) (pieceId - BLACK);
				switch (pieceId)
				{
					case PAWN:
						printf("%cP", black);
						break;
					case ROOK:
						printf("%cR", black);
						break;
					case KNIGHT:
						printf("%cN", black);
						break;
					case BISHOP:
						printf("%cB", black);
						break;
					case QUEEN:
						printf("%cQ", black);
						break;
					case KING:
						printf("%cK", black);
						break;
				}
			} else {
				//white
				switch (pieceId)
				{
					case PAWN:
						printf("%cP", white);
						break;
					case ROOK:
						printf("%cR", white);
						break;
					case KNIGHT:
						printf("%cN", white);
						break;
					case BISHOP:
						printf("%cB", white);
						break;
					case QUEEN:
						printf("%cQ", white);
						break;
					case KING:
						printf("%cK", white);
						break;
				}
			}

			if (j < 8)
			{
				printf("|");
			}
		}
		printf("\n");
	}

	printf("-|--|--|--|--|--|--|--|--|\n");
	printf(" | A| B| C| D| E| F| G| H|\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x7
popq %r14
pushq $0x7c
popq %r15
leaq 0x6b94(%rip), %r13      # 0xa184
testl %r14d, %r14d
js 0x3704
leal 0x1(%r14), %esi
xorl %r12d, %r12d
leaq 0x6e12(%rip), %rdi      # 0xa419
xorl %eax, %eax
callq 0x2040
cmpl $0x8, %r12d
je 0x36f4
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x3534
testb %al, %al
je 0x3656
movzbl %al, %ecx
cmpb $0x33, %al
jl 0x3666
addl $-0x33, %ecx
cmpl $0x5, %ecx
ja 0x36e4
leaq 0x6b58(%rip), %rdx      # 0xa19c
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x6dcc(%rip), %rdi      # 0xa420
jmp 0x36cf
leaq 0x6dc0(%rip), %rdi      # 0xa41d
xorl %eax, %eax
callq 0x2040
jmp 0x36e4
decl %ecx
cmpl $0x5, %ecx
ja 0x36e4
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
leaq 0x6da2(%rip), %rdi      # 0xa420
jmp 0x36da
leaq 0x6da9(%rip), %rdi      # 0xa430
jmp 0x36cf
leaq 0x6da0(%rip), %rdi      # 0xa430
jmp 0x36da
leaq 0x6d8f(%rip), %rdi      # 0xa428
jmp 0x36cf
leaq 0x6d86(%rip), %rdi      # 0xa428
jmp 0x36da
leaq 0x6d81(%rip), %rdi      # 0xa42c
jmp 0x36cf
leaq 0x6d78(%rip), %rdi      # 0xa42c
jmp 0x36da
leaq 0x6d67(%rip), %rdi      # 0xa424
jmp 0x36cf
leaq 0x6d5e(%rip), %rdi      # 0xa424
jmp 0x36da
leaq 0x6d65(%rip), %rdi      # 0xa434
pushq $0x23
jmp 0x36dc
leaq 0x6d5a(%rip), %rdi      # 0xa434
pushq $0x40
popq %rsi
xorl %eax, %eax
callq 0x2040
movl %r15d, %edi
callq 0x2280
incl %r12d
jmp 0x360e
pushq $0xa
popq %rdi
callq 0x2280
decl %r14d
jmp 0x35f0
leaq 0x6d2d(%rip), %rdi      # 0xa438
callq 0x22e0
leaq 0x6d3c(%rip), %rdi      # 0xa453
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22e0
nop
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: kingInCheck(char*, char)
char kingInCheck(char* board, char color)
{
	int i, j, row, col;
	if (color == WHITE)
	{
		//Find white king
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 8; j++)
			{
				if (getPieceAt(board, i, j) == KING)
				{
					row = i;
					col = j;
				}
			}
		}

		return !pieceSafe(board, row, col);
	} else {
		//Find black king
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 8; j++)
			{
				if (getPieceAt(board, i, j) == KING + BLACK)
				{
					row = i;
					col = j;
				}
			}
		}

		return !pieceSafe(board, row, col);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
testb %sil, %sil
je 0x379f
cmpl $0x8, %r12d
je 0x37a5
xorl %r13d, %r13d
cmpl $0x8, %r13d
je 0x3771
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x3534
cmpb $0x38, %al
cmovel %r12d, %r14d
cmovel %r13d, %r15d
incl %r13d
jmp 0x374e
incl %r12d
jmp 0x3745
xorl %r13d, %r13d
cmpl $0x8, %r13d
je 0x379c
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x3534
cmpb $0x6, %al
cmovel %r12d, %r14d
cmovel %r13d, %r15d
incl %r13d
jmp 0x3779
incl %r12d
cmpl $0x8, %r12d
jne 0x3776
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x37c7
testb %al, %al
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: spaceSafe(char*, char, int, int)
char spaceSafe(char* board, char color, int row, int col)
{
	if (row < 0 || row > 7 || col < 0 || col > 7)
	{
		return FALSE;
	} else {
		if (getPieceAt(board, row, col) != EMPTY)
		{
			return FALSE;
		} else {
			char p;
			if (color == WHITE)
				p = PAWN;
			else
				p = BLACK + PAWN;
			setPieceAt(board, row, col, p);
			if (pieceSafe(board, row, col))
			{
				setPieceAt(board, row, col, EMPTY);
				return TRUE;
			} else {
				setPieceAt(board, row, col, EMPTY);
				return FALSE;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %eax
orl %edx, %eax
cmpl $0x7, %eax
ja 0x4190
movl %ecx, %ebx
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %r15
movl %edx, %esi
movl %ecx, %edx
callq 0x3534
testb %al, %al
je 0x419f
xorl %r12d, %r12d
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %r12b, %r12b
pushq $0x1
popq %rax
pushq $0x33
popq %rcx
cmovel %eax, %ecx
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x3557
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x37c7
testb %al, %al
setne %r12b
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x3557
jmp 0x4193
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: newMoveSet()
MoveSet* newMoveSet()
{
	MoveSet* set = (MoveSet*) malloc(sizeof(MoveSet));
	set->cap = 100;
	set->size = 0;
	set->moves = (Move**) malloc(sizeof(Move*) * set->cap);
	return set;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x10
popq %rdi
callq 0x2250
movq %rax, %rbx
movq $0x64, (%rax)
movl $0x320, %edi            # imm = 0x320
callq 0x2250
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: addMove(MoveSet*, char, int, int, int, int, int)
void addMove(MoveSet* set, char pieceId, int startRow, int startCol, int endRow, int endCol, int boardScore)
{
	//Check for expansion
	if (set->size >= set->cap)
	{
		set->cap *= 2;
		int i;
		Move** oMoves = set->moves;
		set->moves = (Move**) malloc(sizeof(Move*) * set->cap);
		for (i = 0; i < set->size; i++)
			set->moves[i] = oMoves[i];
		free(oMoves);
	}

	//Add move
	Move* move = (Move*) malloc(sizeof(Move));
	move->pieceId = pieceId;
	move->startRow = (char) startRow;
	move->startCol = (char) startCol;
	move->endRow = (char) endRow;
	move->endCol = (char) endCol;
	move->boardScore = boardScore;
	set->moves[set->size++] = move;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r15d
movl %r8d, -0x34(%rbp)
movl %ecx, -0x30(%rbp)
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %rbx
movl 0x4(%rdi), %r12d
movslq (%rdi), %rdi
cmpl %edi, %r12d
jl 0x85a5
movl %r15d, -0x2c(%rbp)
leal (%rdi,%rdi), %eax
movl %eax, (%rbx)
movq 0x8(%rbx), %r15
shlq $0x4, %rdi
callq 0x2250
movq %rax, 0x8(%rbx)
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
cmpq %rax, %r12
je 0x8595
movq (%r15,%rax,8), %rcx
movq 0x8(%rbx), %rdx
movq %rcx, (%rdx,%rax,8)
incq %rax
jmp 0x857f
movq %r15, %rdi
callq 0x2200
movl 0x4(%rbx), %r12d
movl -0x2c(%rbp), %r15d
pushq $0xc
popq %rdi
callq 0x2250
movb %r14b, (%rax)
movb %r13b, 0x1(%rax)
movl -0x30(%rbp), %ecx
movb %cl, 0x2(%rax)
movl -0x34(%rbp), %ecx
movb %cl, 0x3(%rax)
movb %r15b, 0x4(%rax)
movl 0x10(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq 0x8(%rbx), %rcx
leal 0x1(%r12), %edx
movl %edx, 0x4(%rbx)
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: printMove(Move*)
void printMove(Move* move)
{
	if (move->startRow == CASTLE && move->endRow == KINGSIDE)
		if (isBlack(move->pieceId))
			printf("BLACK CASTLE KINGSIDE.\n");
		else
			printf("WHITE CASTLE KINGSIDE.\n");
	else if (move->startRow == CASTLE && move->endRow == QUEENSIDE)
		if (isBlack(move->pieceId))
			printf("BLACK CASTLE QUEENSIDE.\n");
		else
			printf("WHITE CASTLE QUEENSIDE.\n");
	else
		printf("%s at %s to %s.\n", toString(move->pieceId), positionString(move->startRow, move->startCol), positionString(move->endRow, move->endCol));
	fflush(stdout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $-0x2, 0x1(%rdi)
jne 0x8cdd
movzbl 0x3(%rbx), %eax
cmpl $0xfc, %eax
je 0x8d1e
cmpl $0xfd, %eax
jne 0x8cdd
movsbl (%rbx), %edi
callq 0x3565
testb %al, %al
je 0x8d33
leaq 0x184f(%rip), %rdi      # 0xa52a
jmp 0x8d43
movsbl (%rbx), %edi
callq 0x34af
movq %rax, %r14
movsbl 0x1(%rbx), %edi
movsbl 0x2(%rbx), %esi
callq 0x350b
movq %rax, %r15
movsbl 0x3(%rbx), %edi
movsbl 0x4(%rbx), %esi
callq 0x350b
leaq 0x17bc(%rip), %rdi      # 0xa4c8
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2040
jmp 0x8d48
movsbl (%rbx), %edi
callq 0x3565
testb %al, %al
je 0x8d3c
leaq 0x17ca(%rip), %rdi      # 0xa4fb
jmp 0x8d43
leaq 0x17d9(%rip), %rdi      # 0xa513
jmp 0x8d43
leaq 0x17a0(%rip), %rdi      # 0xa4e3
callq 0x22e0
movq 0x4259(%rip), %rax      # 0xcfa8
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: moveToString(Move*)
char* moveToString(Move* move)
{
	char* str = (char*) malloc(6);
	if (move->startRow == CASTLE && move->endRow == KINGSIDE)
			sprintf(str, "CK\n");
	else if (move->startRow == CASTLE && move->endRow == QUEENSIDE)
			sprintf(str, "CQ\n");
	else
		sprintf(str, "%c%d%c%d\n", getColumnChar(move->startCol), move->startRow + 1, getColumnChar(move->endCol), move->endRow + 1);
	
	return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
pushq $0x6
popq %rdi
callq 0x2250
movq %rax, %rbx
movsbl 0x1(%r12), %r14d
movsbl 0x3(%r12), %r15d
cmpl $-0x2, %r14d
jne 0x8da8
cmpb $-0x4, %r15b
je 0x8df8
movzbl %r15b, %eax
cmpl $0xfd, %eax
jne 0x8da8
movl $0xa4b43, (%rbx)        # imm = 0xA4B43
jmp 0x8de6
movsbl 0x2(%r12), %edi
callq 0x8e00
movzbl %al, %r13d
incl %r14d
movsbl 0x4(%r12), %edi
callq 0x8e00
movzbl %al, %r8d
incl %r15d
leaq 0x1706(%rip), %rsi      # 0xa4d9
movq %rbx, %rdi
movl %r13d, %edx
movl %r14d, %ecx
movl %r15d, %r9d
xorl %eax, %eax
callq 0x2050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xa5143, (%rbx)        # imm = 0xA5143
jmp 0x8de6
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: destroyMoveSet(MoveSet*)
void destroyMoveSet(MoveSet* set)
{
	int i;
	for (i = 0; i < set->size; i++)
		free(set->moves[i]);
	free(set->moves);
	free(set);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x4(%rbx), %rax
movq 0x8(%rbx), %rdi
cmpq %rax, %r14
jge 0x8e69
movq (%rdi,%r14,8), %rdi
callq 0x2200
incq %r14
jmp 0x8e4e
callq 0x2200
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: subMoveSet(MoveSet*, int, int)
MoveSet* subMoveSet(MoveSet* set, int start, int length)
{
	int i, j;
	MoveSet* s = (MoveSet*) malloc(sizeof(MoveSet));
	s->size = length;
	s->cap = length;
	s->moves = (Move**) malloc(sizeof(Move*) * length);
	
	for (j = 0, i = start; j < length; i++, j++)
		s->moves[j] = set->moves[i];
	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x2250
movq %rax, %r14
movl %r15d, 0x4(%rax)
movl %r15d, (%rax)
movslq %r15d, %r15
leaq (,%r15,8), %rdi
callq 0x2250
movq %rax, 0x8(%r14)
movslq %r12d, %rcx
xorl %edx, %edx
testl %r15d, %r15d
cmovlel %edx, %r15d
shlq $0x3, %rcx
cmpq %rdx, %r15
je 0x9200
movq 0x8(%rbx), %rsi
addq %rcx, %rsi
movq (%rsi,%rdx,8), %rsi
movq %rsi, (%rax,%rdx,8)
incq %rdx
jmp 0x91e7
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: sendMoveSet(int, MoveSet*)
void sendMoveSet(int receiver, MoveSet* set)
{
	//Send set size
	int i;
	int size = set->size;
	COMM_WORLD.Send(&size, 1, MPI_INT, receiver, 0);
	
	//Send move data
	for (i = 0; i < size; i++)
	{
		COMM_WORLD.Send(&set->moves[i]->pieceId, 1, MPI_CHAR, receiver, 0);
		COMM_WORLD.Send(&set->moves[i]->startRow, 1, MPI_CHAR, receiver, 0);
		COMM_WORLD.Send(&set->moves[i]->startCol, 1, MPI_CHAR, receiver, 0);
		COMM_WORLD.Send(&set->moves[i]->endRow, 1, MPI_CHAR, receiver, 0);
		COMM_WORLD.Send(&set->moves[i]->endCol, 1, MPI_CHAR, receiver, 0);
		COMM_WORLD.Send(&set->moves[i]->boardScore, 1, MPI_INT, receiver, 0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r8d
movq %rsi, -0x48(%rbp)
movl 0x4(%rsi), %eax
leaq -0x40(%rbp), %rsi
movl %eax, (%rsi)
leaq 0x39f4(%rip), %rax      # 0xcc28
leaq -0x38(%rbp), %rcx
movq %rax, (%rcx)
movq 0x3d96(%rip), %rax      # 0xcfd8
movq %rax, 0x8(%rcx)
movq 0x3d83(%rip), %rdi      # 0xcfd0
pushq $0x1
popq %rdx
xorl %r15d, %r15d
movl %r8d, -0x3c(%rbp)
xorl %r9d, %r9d
callq 0x2f32
movq -0x48(%rbp), %r14
movl -0x3c(%rbp), %ebx
movslq -0x40(%rbp), %rax
cmpq %rax, %r15
jge 0x93a8
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
leaq 0x39a6(%rip), %r12      # 0xcc28
movq %r12, -0x38(%rbp)
movq 0x3d23(%rip), %r12      # 0xcfb0
movq %r12, -0x30(%rbp)
movq 0x3d38(%rip), %rdi      # 0xcfd0
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
incq %rsi
leaq 0x396c(%rip), %r13      # 0xcc28
movq %r13, -0x38(%rbp)
movq %r12, -0x30(%rbp)
movq 0x3d05(%rip), %r12      # 0xcfd0
movq %r12, %rdi
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
addq $0x2, %rsi
movq %r13, -0x38(%rbp)
movq 0x3cb9(%rip), %rax      # 0xcfb0
movq %rax, -0x30(%rbp)
movq %r12, %rdi
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
addq $0x3, %rsi
movq %r13, -0x38(%rbp)
movq 0x3c89(%rip), %rax      # 0xcfb0
movq %rax, -0x30(%rbp)
movq %r12, %rdi
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
addq $0x4, %rsi
movq %r13, -0x38(%rbp)
movq 0x3c59(%rip), %rax      # 0xcfb0
movq %rax, -0x30(%rbp)
movq %r12, %rdi
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
addq $0x8, %rsi
movq %r13, -0x38(%rbp)
movq 0x3c51(%rip), %rax      # 0xcfd8
movq %rax, -0x30(%rbp)
movq %r12, %rdi
pushq $0x1
popq %rdx
leaq -0x38(%rbp), %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
incq %r15
jmp 0x9266
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: sendMove(int, Move*)
void sendMove(int receiver, Move* move)
{
	COMM_WORLD.Send(&move->pieceId, 1, MPI_CHAR, receiver, 0);
	COMM_WORLD.Send(&move->startRow, 1, MPI_CHAR, receiver, 0);
	COMM_WORLD.Send(&move->startCol, 1, MPI_CHAR, receiver, 0);
	COMM_WORLD.Send(&move->endRow, 1, MPI_CHAR, receiver, 0);
	COMM_WORLD.Send(&move->endCol, 1, MPI_CHAR, receiver, 0);
	COMM_WORLD.Send(&move->boardScore, 1, MPI_INT, receiver, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0x3854(%rip), %rax      # 0xcc28
leaq -0x38(%rbp), %r13
movq %rax, (%r13)
movq 0x3bcd(%rip), %rax      # 0xcfb0
movq %rax, 0x8(%r13)
movq 0x3be2(%rip), %r12      # 0xcfd0
pushq $0x1
popq %r15
movq %r12, %rdi
movl %r15d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
leaq 0x1(%r14), %rsi
leaq 0x3817(%rip), %rax      # 0xcc28
movq %rax, (%r13)
movq 0x3b94(%rip), %rax      # 0xcfb0
movq %rax, 0x8(%r13)
movq %r12, %rdi
movl %r15d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
leaq 0x2(%r14), %rsi
leaq 0x37e9(%rip), %rax      # 0xcc28
movq %rax, (%r13)
movq 0x3b66(%rip), %rax      # 0xcfb0
movq %rax, 0x8(%r13)
movq %r12, %rdi
movl %r15d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
leaq 0x3(%r14), %rsi
leaq 0x37bb(%rip), %rax      # 0xcc28
movq %rax, (%r13)
movq 0x3b38(%rip), %rax      # 0xcfb0
movq %rax, 0x8(%r13)
movq %r12, %rdi
movl %r15d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
leaq 0x4(%r14), %rsi
leaq 0x378d(%rip), %rax      # 0xcc28
movq %rax, (%r13)
movq 0x3b0a(%rip), %rax      # 0xcfb0
movq %rax, 0x8(%r13)
movq %r12, %rdi
movl %r15d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
addq $0x8, %r14
leaq 0x375f(%rip), %rax      # 0xcc28
movq %rax, (%r13)
movq 0x3b04(%rip), %rax      # 0xcfd8
movq %rax, 0x8(%r13)
leaq -0x38(%rbp), %rcx
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x2f32
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: receiveMoveDef(int)
MoveDef* receiveMoveDef(int sender)
{
	int bestIndex;
	int bestValue;
	COMM_WORLD.Recv(&bestIndex, 1, MPI_INT, sender, 0);
	COMM_WORLD.Recv(&bestValue, 1, MPI_INT, sender, 0);
	MoveDef* best = (MoveDef*) malloc(sizeof(MoveDef));
	best->index = bestIndex;
	best->value = bestValue;
	return best;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %r14d
leaq 0x370e(%rip), %rax      # 0xcc28
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
movq 0x3ab0(%rip), %rbx      # 0xcfd8
movq %rbx, 0x8(%r15)
movq 0x3a9d(%rip), %r12      # 0xcfd0
leaq -0x2c(%rbp), %rsi
pushq $0x1
popq %r13
movq %r12, %rdi
movl %r13d, %edx
movq %r15, %rcx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x36d2(%rip), %rax      # 0xcc28
movq %rax, (%r15)
movq %rbx, 0x8(%r15)
leaq -0x30(%rbp), %r15
leaq -0x40(%rbp), %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
pushq $0x8
popq %rdi
callq 0x2250
leaq -0x2c(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movl (%r15), %ecx
movl %ecx, 0x4(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: constructMove(char, char, char, char, char, int)
Move* constructMove(char pieceId, char startRow, char startCol, char endRow, char endCol, int boardScore)
{
	Move* m = (Move*) malloc(sizeof(Move));
	m->pieceId = pieceId;
	m->startRow = startRow;
	m->endRow = endRow;
	m->startCol = startCol;
	m->endCol = endCol;
	m->boardScore = boardScore;
	return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x2c(%rbp)
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movl %edi, %ebx
pushq $0xc
popq %rdi
callq 0x2250
movb %bl, (%rax)
movb %r13b, 0x1(%rax)
movb %r15b, 0x3(%rax)
movb %r12b, 0x2(%rax)
movb %r14b, 0x4(%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: cloneMove(Move*)
Move* cloneMove(Move* m)
{
	Move* n = (Move*) malloc(sizeof(Move));
	n->pieceId = m->pieceId;
	n->startRow = m->startRow;
	n->startCol = m->startCol;
	n->endRow = m->endRow;
	n->endCol = m->endCol;
	n->boardScore = m->boardScore;
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0xc
popq %rdi
callq 0x2250
movb (%rbx), %cl
movb %cl, (%rax)
movb 0x1(%rbx), %cl
movb %cl, 0x1(%rax)
movb 0x2(%rbx), %cl
movb %cl, 0x2(%rax)
movb 0x3(%rbx), %cl
movb %cl, 0x3(%rax)
movb 0x4(%rbx), %cl
movb %cl, 0x4(%rax)
movl 0x8(%rbx), %ecx
movl %ecx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: sendMoveDef(MoveDef*)
void sendMoveDef(MoveDef* best)
{
	int bestIndex = best->index;
	int bestValue = best->value;
	COMM_WORLD.Send(&bestIndex, 1, MPI_INT, HEAD, 0);
	COMM_WORLD.Send(&bestValue, 1, MPI_INT, HEAD, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
movl 0x4(%rdi), %eax
leaq -0x2c(%rbp), %rcx
movl %eax, (%rcx)
leaq 0x3157(%rip), %r13      # 0xcc28
leaq -0x40(%rbp), %r14
movq %r13, (%r14)
movq 0x34f9(%rip), %rbx      # 0xcfd8
movq %rbx, 0x8(%r14)
movq 0x34e6(%rip), %r15      # 0xcfd0
pushq $0x1
popq %r12
movq %r15, %rdi
movl %r12d, %edx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2f32
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
leaq -0x40(%rbp), %rcx
movq %r15, %rdi
leaq -0x2c(%rbp), %rsi
movl %r12d, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2f32
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/moves.c
// Function: receiveMove()
Move* receiveMove()
{
	Move* m = (Move*) malloc(sizeof(Move));
	COMM_WORLD.Recv(&m->pieceId, 1, MPI_CHAR, HEAD, 0);
	COMM_WORLD.Recv(&m->startRow, 1, MPI_CHAR, HEAD, 0);
	COMM_WORLD.Recv(&m->startCol, 1, MPI_CHAR, HEAD, 0);
	COMM_WORLD.Recv(&m->endRow, 1, MPI_CHAR, HEAD, 0);
	COMM_WORLD.Recv(&m->endCol, 1, MPI_CHAR, HEAD, 0);
	COMM_WORLD.Recv(&m->boardScore, 1, MPI_INT, HEAD, 0);
	return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $0xc
popq %rdi
callq 0x2250
movq %rax, %rbx
leaq 0x30d4(%rip), %rax      # 0xcc28
leaq -0x38(%rbp), %r12
movq %rax, (%r12)
movq 0x344d(%rip), %r15      # 0xcfb0
movq %r15, 0x8(%r12)
movq 0x3461(%rip), %r14      # 0xcfd0
pushq $0x1
popq %r13
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x1(%rbx), %rsi
leaq 0x3093(%rip), %rax      # 0xcc28
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movl %r13d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x2(%rbx), %rsi
leaq 0x306b(%rip), %rax      # 0xcc28
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movl %r13d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x3(%rbx), %rsi
leaq 0x3043(%rip), %rax      # 0xcc28
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movl %r13d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x4(%rbx), %rsi
leaq 0x301b(%rip), %rax      # 0xcc28
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movl %r13d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
leaq 0x8(%rbx), %rsi
leaq 0x2ff3(%rip), %rax      # 0xcc28
movq %rax, (%r12)
movq 0x3398(%rip), %rax      # 0xcfd8
movq %rax, 0x8(%r12)
leaq -0x38(%rbp), %rcx
movq %r14, %rdi
movl %r13d, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2fa4
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/upcrob[P]garry/strutil.c
// Function: streq(char*, char*)
int streq(char* s1, char* s2)
{
	int i = 0;
	while (s1[i] == s2[i] && s1[i] != '\0')
		i++;
	
	if (s1[i] == s2[i] && s1[i] == '\0')
		return TRUE;
	else
		return FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movb (%rdi,%rax), %cl
movb (%rsi,%rax), %dl
testb %cl, %cl
je 0x9c83
incq %rax
cmpb %dl, %cl
je 0x9c72
xorl %eax, %eax
orb %cl, %dl
sete %al
popq %rbp
retq