LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_UB
swf_UI32 swf_reader_read_UB(swf_reader *swf,int bits) {
	swf_UI32 r = 0;
	int avail;

	if (bits <= 0 || bits > 32) return 0;

	while (bits > 0) {
		if (swf->bit_buffer_bits == 0) {
			swf->bit_buffer = swf_reader_read_UI8(swf);
			swf->bit_buffer_bits = 8;
		}

		avail = swf->bit_buffer_bits;
		if (avail > bits) avail = bits;
		swf->bit_buffer_bits -= avail;
		r <<= (swf_UI32)avail;
		r |= (((swf_UI32)swf->bit_buffer >> (swf_UI32)swf->bit_buffer_bits)) &
			(((swf_UI32)1 << (swf_UI32)avail) - 1);
		bits -= avail;
	}

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
leal -0x1(%rbx), %eax
xorl %r15d, %r15d
cmpl $0x1f, %eax
ja 0x2d12
movq %rdi, %r14
xorl %r13d, %r13d
leaq -0x29(%rbp), %r12
xorl %r15d, %r15d
cmpb $0x0, 0x59(%r14)
jne 0x2cde
movb %r13b, -0x29(%rbp)
movb %r13b, 0x59(%r14)
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x2a4f
movb -0x29(%rbp), %al
movb %al, 0x58(%r14)
movb $0x8, 0x59(%r14)
movzbl 0x59(%r14), %eax
cmpl %eax, %ebx
movl %eax, %edx
cmovll %ebx, %edx
movl %edx, %ecx
shll %cl, %r15d
subb %dl, %al
movb %al, 0x59(%r14)
movzbl 0x58(%r14), %esi
movl %eax, %ecx
shrl %cl, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %eax
notl %eax
andl %esi, %eax
orl %eax, %r15d
subl %edx, %ebx
jg 0x2cb3
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_SB
swf_SI32 swf_reader_read_SB(swf_reader *swf,int bits) {
	swf_UI32 r = 0;

	/* FIXME: Do we sign-extend if the field is only 1 bit long and bit is set? */
	if (bits <= 0 || bits > 32) return 0;
	r = swf_reader_read_UB(swf,bits);
	if (r & ((swf_UI32)1 << ((swf_UI32)(bits-1))))
		r |= (swf_UI32)0xFFFFFFFF << bits;

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
leal -0x21(%rbx), %ecx
xorl %eax, %eax
cmpl $-0x20, %ecx
jb 0x2d58
movl %ebx, %esi
callq 0x2c8b
movl %eax, %edx
leal -0x1(%rbx), %eax
movzbl %al, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %ebx, %ecx
shll %cl, %edi
xorl %eax, %eax
btl %esi, %edx
cmovbl %edi, %eax
orl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_RECT
void swf_reader_read_RECT(swf_reader *swf,swf_RECT *rect) {
	swf_reader_read_bytealign(swf);				/* "The RECT record must be byte aligned" */
	rect->Nbits = swf_reader_read_UB(swf,5);		/* UB[5] */
	rect->Xmin = swf_reader_read_SB(swf,rect->Nbits);	/* SB[Nbits] */
	rect->Xmax = swf_reader_read_SB(swf,rect->Nbits);	/* SB[Nbits] */
	rect->Ymin = swf_reader_read_SB(swf,rect->Nbits);	/* SB[Nbits] */
	rect->Ymax = swf_reader_read_SB(swf,rect->Nbits);	/* SB[Nbits] */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
movl $0x5, %esi
callq 0x2c8b
movb %al, (%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x4(%rbx)
movzbl (%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x8(%rbx)
movzbl (%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0xc(%rbx)
movzbl (%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_UI16
swf_UI16 swf_reader_read_UI16(swf_reader *swf) {
	unsigned char buf[2] = {0};
	swf_reader_read_bytealign(swf);
	swf_reader_read(swf,buf,2);
	return (swf_UI16)__le_u16(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0xa(%rbp), %rbx
movw $0x0, (%rbx)
movb $0x0, 0x59(%rdi)
movq %rbx, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_UI32
swf_UI32 swf_reader_read_UI32(swf_reader *swf) {
	unsigned char buf[4] = {0};
	swf_reader_read_bytealign(swf);
	swf_reader_read(swf,buf,4);
	return (swf_UI32)__le_u32(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0xc(%rbp), %rbx
movl $0x0, (%rbx)
movb $0x0, 0x59(%rdi)
movq %rbx, %rsi
movl $0x4, %edx
callq 0x2a4f
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_uncompressed_seek
int swf_reader_uncompressed_seek(void *io,uint64_t pos) {
	swf_reader *r = (swf_reader*)io;
	int rd;

	rd = swf_reader_raw_seek((swf_reader*)io,pos);
	r->current_pos = r->raw_current_pos;
	return rd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x2ec5
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
je 0x2ec5
movq %rbx, %rdi
callq *%rcx
movq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_uncompressed_read
int swf_reader_uncompressed_read(void *io,void *buf,int len) {
	swf_reader *r = (swf_reader*)io;
	int rd;

	rd = swf_reader_raw_read((swf_reader*)io,buf,len);
	r->current_pos = r->raw_current_pos;
	return rd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x2ef4
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x2ef4
movq %rbx, %rdi
callq *%rcx
movq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_stock_raw_read
int swf_reader_stock_raw_read(void *io,void *buf,int len) {
	swf_reader *swf = (swf_reader*)io;
	int rd;

	if (swf == NULL) return -1;
	if (swf->file_fd < 0) return -1;
	if (len <= 0) return 0;
	rd = read(swf->file_fd,buf,len);
	if (rd < 0) return -1;
	swf->raw_current_pos += (uint64_t)rd;
	return rd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x2f3d
movq %rdi, %r14
movl 0x10(%rdi), %edi
testl %edi, %edi
js 0x2f3d
testl %edx, %edx
jle 0x2f3b
movl %edx, %edx
callq 0x10d0
testl %eax, %eax
js 0x2f3d
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, (%r14)
movl %eax, %ebx
jmp 0x2f3d
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_close_file
void swf_reader_close_file(swf_reader *r) {
	if (r->zlib.next_in != NULL) {
		inflateEnd(&r->zlib);
		memset(&r->zlib,0,sizeof(r->zlib));
	}
	if (r->lzma.next_in != NULL) {
		lzma_end(&r->lzma);
		memset(&r->lzma,0,sizeof(r->lzma));
	}
	r->decom_buf = sliding_window_v4_destroy(r->decom_buf);
	r->out_buf = sliding_window_v4_destroy(r->out_buf);
	if (r->file_fd >= 0) {
		if (r->file_fd_owner) close(r->file_fd);
		r->file_fd = -1;
	}
	r->file_fd_owner = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x88(%rdi)
je 0x2fb1
leaq 0x88(%rbx), %r14
movq %r14, %rdi
callq 0x1100
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x60(%r14)
cmpq $0x0, 0xf8(%rbx)
je 0x2fd9
leaq 0xf8(%rbx), %r14
movq %r14, %rdi
callq 0x1120
movl $0x88, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
movq 0x78(%rbx), %rdi
callq 0x5200
movq %rax, 0x78(%rbx)
movq 0x80(%rbx), %rdi
callq 0x5200
movq %rax, 0x80(%rbx)
movl 0x10(%rbx), %edi
testl %edi, %edi
js 0x3012
cmpb $0x0, 0x14(%rbx)
je 0x300b
callq 0x10c0
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movb $0x0, 0x14(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_create
swf_reader *swf_reader_create() {
	swf_reader *r = (swf_reader*)malloc(sizeof(swf_reader));
	if (r == NULL) return NULL;
	if (swf_reader_init(r)) {
		free(r);
		return NULL;
	}
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x180, %edi            # imm = 0x180
callq 0x1130
testq %rax, %rax
je 0x3055
movq %rax, %rbx
movl $0x180, %edx            # imm = 0x180
movq %rax, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
jmp 0x3057
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_destroy
swf_reader *swf_reader_destroy(swf_reader *r) {
	if (r != NULL) {
		swf_reader_free(r);
		free(r);
	}

	return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x3082
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2f69
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_record
int swf_reader_read_record(swf_reader *r,swf_tag *tag) {
	swf_UI16 tmp;

	if (r->current_pos > r->next_tag) {
		if (swf_reader_seek(r,r->next_tag)) {
			fprintf(stderr,"SWF I/O error: file pointer past next tag and cannot seek to it\n");
			return 0;
		}
	}

	if (!r->eof && r->current_pos < r->next_tag) {
		if (swf_reader_seek(r,r->next_tag)) {
			r->eof = 1;
			return 0;
		}
	}
	if (r->eof) return 0;

	tag->absolute_tag_offset = r->current_pos;
	tmp = swf_reader_read_UI16(r);
	tag->record.TagCode = tmp >> 6;
	tag->record.Length = tmp & 0x3F;
	if (tag->record.Length == 0x3F) tag->record.Length = swf_reader_read_UI32(r);
	tag->absolute_offset = r->current_pos;
	r->next_tag = tag->absolute_offset + tag->record.Length;
	if (r->eof) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x68(%rdi), %rsi
cmpq %rsi, 0x8(%rdi)
jbe 0x30d6
testq %rbx, %rbx
je 0x3199
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x3199
movb $0x0, 0x71(%rbx)
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jne 0x3199
cmpb $0x0, 0x71(%rbx)
jne 0x310a
movq 0x68(%rbx), %rsi
cmpq %rsi, 0x8(%rbx)
jae 0x310a
testq %rbx, %rbx
je 0x3101
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x3101
movb $0x0, 0x71(%rbx)
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
je 0x310a
movb $0x1, 0x71(%rbx)
jmp 0x319e
xorl %eax, %eax
cmpb $0x0, 0x71(%rbx)
jne 0x31a0
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r14)
leaq -0x1a(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movl %eax, %ecx
shrl $0x6, %ecx
movw %cx, (%r14)
andl $0x3f, %eax
movl %eax, 0x4(%r14)
cmpl $0x3f, %eax
jne 0x317b
leaq -0x20(%rbp), %r15
movl $0x0, (%r15)
movb $0x0, 0x59(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x2a4f
movl (%r15), %eax
movl %eax, 0x4(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%r14)
movl 0x4(%r14), %ecx
addq %rax, %rcx
movq %rcx, 0x68(%rbx)
xorl %eax, %eax
cmpb $0x0, 0x71(%rbx)
sete %al
jmp 0x31a0
callq 0x12b1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_assign_fd
int swf_reader_assign_fd(swf_reader *r,int fd) {
	if (fd != r->file_fd) {
		swf_reader_close_file(r);
		r->file_fd = fd;
		r->file_fd_owner = 0;
	}

	r->raw_seek = swf_reader_stock_raw_seek;
	r->raw_read = swf_reader_stock_raw_read;
	r->seek = NULL;
	r->read = NULL;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x10(%rdi)
je 0x31cd
movl %esi, %r14d
movq %rbx, %rdi
callq 0x2f69
movl %r14d, 0x10(%rbx)
movb $0x0, 0x14(%rbx)
leaq -0x824(%rip), %rax      # 0x29b0
movq %rax, 0x18(%rbx)
leaq -0x2dd(%rip), %rax      # 0x2f02
movq %rax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_DefineSound
int swf_reader_read_DefineSound(swf_reader *swf,swf_DefineSound *h) {
	h->SoundId = swf_reader_read_UI16(swf);
	h->SoundFormat = swf_reader_read_UB(swf,4);
	h->SoundFormat_str = swf_SoundCompressionUB4[h->SoundFormat];
	h->SoundRate = swf_reader_read_UB(swf,2);
	h->SoundRate_value = swf_SoundRatesUB2[h->SoundRate];
	h->SoundSize = swf_reader_read_UB(swf,1);
	h->SoundSize_value = h->SoundSize ? 16 : 8;
	h->SoundType = swf_reader_read_UB(swf,1);
	h->SoundType_value = h->SoundSize ? 2 : 1;
	h->SoundSampleCount = swf_reader_read_UI32(swf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x22(%rbp), %r15
movw $0x0, (%r15)
xorl %r12d, %r12d
movb %r12b, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, (%rbx)
movq %r14, %rdi
movl $0x4, %esi
callq 0x2c8b
movb 0x10(%rbx), %cl
movl %eax, %edx
andb $0xf, %dl
andb $-0x10, %cl
orb %dl, %cl
movb %cl, 0x10(%rbx)
andl $0xf, %eax
leaq 0x6c6c(%rip), %rcx      # 0xa0e0
movq (%rcx,%rax,8), %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x2c8b
movb 0x10(%rbx), %cl
movl %eax, %edx
shlb $0x4, %dl
andb $0x30, %dl
andb $-0x31, %cl
orb %dl, %cl
movb %cl, 0x10(%rbx)
andl $0x3, %eax
leaq 0x38a2(%rip), %rcx      # 0x6d48
movzwl (%rcx,%rax,2), %eax
movw %ax, 0x12(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb 0x10(%rbx), %cl
movl %eax, %edx
shlb $0x6, %dl
andb $0x40, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x10(%rbx)
andb $0x1, %al
shlb $0x3, %al
addb $0x8, %al
movb %al, 0x14(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb 0x10(%rbx), %cl
shlb $0x7, %al
movl %ecx, %edx
andb $0x7f, %dl
orb %al, %dl
movb %dl, 0x10(%rbx)
andb $0x40, %cl
cmpb $0x1, %cl
movb $0x2, %al
sbbb %r12b, %al
movb %al, 0x15(%rbx)
leaq -0x28(%rbp), %r15
movl $0x0, (%r15)
movb %r12b, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x2a4f
movl (%r15), %eax
movl %eax, 0x18(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_FileAttributes
int swf_reader_read_FileAttributes(swf_reader *swf,swf_FileAttributes *a) {
	unsigned int __attribute__((unused)) Reserved;

	Reserved = swf_reader_read_UB(swf,1);
	a->UseDirectBlit = swf_reader_read_UB(swf,1);
	a->UseGPU = swf_reader_read_UB(swf,1);
	a->HasMetadata = swf_reader_read_UB(swf,1);
	a->ActionScript3 = swf_reader_read_UB(swf,1);
	Reserved = swf_reader_read_UB(swf,2);
	a->UseNetwork = swf_reader_read_UB(swf,1);
	Reserved = swf_reader_read_UB(swf,24);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %esi
callq 0x2c8b
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%r14), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%r14), %cl
addb %al, %al
andb $0x2, %al
andb $-0x3, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%r14), %cl
shlb $0x2, %al
andb $0x4, %al
andb $-0x5, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%r14), %cl
shlb $0x3, %al
andb $0x8, %al
andb $-0x9, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x2c8b
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%r14), %cl
shlb $0x4, %al
andb $0x10, %al
andb $-0x11, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl $0x18, %esi
callq 0x2c8b
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_DefineFont_step1
int swf_reader_read_DefineFont_step1(swf_reader *swf,swf_DefineFont *n) {
	n->FontID = swf_reader_read_UI16(swf);
	n->absoluteOffsetTable = swf->current_pos;
	n->_OffsetTableEntry0 = swf_reader_read_UI16(swf);

	/* "Because the GlyphShapeTable immediately follows the OffsetTable, the number of
	 * entries in each table (the number of glyphs in the font) can be inferred by
	 * dividing the first entry in the OffsetTable by two". Ooookay then.. */
	n->nGlyphs = n->_OffsetTableEntry0 >> 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq -0x22(%rbp), %r15
movw %r12w, (%r15)
movb %r12b, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x10(%rbx)
leaq -0x24(%rbp), %r15
movw %r12w, (%r15)
movb %r12b, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x4(%rbx)
shrl %eax
movw %ax, 0x2(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_DefineFont_alloc_OffsetTable
int swf_reader_read_DefineFont_alloc_OffsetTable(swf_DefineFont *nfo) {
	if (nfo->OffsetTable != NULL || nfo->nGlyphs == 0) return 0;
	nfo->OffsetTable = (swf_UI16*)malloc(sizeof(swf_UI16) * nfo->nGlyphs);
	if (nfo->OffsetTable == NULL) return -1;
	return 0;
}

// Assembly:
xorl %eax, %eax
cmpq $0x0, 0x8(%rdi)
je 0x389a
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x2(%rdi), %edi
testq %rdi, %rdi
je 0x38c2
addl %edi, %edi
callq 0x1130
movq %rax, %rcx
movq %rax, 0x8(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_DefineFont_read_OffsetTable
int swf_reader_read_DefineFont_read_OffsetTable(swf_reader *swf,swf_DefineFont *nfo) {
	unsigned int i;

	if (nfo->OffsetTable == NULL) return (nfo->nGlyphs == 0 ? 0 : -1);
	nfo->OffsetTable[0] = nfo->_OffsetTableEntry0; /* NTS: Remember? We had to read the first one to infer nGlyphs */
	for (i=1;i < nfo->nGlyphs;i++) nfo->OffsetTable[i] = swf_reader_read_UI16(swf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3939
movzwl 0x4(%r14), %ecx
movw %cx, (%rax)
xorl %ebx, %ebx
cmpw $0x2, 0x2(%r14)
jb 0x3942
movq %rdi, %r15
movl $0x1, %r13d
leaq -0x2a(%rbp), %r12
movw $0x0, -0x2a(%rbp)
movb $0x0, 0x59(%r15)
movq %r15, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl -0x2a(%rbp), %eax
movq 0x8(%r14), %rcx
movw %ax, (%rcx,%r13,2)
incq %r13
movzwl 0x2(%r14), %eax
cmpq %rax, %r13
jb 0x3902
jmp 0x3942
xorl %ebx, %ebx
cmpw 0x2(%r14), %bx
sbbl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_PlaceObject
int swf_reader_read_PlaceObject(swf_reader *swf,swf_PlaceObject *r) {
	r->CharacterId = swf_reader_read_UI16(swf);
	r->Depth = swf_reader_read_UI16(swf);
	swf_reader_read_MATRIX(swf,&r->Matrix);
	/* TODO: If there is room yet in the tag, read a CXFORM into &r->ColorTransform */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq -0x22(%rbp), %r15
movw %r12w, (%r15)
movb %r12b, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, (%rbx)
leaq -0x24(%rbp), %r15
movw %r12w, (%r15)
movb %r12b, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x2(%rbx)
addq $0x4, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x39cd
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_MATRIX
int swf_reader_read_MATRIX(swf_reader *swf,swf_MATRIX *m) {
	swf_reader_read_bytealign(swf);
	m->HasScale = swf_reader_read_UB(swf,1);
	if (m->HasScale) {
		m->NScaleBits = swf_reader_read_UB(swf,5);
		m->ScaleX = swf_reader_read_SB(swf,m->NScaleBits);
		m->ScaleY = swf_reader_read_SB(swf,m->NScaleBits);
	}
	else {
		m->ScaleX = m->ScaleY = 0x10000;
		m->NScaleBits = 0;
	}
	m->HasRotate = swf_reader_read_UB(swf,1);
	if (m->HasRotate) {
		m->NRotateBits = swf_reader_read_UB(swf,5);
		m->RotateSkew0 = swf_reader_read_SB(swf,m->NRotateBits);
		m->RotateSkew1 = swf_reader_read_SB(swf,m->NRotateBits);
	}
	else {
		m->NRotateBits = 0;
		m->RotateSkew0 = 0;
		m->RotateSkew1 = 0;
	}
	m->NTranslateBits = swf_reader_read_UB(swf,5);
	m->TranslateX = swf_reader_read_SB(swf,m->NTranslateBits);
	m->TranslateY = swf_reader_read_SB(swf,m->NTranslateBits);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
movl $0x1, %esi
callq 0x2c8b
movb (%rbx), %cl
movl %eax, %edx
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0x1, %al
jne 0x3a0e
movabsq $0x1000000010000, %rax  # imm = 0x1000000010000
movq %rax, 0x4(%rbx)
movb $0x0, 0x1(%rbx)
jmp 0x3a3b
movq %r14, %rdi
movl $0x5, %esi
callq 0x2c8b
movb %al, 0x1(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x4(%rbx)
movzbl 0x1(%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x8(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb (%rbx), %cl
leal (%rax,%rax), %edx
andb $0x2, %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0x1, %al
jne 0x3a6a
movb $0x0, 0x2(%rbx)
movl $0x0, 0xc(%rbx)
xorl %eax, %eax
jmp 0x3a94
movq %r14, %rdi
movl $0x5, %esi
callq 0x2c8b
movb %al, 0x2(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0xc(%rbx)
movzbl 0x2(%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x10(%rbx)
movq %r14, %rdi
movl $0x5, %esi
callq 0x2c8b
movb %al, 0x3(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x14(%rbx)
movzbl 0x3(%rbx), %esi
movq %r14, %rdi
callq 0x2d24
movl %eax, 0x18(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_DefineShape4_header
int swf_reader_read_DefineShape4_header(swf_reader *swf,swf_DefineShape *r) {
	r->ShapeId = swf_reader_read_UI16(swf);
	swf_reader_read_RECT(swf,&r->ShapeBounds);
	swf_reader_read_RECT(swf,&r->EdgeBounds);
	/* Reserved */swf_reader_read_UB(swf,5);
	r->UsesFillWindingRule = swf_reader_read_UB(swf,1);
	r->UsesNonScalingStrokes = swf_reader_read_UB(swf,1);
	r->UsesScalingStrokes = swf_reader_read_UB(swf,1);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1a(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, (%rbx)
leaq 0x4(%rbx), %rsi
movq %r14, %rdi
callq 0x2d5f
leaq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x2d5f
movq %r14, %rdi
movl $0x5, %esi
callq 0x2c8b
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb 0x2c(%rbx), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x2c(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb 0x2c(%rbx), %cl
addb %al, %al
andb $0x2, %al
andb $-0x3, %cl
orb %al, %cl
movb %cl, 0x2c(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movb 0x2c(%rbx), %cl
shlb $0x2, %al
andb $0x4, %al
andb $-0x5, %cl
orb %al, %cl
movb %cl, 0x2c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_SHAPE_beginning
int swf_reader_read_SHAPE_beginning(swf_reader *swf,swf_SHAPE_reading *r) {
	swf_reader_read_bytealign(swf);
	r->NumFillBits = swf_reader_read_UB(swf,4);
	r->NumLineBits = swf_reader_read_UB(swf,4);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
movl $0x4, %esi
callq 0x2c8b
movl (%rbx), %ecx
andl $0xf, %eax
andl $-0x10, %ecx
orl %eax, %ecx
movw %cx, (%rbx)
movq %r14, %rdi
movl $0x4, %esi
callq 0x2c8b
shll $0x4, %eax
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rbx), %ecx
movzbl %al, %eax
orl %eax, %ecx
movw %cx, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_FOCALGRADIENT
int swf_reader_read_FOCALGRADIENT(swf_reader *swf,swf_GRADIENT *g,unsigned int rgba) {
	unsigned int i;

	swf_reader_read_bytealign(swf); /* NTS: Adobe documentation does not mention byte alignment requirement */
	g->SpreadMode = swf_reader_read_UB(swf,2);
	g->InterpolationMode = swf_reader_read_UB(swf,2);
	g->NumGradients = swf_reader_read_UB(swf,4);
	for (i=0;i < g->NumGradients;i++) {
		g->GradientRecords[i].Ratio = swf_reader_read_UI8(swf);
		if (rgba)	swf_reader_read_RGBA(swf,&g->GradientRecords[i].Color);
		else		swf_reader_read_RGB_as_RGBA(swf,&g->GradientRecords[i].Color);
	}
	g->FocalPoint = (swf_FIXED8)swf_reader_read_SI16(swf);;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x30(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
movl $0x2, %esi
callq 0x2c8b
movb (%rbx), %cl
andb $0x3, %al
andb $-0x4, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x2c8b
movb (%rbx), %cl
shlb $0x2, %al
andb $0xc, %al
andb $-0xd, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r14, %rdi
movl $0x4, %esi
callq 0x2c8b
movb (%rbx), %cl
movl %eax, %edx
shlb $0x4, %dl
andb $0xf, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0xf, %al
je 0x4064
leaq 0x2(%rbx), %r12
xorl %r13d, %r13d
xorl %r15d, %r15d
movb %r13b, -0x29(%rbp)
movb %r13b, 0x59(%r14)
movq %r14, %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x2a4f
movb -0x29(%rbp), %al
movb %al, -0x1(%r12)
cmpl $0x0, -0x30(%rbp)
je 0x4047
movq %r14, %rdi
movq %r12, %rsi
callq 0x2b5e
jmp 0x4052
movq %r14, %rdi
movq %r12, %rsi
callq 0x2c03
incq %r15
movzbl (%rbx), %eax
shrl $0x4, %eax
addq $0x5, %r12
cmpq %rax, %r15
jb 0x4013
leaq -0x32(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x52(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_GRADIENT
int swf_reader_read_GRADIENT(swf_reader *swf,swf_GRADIENT *g,unsigned int rgba) {
	unsigned int i;

	swf_reader_read_bytealign(swf); /* NTS: Adobe documentation does not mention byte alignment requirement */
	g->SpreadMode = swf_reader_read_UB(swf,2);
	g->InterpolationMode = swf_reader_read_UB(swf,2);
	g->NumGradients = swf_reader_read_UB(swf,4);
	for (i=0;i < g->NumGradients;i++) {
		g->GradientRecords[i].Ratio = swf_reader_read_UI8(swf);
		if (rgba)	swf_reader_read_RGBA(swf,&g->GradientRecords[i].Color);
		else		swf_reader_read_RGB_as_RGBA(swf,&g->GradientRecords[i].Color);
	}
	g->FocalPoint = 0;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, -0x30(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
movb $0x0, 0x59(%rdi)
movl $0x2, %esi
callq 0x2c8b
movb (%rbx), %cl
andb $0x3, %al
andb $-0x4, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r15, %rdi
movl $0x2, %esi
callq 0x2c8b
movb (%rbx), %cl
shlb $0x2, %al
andb $0xc, %al
andb $-0xd, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r15, %rdi
movl $0x4, %esi
callq 0x2c8b
movb (%rbx), %cl
movl %eax, %edx
shlb $0x4, %dl
andb $0xf, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0xf, %al
je 0x4161
leaq 0x2(%rbx), %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
movb %r13b, -0x29(%rbp)
movb %r13b, 0x59(%r15)
movq %r15, %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x2a4f
movb -0x29(%rbp), %al
movb %al, -0x1(%r12)
cmpl $0x0, -0x30(%rbp)
je 0x4144
movq %r15, %rdi
movq %r12, %rsi
callq 0x2b5e
jmp 0x414f
movq %r15, %rdi
movq %r12, %rsi
callq 0x2c03
incq %r14
movzbl (%rbx), %eax
shrl $0x4, %eax
addq $0x5, %r12
cmpq %rax, %r14
jb 0x4110
movw $0x0, 0x52(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_FILLSTYLEARRAY_header
int swf_reader_read_FILLSTYLEARRAY_header(swf_reader *swf,swf_FILLSTYLEARRAY_read *nfo,unsigned int tag_code) {
	nfo->color_rgba = (tag_code == swftag_DefineShape3 || tag_code == swftag_DefineShape4);
	nfo->FillStyleCount = swf_reader_read_UI8(swf);
	if (nfo->FillStyleCount == 0xFF) nfo->FillStyleCount = swf_reader_read_UI16(swf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x20, %edx
sete %al
cmpl $0x53, %edx
sete %cl
orb %al, %cl
movb (%rsi), %al
andb $-0x2, %al
orb %cl, %al
movb %al, (%rsi)
xorl %eax, %eax
leaq -0x19(%rbp), %r15
movb %al, (%r15)
movb %al, 0x59(%rdi)
movq %r15, %rsi
movl $0x1, %edx
callq 0x2a4f
movzbl (%r15), %eax
movzwl %ax, %eax
movw %ax, 0x2(%rbx)
cmpl $0xff, %eax
jne 0x41f0
leaq -0x1c(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x2(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_LINESTYLE
int swf_reader_read_LINESTYLE(swf_reader *swf,swf_LINESTYLEARRAY_read *nfo) {
	nfo->Width = swf_reader_read_UI16(swf);
	if (nfo->color_rgba) swf_reader_read_RGBA(swf,&nfo->Color);
	else swf_reader_read_RGB_as_RGBA(swf,&nfo->Color);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x1a(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x4(%r14)
leaq 0x6(%r14), %rsi
testb $0x1, (%r14)
jne 0x4245
movq %rbx, %rdi
callq 0x2c03
jmp 0x424d
movq %rbx, %rdi
callq 0x2b5e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_LINESTYLE2
int swf_reader_read_LINESTYLE2(swf_reader *swf,swf_LINESTYLEARRAY_read *nfo) {
	nfo->Width = swf_reader_read_UI16(swf);
	nfo->StartCapStyle = swf_reader_read_UB(swf,2);
	nfo->JoinStyle = swf_reader_read_UB(swf,2);
	nfo->HasFillFlag = swf_reader_read_UB(swf,1);
	nfo->NoHScaleFlag = swf_reader_read_UB(swf,1);
	nfo->NoVScaleFlag = swf_reader_read_UB(swf,1);
	nfo->PixelHintingFlag = swf_reader_read_UB(swf,1);
	/* Reserved */swf_reader_read_UB(swf,5);
	nfo->NoClose = swf_reader_read_UB(swf,1);
	nfo->EndCapStyle = swf_reader_read_UB(swf,2);
	if (nfo->JoinStyle == 2) nfo->MiterLimitFactor = swf_reader_read_UI16(swf);
	else nfo->MiterLimitFactor = 0;
	if (nfo->HasFillFlag)
		return swf_reader_read_FILLSTYLE(swf,&nfo->FillType);
	else
		swf_reader_read_RGBA(swf,&nfo->Color);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1a(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%rdi)
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x4(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
andl $0x3, %eax
andl $-0x4, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
andl $0x3, %eax
andl $-0xd, %ecx
leal (%rcx,%rax,4), %eax
movw %ax, 0xa(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
shll $0x4, %eax
andl $0x10, %eax
andl $-0x11, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
shll $0x5, %eax
andl $0x20, %eax
andl $-0x21, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
shll $0x6, %eax
andl $0x40, %eax
andl $-0x41, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
shll $0x7, %eax
movzbl %al, %eax
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x5, %esi
callq 0x2c8b
movq %r14, %rdi
movl $0x1, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
andl $0x1, %eax
shll $0x8, %eax
andl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0x2c8b
movzwl 0xa(%rbx), %ecx
andl $0x3, %eax
shll $0x9, %eax
movl %ecx, %edx
andl $0xf9ff, %edx           # imm = 0xF9FF
orl %eax, %edx
movw %dx, 0xa(%rbx)
andl $0xc, %ecx
cmpw $0x8, %cx
jne 0x43ce
leaq -0x1c(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
jmp 0x43d0
xorl %eax, %eax
movw %ax, 0xc(%rbx)
testb $0x10, 0xa(%rbx)
jne 0x43ed
addq $0x6, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b5e
xorl %eax, %eax
jmp 0x43fc
addq $0x10, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4407
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf_lzma_reader.c
// Function: swf_reader_init_lzma
int swf_reader_init_lzma(swf_reader *swf) {
	lzma_end(&swf->lzma);
	memset(&swf->lzma,0,sizeof(swf->lzma));
	if (lzma_alone_decoder(&swf->lzma,UINT64_MAX) != LZMA_OK) {
		fprintf(stderr,"LZMA failed to init\n");
		return -1;
	}

	swf->eof = 0;
	swf->zlib_eof = 0;
	swf->seek = swf_reader_lzma_seek;
	swf->read = swf_reader_lzma_read;
	swf->current_pos = swf->raw_current_pos;
	swf_reader_raw_seek(swf,8); /* put raw pointer back to just after the header */
	sliding_window_v4_empty(swf->decom_buf); /* reset buffer */
	sliding_window_v4_empty(swf->out_buf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0xf8(%rdi), %r15
movq %r15, %rdi
callq 0x1120
xorl %ebx, %ebx
movl $0x88, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movq %r15, %rdi
movq $-0x1, %rsi
callq 0x1110
testl %eax, %eax
jne 0x46c3
movw $0x0, 0x70(%r14)
leaq 0x5d(%rip), %rax        # 0x46cf
movq %rax, 0x28(%r14)
leaq 0xd9(%rip), %rax        # 0x4756
movq %rax, 0x30(%r14)
movq (%r14), %rax
movq %rax, 0x8(%r14)
movl $0x8, %esi
movq %r14, %rdi
callq 0x2a13
movq 0x78(%r14), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq 0x80(%r14), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x13fd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x46b6
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf_lzma_reader.c
// Function: swf_reader_lzma_seek
int swf_reader_lzma_seek(void *io,uint64_t pos) {
	swf_reader *r = (swf_reader*)io;
	unsigned char temp[512];
	int rd;

	/* if seeking backward we only allow going back to the header */
	if (pos < r->current_pos) {
		if (pos > 8) {
			fprintf(stderr,"LZMA: Seeking backwards beyond the initial header not supported\n");
			return -1;
		}
		else {
			/* reset LZMA decoder */
			if (swf_reader_init_lzma(r)) {
				fprintf(stderr,"Failed to reset LZMA decoder\n");
				return -1;
			}

			r->current_pos = pos;
		}
	}

	/* read until the position */
	while (r->current_pos < pos) {
		uint64_t go = pos - r->current_pos;

		if (go > (uint64_t)sizeof(temp)) go = (uint64_t)sizeof(temp);
		rd = swf_reader_lzma_read(r,temp,(size_t)go);
		if (rd <= 0) return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x8(%rdi)
jbe 0x4703
cmpq $0x9, %rbx
jae 0x4748
movq %r14, %rdi
callq 0x4624
testl %eax, %eax
jne 0x474f
movq %rbx, 0x8(%r14)
movl $0x200, %r12d           # imm = 0x200
leaq -0x220(%rbp), %r15
movq %rbx, %rdx
subq 0x8(%r14), %rdx
jbe 0x4736
cmpq %r12, %rdx
cmovaeq %r12, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4756
testl %eax, %eax
jg 0x4710
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4738
xorl %eax, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x145b
jmp 0x472f
callq 0x142c
jmp 0x472f
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf_zlib_reader.c
// Function: swf_reader_init_zlib
int swf_reader_init_zlib(swf_reader *swf) {
	int rd;

	inflateEnd(&swf->zlib);
	memset(&swf->zlib,0,sizeof(swf->zlib));
	swf_reader_raw_seek(swf,8); /* put raw pointer back to just after the header */
	assert(swf->decom_buf->data == swf->decom_buf->end);
	rd = swf_reader_raw_read(swf,swf->decom_buf->data,sliding_window_v4_can_write(swf->decom_buf));
	swf->decom_buf->end += rd;
	if (rd <= 0) {
		fprintf(stderr,"Unable to read just past header\n");
		return -1;
	}

	memset(&swf->zlib,0,sizeof(swf->zlib));
	swf->zlib.next_in = swf->decom_buf->data;
	swf->zlib.avail_in = sliding_window_v4_data_available(swf->decom_buf);
	if (inflateInit(&swf->zlib) != Z_OK) {
		fprintf(stderr,"ZLIB failed to init\n");
		return -1;
	}

	swf->eof = 0;
	swf->zlib_eof = 0;
	swf->seek = swf_reader_zlib_seek;
	swf->read = swf_reader_zlib_read;
	swf->current_pos = swf->raw_current_pos;
	swf_reader_raw_seek(swf,8); /* put raw pointer back to just after the header */
	sliding_window_v4_empty(swf->decom_buf); /* reset buffer */
	sliding_window_v4_empty(swf->out_buf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x88(%rdi), %r14
movq %r14, %rdi
callq 0x1100
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb8(%rbx)
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movl $0x8, %esi
movq %rbx, %rdi
callq 0x2a13
movq 0x78(%rbx), %rcx
movq 0x10(%rcx), %rsi
movq 0x18(%rcx), %rax
cmpq %rax, %rsi
jne 0x4c80
movl 0x8(%rcx), %edx
subl %eax, %edx
movq %rbx, %rdi
callq 0x2e88
movq 0x78(%rbx), %rcx
cltq
addq %rax, 0x18(%rcx)
testl %eax, %eax
jle 0x4c6d
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq 0x10(%rcx), %rax
movq %rax, 0x88(%rbx)
movl 0x18(%rcx), %ecx
subl %eax, %ecx
movl %ecx, 0x90(%rbx)
leaq 0x29fb(%rip), %rsi      # 0x75ff
movq %r14, %rdi
movl $0x70, %edx
callq 0x1150
testl %eax, %eax
jne 0x4c74
movw $0x0, 0x70(%rbx)
leaq 0x7d(%rip), %rax        # 0x4c9f
movq %rax, 0x28(%rbx)
leaq 0xf9(%rip), %rax        # 0x4d26
movq %rax, 0x30(%rbx)
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
movl $0x8, %esi
movq %rbx, %rdi
callq 0x2a13
movq 0x78(%rbx), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq 0x80(%rbx), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x18(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x14e8
jmp 0x4c79
callq 0x14b9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4c68
leaq 0x28f2(%rip), %rdi      # 0x7579
leaq 0x2917(%rip), %rsi      # 0x75a5
leaq 0x2922(%rip), %rcx      # 0x75b7
movl $0x16, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf_zlib_reader.c
// Function: swf_reader_zlib_seek
int swf_reader_zlib_seek(void *io,uint64_t pos) {
	swf_reader *r = (swf_reader*)io;
	unsigned char temp[512];
	int rd;

	/* if seeking backward we only allow going back to the header */
	if (pos < r->current_pos) {
		if (pos > 8) {
			fprintf(stderr,"ZLIB: Seeking backwards beyond the initial header not supported\n");
			return -1;
		}
		else {
			/* reset ZLIB decoder */
			if (swf_reader_init_zlib(r)) {
				fprintf(stderr,"Failed to reset ZLIB decoder\n");
				return -1;
			}

			r->current_pos = pos;
		}
	}

	/* read until the position */
	while (r->current_pos < pos) {
		uint64_t go = pos - r->current_pos;

		if (go > (uint64_t)sizeof(temp)) go = (uint64_t)sizeof(temp);
		rd = swf_reader_zlib_read(r,temp,(size_t)go);
		if (rd <= 0) return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x8(%rdi)
jbe 0x4cd3
cmpq $0x9, %rbx
jae 0x4d18
movq %r14, %rdi
callq 0x4b34
testl %eax, %eax
jne 0x4d1f
movq %rbx, 0x8(%r14)
movl $0x200, %r12d           # imm = 0x200
leaq -0x220(%rbp), %r15
movq %rbx, %rdx
subq 0x8(%r14), %rdx
jbe 0x4d06
cmpq %r12, %rdx
cmovaeq %r12, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4d26
testl %eax, %eax
jg 0x4ce0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d08
xorl %eax, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x1546
jmp 0x4cff
callq 0x1517
jmp 0x4cff
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_set_custom_buffer
sliding_window_v4 *sliding_window_v4_set_custom_buffer(sliding_window_v4 *sw,size_t size,const unsigned char *data) {
	/* sanity check: the buffer pointer is NULL */
	assert(sw->buffer == NULL);
	/* sanity check: caller isn't trying to alloc a buffer on top of a buffer or mmap() window, it must be a null window.
	 * if it is a buffer, then it must be a buffer we don't own (meaning: previously called with set_custom_buffer) */
	assert(sw->type == SLIDING_WINDOW_V4_TYPE_NULL || (sw->type == SLIDING_WINDOW_V4_TYPE_BUFFER && !sw->u.buffer.lib_owner));
	/* OK, zero the struct and prepare it for buffer management */
	memset(sw,0,sizeof(*sw));
	if (size < 2) size = 2;
	sw->buffer = (unsigned char*)data;
	sw->type = SLIDING_WINDOW_V4_TYPE_BUFFER;
	sw->u.buffer.lib_owner = 0; /* this library does not own the buffer */
	sw->fence = sw->buffer + size;
	sw->data = sw->end = sw->buffer;
	return sw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, (%rdi)
jne 0x5097
movzbl 0x20(%rdi), %eax
testl %eax, %eax
je 0x5059
cmpl $0x1, %eax
jne 0x50b6
cmpb $0x0, 0x30(%rdi)
jne 0x50b6
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x10(%rdi)
cmpq $0x3, %rsi
movl $0x2, %eax
cmovaeq %rsi, %rax
movq %rdx, (%rdi)
movb $0x1, 0x20(%rdi)
movb $0x0, 0x30(%rdi)
addq %rdx, %rax
movq %rax, 0x8(%rdi)
movq %rdx, 0x18(%rdi)
movq %rdx, 0x10(%rdi)
movq %rdi, %rax
popq %rbp
retq
leaq 0x2619(%rip), %rdi      # 0x76b7
leaq 0x2625(%rip), %rsi      # 0x76ca
leaq 0x262f(%rip), %rcx      # 0x76db
movl $0x35, %edx
callq 0x10a0
leaq 0x2689(%rip), %rdi      # 0x7746
leaq 0x2606(%rip), %rsi      # 0x76ca
leaq 0x2610(%rip), %rcx      # 0x76db
movl $0x38, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_alloc_buffer
sliding_window_v4 *sliding_window_v4_alloc_buffer(sliding_window_v4 *sw,size_t size) {
	/* sanity check: the buffer pointer is NULL */
	assert(sw->buffer == NULL);
	/* sanity check: caller isn't trying to alloc a buffer on top of a buffer or mmap() window, it must be a null window */
	assert(sw->type == SLIDING_WINDOW_V4_TYPE_NULL);
	/* OK, zero the struct and prepare it for buffer management */
	memset(sw,0,sizeof(*sw));
	if (size < 2) size = 2;
	sw->buffer = (unsigned char*)malloc(size);
	if (!sw->buffer) return NULL;
	sw->type = SLIDING_WINDOW_V4_TYPE_BUFFER;
	sw->u.buffer.lib_owner = 1; /* this library owns the buffer */
	sw->fence = sw->buffer + size;
	sw->data = sw->end = sw->buffer;
	return sw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpq $0x0, (%rdi)
jne 0x513e
movq %rdi, %rbx
cmpb $0x0, 0x20(%rdi)
jne 0x515d
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
cmpq $0x3, %rsi
movl $0x2, %r14d
cmovaeq %rsi, %r14
movq %r14, %rdi
callq 0x1130
movq %rax, (%rbx)
testq %rax, %rax
je 0x5134
movb $0x1, %cl
movb %cl, 0x20(%rbx)
movb %cl, 0x30(%rbx)
addq %rax, %r14
movq %r14, 0x8(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x10(%rbx)
jmp 0x5136
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2572(%rip), %rdi      # 0x76b7
leaq 0x257e(%rip), %rsi      # 0x76ca
leaq 0x2665(%rip), %rcx      # 0x77b8
movl $0x46, %edx
callq 0x10a0
leaq 0x26a3(%rip), %rdi      # 0x7807
leaq 0x255f(%rip), %rsi      # 0x76ca
leaq 0x2646(%rip), %rcx      # 0x77b8
movl $0x48, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_create_null
sliding_window_v4* sliding_window_v4_create_null() {
	sliding_window_v4 *sw = (sliding_window_v4*)malloc(sizeof(sliding_window_v4));
	if (!sw) return NULL;
	memset(sw,0,sizeof(*sw));
	return sw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x40, %edi
callq 0x1130
testq %rax, %rax
je 0x51a3
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
popq %rbp
retq
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_create_buffer
sliding_window_v4* sliding_window_v4_create_buffer(size_t size) {
	sliding_window_v4 *sw = sliding_window_v4_create_null();
	if (!sw) return NULL;
	if (sliding_window_v4_alloc_buffer(sw,size) == NULL) {
		free(sw);
		return NULL;
	}
	return sw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x40, %edi
callq 0x1130
testq %rax, %rax
je 0x51d7
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0x51d9
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x51f6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50d5
testq %rax, %rax
jne 0x51f8
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_destroy
sliding_window_v4* sliding_window_v4_destroy(sliding_window_v4 *sw) {
	if (sw) {
		sliding_window_v4_free(sw);
		memset(sw,0,sizeof(*sw));
		free(sw);
	}
	return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x523c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x20(%rdi)
jne 0x521c
movq %rbx, %rdi
callq 0x543e
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq