LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x2a6b
movq %rbx, %rdi
callq 0x2551
testl %eax, %eax
jne 0x2af3
xorl %r15d, %r15d
cmpb $0x0, 0x71(%rbx)
jne 0x2ae5
movq 0x68(%rbx), %rsi
cmpq %rsi, 0x8(%rbx)
jae 0x2a96
movq %rbx, %rdi
callq 0x2551
testl %eax, %eax
je 0x2a90
movb $0x1, 0x71(%rbx)
jmp 0x2ae5
cmpb $0x0, 0x71(%rbx)
jne 0x2ae5
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
callq 0x27a3
movzwl %ax, %ecx
shrl $0x6, %ecx
movw %cx, (%r14)
andl $0x3f, %eax
movl %eax, 0x4(%r14)
cmpw $0x3f, %ax
jne 0x2ac9
movq %rbx, %rdi
callq 0x27ca
movl %eax, 0x4(%r14)
movq 0x8(%rbx), %rcx
movq %rcx, 0x10(%r14)
movl %eax, %eax
addq %rcx, %rax
movq %rax, 0x68(%rbx)
xorl %r15d, %r15d
cmpb $0x0, 0x71(%rbx)
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x64fe(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x374d(%rip), %rdi      # 0x6251
pushq $0x40
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
xorl %r15d, %r15d
jmp 0x2ae5
// File: /workspace/github_c_makefile_star2_O2/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 0x2b36
movl %esi, %r14d
movq %rbx, %rdi
callq 0x2938
movl %r14d, 0x10(%rbx)
movb $0x0, 0x14(%rbx)
leaq -0x669(%rip), %rax      # 0x24d4
movq %rax, 0x18(%rbx)
leaq -0x272(%rip), %rax      # 0x28d6
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_O2/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 %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x27a3
movw %ax, (%rbx)
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x2694
movb 0x10(%rbx), %cl
movl %eax, %edx
andb $0xf, %dl
andb $-0x10, %cl
orb %dl, %cl
movb %cl, 0x10(%rbx)
andl $0xf, %eax
leaq 0x636a(%rip), %rcx      # 0x90f0
movq (%rcx,%rax,8), %rax
movq %rax, 0x8(%rbx)
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x2694
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 0x2f92(%rip), %rcx      # 0x5d48
movzwl (%rcx,%rax,2), %eax
movw %ax, 0x12(%rbx)
pushq $0x1
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
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 %r15d, %esi
callq 0x2694
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 $0x0, %al
movb %al, 0x15(%rbx)
movq %r14, %rdi
callq 0x27ca
movl %eax, 0x18(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1
popq %r15
movl %r15d, %esi
callq 0x2694
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2694
movb (%r14), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2694
movb (%r14), %cl
addb %al, %al
andb $0x2, %al
andb $-0x3, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2694
movb (%r14), %cl
shlb $0x2, %al
andb $0x4, %al
andb $-0x5, %cl
orb %al, %cl
movb %cl, (%r14)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2694
movb (%r14), %cl
shlb $0x3, %al
andb $0x8, %al
andb $-0x9, %cl
orb %al, %cl
movb %cl, (%r14)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x2694
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2694
movb (%r14), %cl
shlb $0x4, %al
andb $0x10, %al
andb $-0x11, %cl
orb %al, %cl
movb %cl, (%r14)
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x2694
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x27a3
movw %ax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x27a3
movzwl %ax, %eax
movw %ax, 0x4(%rbx)
shrl %eax
movw %ax, 0x2(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x311e
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x2(%rdi), %edi
testq %rdi, %rdi
je 0x3146
addl %edi, %edi
callq 0x1140
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_O2/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 %rbx
pushq %rax
movq %rsi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3194
movq %rdi, %r14
movzwl 0x4(%rbx), %ecx
movw %cx, (%rax)
pushq $0x1
popq %r15
movzwl 0x2(%rbx), %eax
cmpq %rax, %r15
jae 0x3190
movq %r14, %rdi
callq 0x27a3
movq 0x8(%rbx), %rcx
movw %ax, (%rcx,%r15,2)
incq %r15
jmp 0x3171
xorl %eax, %eax
jmp 0x319c
xorl %eax, %eax
cmpw 0x2(%rbx), %ax
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x27a3
movw %ax, (%rbx)
movq %r14, %rdi
callq 0x27a3
movw %ax, 0x2(%rbx)
addq $0x4, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x31de
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x1
popq %rsi
callq 0x2694
movb (%rbx), %cl
movl %eax, %edx
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0x1, %al
jne 0x321b
movl $0x10000, 0x4(%rbx)     # imm = 0x10000
movb $0x0, 0x1(%rbx)
movl $0x10000, %eax          # imm = 0x10000
jmp 0x3243
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2694
movb %al, 0x1(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0x4(%rbx)
movzbl 0x1(%rbx), %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0x8(%rbx)
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2694
movb (%rbx), %cl
leal (%rax,%rax), %edx
andb $0x2, %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, (%rbx)
testb $0x1, %al
jne 0x3270
movb $0x0, 0x2(%rbx)
andl $0x0, 0xc(%rbx)
xorl %eax, %eax
jmp 0x3298
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2694
movb %al, 0x2(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0xc(%rbx)
movzbl 0x2(%rbx), %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0x10(%rbx)
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2694
movb %al, 0x3(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0x14(%rbx)
movzbl 0x3(%rbx), %esi
movq %r14, %rdi
callq 0x2712
movl %eax, 0x18(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x27a3
movw %ax, (%rbx)
leaq 0x4(%rbx), %rsi
movq %r14, %rdi
callq 0x274b
leaq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x274b
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2694
pushq $0x1
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
movb 0x2c(%rbx), %cl
andb $0x1, %al
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x2c(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
movb 0x2c(%rbx), %cl
addb %al, %al
andb $0x2, %al
andb $-0x3, %cl
orb %al, %cl
movb %cl, 0x2c(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
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_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
pushq $0x4
popq %r15
movl %r15d, %esi
callq 0x2694
movl (%rbx), %ecx
andl $0xf, %eax
andl $-0x10, %ecx
orl %eax, %ecx
movw %cx, (%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
shll $0x4, %eax
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rbx), %ecx
movzbl %al, %eax
orl %eax, %ecx
movw %cx, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x59(%rdi)
pushq $0x2
popq %r12
movl %r12d, %esi
callq 0x2694
movb (%rbx), %cl
andb $0x3, %al
andb $-0x4, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
movb (%rbx), %cl
shlb $0x2, %al
andb $0xc, %al
andb $-0xd, %cl
orb %al, %cl
movb %cl, (%rbx)
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x2694
movb (%rbx), %cl
shlb $0x4, %al
andb $0xf, %cl
orb %al, %cl
movb %cl, (%rbx)
leaq 0x2(%rbx), %r12
xorl %r13d, %r13d
shrb $0x4, %cl
movzbl %cl, %eax
cmpq %rax, %r13
jae 0x37bf
movq %r14, %rdi
callq 0x25d3
movb %al, -0x1(%r12)
movq %r14, %rdi
movq %r12, %rsi
testl %r15d, %r15d
je 0x37af
callq 0x2627
jmp 0x37b4
callq 0x2661
incq %r13
movb (%rbx), %cl
addq $0x5, %r12
jmp 0x3785
movq %r14, %rdi
callq 0x2814
movw %ax, 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_O2/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, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movb $0x0, 0x59(%rdi)
pushq $0x2
popq %r12
movl %r12d, %esi
callq 0x2694
movb (%rbx), %cl
andb $0x3, %al
andb $-0x4, %cl
orb %al, %cl
movb %cl, (%rbx)
movq %r15, %rdi
movl %r12d, %esi
callq 0x2694
movb (%rbx), %cl
shlb $0x2, %al
andb $0xc, %al
andb $-0xd, %cl
orb %al, %cl
movb %cl, (%rbx)
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x2694
movb (%rbx), %cl
shlb $0x4, %al
andb $0xf, %cl
orb %al, %cl
movb %cl, (%rbx)
leaq 0x2(%rbx), %r12
xorl %r13d, %r13d
shrb $0x4, %cl
movzbl %cl, %eax
cmpq %rax, %r13
jae 0x387f
movq %r15, %rdi
callq 0x25d3
movb %al, -0x1(%r12)
movq %r15, %rdi
movq %r12, %rsi
testl %r14d, %r14d
je 0x386f
callq 0x2627
jmp 0x3874
callq 0x2661
incq %r13
movb (%rbx), %cl
addq $0x5, %r12
jmp 0x3845
andw $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_O2/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 %r14
pushq %rbx
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)
callq 0x25d3
movzbl %al, %eax
movw %ax, 0x2(%rbx)
cmpb $-0x1, %al
jne 0x38d4
movq %r14, %rdi
callq 0x27a3
movw %ax, 0x2(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x27a3
movw %ax, 0x4(%r14)
leaq 0x6(%r14), %rsi
testb $0x1, (%r14)
jne 0x3906
movq %rbx, %rdi
callq 0x2661
jmp 0x390e
movq %rbx, %rdi
callq 0x2627
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x27a3
movw %ax, 0x4(%rbx)
pushq $0x2
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
andl $0x3, %eax
andl $-0x4, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
andl $0x3, %eax
andl $-0xd, %ecx
leal (%rcx,%rax,4), %eax
movw %ax, 0xa(%rbx)
pushq $0x1
popq %r12
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
shll $0x4, %eax
andl $0x10, %eax
andl $-0x11, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
shll $0x5, %eax
andl $0x20, %eax
andl $-0x21, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
shll $0x6, %eax
andl $0x40, %eax
andl $-0x41, %ecx
orl %eax, %ecx
movw %cx, 0xa(%rbx)
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
movzwl 0xa(%rbx), %ecx
shll $0x7, %eax
movzbl %al, %eax
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
orl %eax, %ecx
movw %cx, 0xa(%rbx)
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2694
movq %r14, %rdi
movl %r12d, %esi
callq 0x2694
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 %r15d, %esi
callq 0x2694
movzwl 0xa(%rbx), %edx
andl $0x3, %eax
shll $0x9, %eax
movl %edx, %ecx
andl $0xf9ff, %ecx           # imm = 0xF9FF
orl %eax, %ecx
movw %cx, 0xa(%rbx)
andl $0xc, %edx
cmpw $0x8, %dx
jne 0x3a4f
movq %r14, %rdi
callq 0x27a3
movzwl 0xa(%rbx), %ecx
jmp 0x3a51
xorl %eax, %eax
movw %ax, 0xc(%rbx)
testb $0x10, %cl
jne 0x3a74
addq $0x6, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2627
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq $0x10, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3a8b
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_LINESTYLEARRAY_header
int swf_reader_read_LINESTYLEARRAY_header(swf_reader *swf,swf_LINESTYLEARRAY_read *nfo,unsigned int tag_code) {
	nfo->color_rgba = (tag_code == swftag_DefineShape3 || tag_code == swftag_DefineShape4);
	nfo->LineStyleCount = swf_reader_read_UI8(swf);
	if (nfo->LineStyleCount == 0xFF) nfo->LineStyleCount = swf_reader_read_UI16(swf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
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)
callq 0x25d3
movzbl %al, %eax
movw %ax, 0x2(%rbx)
cmpb $-0x1, %al
jne 0x3c01
movq %r14, %rdi
callq 0x27a3
movw %ax, 0x2(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1130
xorl %ebx, %ebx
movl $0x88, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
pushq $-0x1
popq %rsi
movq %r15, %rdi
callq 0x1120
testl %eax, %eax
jne 0x3ca0
andw $0x0, 0x70(%r14)
leaq 0x70(%rip), %rax        # 0x3cc1
movq %rax, 0x28(%r14)
leaq 0x11c(%rip), %rax       # 0x3d78
movq %rax, 0x30(%r14)
movq (%r14), %rax
movq %rax, 0x8(%r14)
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x2535
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
movq 0x5351(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x279b(%rip), %rdi      # 0x644c
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
pushq $-0x1
popq %rbx
jmp 0x3c93
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x8(%rdi)
jbe 0x3cf7
cmpq $0x9, %rbx
jae 0x3d41
movq %r14, %rdi
callq 0x3c08
testl %eax, %eax
jne 0x3d56
movq %rbx, 0x8(%r14)
movl $0x200, %r13d           # imm = 0x200
leaq -0x230(%rbp), %r12
pushq $-0x1
popq %r15
movq %rbx, %rdx
subq 0x8(%r14), %rdx
jbe 0x3d29
cmpq %r13, %rdx
cmovaeq %r13, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3d78
testl %eax, %eax
jg 0x3d08
jmp 0x3d2c
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x52b0(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x270f(%rip), %rdi      # 0x6461
pushq $0x40
jmp 0x3d69
movq 0x529b(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x273b(%rip), %rdi      # 0x64a2
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
pushq $-0x1
popq %r15
jmp 0x3d2c
// File: /workspace/github_c_makefile_star2_O2/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 0x1110
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)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2535
movq 0x78(%rbx), %rax
movq 0x10(%rax), %rsi
cmpq 0x18(%rax), %rsi
jne 0x42b1
movl 0x8(%rax), %edx
subl %esi, %edx
movq %rbx, %rdi
callq 0x2860
movq 0x78(%rbx), %rcx
cltq
addq %rax, 0x18(%rcx)
testl %eax, %eax
jle 0x427b
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 0x23e8(%rip), %rsi      # 0x65ff
pushq $0x70
popq %rdx
movq %r14, %rdi
callq 0x1160
testl %eax, %eax
jne 0x4290
andw $0x0, 0x70(%rbx)
leaq 0x9c(%rip), %rax        # 0x42ce
movq %rax, 0x28(%rbx)
leaq 0x148(%rip), %rax       # 0x4385
movq %rax, 0x30(%rbx)
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2535
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
movq 0x4d76(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x2352(%rip), %rdi      # 0x65de
pushq $0x20
jmp 0x42a3
movq 0x4d61(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x2365(%rip), %rdi      # 0x6606
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
pushq $-0x1
popq %rax
jmp 0x4276
leaq 0x22c1(%rip), %rdi      # 0x6579
leaq 0x22e6(%rip), %rsi      # 0x65a5
leaq 0x22f1(%rip), %rcx      # 0x65b7
pushq $0x16
popq %rdx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x8(%rdi)
jbe 0x4304
cmpq $0x9, %rbx
jae 0x434e
movq %r14, %rdi
callq 0x414c
testl %eax, %eax
jne 0x4363
movq %rbx, 0x8(%r14)
movl $0x200, %r13d           # imm = 0x200
leaq -0x230(%rbp), %r12
pushq $-0x1
popq %r15
movq %rbx, %rdx
subq 0x8(%r14), %rdx
jbe 0x4336
cmpq %r13, %rdx
cmovaeq %r13, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4385
testl %eax, %eax
jg 0x4315
jmp 0x4339
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4ca3(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x22bc(%rip), %rdi      # 0x661b
pushq $0x40
jmp 0x4376
movq 0x4c8e(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x22e8(%rip), %rdi      # 0x665c
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
pushq $-0x1
popq %r15
jmp 0x4339
// File: /workspace/github_c_makefile_star2_O2/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 0x46d2
movzbl 0x20(%rdi), %eax
testl %eax, %eax
je 0x46a1
cmpl $0x1, %eax
jne 0x46eb
cmpb $0x0, 0x30(%rdi)
jne 0x46eb
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
cmpq $0x3, %rsi
pushq $0x2
popq %rax
cmovaeq %rsi, %rax
movups %xmm0, 0x30(%rdi)
movq %rdx, (%rdi)
movb $0x1, 0x20(%rdi)
addq %rdx, %rax
movq %rax, 0x8(%rdi)
movq %rdx, 0x18(%rdi)
movq %rdx, 0x10(%rdi)
movq %rdi, %rax
popq %rbp
retq
leaq 0x1fde(%rip), %rdi      # 0x66b7
leaq 0x1fea(%rip), %rsi      # 0x66ca
leaq 0x1ff4(%rip), %rcx      # 0x66db
pushq $0x35
jmp 0x4702
leaq 0x2054(%rip), %rdi      # 0x6746
leaq 0x1fd1(%rip), %rsi      # 0x66ca
leaq 0x1fdb(%rip), %rcx      # 0x66db
pushq $0x38
popq %rdx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/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 0x4771
movq %rdi, %rbx
cmpb $0x0, 0x20(%rdi)
jne 0x478a
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x8(%rbx)
andq $0x0, 0x38(%rbx)
cmpq $0x3, %rsi
pushq $0x2
popq %r14
cmovaeq %rsi, %r14
movq %r14, %rdi
callq 0x1140
movq %rax, (%rbx)
testq %rax, %rax
je 0x4767
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 0x4769
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1f3f(%rip), %rdi      # 0x66b7
leaq 0x1f4b(%rip), %rsi      # 0x66ca
leaq 0x2032(%rip), %rcx      # 0x67b8
pushq $0x46
jmp 0x47a1
leaq 0x2076(%rip), %rdi      # 0x6807
leaq 0x1f32(%rip), %rsi      # 0x66ca
leaq 0x2019(%rip), %rcx      # 0x67b8
pushq $0x48
popq %rdx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x47a7
testq %rax, %rax
je 0x47f4
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4708
testq %rax, %rax
jne 0x47f6
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x481f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4822
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_resize_buffer
int sliding_window_v4_resize_buffer(sliding_window_v4 *sw,size_t new_size) {
	unsigned char *np;

	assert(sw->type == SLIDING_WINDOW_V4_TYPE_BUFFER);

	if (new_size < 2) new_size = 2;

	/* don't resize if we're resizing to the same size buffer */
	if (sw->buffer+new_size == sw->fence) return 1;

	/* check for pointer location overflow */
	if (size_t_overflow(sw->buffer,new_size)) return 0;

	/* don't allow resizing if doing so would leave the data & end pointers outside the buffer (violating window sanity) */
	if (sw->data > (sw->buffer+new_size)) return 0;
	if (sw->end > (sw->buffer+new_size)) return 0;

	/* carry out the resize. manage pointers so that if realloc() fails we can gracefully return the struct unmodified */
	if ((np = (unsigned char*)realloc(sw->buffer,new_size)) == NULL) return 0;

	/* throw away the old pointer and update the structure */
	{
		size_t old_do = (size_t)(sw->data - sw->buffer);
		size_t old_eo = (size_t)(sw->end - sw->buffer);
		sw->buffer = np;
		sw->fence = np + new_size;
		sw->data = np + old_do;
		sw->end = np + old_eo;
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, 0x20(%rdi)
jne 0x48d7
movq %rdi, %rbx
cmpq $0x3, %rsi
pushq $0x2
popq %r14
cmovaeq %rsi, %r14
movq (%rdi), %rdi
leaq (%rdi,%r14), %rax
pushq $0x1
popq %r12
cmpq 0x8(%rbx), %rax
je 0x48c8
xorl %r15d, %r15d
movq %rdi, %rcx
addq %r14, %rcx
jb 0x48cb
cmpq %rax, 0x10(%rbx)
ja 0x48cb
cmpq %rax, 0x18(%rbx)
ja 0x48cb
movq %r14, %rsi
callq 0x1150
testq %rax, %rax
je 0x48cb
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
movq 0x18(%rbx), %rsi
subq %rcx, %rsi
movq %rax, (%rbx)
addq %rax, %r14
movq %r14, 0x8(%rbx)
addq %rax, %rdx
movq %rdx, 0x10(%rbx)
addq %rax, %rsi
movq %rsi, 0x18(%rbx)
movl %r12d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f51(%rip), %rdi      # 0x682f
leaq 0x1de5(%rip), %rsi      # 0x66ca
leaq 0x1f6d(%rip), %rcx      # 0x6859
movl $0x8c, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_resize
int sliding_window_v4_resize(sliding_window_v4 *sw,size_t new_size) {
	if (sw == NULL)
		return 0;
	else if (sw->type == SLIDING_WINDOW_V4_TYPE_BUFFER)
		return sliding_window_v4_resize_buffer(sw,new_size);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x490b
cmpb $0x1, 0x20(%rdi)
jne 0x490b
popq %rbp
jmp 0x484a
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_data_advance
size_t sliding_window_v4_data_advance(sliding_window_v4 *sw,size_t bytes) {
	if (sw->buffer == NULL)
		return 0;

	/* don't let the caller advance too far and violate the pointer rule specified in the header file */
	if ((sw->data+bytes) > sw->end)
		bytes = (size_t)(sw->end - sw->data);

	sw->data += bytes;
	return bytes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, (%rdi)
je 0x493b
movq 0x10(%rdi), %rcx
movq 0x18(%rdi), %rdx
leaq (%rcx,%rsi), %r8
movq %rdx, %rax
subq %rcx, %rax
cmpq %rdx, %r8
cmovbeq %rsi, %rax
addq %rax, %rcx
movq %rcx, 0x10(%rdi)
jmp 0x493d
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_wrote
size_t sliding_window_v4_wrote(sliding_window_v4 *sw,size_t bytes) {
	if (sw->buffer == NULL)
		return 0;

	/* to clarify: the caller loads data into memory at sw->end and uses this function to
	 * tell us HOW much data it wrote so the sliding window can follow along */
	if ((sw->end+bytes) > sw->fence)
		bytes = (size_t)(sw->fence - sw->end);

	sw->end += bytes;
	return bytes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, (%rdi)
je 0x496b
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %rdx
leaq (%rdx,%rsi), %r8
movq %rcx, %rax
subq %rdx, %rax
cmpq %rcx, %r8
cmovbeq %rsi, %rax
addq %rax, %rdx
movq %rdx, 0x18(%rdi)
jmp 0x496d
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_flush
size_t sliding_window_v4_flush(sliding_window_v4 *sw) {
	size_t valid_data,ret=0;

    SYSTEM_PAGE_SIZE_init();

	/* copy the valid data left back to the front of the buffer, reset data/end pointers. */
	/* NOTICE: used properly this allows fast reading and parsing of streams. over-used, and
	 * performance will suffer horribly. call this function only when you need to. */

	/* if already there, do nothing */
	if (sw->data == sw->buffer) return 0;

	if (sw->type == SLIDING_WINDOW_V4_TYPE_BUFFER) {
		ret = (size_t)(sw->data - sw->buffer);
		valid_data = sliding_window_v4_data_available(sw);
		if (valid_data > 0) memmove(sw->buffer,sw->data,valid_data);
		sw->data = sw->buffer;
		sw->end = sw->data + valid_data;
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x47f4(%rip)      # 0x9178
jne 0x4995
pushq $0x1e
popq %rdi
callq 0x1190
movq %rax, 0x47e3(%rip)      # 0x9178
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movq %rsi, %r14
subq %rdi, %r14
je 0x49cb
cmpb $0x1, 0x20(%rbx)
jne 0x49cb
movq 0x18(%rbx), %r15
subq %rsi, %r15
je 0x49be
movq %r15, %rdx
callq 0x1170
movq (%rbx), %rdi
movq %rdi, 0x10(%rbx)
addq %rdi, %r15
movq %r15, 0x18(%rbx)
jmp 0x49ce
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_lazy_flush
size_t sliding_window_v4_lazy_flush(sliding_window_v4 *sw) {
	/* lazy flush: call sliding_window_flush() only if more than half the entire buffer has
	 * been consumed. a caller that wants a generally-optimal streaming buffer policy would
	 * call this instead of duplicating code to check and call all over the place. */
	size_t threshhold = ((size_t)(sw->fence - sw->buffer)) >> 1;
	if ((sw->data+threshhold) >= sw->end && sliding_window_v4_data_offset(sw) >= (threshhold/2))
		return sliding_window_v4_flush(sw);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
movq %rax, %rsi
shrq %rsi
movq 0x10(%rdi), %rdx
addq %rdx, %rsi
cmpq 0x18(%rdi), %rsi
jb 0x4a09
subq %rcx, %rdx
shrq $0x2, %rax
cmpq %rax, %rdx
jae 0x4a0d
xorl %eax, %eax
popq %rbp
retq
popq %rbp
jmp 0x496f
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_free_buffer
void sliding_window_v4_free_buffer(sliding_window_v4 *sw) {
	if (sw->buffer != NULL) {
		if (sw->u.buffer.lib_owner) {
			free(sw->buffer); /* we own the buffer, we free it */
			sw->buffer = NULL;
		}
		else if (sw->u.buffer.owner_free_buffer != NULL) {
			/* the buffer is owned by someone else, and that someone else
			 * gave us a callback to free it by. */
			sw->u.buffer.owner_free_buffer(sw);
			sw->buffer = NULL;
		}
		else {
			/* no way to free the buffer. hope the owner intended it that
			 * way, or else a memory leak may happen */
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x4a43
cmpb $0x0, 0x30(%rbx)
je 0x4a31
callq 0x1030
jmp 0x4a3f
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x4a43
movq %rbx, %rdi
callq *%rax
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/sliding_window.c
// Function: sliding_window_v4_is_sane
int sliding_window_v4_is_sane(sliding_window_v4 *sw) {
	if (sw == NULL) return 0;

	/* if any of the pointers are NULL, */
	if (sw->buffer == NULL || sw->data == NULL || sw->fence == NULL || sw->end == NULL) {
		/* if it's a memory buffer: NO, the pointers must not be null */
		if (sw->type == SLIDING_WINDOW_V4_TYPE_BUFFER)
			return 0;

		/* if it's not, then for the window to be valid all four pointers must be NULL.
		 * We enforce consistency here: either they are all non-NULL or they are all NULL. */
		if (sw->buffer != NULL || sw->data != NULL || sw->fence != NULL || sw->end != NULL)
			return 0;

		/* it's valid, then */
		return 1;
	}

	return	(sw->buffer <= sw->data) &&
		(sw->data <= sw->end) &&
		(sw->end <= sw->fence) &&
		(sw->buffer != sw->fence);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x4aae
movq (%rdi), %rax
testq %rax, %rax
je 0x4a9a
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x4aae
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x4aae
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
je 0x4aae
cmpq %rdx, %rax
setbe %dil
cmpq %rsi, %rdx
setbe %dl
andb %dil, %dl
cmpq %rcx, %rsi
setbe %sil
cmpq %rcx, %rax
setne %al
andb %sil, %al
andb %dl, %al
jmp 0x4ab0
cmpb $0x1, 0x20(%rdi)
je 0x4aae
cmpq $0x0, 0x10(%rdi)
jne 0x4aae
cmpq $0x0, 0x8(%rdi)
je 0x4ab5
xorl %eax, %eax
movzbl %al, %eax
popq %rbp
retq
cmpq $0x0, 0x18(%rdi)
sete %al
jmp 0x4ab0
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/util.c
// Function: parseline
size_t
parseline(char *line, char *fields[FieldLast])
{
	char *prev, *s;
	size_t i;

	for (prev = line, i = 0;
	    (s = strchr(prev, '\t')) && i < FieldLast - 1;
	    i++) {
		*s = '\0';
		fields[i] = prev;
		prev = s + 1;
	}
	fields[i++] = prev;
	/* make non-parsed fields empty. */
	for (; i < FieldLast; i++)
		fields[i] = "";

	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x9
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1080
testq %rax, %rax
je 0x1d8b
cmpq $0x7, %r15
jae 0x1d8b
movb $0x0, (%rax)
movq %r14, (%rbx,%r15,8)
incq %rax
incq %r15
movq %rax, %r14
jmp 0x1d64
movq %r14, (%rbx,%r15,8)
incq %r15
leaq 0x16ed(%rip), %r14      # 0x3486
cmpq $0x8, %r15
jne 0x1d8b
pushq $0x8
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/util.c
// Function: strtotime
int
strtotime(const char *s, time_t *t)
{
	long long l;
	char *e;

	errno = 0;
	l = strtoll(s, &e, 10);
	if (errno || *s == '\0' || *e)
		return -1;
	/* NOTE: assumes time_t is 64-bit on 64-bit platforms:
	         long long (atleast 32-bit) to time_t. */
	if (t)
		*t = (time_t)l;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1040
movq %rax, %r15
andl $0x0, (%rax)
leaq 0x8(%rsp), %rsi
pushq $0xa
popq %rdx
movq %r14, %rdi
callq 0x1110
movq %rax, %rcx
pushq $-0x1
popq %rax
cmpl $0x0, (%r15)
je 0x1ded
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpb $0x0, (%r14)
je 0x1de3
movq 0x8(%rsp), %rdx
cmpb $0x0, (%rdx)
jne 0x1de3
xorl %eax, %eax
testq %rbx, %rbx
je 0x1de3
movq %rcx, (%rbx)
jmp 0x1de3
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/util.c
// Function: xmlencode
void
xmlencode(const char *s, FILE *fp)
{
	for (; *s; ++s) {
		switch (*s) {
		case '<':  fputs("&lt;",   fp); break;
		case '>':  fputs("&gt;",   fp); break;
		case '\'': fputs("&#39;",  fp); break;
		case '&':  fputs("&amp;",  fp); break;
		case '"':  fputs("&quot;", fp); break;
		default:   fputc(*s, fp);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1730(%rip), %r12      # 0x3551
leaq 0x1723(%rip), %r13      # 0x354b
leaq 0x1712(%rip), %rbp      # 0x3541
leaq 0x1710(%rip), %r15      # 0x3546
movzbl (%r14), %eax
cmpl $0x22, %eax
je 0x1e6e
cmpl $0x26, %eax
je 0x1e7c
cmpl $0x27, %eax
je 0x1e64
cmpl $0x3c, %eax
je 0x1e77
cmpl $0x3e, %eax
je 0x1e69
testl %eax, %eax
je 0x1e8c
movsbl %al, %edi
movq %rbx, %rsi
callq 0x10d0
jmp 0x1e87
movq %r13, %rdi
jmp 0x1e7f
movq %r15, %rdi
jmp 0x1e7f
leaq 0x16e2(%rip), %rdi      # 0x3557
jmp 0x1e7f
movq %rbp, %rdi
jmp 0x1e7f
movq %r12, %rdi
movq %rbx, %rsi
callq 0x10b0
incq %r14
jmp 0x1e36
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq