LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_get_start_time
double plm_demux_get_start_time(plm_demux_t *self, int type) {
	if (self->start_time != PLM_PACKET_INVALID_TS) {
		return self->start_time;
	}

	int previous_pos = plm_buffer_tell(self->buffer);
	int previous_start_code = self->start_code;
	
	// Find first video PTS
	plm_demux_rewind(self);
	do {
		plm_packet_t *packet = plm_demux_decode(self);
		if (!packet) {
			break;
		}
		if (packet->type == type) {
			self->start_time = packet->pts;
		}
	} while (self->start_time == PLM_PACKET_INVALID_TS);

	plm_demux_buffer_seek(self, previous_pos);
	self->start_code = previous_start_code;
	return self->start_time;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movsd 0x28(%rdi), %xmm0
ucomisd 0x5495(%rip), %xmm0     # 0x9008
jne 0x3c25
jp 0x3c25
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x48(%r14), %rax
testq %rax, %rax
je 0x3ba9
movq 0x50(%r14), %rsi
movq %r14, %rdi
callq *%rax
movq (%r14), %r15
shrq $0x3, %r15
addq %rax, %r15
subq 0x10(%r14), %r15
jmp 0x3bb0
movq (%r14), %r15
shrq $0x3, %r15
movl 0x38(%rbx), %r14d
movq (%rbx), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x430a
movq %r12, 0x60(%rbx)
movq %r12, 0x80(%rbx)
movl $0xffffffff, 0x38(%rbx) # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x387e
testq %rax, %rax
je 0x3c04
cmpl %ebp, (%rax)
jne 0x3bee
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x28(%rbx)
testq %rax, %rax
je 0x3c04
movsd 0x28(%rbx), %xmm0
ucomisd 0x5408(%rip), %xmm0     # 0x9008
jne 0x3c04
jnp 0x3bd3
movslq %r15d, %rsi
movq (%rbx), %rdi
callq 0x430a
xorl %eax, %eax
movq %rax, 0x60(%rbx)
movq %rax, 0x80(%rbx)
movl %r14d, 0x38(%rbx)
movsd 0x28(%rbx), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_seek
int plm_seek(plm_t *self, double time, int seek_exact) {
	plm_frame_t *frame = plm_seek_frame(self, time, seek_exact);
	
	if (!frame) {
		return FALSE;
	}

	if (self->video_decode_callback) {
		self->video_decode_callback(self, frame, self->video_decode_callback_user_data);	
	}

	// If audio is not enabled we are done here.
	if (!self->audio_packet_type) {
		return TRUE;
	}

	// Sync up Audio. This demuxes more packets until the first audio packet
	// with a PTS greater than the current time is found. plm_decode() is then
	// called to decode enough audio data to satisfy the audio_lead_time.

	double start_time = plm_demux_get_start_time(self->demux, self->video_packet_type);
	plm_audio_rewind(self->audio_decoder);

	plm_packet_t *packet = NULL;
	while ((packet = plm_demux_decode(self->demux))) {
		if (packet->type == self->video_packet_type) {
			plm_buffer_write(self->video_buffer, packet->data, packet->length);
		}
		else if (
			packet->type == self->audio_packet_type &&
			packet->pts - start_time > self->time
		) {
			plm_audio_set_time(self->audio_decoder, packet->pts - start_time);
			plm_buffer_write(self->audio_buffer, packet->data, packet->length);
			plm_decode(self, 0);
			break;
		}
	}	
	
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x39f1
testq %rax, %rax
je 0x40d9
movq 0x60(%rbx), %rcx
testq %rcx, %rcx
je 0x4017
movq 0x68(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq *%rcx
movl $0x1, %ebp
cmpl $0x0, 0x40(%rbx)
je 0x40db
movq (%rbx), %rdi
movl 0x20(%rbx), %esi
callq 0x3b5e
movsd %xmm0, (%rsp)
movq 0x58(%rbx), %r14
movq 0x30(%r14), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x430a
movq $0x0, (%r14)
movl %r15d, 0x8(%r14)
movl %r15d, 0x28(%r14)
movq (%rbx), %rdi
callq 0x387e
testq %rax, %rax
je 0x40db
movl (%rax), %ecx
cmpl 0x20(%rbx), %ecx
jne 0x407e
movq 0x28(%rbx), %rdi
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rsi
callq 0x394d
jmp 0x4057
cmpl 0x40(%rbx), %ecx
jne 0x4057
movsd 0x8(%rax), %xmm0
subsd (%rsp), %xmm0
ucomisd 0x8(%rbx), %xmm0
jbe 0x4057
movq 0x58(%rbx), %rcx
movslq 0xc(%rcx), %rdx
leaq 0x4fbd(%rip), %rsi      # 0x9060
movzwl (%rsi,%rdx,2), %edx
cvtsi2sd %edx, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl %edx, 0x8(%rcx)
movsd %xmm0, (%rcx)
movq 0x50(%rbx), %rdi
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rsi
callq 0x394d
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x33a3
jmp 0x40db
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_load_file_callback
void plm_buffer_load_file_callback(plm_buffer_t *self, void *user) {
	PLM_UNUSED(user);
	
	if (self->discard_read_bytes) {
		plm_buffer_discard_read_bytes(self);
	}

	size_t bytes_available = self->capacity - self->length;
	size_t bytes_read = fread(self->bytes + self->length, 1, bytes_available, self->fh);
	self->length += bytes_read;

	if (bytes_read == 0) {
		self->has_ended = TRUE;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
je 0x411d
movq %rbx, %rdi
callq 0x42b2
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rdi
subq %rdi, %rdx
addq 0x58(%rbx), %rdi
movq 0x30(%rbx), %rcx
movl $0x1, %esi
callq 0x2210
addq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x414a
movl $0x1, 0x24(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_with_callbacks
plm_buffer_t *plm_buffer_create_with_callbacks(
	plm_buffer_load_callback load_callback,
	plm_buffer_seek_callback seek_callback,
	plm_buffer_tell_callback tell_callback,
	size_t length,
	void *user
) {
	plm_buffer_t *self = plm_buffer_create_with_capacity(PLM_BUFFER_DEFAULT_SIZE);
	self->mode = PLM_BUFFER_MODE_FILE;
	self->total_size = length;
	self->load_callback = load_callback;
	self->seek_callback = seek_callback;
	self->tell_callback = tell_callback;
	self->load_callback_user_data = user;
	return self;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl $0x68, %edi
callq 0x2200
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movq $0x0, 0x60(%rax)
movq $0x20000, 0x8(%rax)     # imm = 0x20000
movl $0x1, %ebx
movl %ebx, 0x28(%rax)
movl $0x20000, %edi          # imm = 0x20000
callq 0x2200
movq %rax, 0x58(%rbp)
movl %ebx, 0x20(%rbp)
movl $0x0, 0x60(%rbp)
movq %r14, 0x18(%rbp)
movq %r13, 0x38(%rbp)
movq %r12, 0x40(%rbp)
movq %r15, 0x48(%rbp)
movq (%rsp), %rax
movq %rax, 0x50(%rbp)
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_create_for_appending
plm_buffer_t *plm_buffer_create_for_appending(size_t initial_capacity) {
	plm_buffer_t *self = plm_buffer_create_with_capacity(initial_capacity);
	self->mode = PLM_BUFFER_MODE_APPEND;
	self->discard_read_bytes = FALSE;
	return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x68, %edi
callq 0x2200
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movq $0x0, 0x60(%rax)
movq %rbx, 0x8(%rax)
movl $0x1, 0x28(%rax)
movq %rbx, %rdi
callq 0x2200
movq %rax, 0x58(%r14)
movl $0x3, 0x60(%r14)
movl $0x0, 0x20(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_destroy
void plm_buffer_destroy(plm_buffer_t *self) {
#ifndef PLM_NO_STDIO
	if (self->fh && self->close_when_done) {
		fclose(self->fh);
	}
#endif
	if (self->free_when_done) {
		PLM_FREE(self->bytes);
	}
	PLM_FREE(self);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x427c
cmpl $0x0, 0x2c(%rbx)
je 0x427c
callq 0x2160
cmpl $0x0, 0x28(%rbx)
je 0x428b
movq 0x58(%rbx), %rdi
callq 0x21b0
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_discard_read_bytes
void plm_buffer_discard_read_bytes(plm_buffer_t *self) {
	size_t byte_pos = self->bit_index >> 3;
	if (byte_pos == self->length) {
		self->bit_index = 0;
		self->length = 0;
	}
	else if (byte_pos > 0) {
		memmove(self->bytes, self->bytes + byte_pos, self->length - byte_pos);
		self->bit_index -= byte_pos << 3;
		self->length -= byte_pos;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x10(%rdi), %rdx
movq %r15, %r14
shrq $0x3, %r14
subq %r14, %rdx
jne 0x42d8
movq $0x0, (%rbx)
xorl %eax, %eax
jmp 0x42f9
cmpq $0x8, %r15
jb 0x42fd
movq 0x58(%rbx), %rdi
leaq (%rdi,%r14), %rsi
callq 0x2240
andq $-0x8, %r15
subq %r15, (%rbx)
movq 0x10(%rbx), %rax
subq %r14, %rax
movq %rax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_seek
void plm_buffer_seek(plm_buffer_t *self, size_t pos) {
	self->has_ended = FALSE;

	if (self->seek_callback) {
		self->seek_callback(self, pos, self->load_callback_user_data);
		self->bit_index = 0;
		self->length = 0;
	}
	else if (self->mode == PLM_BUFFER_MODE_RING) {
		if (pos != 0) {
			// Seeking to non-0 is forbidden for dynamic-mem buffers
			return; 
		}
		self->bit_index = 0;
		self->length = 0;
		self->total_size = 0;
	}
	else if (pos < self->length) {
		self->bit_index = pos << 3;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x0, 0x24(%rdi)
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x4332
movq 0x50(%rbx), %rdx
movq %rbx, %rdi
callq *%rax
xorl %eax, %eax
movq %rax, (%rbx)
movq %rax, 0x10(%rbx)
popq %rbx
retq
cmpl $0x2, 0x60(%rbx)
jne 0x434d
testq %rsi, %rsi
jne 0x4330
movq $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x4330
cmpq %rsi, 0x10(%rbx)
jbe 0x4330
shlq $0x3, %rsi
movq %rsi, (%rbx)
jmp 0x4330
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_has
int plm_buffer_has(plm_buffer_t *self, size_t count) {
	if (((self->length << 3) - self->bit_index) >= count) {
		return TRUE;
	}

	if (self->load_callback) {
		self->load_callback(self, self->load_callback_user_data);
		
		if (((self->length << 3) - self->bit_index) >= count) {
			return TRUE;
		}
	}	
	
	if (self->total_size != 0 && self->length == self->total_size) {
		self->has_ended = TRUE;
	}
	return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
shlq $0x3, %rax
subq (%rdi), %rax
movl $0x1, %ebx
cmpq %rsi, %rax
jae 0x43ed
movq %rdi, %r14
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x43d4
movq %rsi, %r15
movq 0x50(%r14), %rsi
movq %r14, %rdi
callq *%rax
movq 0x10(%r14), %rax
shlq $0x3, %rax
subq (%r14), %rax
cmpq %r15, %rax
jae 0x43ed
movq 0x18(%r14), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x43ed
cmpq %rax, 0x10(%r14)
jne 0x43ed
movl $0x1, 0x24(%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_read
int plm_buffer_read(plm_buffer_t *self, int count) {
	if (!plm_buffer_has(self, count)) {
		return 0;
	}

	int value = 0;
	while (count) {
		int current_byte = self->bytes[self->bit_index >> 3];

		int remaining = 8 - (self->bit_index & 7); // Remaining bits in byte
		int read = remaining < count ? remaining : count; // Bits in self run
		int shift = remaining - read;
		int mask = (0xff >> (8 - read));

		value = (value << read) | ((current_byte & (mask << shift)) >> shift);

		self->bit_index += read;
		count -= read;
	}

	return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movslq %esi, %r15
movq %r15, %rsi
callq 0x4392
testl %eax, %eax
sete %cl
testl %r15d, %r15d
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x4474
movq (%r14), %rdi
movq 0x58(%r14), %r8
xorl %eax, %eax
movq %rdi, %r9
shrq $0x3, %r9
movl %edi, %ecx
andl $0x7, %ecx
movl $0x8, %edx
subl %ecx, %edx
cmpl %ebx, %edx
movl %ebx, %esi
cmovll %edx, %esi
subl %esi, %edx
movb $0x8, %cl
subb %sil, %cl
movl $0xff, %r10d
shrl %cl, %r10d
movl %esi, %ecx
shll %cl, %eax
movl %edx, %ecx
shll %cl, %r10d
movzbl (%r8,%r9), %ecx
andl %ecx, %r10d
movl %edx, %ecx
shrl %cl, %r10d
orl %r10d, %eax
movslq %esi, %rcx
addq %rcx, %rdi
movq %rdi, (%r14)
subl %ecx, %ebx
jne 0x4424
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_skip_bytes
int plm_buffer_skip_bytes(plm_buffer_t *self, uint8_t v) {
	plm_buffer_align(self);
	int skipped = 0;
	while (plm_buffer_has(self, 8) && self->bytes[self->bit_index >> 3] == v) {
		self->bit_index += 8;
		skipped++;
	}
	return skipped;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
addq $0x7, %rax
andq $-0x8, %rax
movq %rax, (%rdi)
movl $0x8, %esi
callq 0x4392
xorl %ebp, %ebp
testl %eax, %eax
je 0x44f9
movq (%r14), %rax
movq 0x58(%r14), %rcx
movq %rax, %rdx
shrq $0x3, %rdx
cmpb %bl, (%rcx,%rdx)
jne 0x44f9
addq $0x8, %rax
movq %rax, (%r14)
incl %ebp
movl $0x8, %esi
movq %r14, %rdi
callq 0x4392
jmp 0x44ca
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_next_start_code
int plm_buffer_next_start_code(plm_buffer_t *self) {
	plm_buffer_align(self);

	while (plm_buffer_has(self, (5 << 3))) {
		size_t byte_index = (self->bit_index) >> 3;
		if (
			self->bytes[byte_index] == 0x00 &&
			self->bytes[byte_index + 1] == 0x00 &&
			self->bytes[byte_index + 2] == 0x01
		) {
			self->bit_index = (byte_index + 4) << 3;
			return self->bytes[byte_index + 3];
		}
		self->bit_index += 8;
	}
	return -1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
addq $0x7, %rax
andq $-0x8, %rax
movq %rax, (%rdi)
movl $0x28, %esi
movq %rbx, %rdi
callq 0x4392
testl %eax, %eax
je 0x456a
movq (%rbx), %rax
movq 0x58(%rbx), %rcx
movq %rax, %rdx
shrq $0x3, %rdx
cmpb $0x0, (%rcx,%rdx)
jne 0x455b
cmpb $0x0, 0x1(%rcx,%rdx)
jne 0x455b
cmpb $0x1, 0x2(%rcx,%rdx)
jne 0x455b
andq $-0x8, %rax
addq $0x20, %rax
movq %rax, (%rbx)
movzbl 0x3(%rcx,%rdx), %ebp
xorl %eax, %eax
jmp 0x4564
addq $0x8, %rax
movq %rax, (%rbx)
movb $0x1, %al
testb %al, %al
jne 0x4514
jmp 0x456f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_find_start_code
int plm_buffer_find_start_code(plm_buffer_t *self, int code) {
	int current = 0;
	while (TRUE) {
		current = plm_buffer_next_start_code(self);
		if (current == code || current == -1) {
			return current;
		}
	}
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq %r14, %rdi
callq 0x4500
cmpl %ebx, %eax
je 0x4592
cmpl $-0x1, %eax
jne 0x4581
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_has_start_code
int plm_buffer_has_start_code(plm_buffer_t *self, int code) {
	size_t previous_bit_index = self->bit_index;
	int previous_discard_read_bytes = self->discard_read_bytes;
	
	self->discard_read_bytes = FALSE;
	int current = plm_buffer_find_start_code(self, code);

	self->bit_index = previous_bit_index;
	self->discard_read_bytes = previous_discard_read_bytes;
	return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r14
movl 0x20(%rdi), %r15d
movl $0x0, 0x20(%rdi)
movq %rbx, %rdi
callq 0x4500
cmpl %ebp, %eax
je 0x45c5
cmpl $-0x1, %eax
jne 0x45b4
movq %r14, (%rbx)
movl %r15d, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_peek_non_zero
int plm_buffer_peek_non_zero(plm_buffer_t *self, int bit_count) {
	if (!plm_buffer_has(self, bit_count)) {
		return FALSE;
	}

	int val = plm_buffer_read(self, bit_count);
	self->bit_index -= bit_count;
	return val != 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r14
movq %r14, %rsi
callq 0x4392
testl %eax, %eax
je 0x4606
movq %rbx, %rdi
movl %r14d, %esi
callq 0x43f5
subq %r14, (%rbx)
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x4608
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_buffer_read_vlc
int16_t plm_buffer_read_vlc(plm_buffer_t *self, const plm_vlc_t *table) {
	plm_vlc_t state = {0, 0};
	do {
		state = table[state.index + plm_buffer_read(self, 1)];
	} while (state.index > 0);
	return state.value;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movzwl %ax, %ebp
movq %r14, %rdi
movl $0x1, %esi
callq 0x43f5
addl %ebp, %eax
movslq %eax, %rcx
movzwl (%rbx,%rcx,4), %eax
testw %ax, %ax
jg 0x461c
movzwl 0x2(%rbx,%rcx,4), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_decode_time
double plm_demux_decode_time(plm_demux_t *self) {
	int64_t clock = plm_buffer_read(self->buffer, 3) << 30;
	plm_buffer_skip(self->buffer, 1);
	clock |= plm_buffer_read(self->buffer, 15) << 15;
	plm_buffer_skip(self->buffer, 1);
	clock |= plm_buffer_read(self->buffer, 15);
	plm_buffer_skip(self->buffer, 1);
	return (double)clock / 90000.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x3, %esi
callq 0x43f5
movl %eax, %ebx
movq (%r14), %r15
movl $0x1, %esi
movq %r15, %rdi
callq 0x4392
testl %eax, %eax
je 0x46a8
incq (%r15)
movq (%r14), %rdi
movl $0xf, %esi
callq 0x43f5
movl %eax, %ebp
movq (%r14), %r15
movl $0x1, %esi
movq %r15, %rdi
callq 0x4392
testl %eax, %eax
je 0x46ce
incq (%r15)
movq (%r14), %rdi
movl $0xf, %esi
callq 0x43f5
movl %eax, %r15d
movq (%r14), %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0x4392
testl %eax, %eax
je 0x46f5
incq (%r14)
shll $0x1e, %ebx
shll $0xf, %ebp
orl %ebx, %ebp
orl %r15d, %ebp
cvtsi2sd %ebp, %xmm0
divsd 0x490c(%rip), %xmm0     # 0x9018
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_buffer_seek
void plm_demux_buffer_seek(plm_demux_t *self, size_t pos) {
	plm_buffer_seek(self->buffer, pos);
	self->current_packet.length = 0;
	self->next_packet.length = 0;
	self->start_code = -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x430a
xorl %eax, %eax
movq %rax, 0x60(%rbx)
movq %rax, 0x80(%rbx)
movl $0xffffffff, 0x38(%rbx) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_decode_packet
plm_packet_t *plm_demux_decode_packet(plm_demux_t *self, int type) {
	if (!plm_buffer_has(self->buffer, 16 << 3)) {
		return NULL;
	}

	self->start_code = -1;

	self->next_packet.type = type;
	self->next_packet.length = plm_buffer_read(self->buffer, 16);
	self->next_packet.length -= plm_buffer_skip_bytes(self->buffer, 0xff); // stuffing

	// skip P-STD
	if (plm_buffer_read(self->buffer, 2) == 0x01) {
		plm_buffer_skip(self->buffer, 16);
		self->next_packet.length -= 2;
	}

	int pts_dts_marker = plm_buffer_read(self->buffer, 2);
	if (pts_dts_marker == 0x03) {
		self->next_packet.pts = plm_demux_decode_time(self);
		self->last_decoded_pts = self->next_packet.pts;
		plm_buffer_skip(self->buffer, 40); // skip dts
		self->next_packet.length -= 10;
	}
	else if (pts_dts_marker == 0x02) {
		self->next_packet.pts = plm_demux_decode_time(self);
		self->last_decoded_pts = self->next_packet.pts;
		self->next_packet.length -= 5;
	}
	else if (pts_dts_marker == 0x00) {
		self->next_packet.pts = PLM_PACKET_INVALID_TS;
		plm_buffer_skip(self->buffer, 4);
		self->next_packet.length -= 1;
	}
	else {
		return NULL; // invalid
	}
	
	return plm_demux_get_packet(self);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x80, %esi
callq 0x4392
testl %eax, %eax
je 0x480d
movl $0xffffffff, 0x38(%rbx) # imm = 0xFFFFFFFF
movl %ebp, 0x70(%rbx)
movq (%rbx), %rdi
movl $0x10, %esi
callq 0x43f5
cltq
movq %rax, 0x80(%rbx)
movq (%rbx), %rdi
movl $0xff, %esi
callq 0x44a7
cltq
subq %rax, 0x80(%rbx)
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x43f5
cmpl $0x1, %eax
jne 0x47bf
movq (%rbx), %r14
movl $0x10, %esi
movq %r14, %rdi
callq 0x4392
testl %eax, %eax
je 0x47b7
addq $0x10, (%r14)
addq $-0x2, 0x80(%rbx)
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x43f5
testl %eax, %eax
je 0x482f
cmpl $0x2, %eax
je 0x4814
cmpl $0x3, %eax
jne 0x480d
movq %rbx, %rdi
callq 0x4678
movsd %xmm0, 0x78(%rbx)
movsd %xmm0, 0x20(%rbx)
movq (%rbx), %r14
movl $0x28, %esi
movq %r14, %rdi
callq 0x4392
movq $-0xa, %rcx
testl %eax, %eax
je 0x485c
addq $0x28, (%r14)
jmp 0x485c
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x4678
movsd %xmm0, 0x78(%rbx)
movsd %xmm0, 0x20(%rbx)
movq $-0x5, %rcx
jmp 0x485c
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x78(%rbx)
movq (%rbx), %r14
movl $0x4, %esi
movq %r14, %rdi
callq 0x4392
movq $-0x1, %rcx
testl %eax, %eax
je 0x485c
addq $0x4, (%r14)
addq %rcx, 0x80(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x486f
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_demux_get_packet
plm_packet_t *plm_demux_get_packet(plm_demux_t *self) {
	if (!plm_buffer_has(self->buffer, self->next_packet.length << 3)) {
		return NULL;
	}

	self->current_packet.data = self->buffer->bytes + (self->buffer->bit_index >> 3);
	self->current_packet.length = self->next_packet.length;
	self->current_packet.type = self->next_packet.type;
	self->current_packet.pts = self->next_packet.pts;

	self->next_packet.length = 0;
	return &self->current_packet;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x80(%rbx), %rsi
shlq $0x3, %rsi
callq 0x4392
testl %eax, %eax
je 0x48c8
movq (%rbx), %rax
movq (%rax), %rcx
shrq $0x3, %rcx
addq 0x58(%rax), %rcx
leaq 0x50(%rbx), %rax
movq %rcx, 0x68(%rbx)
movq 0x80(%rbx), %rcx
movq %rcx, 0x60(%rbx)
movl 0x70(%rbx), %ecx
movl %ecx, 0x50(%rbx)
movsd 0x78(%rbx), %xmm0
movsd %xmm0, 0x58(%rbx)
movq $0x0, 0x80(%rbx)
jmp 0x48ca
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_init_frame
void plm_video_init_frame(plm_video_t *self, plm_frame_t *frame, uint8_t *base) {
	size_t luma_plane_size = self->luma_width * self->luma_height;
	size_t chroma_plane_size = self->chroma_width * self->chroma_height;

	frame->width = self->width;
	frame->height = self->height;
	frame->y.width = self->luma_width;
	frame->y.height = self->luma_height;
	frame->y.data = base;

	frame->cr.width = self->chroma_width;
	frame->cr.height = self->chroma_height;
	frame->cr.data = base + luma_plane_size;

	frame->cb.width = self->chroma_width;
	frame->cb.height = self->chroma_height;
	frame->cb.data = base + luma_plane_size + chroma_plane_size;
}

// Assembly:
movl 0x1c(%rdi), %eax
movl 0x30(%rdi), %ecx
movl 0x34(%rdi), %r8d
movl 0x38(%rdi), %r9d
movl 0x3c(%rdi), %r10d
movl %eax, 0x8(%rsi)
movl 0x20(%rdi), %eax
movl %eax, 0xc(%rsi)
movl %ecx, 0x10(%rsi)
movl %r8d, 0x14(%rsi)
imull %ecx, %r8d
movslq %r8d, %rax
movq %rdx, 0x18(%rsi)
movl %r9d, 0x20(%rsi)
movl %r10d, 0x24(%rsi)
addq %rdx, %rax
movq %rax, 0x28(%rsi)
movl %r9d, 0x30(%rsi)
movl %r10d, 0x34(%rsi)
imull %r9d, %r10d
movslq %r10d, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_decode_slice
void plm_video_decode_slice(plm_video_t *self, int slice) {
	self->slice_begin = TRUE;
	self->macroblock_address = (slice - 1) * self->mb_width - 1;

	// Reset motion vectors and DC predictors
	self->motion_backward.h = self->motion_forward.h = 0;
	self->motion_backward.v = self->motion_forward.v = 0;
	self->dc_predictor[0] = 128;
	self->dc_predictor[1] = 128;
	self->dc_predictor[2] = 128;

	self->quantizer_scale = plm_buffer_read(self->buffer, 5);

	// Skip extra
	while (plm_buffer_read(self->buffer, 1)) {
		plm_buffer_skip(self->buffer, 8);
	}

	do {
		plm_video_decode_macroblock(self);
	} while (
		self->macroblock_address < self->mb_size - 1 &&
		plm_buffer_peek_non_zero(self->buffer, 23)
	);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x78(%rdi)
decl %esi
imull 0x24(%rdi), %esi
decl %esi
movl %esi, 0x7c(%rdi)
xorl %eax, %eax
movq %rax, 0x54(%rdi)
movq %rax, 0x68(%rdi)
movabsq $0x8000000080, %rax     # imm = 0x8000000080
movq %rax, 0x90(%rdi)
movl $0x80, 0x98(%rdi)
movq 0xa0(%rdi), %rdi
movl $0x5, %esi
callq 0x43f5
movl %eax, 0x74(%rbx)
movq 0xa0(%rbx), %rdi
movl $0x1, %esi
callq 0x43f5
testl %eax, %eax
je 0x4f48
movq 0xa0(%rbx), %r14
movl $0x8, %esi
movq %r14, %rdi
callq 0x4392
testl %eax, %eax
je 0x4f00
addq $0x8, (%r14)
jmp 0x4f00
movq 0xa0(%rbx), %rdi
movl $0x17, %esi
callq 0x45d7
testl %eax, %eax
je 0x4f5a
movq %rbx, %rdi
callq 0x4f62
movl 0x2c(%rbx), %eax
decl %eax
cmpl %eax, 0x7c(%rbx)
jl 0x4f33
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_predict_macroblock
void plm_video_predict_macroblock(plm_video_t *self) {
	int fw_h = self->motion_forward.h;
	int fw_v = self->motion_forward.v;

	if (self->motion_forward.full_px) {
		fw_h <<= 1;
		fw_v <<= 1;
	}

	if (self->picture_type == PLM_VIDEO_PICTURE_TYPE_B) {
		int bw_h = self->motion_backward.h;
		int bw_v = self->motion_backward.v;

		if (self->motion_backward.full_px) {
			bw_h <<= 1;
			bw_v <<= 1;
		}

		if (self->motion_forward.is_set) {
			plm_video_copy_macroblock(self, &self->frame_forward, fw_h, fw_v);
			if (self->motion_backward.is_set) {
				plm_video_interpolate_macroblock(self, &self->frame_backward, bw_h, bw_v);
			}
		}
		else {
			plm_video_copy_macroblock(self, &self->frame_backward, bw_h, bw_v);
		}
	}
	else {
		plm_video_copy_macroblock(self, &self->frame_forward, fw_h, fw_v);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x54(%rdi), %edx
movl 0x58(%rdi), %eax
cmpl $0x0, 0x48(%rdi)
setne %cl
shll %cl, %edx
shll %cl, %eax
cmpl $0x3, 0x44(%rdi)
jne 0x5260
movl 0x68(%rbx), %r14d
movl 0x6c(%rbx), %ebp
cmpl $0x0, 0x5c(%rbx)
setne %cl
shll %cl, %r14d
shll %cl, %ebp
cmpl $0x0, 0x4c(%rbx)
je 0x526e
leaq 0xf0(%rbx), %rsi
movq %rbx, %rdi
movl %eax, %ecx
callq 0x5832
cmpl $0x0, 0x60(%rbx)
je 0x5286
leaq 0x130(%rbx), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0x58d7
leaq 0xf0(%rbx), %rsi
movq %rbx, %rdi
movl %eax, %ecx
jmp 0x527d
leaq 0x130(%rbx), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0x5832
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_decode_motion_vectors
void plm_video_decode_motion_vectors(plm_video_t *self) {

	// Forward
	if (self->motion_forward.is_set) {
		int r_size = self->motion_forward.r_size;
		self->motion_forward.h = plm_video_decode_motion_vector(self, r_size, self->motion_forward.h);
		self->motion_forward.v = plm_video_decode_motion_vector(self, r_size, self->motion_forward.v);
	}
	else if (self->picture_type == PLM_VIDEO_PICTURE_TYPE_PREDICTIVE) {
		// No motion information in P-picture, reset vectors
		self->motion_forward.h = 0;
		self->motion_forward.v = 0;
	}

	if (self->motion_backward.is_set) {
		int r_size = self->motion_backward.r_size;
		self->motion_backward.h = plm_video_decode_motion_vector(self, r_size, self->motion_backward.h);
		self->motion_backward.v = plm_video_decode_motion_vector(self, r_size, self->motion_backward.v);
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x4c(%rdi)
je 0x52bc
movl 0x50(%rbx), %ebp
movl 0x54(%rbx), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5770
movl %eax, 0x54(%rbx)
movl 0x58(%rbx), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5770
movl %eax, 0x58(%rbx)
jmp 0x52ca
cmpl $0x2, 0x44(%rbx)
jne 0x52ca
movq $0x0, 0x54(%rbx)
cmpl $0x0, 0x60(%rbx)
je 0x52f3
movl 0x64(%rbx), %ebp
movl 0x68(%rbx), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5770
movl %eax, 0x68(%rbx)
movl 0x6c(%rbx), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5770
movl %eax, 0x6c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_decode_motion_vector
int plm_video_decode_motion_vector(plm_video_t *self, int r_size, int motion) {
	int fscale = 1 << r_size;
	int m_code = plm_buffer_read_vlc(self->buffer, PLM_VIDEO_MOTION);
	int r = 0;
	int d;

	if ((m_code != 0) && (fscale != 1)) {
		r = plm_buffer_read(self->buffer, r_size);
		d = ((abs(m_code) - 1) << r_size) + r + 1;
		if (m_code < 0) {
			d = -d;
		}
	}
	else {
		d = m_code;
	}

	motion += d;
	if (motion > (fscale << 4) - 1) {
		motion -= fscale << 5;
	}
	else if (motion < (int)((unsigned)(-fscale) << 4)) {
		motion += fscale << 5;
	}

	return motion;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
movq 0xa0(%rdi), %r12
xorl %eax, %eax
leaq 0x3d8d(%rip), %r13      # 0x9520
movzwl %ax, %ebp
movq %r12, %rdi
movl $0x1, %esi
callq 0x43f5
addl %ebp, %eax
movslq %eax, %rcx
movzwl (%r13,%rcx,4), %eax
testw %ax, %ax
jg 0x5793
movzwl 0x2(%r13,%rcx,4), %r12d
movswl %r12w, %ebp
testl %ebx, %ebx
je 0x57f2
testw %r12w, %r12w
je 0x57f2
movq 0xa0(%r15), %rdi
movl %ebx, %esi
callq 0x43f5
movl %ebp, %edx
negl %edx
cmovsl %ebp, %edx
decl %edx
movl %ebx, %ecx
shll %cl, %edx
leal (%rax,%rdx), %ebp
addl %edx, %eax
incl %eax
testw %r12w, %r12w
notl %ebp
cmovnsl %eax, %ebp
addl %r14d, %ebp
movl $0x10, %eax
movl %ebx, %ecx
shll %cl, %eax
cmpl %eax, %ebp
jge 0x5816
movl $0xfffffff0, %eax       # imm = 0xFFFFFFF0
movl %ebx, %ecx
shll %cl, %eax
cmpl %eax, %ebp
jge 0x5821
movl $0x20, %eax
jmp 0x581b
movl $0xffffffe0, %eax       # imm = 0xFFFFFFE0
movl %ebx, %ecx
shll %cl, %eax
addl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_video_copy_macroblock
void plm_video_copy_macroblock(plm_video_t *self, plm_frame_t *s, int motion_h, int motion_v) {
	plm_frame_t *d = &self->frame_current;
	plm_video_process_macroblock(self, s->y.data, d->y.data, motion_h, motion_v, 16, FALSE);
	plm_video_process_macroblock(self, s->cr.data, d->cr.data, motion_h / 2, motion_v / 2, 8, FALSE);
	plm_video_process_macroblock(self, s->cb.data, d->cb.data, motion_h / 2, motion_v / 2, 8, FALSE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rsi
movq 0xc8(%rdi), %rdx
xorl %r13d, %r13d
movl %r13d, (%rsp)
movl %r12d, %ecx
movl %r15d, %r8d
movl $0x10, %r9d
callq 0x597f
movq 0x28(%r14), %rsi
movq 0xd8(%rbx), %rdx
movl %r12d, %ebp
shrl $0x1f, %ebp
addl %r12d, %ebp
sarl %ebp
movl %r15d, %r12d
shrl $0x1f, %r12d
addl %r15d, %r12d
sarl %r12d
movl %r13d, (%rsp)
movq %rbx, %rdi
movl %ebp, %ecx
movl %r12d, %r8d
movl $0x8, %r9d
callq 0x597f
movq 0x38(%r14), %rsi
movq 0xe8(%rbx), %rdx
movl %r13d, (%rsp)
movq %rbx, %rdi
movl %ebp, %ecx
movl %r12d, %r8d
movl $0x8, %r9d
callq 0x597f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/./pl_mpeg.h
// Function: plm_audio_find_frame_sync
int plm_audio_find_frame_sync(plm_audio_t *self) {
	size_t i;
	for (i = self->buffer->bit_index >> 3; i < self->buffer->length-1; i++) {
		if (
			self->buffer->bytes[i] == 0xFF &&
			(self->buffer->bytes[i+1] & 0xFE) == 0xFC
		) {
			self->buffer->bit_index = ((i+1) << 3) + 3;
			return TRUE;
		}
	}
	self->buffer->bit_index = (i + 1) << 3;
	return FALSE;
}

// Assembly:
movq 0x30(%rdi), %rcx
movq (%rcx), %rax
movq 0x10(%rcx), %rsi
shrq $0x3, %rax
leaq -0x1(%rsi), %rdi
cmpq %rdi, %rax
jae 0x79de
movq 0x58(%rcx), %r8
leaq 0xb(,%rax,8), %rdx
incq %rax
cmpb $-0x1, -0x1(%r8,%rax)
jne 0x79cf
movb (%r8,%rax), %r9b
andb $-0x2, %r9b
cmpb $-0x4, %r9b
je 0x79ec
incq %rax
addq $0x8, %rdx
cmpq %rax, %rsi
jne 0x79b9
movq %rdi, %rax
leaq 0x8(,%rax,8), %rdx
xorl %eax, %eax
movq %rdx, (%rcx)
retq
movl $0x1, %eax
jmp 0x79e8
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/pl_mpeg_player_sdl.c
// Function: app_destroy
void app_destroy(app_t *self) {
	plm_destroy(self->plm);

	if (self->audio_device) {
		SDL_CloseAudioDevice(self->audio_device);
	}

	if (self->texture) {
		SDL_DestroyTexture(self->texture);
	}

	if (self->renderer) {
		SDL_DestroyRenderer(self->renderer);
	}

	if (self->window) {
		SDL_DestroyWindow(self->window);
	}

	SDL_Quit();
	
	free(self);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2bce
movl 0x40(%rbx), %edi
testl %edi, %edi
je 0x8c7e
callq 0x20c0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8c8c
callq 0x2110
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x8c9a
callq 0x20b0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x8ca8
callq 0x2040
callq 0x2070
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O1/phoboslab[P]pl_mpeg/pl_mpeg_player_sdl.c
// Function: main
int main(int argc, char *argv[]) {
	if (argc < 2) {
		SDL_Log("Usage: pl_mpeg_player_sdl <file.mpg>");
		exit(1);
	}

	SDL_SetMainReady();
	
	app_t *app = app_create(argv[1]);
	while (!app->wants_to_quit) {
		app_update(app);
	}
	app_destroy(app);
	
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
cmpl $0x1, %edi
jle 0x8e93
movq %rsi, %rbx
callq 0x2100
movq 0x8(%rbx), %rdi
callq 0x8959
movq %rax, %rbx
cmpl $0x0, 0x10(%rax)
jne 0x8e87
movq %rbx, %rdi
callq 0x8cb6
cmpl $0x0, 0x10(%rbx)
je 0x8e79
movq %rbx, %rdi
callq 0x8c66
xorl %eax, %eax
popq %rbx
retq
leaq 0x175d(%rip), %rdi      # 0xa5f7
xorl %eax, %eax
callq 0x21f0
movl $0x1, %edi
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/context_switch1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	struct args *a;
	char c;
	int ret;
	a = malloc(sizeof(struct args));
	assert(pipe(a->fd1) == 0);
	assert(pipe(a->fd2) == 0);

	new_task(child, a);

	while (1) {
		do {
			ret = write(a->fd1[WRITE], &c, 1);
		} while (ret != 1 && errno == EINTR);
		assert(ret == 1);

		do {
			ret = read(a->fd2[READ], &c, 1);
		} while (ret != 1 && errno == EINTR);
		assert(ret == 1);
			
		(*iterations) += 2;
	}

	free(a);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %edi
callq 0x11d0
movq %rax, %r14
movq %rax, %rdi
callq 0x1160
testl %eax, %eax
jne 0x1cf1
leaq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x1160
testl %eax, %eax
jne 0x1d10
leaq 0xd2(%rip), %rdi        # 0x1d6d
movq %r14, %rsi
callq 0x13ce
leaq 0x7(%rsp), %r12
movl 0x4(%r14), %edi
movl $0x1, %edx
movq %r12, %rsi
callq 0x10d0
cmpl $0x1, %eax
jne 0x1cdf
movl (%r15), %edi
movl $0x1, %edx
movq %r12, %rsi
callq 0x1170
cmpl $0x1, %eax
je 0x1ceb
callq 0x1070
cmpl $0x4, (%rax)
je 0x1cbe
jmp 0x1d2f
callq 0x1070
cmpl $0x4, (%rax)
je 0x1ca8
jmp 0x1d4e
addq $0x2, (%rbx)
jmp 0x1ca8
leaq 0x579(%rip), %rdi       # 0x2271
leaq 0x584(%rip), %rsi       # 0x2283
leaq 0x595(%rip), %rcx       # 0x229b
movl $0x2d, %edx
callq 0x1130
leaq 0x5b7(%rip), %rdi       # 0x22ce
leaq 0x565(%rip), %rsi       # 0x2283
leaq 0x576(%rip), %rcx       # 0x229b
movl $0x2e, %edx
callq 0x1130
leaq 0x5aa(%rip), %rdi       # 0x22e0
leaq 0x546(%rip), %rsi       # 0x2283
leaq 0x557(%rip), %rcx       # 0x229b
movl $0x3b, %edx
callq 0x1130
leaq 0x58b(%rip), %rdi       # 0x22e0
leaq 0x527(%rip), %rsi       # 0x2283
leaq 0x538(%rip), %rcx       # 0x229b
movl $0x36, %edx
callq 0x1130
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/context_switch1.c
// Function: child
static void *child(void *arg)
{
	struct args *a = arg;
	char c;
	int ret;

	while (1) {
		do {
			ret = read(a->fd1[READ], &c, 1);
		} while (ret != 1 && errno == EINTR);
		assert(ret == 1);

		do {
			ret = write(a->fd2[WRITE], &c, 1);
		} while (ret != 1 && errno == EINTR);
		assert(ret == 1);
	}

	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7(%rsp), %r14
movl (%rbx), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x1170
cmpl $0x1, %eax
jne 0x1dae
movl 0xc(%rbx), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x10d0
cmpl $0x1, %eax
je 0x1d79
callq 0x1070
cmpl $0x4, (%rax)
je 0x1d8d
jmp 0x1dd7
callq 0x1070
cmpl $0x4, (%rax)
je 0x1d79
leaq 0x521(%rip), %rdi       # 0x22e0
leaq 0x4bd(%rip), %rsi       # 0x2283
leaq 0x51c(%rip), %rcx       # 0x22e9
movl $0x1c, %edx
callq 0x1130
leaq 0x502(%rip), %rdi       # 0x22e0
leaq 0x49e(%rip), %rsi       # 0x2283
leaq 0x4fd(%rip), %rcx       # 0x22e9
movl $0x21, %edx
callq 0x1130
// File: /workspace/github_c_makefile_star2_O1/s3lase[P]v6shell/glob6.c
// Function: gnew
static const char **
gnew(const char **gav)
{
	size_t siz;
	ptrdiff_t gidx;
	const char **nav;
	static unsigned mult = 1;

	if (gavp == gave) {
		mult *= GAVMULT;
		gidx  = (ptrdiff_t)(gavp - gav);
		siz   = (size_t)((gidx + (GAVNEW * mult)) * sizeof(char *));
		if ((nav = realloc(gav, siz)) == NULL)
			err(SH_ERR, FMT1S, ERR_NOMEM);
		gav   = nav;
		gavp  = gav + gidx;
		gave  = &gav[gidx + (GAVNEW * mult) - 1];
	}
	return gav;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x3a95(%rip), %r14      # 0x5108
cmpq 0x3a96(%rip), %r14      # 0x5110
jne 0x16e5
movl 0x3a76(%rip), %eax      # 0x50f8
leal (%rax,%rax), %ecx
movl %ecx, 0x3a6d(%rip)      # 0x50f8
subq %rbx, %r14
shll $0x8, %eax
leaq (%r14,%rax,8), %rsi
andq $-0x8, %rsi
movq %rbx, %rdi
callq 0x11a0
movq %rax, %rbx
testq %rax, %rax
jne 0x16c3
leaq 0x1b79(%rip), %rsi      # 0x3229
leaq 0x1a72(%rip), %rdx      # 0x3129
movl $0x2, %edi
xorl %eax, %eax
callq 0x19c8
addq %rbx, %r14
movq %r14, 0x3a3b(%rip)      # 0x5108
movl 0x3a25(%rip), %eax      # 0x50f8
shll $0x7, %eax
leaq (%r14,%rax,8), %rax
addq $-0x8, %rax
movq %rax, 0x3a2b(%rip)      # 0x5110
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/s3lase[P]v6shell/glob6.c
// Function: gcat
static char *
gcat(const char *src1, const char *src2)
{
	size_t siz;
	char *b, buf[PATHMAX], c, *dst;
	const char *s;

	*buf = EOS, b = buf, s = src1;
	while ((c = *s++) != EOS) {
		if (b >= &buf[PATHMAX - 1])
			err(SH_ERR, FMT1S, strerror(ENAMETOOLONG));
		if ((c &= ASCII) == EOS) {
			*b++ = SLASH;
			break;
		}
		*b++ = c;
	}

	s = src2;
	do {
		if (b >= &buf[PATHMAX])
			err(SH_ERR, FMT1S, strerror(ENAMETOOLONG));
		*b++ = c = *s++;
	} while (c != EOS);

	siz = b - buf;
	gavtot += siz;
	if (gavtot > GAVMAX)
		err(SH_ERR, FMT1S, ERR_E2BIG);
	if ((dst = malloc(siz)) == NULL) {
		err(SH_ERR, FMT1S, ERR_NOMEM);
		/*NOTREACHED*/
	}

	(void)memcpy(dst, buf, siz);
	return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %r14
movb $0x0, (%rsp)
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x175b
movq %rdi, %r15
leaq 0x1b11(%rip), %r12      # 0x3229
xorl %eax, %eax
movq %rax, %rbx
cmpq $0xfff, %rax            # imm = 0xFFF
jb 0x1741
movl $0x24, %edi
callq 0x11c0
movl $0x2, %edi
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19c8
andb $0x7f, %bpl
je 0x175f
movb %bpl, (%rsp,%rbx)
movb 0x1(%r15,%rbx), %bpl
leaq 0x1(%rbx), %rax
testb %bpl, %bpl
jne 0x171a
jmp 0x1763
xorl %ebx, %ebx
jmp 0x1766
movb $0x2f, (%rsp,%rbx)
incq %rbx
leaq 0x1abc(%rip), %r15      # 0x3229
cmpq $0x1000, %rbx           # imm = 0x1000
jl 0x1792
movl $0x24, %edi
callq 0x11c0
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19c8
movb (%r14), %al
incq %r14
movb %al, (%rsp,%rbx)
incq %rbx
testb %al, %al
jne 0x176d
movq 0x396f(%rip), %rax      # 0x5118
addq %rbx, %rax
movq %rax, 0x3965(%rip)      # 0x5118
cmpq $0x100001, %rax         # imm = 0x100001
jb 0x17d5
leaq 0x1a67(%rip), %rsi      # 0x3229
leaq 0x1997(%rip), %rdx      # 0x3160
movl $0x2, %edi
xorl %eax, %eax
callq 0x19c8
movq %rbx, %rdi
callq 0x1180
movq %rax, %r14
testq %rax, %rax
jne 0x17ff
leaq 0x1a3d(%rip), %rsi      # 0x3229
leaq 0x1936(%rip), %rdx      # 0x3129
movl $0x2, %edi
xorl %eax, %eax
callq 0x19c8
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1150
movq %r14, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/s3lase[P]v6shell/err.c
// Function: err
void
err(int es, const char *msgfmt, ...)
{
	va_list va;

	if (msgfmt != NULL) {
		va_start(va, msgfmt);
		wmsg(FD2, msgfmt, va);
		va_end(va);
	}
	if (myerrexit == NULL) {
		fd_print(FD2, FMT1S, "err: Invalid myerrexit function pointer");
		abort();
	}

	(*myerrexit)(es);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movl %edi, %ebx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x1a21
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rsi, %rsi
je 0x1a55
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movl $0x2, %edi
callq 0x1a8d
movq 0x36c4(%rip), %rax      # 0x5120
testq %rax, %rax
je 0x1a6e
movl %ebx, %edi
callq *%rax
addq $0xd0, %rsp
popq %rbx
retq
leaq 0x17b4(%rip), %rsi      # 0x3229
leaq 0x16f6(%rip), %rdx      # 0x3172
movl $0x2, %edi
xorl %eax, %eax
callq 0x1b82
callq 0x1050
// File: /workspace/github_c_makefile_star2_O1/s3lase[P]v6shell/err.c
// Function: wmsg
static void
wmsg(int wfd, const char *msgfmt, va_list va)
{
	char msg[MSGMAX];
	char fmt[FMTMAX];
	struct iovec ev[4];
	int i;

	i = snprintf(fmt, sizeof(fmt), "%s", msgfmt);
	if (i >= 1 && i < (int)sizeof(fmt)) {
		i = vsnprintf(msg, sizeof(msg), fmt, va);
		if (i >= 0 && i < (int)sizeof(msg)) {
			if (write(wfd, msg, strlen(msg)) == -1) {
				ev[0].iov_base = (char *)getmyname();
				ev[0].iov_len  = strlen(getmyname());
				ev[1].iov_base = ": ";
				ev[1].iov_len  = (size_t)2;
				ev[2].iov_base = ERR_WRITE;
				ev[2].iov_len  = strlen(ERR_WRITE);
				ev[3].iov_base = "\n";
				ev[3].iov_len  = (size_t)1;
				(void)writev(FD2, ev, 4);
			}
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x8d8, %rsp            # imm = 0x8D8
movq %rdx, %r14
movq %rsi, %rcx
movl %edi, %ebx
leaq 0x1703(%rip), %rdx      # 0x31a9
movq %rsp, %rdi
movl $0x41, %esi
xorl %eax, %eax
callq 0x10f0
decl %eax
cmpl $0x3f, %eax
ja 0x1b77
leaq 0x90(%rsp), %rdi
movq %rsp, %rdx
movl $0x841, %esi            # imm = 0x841
movq %r14, %rcx
callq 0x1090
cmpl $0x840, %eax            # imm = 0x840
ja 0x1b77
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x10d0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x10a0
cmpq $-0x1, %rax
jne 0x1b77
movq 0x361b(%rip), %rax      # 0x5128
testq %rax, %rax
leaq 0x1683(%rip), %rdi      # 0x319a
cmovneq %rax, %rdi
leaq 0x50(%rsp), %rbx
movq %rdi, (%rbx)
callq 0x10d0
movq %rax, 0x8(%rbx)
leaq 0x1690(%rip), %rax      # 0x31c3
movq %rax, 0x10(%rbx)
movq $0x2, 0x18(%rbx)
leaq 0x1666(%rip), %rax      # 0x31ac
movq %rax, 0x20(%rbx)
movq $0xc, 0x28(%rbx)
leaq 0x167c(%rip), %rax      # 0x31d5
movq %rax, 0x30(%rbx)
movq $0x1, 0x38(%rbx)
movl $0x2, %edi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x1080
addq $0x8d8, %rsp            # imm = 0x8D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/s3lase[P]v6shell/err.c
// Function: setmyname
void
setmyname(const char *s)
{
	const char *p;

	if (s != NULL && *s != EOS) {
		if ((p = strrchr(s, SLASH)) != NULL)
			p++;
		else
			p = s;
		if (*p == HYPHEN && *(p + 1) != EOS)
			p++;
		else if (*p == EOS)
			/* should never (but can) be true */
			p = MYNAME;
	} else
		/* should never (but can) be true */
		p = MYNAME;

	myname = p;
}

// Assembly:
leaq 0x1559(%rip), %rcx      # 0x31a1
testq %rdi, %rdi
je 0x1c8d
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0x1c8c
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x1100
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
movb (%rcx), %al
cmpb $0x2d, %al
jne 0x1c7f
cmpb $0x0, 0x1(%rcx)
je 0x1c7f
incq %rcx
jmp 0x1c8c
testb %al, %al
leaq 0x1519(%rip), %rax      # 0x31a1
cmoveq %rax, %rcx
popq %rbx
movq %rcx, 0x3494(%rip)      # 0x5128
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v2d5n64/ref/shellaes.c
// Function: tagVef
int tagVef(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], const u8 T[], unsigned long long int ptlen){

    u8 tempT[16];
    int flag=1;
    int i;

    tagGen(rk, checksum, Lprime, U, F, tempT, ptlen);

    for(i=0; i<byte_length_tag; ++i){
        if(tempT[i]!=T[i]){
            flag=0;
        }
    }
    return flag;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r9
callq 0x1070
kxorw %k0, %k0, %k0
xorl %eax, %eax
vmovq 0x10(%rsp,%rax), %xmm0
vmovq (%rbx,%rax), %xmm1
vpcmpneqb %xmm1, %xmm0, %k1
korb %k1, %k0, %k0
addq $0x8, %rax
cmpq $0x10, %rax
jne 0x3507
xorl %eax, %eax
kortestb %k0, %k0
sete %al
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v2d5n64/ref/shellaes.c
// Function: shellaesEnc
void shellaesEnc(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], unsigned long long int ctlen){

    u8 tag[16];
    unsigned long long int padp_len=ptlen+16-(ptlen%16);
    u8* padp;

    /*pad plaintexts to multiple blocks*/
    padp=(u8*) malloc(padp_len);
    memcpy(padp, p, ptlen);
    memset(padp+ptlen,0x80,1);
    memset(padp+ptlen+1, 0, 15-(ptlen%16));


    /*encryption of padded plaintext*/
    shellaesEnc_fb(key, nonce, ad, adlen, padp, padp_len, c, tag);
    free(padp);

    /*append the tag to ciphertext*/
    memcpy(c+padp_len, tag, byte_length_tag);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
movl %r14d, %ebp
notl %ebp
movq %r9, %r13
andq $-0x10, %r13
leaq 0x10(%r13), %r15
movq %r15, %rdi
callq 0x10c0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11d0
leaq (%r12,%r14), %rdi
incq %rdi
movb $-0x80, -0x1(%rdi)
andl $0xf, %ebp
xorl %esi, %esi
movq %rbp, %rdx
callq 0x1060
leaq 0x20(%rsp), %rbx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r12, %r8
movq %r15, %r9
pushq %rbx
movq 0x78(%rsp), %r14
pushq %r14
callq 0x11e0
addq $0x10, %rsp
movq %r12, %rdi
callq 0x1110
vmovaps (%rbx), %xmm0
vmovups %xmm0, 0x10(%r14,%r13)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v2d5n64/ref/shellaes.c
// Function: shellaesDec
int shellaesDec(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], unsigned long long int* ptlen){

    u8 tag[16];
    int flag;

    memcpy(tag, c+*ptlen, byte_length_tag);

    flag=shellaesDecVef_fb(key, nonce, ad, adlen, c, *ptlen, p, tag);


    /*if the tag is valid, erase the padding bits*/
    if(flag){
        while(p[*ptlen-1]!=0x80){
            *ptlen=*ptlen-1;
        }

        *ptlen=*ptlen-1;
    }

    return flag;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %r14
movq (%rbx), %r9
vmovups (%r8,%r9), %xmm0
movq %rsp, %rax
vmovaps %xmm0, (%rax)
pushq %rax
pushq %r14
callq 0x10e0
addq $0x10, %rsp
testl %eax, %eax
je 0x3de3
movq (%rbx), %rdx
leaq -0x1(%rdx), %rcx
xorl %esi, %esi
cmpb -0x1(%r14,%rdx), %sil
jno 0x3dcd
movq %rcx, %rsi
jmp 0x3de0
xorl %edx, %edx
movq %rcx, (%rbx)
leaq -0x1(%rcx), %rsi
cmpb -0x1(%r14,%rcx), %dl
movq %rsi, %rcx
jno 0x3dcf
movq %rsi, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop