LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_open_w
static RAZF* razf_open_w(int fd){
	RAZF *rz;
#ifdef _WIN32
	setmode(fd, O_BINARY);
#endif
	rz = calloc(1, sizeof(RAZF));
	rz->mode = 'w';
#ifdef _USE_KNETFILE
    rz->x.fpw = fd;
#else
	rz->filedes = fd;
#endif
	rz->stream = calloc(sizeof(z_stream), 1);
	rz->inbuf  = malloc(RZ_BUFFER_SIZE);
	rz->outbuf = malloc(RZ_BUFFER_SIZE);
	rz->index = calloc(sizeof(ZBlockIndex), 1);
	deflateInit2(rz->stream, RZ_COMPRESS_LEVEL, Z_DEFLATED, WINDOW_BITS + 16, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
	rz->stream->avail_out = RZ_BUFFER_SIZE;
	rz->stream->next_out  = rz->outbuf;
	rz->header = calloc(sizeof(gz_header), 1);
	rz->header->os    = 0x03; //Unix
	rz->header->text  = 0;
	rz->header->time  = 0;
	rz->header->extra = malloc(7);
	strncpy((char*)rz->header->extra, "RAZF", 4);
	rz->header->extra[4] = 1; // obsolete field
	// block size = RZ_BLOCK_SIZE, Big-Endian
	rz->header->extra[5] = RZ_BLOCK_SIZE >> 8;
	rz->header->extra[6] = RZ_BLOCK_SIZE & 0xFF;
	rz->header->extra_len = 7;
	rz->header->name = rz->header->comment  = 0;
	rz->header->hcrc = 0;
	deflateSetHeader(rz->stream, rz->header);
	rz->block_pos = rz->block_off = 0;
	return rz;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x1, %edi
movl $0x98, %esi
callq 0x3530
movq %rax, %rbx
movb $0x77, (%rax)
movl %ebp, 0x8(%rax)
movl $0x70, %edi
movl $0x1, %esi
callq 0x3530
movq %rax, %r14
movq %rax, 0x10(%rbx)
movl $0x1000, %edi           # imm = 0x1000
callq 0x31d0
movq %rax, 0x60(%rbx)
movl $0x1000, %edi           # imm = 0x1000
callq 0x31d0
movq %rax, %r15
movq %rax, 0x68(%rbx)
movl $0x18, %edi
movl $0x1, %esi
callq 0x3530
movq %rax, 0x18(%rbx)
leaq 0x32e4(%rip), %rax      # 0x251cc
movq %r14, %rdi
movl $0x6, %esi
movl $0x8, %edx
movl $0x1f, %ecx
movl $0x8, %r8d
xorl %r9d, %r9d
pushq $0x70
pushq %rax
callq 0x3520
addq $0x10, %rsp
movl $0x1000, 0x20(%r14)     # imm = 0x1000
movq %r15, 0x18(%r14)
movl $0x50, %edi
movl $0x1, %esi
callq 0x3530
movq %rax, %r15
movq %rax, 0x78(%rbx)
movl $0x3, 0x14(%rax)
movl $0x7, %edi
callq 0x31d0
movq %rax, 0x18(%r15)
movl $0x465a4152, (%rax)     # imm = 0x465A4152
movw $0x8001, 0x4(%rax)      # imm = 0x8001
movb $0x0, 0x6(%rax)
movl $0x7, 0x20(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x33e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_get_data_size
int razf_get_data_size(RAZF *rz, int64_t *u_size, int64_t *c_size){
	int64_t n;
	if(rz->mode != 'r' && rz->mode != 'R') return 0;
	switch(rz->file_type){
		case FILE_TYPE_PLAIN:
			if(rz->end == 0x7fffffffffffffffLL){
#ifdef _USE_KNETFILE
				if(knet_seek(rz->x.fpr, 0, SEEK_CUR) == -1) return 0;
                n = knet_tell(rz->x.fpr);
				knet_seek(rz->x.fpr, 0, SEEK_END);
                rz->end = knet_tell(rz->x.fpr);
				knet_seek(rz->x.fpr, n, SEEK_SET);
#else
				if((n = lseek(rz->filedes, 0, SEEK_CUR)) == -1) return 0;
				rz->end = lseek(rz->filedes, 0, SEEK_END);
				lseek(rz->filedes, n, SEEK_SET);
#endif                
			}
			*u_size = *c_size = rz->end;
			return 1;
		case FILE_TYPE_GZ:
			return 0;
		case FILE_TYPE_RZ:
			if(rz->src_end == rz->end) return 0;
			*u_size = rz->src_end;
			*c_size = rz->end;
			return 1;
		default:
			return 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movzbl (%rdi), %eax
xorl %r12d, %r12d
orl $0x20, %eax
cmpl $0x72, %eax
jne 0x22436
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x4(%rdi), %eax
cmpl $0x1, %eax
je 0x2241c
cmpl $0x2, %eax
jne 0x22436
movq 0x30(%r15), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
jne 0x22414
movq 0x8(%r15), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
movl $0x1, %edx
callq 0x1cb7b
cmpq $-0x1, %rax
je 0x22436
movq 0x8(%r15), %rdi
movq 0x8(%rdi), %r12
xorl %esi, %esi
movl $0x2, %edx
callq 0x1cb7b
movq 0x8(%r15), %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x30(%r15)
movq %r12, %rsi
xorl %edx, %edx
callq 0x1cb7b
movq 0x30(%r15), %rax
movq %rax, (%rbx)
movq %rax, (%r14)
jmp 0x22430
movq 0x38(%r15), %rax
cmpq 0x30(%r15), %rax
je 0x22436
movq %rax, (%r14)
movq 0x30(%r15), %rax
movq %rax, (%rbx)
movl $0x1, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_read
int razf_read(RAZF *rz, void *data, int size){
	int ori_size, i;
	ori_size = size;
	while(size > 0){
		if(rz->buf_len){
			if(size < rz->buf_len){
				for(i=0;i<size;i++) ((char*)data)[i] = ((char*)rz->outbuf + rz->buf_off)[i];
				rz->buf_off += size;
				rz->buf_len -= size;
				data += size;
				rz->block_off += size;
				size = 0;
				break;
			} else {
				for(i=0;i<rz->buf_len;i++) ((char*)data)[i] = ((char*)rz->outbuf + rz->buf_off)[i];
				data += rz->buf_len;
				size -= rz->buf_len;
				rz->block_off += rz->buf_len;
				rz->buf_off = 0;
				rz->buf_len = 0;
				if(rz->buf_flush){
					rz->block_pos = rz->next_block_pos;
					rz->block_off = 0;
					rz->buf_flush = 0;
				}
			}
		} else if(rz->buf_flush){
			rz->block_pos = rz->next_block_pos;
			rz->block_off = 0;
			rz->buf_flush = 0;
		}
		if(rz->buf_flush) continue;
		rz->buf_len = _razf_read(rz, rz->outbuf, RZ_BUFFER_SIZE);
		if(rz->z_eof && rz->buf_len == 0) break;
	}
	rz->out += ori_size - size;
	return ori_size - size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl %edx, %ebp
testl %edx, %edx
jle 0x2253b
movq %rsi, %r15
movl 0x84(%r14), %eax
movl %ebx, %ebp
testl %eax, %eax
je 0x224b6
cmpl %eax, %ebp
jl 0x22509
testl %eax, %eax
jle 0x2249f
xorl %ecx, %ecx
movslq 0x80(%r14), %rax
addq 0x68(%r14), %rax
movb (%rcx,%rax), %al
movb %al, (%r15,%rcx)
incq %rcx
movl 0x84(%r14), %eax
movslq %eax, %rdx
cmpq %rdx, %rcx
jl 0x22479
jmp 0x224a2
movslq %eax, %rdx
addq %rdx, %r15
addq %rdx, 0x50(%r14)
subl %eax, %ebp
movq $0x0, 0x80(%r14)
cmpl $0x0, 0x40(%r14)
je 0x224d5
movq 0x58(%r14), %rax
movq %rax, 0x48(%r14)
movq $0x0, 0x50(%r14)
movl $0x0, 0x40(%r14)
movq 0x68(%r14), %rsi
movq %r14, %rdi
callq 0x2254f
movl %eax, 0x84(%r14)
cmpl $0x0, 0x8c(%r14)
sete %cl
testl %eax, %eax
setne %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x2253b
testl %ebp, %ebp
jg 0x22467
jmp 0x2253b
movl %ebp, %eax
xorl %ecx, %ecx
movslq 0x80(%r14), %rdx
addq 0x68(%r14), %rdx
movb (%rcx,%rdx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x2250d
addl %ebp, 0x80(%r14)
subl %ebp, 0x84(%r14)
addq %rax, 0x50(%r14)
xorl %ebp, %ebp
subl %ebp, %ebx
movslq %ebx, %rax
addq %rax, 0x28(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_skip
int razf_skip(RAZF* rz, int size){
	int ori_size;
	ori_size = size;
	while(size > 0){
		if(rz->buf_len){
			if(size < rz->buf_len){
				rz->buf_off += size;
				rz->buf_len -= size;
				rz->block_off += size;
				size = 0;
				break;
			} else {
				size -= rz->buf_len;
				rz->buf_off = 0;
				rz->buf_len = 0;
				rz->block_off += rz->buf_len;
				if(rz->buf_flush){
					rz->block_pos = rz->next_block_pos;
					rz->block_off = 0;
					rz->buf_flush = 0;
				}
			}
		} else if(rz->buf_flush){
			rz->block_pos = rz->next_block_pos;
			rz->block_off = 0;
			rz->buf_flush = 0;
		}
		if(rz->buf_flush) continue;
		rz->buf_len = _razf_read(rz, rz->outbuf, RZ_BUFFER_SIZE);
		if(rz->z_eof || rz->z_err) break;
	}
	rz->out += ori_size - size;
	return ori_size - size;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %r14d
testl %esi, %esi
jle 0x2274f
movl 0x84(%rbx), %eax
movl %ebp, %ecx
testl %eax, %eax
je 0x2272d
movl %ecx, %r14d
subl %eax, %r14d
jl 0x22738
movq $0x0, 0x80(%rbx)
cmpl $0x0, 0x40(%rbx)
je 0x226ff
movq 0x58(%rbx), %rax
movq %rax, 0x48(%rbx)
movq $0x0, 0x50(%rbx)
movl $0x0, 0x40(%rbx)
movq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0x2254f
movl %eax, 0x84(%rbx)
cmpl $0x0, 0x8c(%rbx)
jne 0x2274f
cmpl $0x0, 0x88(%rbx)
jne 0x2274f
movl %r14d, %ecx
testl %r14d, %r14d
jg 0x226cb
jmp 0x2274f
cmpl $0x0, 0x40(%rbx)
movl %ecx, %r14d
jne 0x226e8
jmp 0x226ff
addl %ecx, 0x80(%rbx)
subl %ecx, %eax
movl %eax, 0x84(%rbx)
movl %ecx, %eax
addq %rax, 0x50(%rbx)
xorl %r14d, %r14d
subl %r14d, %ebp
movslq %ebp, %rax
addq %rax, 0x28(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_jump
int64_t razf_jump(RAZF *rz, int64_t block_start, int block_offset){
	int64_t pos;
	rz->z_eof = 0;
	if(rz->file_type == FILE_TYPE_PLAIN){
		rz->buf_off = rz->buf_len = 0;
		pos = block_start + block_offset;
#ifdef _USE_KNETFILE
		knet_seek(rz->x.fpr, pos, SEEK_SET);
        pos = knet_tell(rz->x.fpr);
#else
		pos = lseek(rz->filedes, pos, SEEK_SET);
#endif
		rz->out = rz->in = pos;
		return pos;
	}
	if(block_start == rz->block_pos && block_offset >= rz->block_off) {
		block_offset -= rz->block_off;
		goto SKIP; // Needn't reset inflate
	}
	if(block_start  == 0) block_start = rz->header_size; // Automaticly revist wrong block_start
	_razf_reset_read(rz, block_start, 0);
	SKIP:
	if(block_offset) razf_skip(rz, block_offset);
	return rz->block_off;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movl $0x0, 0x8c(%rdi)
cmpl $0x2, 0x4(%rdi)
jne 0x227a7
movq $0x0, 0x80(%rbx)
movslq %ebp, %rax
addq %rsi, %rax
movq 0x8(%rbx), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1cb7b
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rbx)
movq %rax, 0x28(%rbx)
jmp 0x227e2
cmpq %rsi, 0x48(%rbx)
jne 0x227b9
movslq %ebp, %rcx
movq 0x50(%rbx), %rax
cmpq %rcx, %rax
jle 0x227ce
testq %rsi, %rsi
jne 0x227c2
movslq 0x70(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x227e9
jmp 0x227d0
subl %eax, %ebp
testl %ebp, %ebp
je 0x227de
movq %rbx, %rdi
movl %ebp, %esi
callq 0x226af
movq 0x50(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_seek
int64_t razf_seek(RAZF* rz, int64_t pos, int where){
	int64_t idx;
	int64_t seek_pos, new_out;
	rz->z_eof = 0;
	if (where == SEEK_CUR) pos += rz->out;
	else if (where == SEEK_END) pos += rz->src_end;
	if(rz->file_type == FILE_TYPE_PLAIN){
#ifdef _USE_KNETFILE
		knet_seek(rz->x.fpr, pos, SEEK_SET);
        seek_pos = knet_tell(rz->x.fpr);
#else
		seek_pos = lseek(rz->filedes, pos, SEEK_SET);
#endif
		rz->buf_off = rz->buf_len = 0;
		rz->out = rz->in = seek_pos;
		return seek_pos;
	} else if(rz->file_type == FILE_TYPE_GZ){
		if(pos >= rz->out) goto SKIP;
		return rz->out;
	}
	if(pos == rz->out) return pos;
	if(pos > rz->src_end) return rz->out;
	if(!rz->seekable || !rz->load_index){
		if(pos >= rz->out) goto SKIP;
	}
	idx = pos / RZ_BLOCK_SIZE - 1;
	seek_pos = (idx < 0)? rz->header_size:(rz->index->cell_offsets[idx] + rz->index->bin_offsets[idx / RZ_BIN_SIZE]);
	new_out  = (idx + 1) * RZ_BLOCK_SIZE;
	if(pos > rz->out && new_out <= rz->out) goto SKIP;
	_razf_reset_read(rz, seek_pos, new_out);
	SKIP:
	razf_skip(rz, (int)(pos - rz->out));
	return rz->out;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, 0x8c(%rdi)
cmpl $0x1, %edx
je 0x22870
cmpl $0x2, %edx
jne 0x22879
movl $0x38, %eax
jmp 0x22875
movl $0x28, %eax
addq (%rbx,%rax), %r14
movl 0x4(%rbx), %eax
cmpl $0x3, %eax
je 0x228b1
cmpl $0x2, %eax
jne 0x228ce
movq 0x8(%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1cb7b
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x80(%rbx)
movq %rax, 0x20(%rbx)
movq %rax, 0x28(%rbx)
jmp 0x228e2
movq 0x28(%rbx), %rax
cmpq %rax, %r14
jl 0x228e2
subl %eax, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x226af
movq 0x28(%rbx), %rax
jmp 0x228e2
movq 0x28(%rbx), %rax
cmpq %rax, %r14
jne 0x228dc
movq %r14, %rax
jmp 0x228e2
cmpq 0x38(%rbx), %r14
jle 0x228ea
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x0, 0x90(%rbx)
je 0x228fc
cmpl $0x0, 0x94(%rbx)
jne 0x22901
cmpq %rax, %r14
jge 0x228ba
movl $0x7fff, %ecx           # imm = 0x7FFF
leaq (%r14,%rcx), %rdx
testq %r14, %r14
cmovnsq %r14, %rdx
sarq $0xf, %rdx
cmpq %rcx, %r14
jg 0x22920
movslq 0x70(%rbx), %rsi
jmp 0x2293b
leaq -0x1(%rdx), %rcx
movq 0x18(%rbx), %rsi
movq (%rsi), %rdi
movq 0x8(%rsi), %r8
movl -0x4(%rdi,%rdx,4), %esi
shrq $0x11, %rcx
addq (%r8,%rcx,8), %rsi
shlq $0xf, %rdx
cmpq %rax, %r14
setle %cl
cmpq %rax, %rdx
setg %dil
orb %cl, %dil
cmpb $0x1, %dil
jne 0x228ba
movq %rbx, %rdi
callq 0x227e9
movq 0x28(%rbx), %rax
jmp 0x228ba
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: razf_write
static void _razf_write(RAZF* rz, const void *data, int size){
	int tout;
	rz->stream->avail_in = size;
	rz->stream->next_in  = (void*)data;
	while(1){
		tout = rz->stream->avail_out;
		deflate(rz->stream, Z_NO_FLUSH);
		rz->out += tout - rz->stream->avail_out;
		if(rz->stream->avail_out) break;
#ifdef _USE_KNETFILE
		write(rz->x.fpw, rz->outbuf, RZ_BUFFER_SIZE - rz->stream->avail_out);
#else
		write(rz->filedes, rz->outbuf, RZ_BUFFER_SIZE - rz->stream->avail_out);
#endif
		rz->stream->avail_out = RZ_BUFFER_SIZE;
		rz->stream->next_out  = rz->outbuf;
		if(rz->stream->avail_in == 0) break;
	};
	rz->in += size - rz->stream->avail_in;
	rz->block_off += size - rz->stream->avail_in;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
movl %edx, 0x8(%rdi)
movq %rsi, (%rdi)
movl 0x20(%rdi), %r15d
xorl %esi, %esi
callq 0x3180
movq 0x10(%r14), %rax
movl 0x20(%rax), %ecx
subl %ecx, %r15d
addq %r15, 0x28(%r14)
testl %ecx, %ecx
jne 0x22c3a
movl 0x8(%r14), %edi
movq 0x68(%r14), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x3640
movq 0x10(%r14), %rdi
movl $0x1000, 0x20(%rdi)     # imm = 0x1000
movq 0x68(%r14), %rax
movq %rax, 0x18(%rdi)
movl $0x1000, %r15d          # imm = 0x1000
cmpl $0x0, 0x8(%rdi)
jne 0x22bec
xorl %eax, %eax
jmp 0x22c3d
movl 0x8(%rax), %eax
subl %eax, %ebx
addq %rbx, 0x20(%r14)
addq %rbx, 0x50(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/razf.c
// Function: load_zindex
static void load_zindex(RAZF *rz, int fd){
#endif
	int32_t i, v32;
	int is_be;
	if(!rz->load_index) return;
	if(rz->index == NULL) rz->index = malloc(sizeof(ZBlockIndex));
	is_be = is_big_endian();
#ifdef _USE_KNETFILE
	knet_read(fp, &rz->index->size, sizeof(int));
#else
	read(fd, &rz->index->size, sizeof(int));
#endif
	if(!is_be) rz->index->size = byte_swap_4((uint32_t)rz->index->size);
	rz->index->cap = rz->index->size;
	v32 = rz->index->size / RZ_BIN_SIZE + 1;
	rz->index->bin_offsets  = malloc(sizeof(int64_t) * v32);
#ifdef _USE_KNETFILE
	knet_read(fp, rz->index->bin_offsets, sizeof(int64_t) * v32);
#else
	read(fd, rz->index->bin_offsets, sizeof(int64_t) * v32);
#endif
	rz->index->cell_offsets = malloc(sizeof(int) * rz->index->size);
#ifdef _USE_KNETFILE
	knet_read(fp, rz->index->cell_offsets, sizeof(int) * rz->index->size);
#else
	read(fd, rz->index->cell_offsets, sizeof(int) * rz->index->size);
#endif
	if(!is_be){
		for(i=0;i<v32;i++) rz->index->bin_offsets[i] = byte_swap_8((uint64_t)rz->index->bin_offsets[i]);
		for(i=0;i<rz->index->size;i++) rz->index->cell_offsets[i] = byte_swap_4((uint32_t)rz->index->cell_offsets[i]);
	}
}

// Assembly:
cmpl $0x0, 0x94(%rdi)
je 0x22d44
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
jne 0x22c82
movl $0x18, %edi
callq 0x31d0
movq %rax, %rsi
movq %rax, 0x18(%rbx)
addq $0x10, %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x1cabb
movq 0x18(%rbx), %r12
movl 0x10(%r12), %ebp
bswapl %ebp
movl %ebp, 0x10(%r12)
movl %ebp, 0x14(%r12)
sarl $0x11, %ebp
movslq %ebp, %rax
leaq 0x8(,%rax,8), %r15
movq %r15, %rdi
callq 0x31d0
movq %rax, 0x8(%r12)
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1cabb
movq 0x18(%rbx), %r12
movslq 0x10(%r12), %r15
shlq $0x2, %r15
movq %r15, %rdi
callq 0x31d0
movq %rax, (%r12)
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1cabb
movq 0x18(%rbx), %rax
testl %ebp, %ebp
js 0x22d1d
incl %ebp
movq 0x8(%rax), %rcx
movl %ebp, %edx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
bswapq %rdi
movq %rdi, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x22d0a
cmpl $0x0, 0x10(%rax)
jle 0x22d3c
movq (%rax), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
bswapl %esi
movl %esi, (%rcx,%rdx,4)
incq %rdx
movslq 0x10(%rax), %rsi
cmpq %rsi, %rdx
jl 0x22d28
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/actor.cpp
// Function: Actor::create(int, int, int, int, int, double)
Actor *Actor::create(int gridsize_x, int gridsize_y, int proc_amt, int proc_num, int total_rounds, double worker_share)
{
    World *world = new World(gridsize_x, gridsize_y, proc_amt, total_rounds, worker_share);
    if (world->is_worker(proc_num))
    {
        return new Worker(world, proc_num);
    }
    else
    {
        return new Writer(world, proc_num);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movl %r8d, %ebp
movl %ecx, %ebx
movl %edx, %r15d
movl %esi, %r12d
movl %edi, %r13d
movl $0x38, %edi
callq 0x2170
movq %rax, %r14
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
movsd (%rsp), %xmm0
callq 0x3a38
movq %r14, %rdi
movl %ebx, %esi
callq 0x3ce2
testb %al, %al
je 0x2674
movl $0x48, %edi
callq 0x2170
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x26ec
jmp 0x268e
movl $0x38, %edi
callq 0x2170
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2ae0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x38, %esi
jmp 0x26b2
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
jmp 0x26c2
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/worker.cpp
// Function: Worker::Worker(World*, int)
Worker::Worker(World *world, int proc_num) : Actor(world, proc_num)
{
    block = new Active_block(world, proc_num);

    /* Borders */
    border_send_buffers = new unsigned char **[world->total_rounds];
    for (int r = 0; r < world->total_rounds; r++)
    {
        border_send_buffers[r] = new unsigned char *[Border_direction_count];
        for (int i = Border_direction_first; i <= Border_direction_last; i++)
        {
            Border_direction dir = (Border_direction)i;
            int buffer_size = block->get_border_size(dir);
            border_send_buffers[r][dir] = new unsigned char[buffer_size];
        }
    }
    border_send_requests = new MPI_Request *[world->total_rounds];
    for (int r = 0; r < world->total_rounds; r++)
    {
        border_send_requests[r] = new MPI_Request[Border_direction_count];
    }

    /* Block sends */
    block_send_buffers = new unsigned char *[world->total_rounds];
    for (int r = 0; r < world->total_rounds; r++)
    {
        block_send_buffers[r] = new unsigned char[block->width_byte * block->height];
    }
    block_send_requests = new MPI_Request[world->total_rounds];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x2598
leaq 0x4605(%rip), %rax      # 0x6d10
movq %rax, (%rbx)
movl $0x40, %edi
callq 0x2170
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2e0c
movq %r14, 0x20(%rbx)
movslq 0x28(%r15), %r13
leaq (,%r13,8), %r14
testq %r13, %r13
movq $-0x1, %r12
movq %r14, %rdi
cmovsq %r12, %rdi
callq 0x2030
movq %rax, 0x38(%rbx)
testq %r13, %r13
jle 0x27aa
xorl %ebp, %ebp
movl $0x40, %edi
callq 0x2030
movq 0x38(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
xorl %r14d, %r14d
movq 0x20(%rbx), %rdi
movl %r14d, %esi
callq 0x2fda
movslq %eax, %rdi
callq 0x2030
movq 0x38(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq $0x8, %r14
jne 0x276e
incq %rbp
movl 0x28(%r15), %r13d
movslq %r13d, %r14
cmpq %r14, %rbp
jl 0x2759
shlq $0x3, %r14
testl %r13d, %r13d
cmovsq %r12, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x40(%rbx)
testl %r13d, %r13d
jle 0x281d
movl %r13d, %r15d
xorl %r12d, %r12d
movl $0x40, %edi
callq 0x2030
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x27c8
movq %r14, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
testl %r13d, %r13d
jle 0x2829
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movslq 0x24(%rax), %rcx
movslq 0x20(%rax), %rdi
imulq %rcx, %rdi
callq 0x2030
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x27f6
jmp 0x2829
movq %r14, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x40, %esi
movq %r14, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/worker.cpp
// Function: Worker::store(int)
void Worker::store(int round)
{
    unsigned char *buffer_compressed = block_send_buffers[round];
    block->compress(buffer_compressed);
    int buffer_size = block->width_byte * block->height;
    int writer_num = world->get_writer_num(round);
    MPI_Isend(buffer_compressed, buffer_size, MPI_UNSIGNED_CHAR, writer_num, round, MPI_COMM_WORLD, &block_send_requests[round]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x20(%rdi), %rdi
movq 0x28(%r14), %rax
movslq %esi, %rbx
leaq (,%rbx,8), %r12
movq (%rax,%rbx,8), %r15
movq %r15, %rsi
callq 0x2f42
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rax
movl 0x20(%rax), %ebp
imull 0x24(%rax), %ebp
movl %ebx, %esi
callq 0x3d16
addq 0x30(%r14), %r12
movq %r12, (%rsp)
movq 0x46e9(%rip), %rdx      # 0x6fc0
movq 0x46d2(%rip), %r9       # 0x6fb0
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %ecx
movl %ebx, %r8d
callq 0x20a0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/worker.cpp
// Function: Worker::communicate(int)
void Worker::communicate(int round)
{
    for (int i = Border_direction_first; i <= Border_direction_last; i++)
    {
        Border_direction dir = (Border_direction)i;

        unsigned char *border_send_buffer = border_send_buffers[round][dir];
        MPI_Request *send_request = &border_send_requests[round][dir];
        block->wrap_border(dir, border_send_buffer);
        border_send(dir, border_send_buffer, send_request);
    }

    for (int i = Border_direction_first; i <= Border_direction_last; i++)
    {
        Border_direction dir = (Border_direction)i;

        int border_recv_buffer_size = block->get_border_size(dir);
        unsigned char border_recv_buffer[border_recv_buffer_size];

        border_recv(dir, border_recv_buffer);
        block->unwrap_border(dir, border_recv_buffer);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x20(%rbx), %rdi
movq 0x38(%rbx), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r14,8), %r15
movq 0x40(%rbx), %rax
movq (%rax,%rcx,8), %r12
addq %r13, %r12
movl %r14d, %esi
movq %r15, %rdx
callq 0x3276
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2a08
incq %r14
addq $0x8, %r13
cmpq $0x8, %r14
jne 0x2918
xorl %r14d, %r14d
movq 0x20(%rbx), %rdi
movl %r14d, %esi
callq 0x2fda
movq %rsp, %r12
movl %eax, %eax
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x2a62
movq 0x20(%rbx), %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x33e4
movq %r12, %rsp
incl %r14d
cmpl $0x8, %r14d
jne 0x2963
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/worker.cpp
// Function: Worker::border_recv(Border_direction, unsigned char*)
void Worker::border_recv(Border_direction source_dir, unsigned char *buffer)
{
    int element_count = block->get_border_size(source_dir);
    int source_block = block->get_neighbor_block_num(source_dir);
    int tag = opposite_direction(source_dir);
    MPI_Recv(buffer, element_count, MPI_UNSIGNED_CHAR, source_block, tag, worker_comm, MPI_STATUS_IGNORE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
movq 0x20(%rdi), %rdi
callq 0x2fda
movl %eax, %ebp
movq 0x20(%r14), %rdi
movl %r15d, %esi
callq 0x2ff4
xorl %r8d, %r8d
cmpl $0x7, %r15d
ja 0x2aa0
movl %r15d, %ecx
leaq 0x15e8(%rip), %rdx      # 0x4084
movl (%rdx,%rcx,4), %r8d
movq 0x18(%r14), %r9
movq $0x0, (%rsp)
movq 0x450d(%rip), %rdx      # 0x6fc0
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %ecx
callq 0x20f0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/writer.cpp
// Function: Writer::Writer(World*, int)
Writer::Writer(World *world, int proc_num) : Actor(world, proc_num)
{
    world->set_blocks();

    /* File write buffers */
    file_write_buffers = new char *[world->total_rounds];
    /* File write buffers are created at runtime,
     * since the header and block size can not yet be determined.
     */
    file_write_requests = new MPI_Request[world->total_rounds];

    file_handles = new MPI_File[world->total_rounds];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2598
leaq 0x4252(%rip), %rax      # 0x6d48
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x3c10
movslq 0x28(%r14), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %r14
cmovnsq %rcx, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/actors/writer.cpp
// Function: Writer::open_file(int)
MPI_File *Writer::open_file(int round)
{
    char filename[100];
    sprintf(filename, "./images/frame_%03d.pbm", round);
    MPI_File *file_handle = &file_handles[round];
    MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, file_handle);
    return file_handle;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1331(%rip), %rsi      # 0x40ae
movq %rsp, %r15
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2060
movslq %ebx, %rbx
shlq $0x3, %rbx
addq 0x30(%r14), %rbx
movq 0x423a(%rip), %rdi      # 0x6fd8
movq 0x422b(%rip), %rcx      # 0x6fd0
movq %r15, %rsi
movl $0x5, %edx
movq %rbx, %r8
callq 0x20c0
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::randomize()
void Active_block::randomize()
{
    srand(time(NULL) * block_num);
    for (int x = 1; x <= width; x++)
    {
        for (int y = 1; y <= height; y++)
        {

            grid[y][x] = (int)rand() % 100 < 35 ? 1 : 0;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2140
imull 0x8(%rbx), %eax
movl %eax, %edi
callq 0x2160
movl 0x1c(%rbx), %ecx
testl %ecx, %ecx
jle 0x2f3c
movl 0x20(%rbx), %eax
movl $0x1, %r14d
testl %eax, %eax
jle 0x2f2d
xorl %r15d, %r15d
callq 0x2070
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
cmpl $0x23, %eax
movq 0x30(%rbx), %rax
movq 0x8(%rax,%r15,8), %rax
setl (%rax,%r14)
movslq 0x20(%rbx), %rax
incq %r15
cmpq %rax, %r15
jl 0x2eed
movl 0x1c(%rbx), %ecx
leaq 0x1(%r14), %rdx
movslq %ecx, %rsi
cmpq %rsi, %r14
movq %rdx, %r14
jl 0x2ee6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::compress(unsigned char*)
void Active_block::compress(unsigned char *buffer)
{
    memset(buffer, 0, width_byte * height);
    for (int grid_y = 1; grid_y <= height; grid_y++)
    {
        for (int grid_x = 1; grid_x <= width; grid_x++)
        {
            /* Information about 8 cells are packed into one byte.
             * If the number of pixels in a row is not divisible by 8, 
             * the remaining bits are left empty.
             */
            if (grid[grid_y][grid_x] == 1)
            {
                int buffer_x = (grid_x - 1) / 8;
                int buffer_y = grid_y - 1;
                int k = (grid_x - 1) % 8;
                int buffer_pos = buffer_y * width_byte + buffer_x;
                buffer[buffer_pos] |= 1 << (7 - k);
            }
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x24(%rdi), %rax
movslq 0x20(%rdi), %rdx
imulq %rax, %rdx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x20b0
movl 0x20(%r14), %edx
testl %edx, %edx
jle 0x2fd2
movl 0x1c(%r14), %ecx
movl $0x1, %eax
testl %ecx, %ecx
jle 0x2fc3
leal -0x1(%rax), %edx
xorl %esi, %esi
movq 0x30(%r14), %rdi
movq (%rdi,%rax,8), %rdi
cmpb $0x1, 0x1(%rdi,%rsi)
jne 0x2fb4
movl %esi, %ecx
shrl $0x3, %ecx
movl 0x24(%r14), %edi
imull %edx, %edi
addl %ecx, %edi
movl %esi, %ecx
notb %cl
andb $0x7, %cl
movl $0x1, %r8d
shll %cl, %r8d
movslq %edi, %rcx
orb %r8b, (%rbx,%rcx)
movl 0x1c(%r14), %ecx
movslq %ecx, %rdi
incq %rsi
cmpq %rdi, %rsi
jl 0x2f7c
movl 0x20(%r14), %edx
leaq 0x1(%rax), %rsi
movslq %edx, %rdi
cmpq %rdi, %rax
movq %rsi, %rax
jl 0x2f73
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::get_neighbor_block_num(Border_direction)
int Active_block::get_neighbor_block_num(Border_direction dir)
{
    switch (dir)
    {
    case NORTH:
        return north();
    case SOUTH:
        return south();
    case WEST:
        return west();
    case EAST:
        return east();
    case NORTH_WEST:
        return north_west();
    case NORTH_EAST:
        return north_east();
    case SOUTH_WEST:
        return south_west();
    case SOUTH_EAST:
        return south_east();
    default:
        return -1;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x311c
movl %esi, %eax
leaq 0x10ca(%rip), %rcx      # 0x40d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rdi), %rax
movq (%rdi), %rcx
leaq 0xc(%rcx), %rdx
cmpb $0x0, 0x28(%rdi)
cmovneq %rdx, %rax
movl (%rax), %eax
decl %eax
imull 0x10(%rcx), %eax
addl 0xc(%rdi), %eax
retq
movq (%rdi), %rax
leaq 0x10(%rax), %rcx
leaq 0xc(%rdi), %rdx
cmpb $0x0, 0x29(%rdi)
cmovneq %rcx, %rdx
movl (%rdx), %ecx
leaq 0xc(%rax), %rdx
cmpb $0x0, 0x28(%rdi)
leaq 0x10(%rdi), %rsi
cmovneq %rdx, %rsi
movl (%rsi), %edx
decl %edx
imull 0x10(%rax), %edx
leal (%rcx,%rdx), %eax
decl %eax
retq
cmpb $0x1, 0x2b(%rdi)
jne 0x3122
movq (%rdi), %rax
movl 0x10(%rax), %eax
imull 0x10(%rdi), %eax
retq
cmpb $0x1, 0x29(%rdi)
jne 0x3134
movq (%rdi), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
jmp 0x313d
movl 0xc(%rdi), %ecx
incl %ecx
xorl %edx, %edx
cmpb $0x0, 0x2b(%rdi)
cmovnel %edx, %ecx
movl 0x10(%rdi), %eax
incl %eax
cmpb $0x0, 0x2a(%rdi)
cmovnel %edx, %eax
movq (%rdi), %rdx
jmp 0x30e8
movl 0xc(%rdi), %eax
cmpb $0x0, 0x2a(%rdi)
jne 0x30ee
movl 0x10(%rdi), %ecx
incl %ecx
movq (%rdi), %rdx
imull 0x10(%rdx), %ecx
jmp 0x30ec
movl 0xc(%rdi), %eax
incl %eax
xorl %ecx, %ecx
cmpb $0x0, 0x2b(%rdi)
cmovel %eax, %ecx
movq (%rdi), %rdx
leaq 0xc(%rdx), %rax
cmpb $0x0, 0x28(%rdi)
leaq 0x10(%rdi), %rsi
cmovneq %rax, %rsi
movl (%rsi), %eax
decl %eax
imull 0x10(%rdx), %eax
addl %ecx, %eax
retq
movq (%rdi), %rax
leaq 0x10(%rax), %rcx
leaq 0xc(%rdi), %rdx
cmpb $0x0, 0x29(%rdi)
cmovneq %rcx, %rdx
movl 0x10(%rdi), %ecx
incl %ecx
xorl %esi, %esi
cmpb $0x0, 0x2a(%rdi)
cmovel %ecx, %esi
movl (%rdx), %ecx
imull 0x10(%rax), %esi
leal (%rcx,%rsi), %eax
decl %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl 0xc(%rdi), %eax
movq (%rdi), %rcx
movl 0x10(%rcx), %ecx
imull 0x10(%rdi), %ecx
addl %ecx, %eax
incl %eax
retq
movl 0xc(%rdi), %ecx
movl 0x10(%rdi), %eax
movq (%rdi), %rdi
imull 0x10(%rdi), %eax
addl %ecx, %eax
decl %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::west()
int Active_block::west()
{
    if (first_col)
    {
        // left from first col is last col
        return position_to_block_num(world->cols - 1, y);
    }
    else
    {
        return position_to_block_num(x - 1, y);
    }
}

// Assembly:
cmpb $0x1, 0x29(%rdi)
jne 0x318e
movq (%rdi), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
jmp 0x3197
movl 0xc(%rdi), %ecx
movl 0x10(%rdi), %eax
movq (%rdi), %rdi
imull 0x10(%rdi), %eax
addl %ecx, %eax
decl %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::east()
int Active_block::east()
{
    if (last_col)
    {
        // right from last col is first col
        return position_to_block_num(0, y);
    }
    else
    {
        return position_to_block_num(x + 1, y);
    }
}

// Assembly:
cmpb $0x1, 0x2b(%rdi)
jne 0x31b1
movq (%rdi), %rax
movl 0x10(%rax), %eax
imull 0x10(%rdi), %eax
retq
movl 0xc(%rdi), %eax
movq (%rdi), %rcx
movl 0x10(%rcx), %ecx
imull 0x10(%rdi), %ecx
addl %ecx, %eax
incl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::wrap_border(Border_direction, unsigned char*)
void Active_block::wrap_border(Border_direction dir, unsigned char *buffer)
{
    switch (dir)
    {
    case NORTH:
        wrap_row(1, buffer);
        break;
    case SOUTH:
        wrap_row(height, buffer);
        break;
    case WEST:
        wrap_col(1, buffer);
        break;
    case EAST:
        wrap_col(width, buffer);
        break;
    case NORTH_WEST:
        wrap_corner(1, 1, buffer);
        break;
    case NORTH_EAST:
        wrap_corner(width, 1, buffer);
        break;
    case SOUTH_WEST:
        wrap_corner(1, height, buffer);
        break;
    case SOUTH_EAST:
        wrap_corner(width, height, buffer);
        break;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x3359
movl %esi, %eax
leaq 0xe68(%rip), %rcx       # 0x40f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1c(%rdi)
jle 0x3359
xorl %eax, %eax
movq 0x30(%rdi), %rcx
movq 0x8(%rcx), %rcx
movb 0x1(%rcx,%rax), %cl
movb %cl, (%rdx,%rax)
movslq 0x1c(%rdi), %rcx
incq %rax
cmpq %rcx, %rax
jl 0x329d
jmp 0x3359
movq 0x30(%rdi), %rax
movq 0x8(%rax), %rax
jmp 0x3374
cmpl $0x0, 0x20(%rdi)
jle 0x3359
movslq 0x1c(%rdi), %rax
xorl %ecx, %ecx
movq 0x30(%rdi), %rsi
movq 0x8(%rsi,%rcx,8), %rsi
movb (%rsi,%rax), %sil
movb %sil, (%rdx,%rcx)
movslq 0x20(%rdi), %rsi
incq %rcx
cmpq %rsi, %rcx
jl 0x32da
jmp 0x3359
cmpl $0x0, 0x20(%rdi)
jle 0x3359
xorl %eax, %eax
movq 0x30(%rdi), %rcx
movq 0x8(%rcx,%rax,8), %rcx
movb 0x1(%rcx), %cl
movb %cl, (%rdx,%rax)
movslq 0x20(%rdi), %rcx
incq %rax
cmpq %rcx, %rax
jl 0x3301
jmp 0x3359
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq 0x30(%rdi), %rsi
addq (%rsi,%rcx,8), %rax
jmp 0x3377
cmpl $0x0, 0x1c(%rdi)
jle 0x3359
movslq 0x20(%rdi), %rax
xorl %ecx, %ecx
movq 0x30(%rdi), %rsi
movq (%rsi,%rax,8), %rsi
movb 0x1(%rsi,%rcx), %sil
movb %sil, (%rdx,%rcx)
movslq 0x1c(%rdi), %rsi
incq %rcx
cmpq %rsi, %rcx
jl 0x333c
retq
movslq 0x1c(%rdi), %rax
movq 0x30(%rdi), %rcx
addq 0x8(%rcx), %rax
jmp 0x3377
movslq 0x20(%rdi), %rax
movq 0x30(%rdi), %rcx
movq (%rcx,%rax,8), %rax
incq %rax
movb (%rax), %al
movb %al, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::unwrap_border(Border_direction, unsigned char*)
void Active_block::unwrap_border(Border_direction dir, unsigned char *buffer)
{
    switch (dir)
    {
    case NORTH:
        unwrap_row(0, buffer);
        break;
    case SOUTH:
        unwrap_row(height + 1, buffer);
        break;
    case WEST:
        unwrap_col(0, buffer);
        break;
    case EAST:
        unwrap_col(width + 1, buffer);
        break;
    case NORTH_WEST:
        unwrap_corner(0, 0, buffer);
        break;
    case NORTH_EAST:
        unwrap_corner(width + 1, 0, buffer);
        break;
    case SOUTH_WEST:
        unwrap_corner(0, height + 1, buffer);
        break;
    case SOUTH_EAST:
        unwrap_corner(width + 1, height + 1, buffer);
        break;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x341d
movl %esi, %eax
leaq 0xd1e(%rip), %rcx       # 0x4110
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1c(%rdi)
jle 0x341d
xorl %eax, %eax
movb (%rdx,%rax), %cl
movq 0x30(%rdi), %rsi
movq (%rsi), %rsi
movb %cl, 0x1(%rsi,%rax)
movslq 0x1c(%rdi), %rcx
incq %rax
cmpq %rcx, %rax
jl 0x3403
retq
movb (%rdx), %al
movq 0x30(%rdi), %rcx
movq (%rcx), %rcx
movb %al, (%rcx)
retq
cmpl $0x0, 0x20(%rdi)
jle 0x341d
movslq 0x1c(%rdi), %rax
xorl %ecx, %ecx
movb (%rdx,%rcx), %sil
movq 0x30(%rdi), %r8
movq 0x8(%r8,%rcx,8), %r8
movb %sil, 0x1(%r8,%rax)
movslq 0x20(%rdi), %rsi
incq %rcx
cmpq %rsi, %rcx
jl 0x3436
jmp 0x341d
cmpl $0x0, 0x20(%rdi)
jle 0x341d
xorl %eax, %eax
movb (%rdx,%rax), %cl
movq 0x30(%rdi), %rsi
movq 0x8(%rsi,%rax,8), %rsi
movb %cl, (%rsi)
movslq 0x20(%rdi), %rcx
incq %rax
cmpq %rcx, %rax
jl 0x345e
jmp 0x341d
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movb (%rdx), %dl
movq 0x30(%rdi), %rsi
movq 0x8(%rsi,%rcx,8), %rcx
movb %dl, 0x1(%rcx,%rax)
retq
cmpl $0x0, 0x1c(%rdi)
jle 0x341d
movslq 0x20(%rdi), %rax
xorl %ecx, %ecx
movb (%rdx,%rcx), %sil
movq 0x30(%rdi), %r8
movq 0x8(%r8,%rax,8), %r8
movb %sil, 0x1(%r8,%rcx)
movslq 0x1c(%rdi), %rsi
incq %rcx
cmpq %rsi, %rcx
jl 0x349e
jmp 0x341d
movslq 0x1c(%rdi), %rax
movb (%rdx), %cl
movq 0x30(%rdi), %rdx
movq (%rdx), %rdx
movb %cl, 0x1(%rdx,%rax)
retq
movslq 0x20(%rdi), %rax
movb (%rdx), %cl
movq 0x30(%rdi), %rdx
movq 0x8(%rdx,%rax,8), %rax
movb %cl, (%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::step()
void Active_block::step()
{
    for (int y = 1; y <= height; y++)
    {
        for (int x = 1; x <= width; x++)
        {
            int neighbours;
            neighbours = get_neighbors(x, y);
            next_grid[y][x] = is_alive(neighbours, grid[y][x]);
        }
    }

    //swap pointers
    unsigned char **swap = grid;
    grid = next_grid;
    next_grid = swap;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x20(%rdi), %ecx
testl %ecx, %ecx
jle 0x35ca
movl 0x1c(%rbx), %eax
movl $0x1, %r14d
testl %eax, %eax
jle 0x35bb
movl $0x1, %r15d
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x35e0
cmpl $0x3, %eax
je 0x3596
cmpl $0x2, %eax
jne 0x359a
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rax
movb (%rax,%r15), %al
jmp 0x359c
movb $0x1, %al
jmp 0x359c
xorl %eax, %eax
movq 0x38(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movb %al, (%rcx,%r15)
leaq 0x1(%r15), %rcx
movslq 0x1c(%rbx), %rax
cmpq %rax, %r15
movq %rcx, %r15
jl 0x3570
movl 0x20(%rbx), %ecx
leaq 0x1(%r14), %rdx
movslq %ecx, %rsi
cmpq %rsi, %r14
movq %rdx, %r14
jl 0x3566
movdqu 0x30(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x30(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::get_neighbors(int, int)
int Active_block::get_neighbors(int pixel_x, int pixel_y)
{
    int sum = 0;
    // Pixels in row above and below
    for (int i = 0; i < 3; ++i)
    {
        sum += grid[pixel_y - 1][pixel_x - 1 + i];
        sum += grid[pixel_y + 1][pixel_x - 1 + i];
    }
    // Pixels left and right
    sum += grid[pixel_y][pixel_x - 1];
    sum += grid[pixel_y][pixel_x + 1];
    return sum;
}

// Assembly:
movq 0x30(%rdi), %rcx
movslq %edx, %rdx
movslq %esi, %rax
movq -0x8(%rcx,%rdx,8), %rdi
addq %rax, %rdi
movq 0x8(%rcx,%rdx,8), %r8
addq %rax, %r8
xorl %esi, %esi
movq $-0x1, %r9
movzbl (%rdi,%r9), %r10d
addl %esi, %r10d
movzbl (%r8,%r9), %esi
addl %r10d, %esi
incq %r9
cmpq $0x2, %r9
jne 0x3603
movq (%rcx,%rdx,8), %rcx
movzbl -0x1(%rcx,%rax), %edx
addl %edx, %esi
movzbl 0x1(%rcx,%rax), %eax
addl %esi, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::print_grid()
void Active_block::print_grid()
{
    // Print the current blocks adress
    printf("Active_block [%d, %d]:\n", x, y);

    // Print all the assigned pixels without the borders
    for (int y = 0; y < height + 2; y++)
    {
        if (y == width + 1)
        {
            printf("\n");
        }
        for (int x = 0; x < width + 2; x++)
        {
            if (x == width + 1)
            {
                printf("\t");
            }
            if (grid[y][x])
            {
                printf("X");
            }
            else
            {
                printf("-");
            }
            if (x == 0)
            {
                printf("\t");
            }
        }
        printf("\n");
        if (y == 0)
        {
            printf("\n");
        }
    }
    printf("\n\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movl 0x10(%rdi), %edx
leaq 0x9ea(%rip), %rdi       # 0x41cf
xorl %eax, %eax
callq 0x2040
cmpl $-0x1, 0x20(%rbx)
jl 0x3894
xorl %r14d, %r14d
movl 0x1c(%rbx), %eax
leal 0x1(%rax), %ecx
cmpq %rcx, %r14
jne 0x3811
movl $0xa, %edi
callq 0x21d0
movl 0x1c(%rbx), %eax
cmpl $-0x1, %eax
jl 0x3867
xorl %r15d, %r15d
incl %eax
cmpq %rax, %r15
jne 0x382a
movl $0x9, %edi
callq 0x21d0
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rax
cmpb $0x0, (%rax,%r15)
movl $0x2d, %edi
je 0x3843
movl $0x58, %edi
callq 0x21d0
testq %r15, %r15
jne 0x3857
movl $0x9, %edi
callq 0x21d0
leaq 0x1(%r15), %rcx
movslq 0x1c(%rbx), %rax
cmpq %rax, %r15
movq %rcx, %r15
jle 0x3819
movl $0xa, %edi
callq 0x21d0
testq %r14, %r14
jne 0x3880
movl $0xa, %edi
callq 0x21d0
leaq 0x1(%r14), %rax
movslq 0x20(%rbx), %rcx
cmpq %rcx, %r14
movq %rax, %r14
jle 0x37f9
leaq 0x8a9(%rip), %rdi       # 0x4144
popq %rbx
popq %r14
popq %r15
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: print_unsigned_char_array(unsigned char*, int)
void print_unsigned_char_array(unsigned char *arr, int size)
{
    printf("[");
    for (int i = 0; i < size; i++)
    {
        if (i > 0)
        {
            printf(", ");
        }
        printf("%d", arr[i]);
    }
    printf("]\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl $0x5b, %edi
callq 0x21d0
testl %ebp, %ebp
jle 0x38fd
movl %ebp, %r12d
leaq 0x91d(%rip), %r14       # 0x41ea
leaq 0x913(%rip), %r15       # 0x41e7
xorl %r13d, %r13d
testq %r13, %r13
je 0x38e6
movq %r15, %rdi
xorl %eax, %eax
callq 0x2040
movzbl (%rbx,%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2040
incq %r13
cmpq %r13, %r12
jne 0x38d7
leaq 0x90e(%rip), %rdi       # 0x4212
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/world.cpp
// Function: World::set_blocks()
void World::set_blocks()
{
    blocks = new Block **[rows];
    for (int row = 0; row < rows; row++)
    {
        blocks[row] = new Block *[cols];
        for (int col = 0; col < cols; col++)
        {
            int block_num = row * cols + col;
            blocks[row][col] = new Block(this, block_num);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xc(%rdi), %r15
leaq (,%r15,8), %rdi
testq %r15, %r15
movq $-0x1, %r12
cmovsq %r12, %rdi
callq 0x2030
movq %rax, 0x30(%rbx)
testq %r15, %r15
jle 0x3cba
movl 0x10(%rbx), %r14d
xorl %r13d, %r13d
movslq %r14d, %rbp
leaq (,%rbp,8), %rdi
testl %ebp, %ebp
cmovsq %r12, %rdi
callq 0x2030
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
testl %ebp, %ebp
jle 0x3caf
xorl %ebp, %ebp
imull %r13d, %r14d
addl %ebp, %r14d
movl $0x30, %edi
callq 0x2170
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x3918
movq 0x30(%rbx), %rax
movq (%rax,%r13,8), %rax
movq %r15, (%rax,%rbp,8)
incq %rbp
movslq 0x10(%rbx), %r14
cmpq %r14, %rbp
jl 0x3c71
movl 0xc(%rbx), %r15d
incq %r13
movslq %r15d, %rax
cmpq %rax, %r13
jl 0x3c4d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x30, %esi
movq %r15, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/world.cpp
// Function: World::is_worker(int)
bool World::is_worker(int proc_num)
{
    // Processor proc_num is a worker,
    // as long as it does not appear in the writer array
    for (int w = 0; w < writer_amt; w++)
    {
        if (writer_nums[w] == proc_num)
        {
            return false;
        }
    }
    return true;
}

// Assembly:
movslq 0x1c(%rdi), %rax
testq %rax, %rax
jle 0x3cf6
movq 0x20(%rdi), %rcx
cmpl %esi, (%rcx)
jne 0x3cf9
xorl %eax, %eax
retq
movb $0x1, %al
retq
movl $0x1, %edi
movq %rdi, %rdx
cmpq %rdi, %rax
je 0x3d0f
leaq 0x1(%rdx), %rdi
cmpl %esi, (%rcx,%rdx,4)
jne 0x3cfe
cmpq %rax, %rdx
setae %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/Gammelkebab[P]GameOfLife/src/world/world.cpp
// Function: World::print()
void World::print()
{
    printf("World:\n{\n");
    printf("\tPixels: \t%d x %d\n", width, height);
    printf("\tBlocks: \t%d x %d\n", cols, rows);
    printf("\tWorkers: \t%d\n", worker_amt);
    printf("\tTotal rounds: \t%d\n", total_rounds);
    printf("\n}\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x566(%rip), %rdi       # 0x4299
callq 0x2210
movl (%rbx), %esi
movl 0x4(%rbx), %edx
leaq 0x50c(%rip), %rdi       # 0x4250
xorl %eax, %eax
callq 0x2040
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %esi
leaq 0x50b(%rip), %rdi       # 0x4263
xorl %eax, %eax
callq 0x2040
movl 0x18(%rbx), %esi
leaq 0x50d(%rip), %rdi       # 0x4276
xorl %eax, %eax
callq 0x2040
movl 0x28(%rbx), %esi
leaq 0x50b(%rip), %rdi       # 0x4285
xorl %eax, %eax
callq 0x2040
leaq 0x51a(%rip), %rdi       # 0x42a2
popq %rbx
jmp 0x2210