LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/icns.c
// Function: do_uncompress_24
static void do_uncompress_24(deark *c, lctx *d, struct page_ctx *pg, dbuf *unc_pixels,
	i64 skip)
{
	i64 pos;
	u8 b;
	i64 count;
	u8 n;

	pos = pg->image_pos;
	if(skip) pos+=4;

	while(1) {
		if(pos >= pg->image_pos + pg->image_len) break;

		b = de_getbyte(pos);
		pos++;
		if(b>=128) {
			// Compressed run
			count = (i64)b - 125;
			n = de_getbyte(pos);
			pos++;
			dbuf_write_run(unc_pixels, n, count);
		}
		else {
			// An uncompressed run
			count = 1 + (i64)b;
			dbuf_copy(c->infile, pos, count, unc_pixels);
			pos += count;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rsi), %rax
leaq 0x4(%rax), %r12
testq %rcx, %rcx
cmoveq %rax, %r12
addq 0x18(%rsi), %rax
cmpq %rax, %r12
jge 0x74b67
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0xef0d5
leaq 0x1(%r12), %rbp
movq 0x18(%r15), %rdi
movzbl %al, %r13d
testb %al, %al
js 0x74b3c
leaq 0x1(%r13), %rdx
movq %rbp, %rsi
movq %rbx, %rcx
callq 0xefabc
leaq 0x1(,%r13), %r12
addq %rbp, %r12
jmp 0x74b5a
addq $-0x7d, %r13
movq %rbp, %rsi
callq 0xef0d5
addq $0x2, %r12
movzbl %al, %esi
movq %rbx, %rdi
movq %r13, %rdx
callq 0xf14bd
movq 0x18(%r14), %rax
addq 0x10(%r14), %rax
cmpq %rax, %r12
jl 0x74b03
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/icns.c
// Function: read_image_plane
static void read_image_plane(deark *c, lctx *d,
	dbuf *unc_pixels, i64 plane, de_bitmap *img, i64 samplenum)
{
	i64 i, j;
	i64 w, h;

	w = img->width;
	h = img->height;

	for(j=0; j<h; j++) {
		for(i=0; i<w; i++) {
			u8 v;

			v = dbuf_getbyte(unc_pixels, (plane*h+j)*w + i);
			de_bitmap_setsample(img, i, j, samplenum, v);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x10(%rdx), %rax
movq %rax, (%rsp)
testq %rax, %rax
jle 0x74bfa
movq %rdi, %rbp
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rbx
movq (%rsp), %r12
imulq %rbx, %r12
imulq %rsi, %r12
xorl %r14d, %r14d
movq 0x8(%rsp), %r15
testq %rbx, %rbx
jle 0x74bee
xorl %r13d, %r13d
leaq (%r12,%r13), %rsi
movq %rbp, %rdi
callq 0xef0d5
movzbl %al, %r8d
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
callq 0xf299c
incq %r13
cmpq %r13, %rbx
jne 0x74bc3
incq %r14
addq %rbx, %r12
cmpq (%rsp), %r14
jne 0x74bbb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: de_module_id3
void de_module_id3(deark *c, struct deark_module_info *mi)
{
	mi->id = "id3";
	mi->desc = "ID3 metadata";
	mi->run_fn = de_run_id3;
	mi->identify_fn = de_identify_id3;
	mi->flags |= DE_MODFLAG_HIDDEN | DE_MODFLAG_SHAREDDETECTION;
}

// Assembly:
leaq 0x9dbb3(%rip), %rax     # 0x1127c6
movq %rax, (%rsi)
leaq 0xb2ae7(%rip), %rax     # 0x127704
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x74c3c
movq %rax, 0x18(%rsi)
leaq 0xef0(%rip), %rax       # 0x75b23
movq %rax, 0x20(%rsi)
orb $0x11, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: de_identify_id3
static int de_identify_id3(deark *c)
{
	u8 flags;
	u8 version_code;
	u8 has_footer = 0;
	i64 total_len;

	c->detection_data->id3.detection_attempted = 1;
	if(dbuf_memcmp(c->infile, 0, "ID3", 3)) return 0;
	c->detection_data->id3.has_id3v2 = 1;

	version_code = dbuf_getbyte(c->infile, 3);
	flags = dbuf_getbyte(c->infile, 5);
	if(version_code >= 4) {
		has_footer = (flags&0x10)?1:0;
	}

	total_len = 10;
	total_len += get_synchsafe_int(c->infile, 6);
	if(has_footer) total_len += 10;

	de_dbg2(c, "[id3detect] calculated end of ID3v2 data: %u", (unsigned int)total_len);
	c->detection_data->id3.bytes_at_start = (u32)total_len;

	// This module is never "detected". It's only used for its side effects,
	// and as a submodule.
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movb $0x1, 0x14(%rax)
movq 0x18(%rdi), %rdi
leaq 0x9cc4e(%rip), %rdx     # 0x11278e
movl $0x3, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
jne 0x75bf4
movq 0x28(%rbx), %rax
movb $0x1, 0x15(%rax)
movq 0x18(%rbx), %rdi
movl $0x3, %esi
callq 0xef0d5
movl %eax, %ebp
movq 0x18(%rbx), %rdi
movl $0x5, %esi
callq 0xef0d5
movl %eax, %r14d
movq 0x18(%rbx), %rdi
leaq 0x4(%rsp), %r15
movl $0x6, %edx
movl $0x4, %ecx
movq %r15, %rsi
callq 0xeeee8
movzbl (%r15), %eax
shll $0x15, %eax
movzbl 0x1(%r15), %ecx
shll $0xe, %ecx
orl %eax, %ecx
movzbl 0x2(%r15), %eax
shll $0x7, %eax
movzbl 0x3(%r15), %edx
orl %eax, %edx
orl %ecx, %edx
testb $0x10, %r14b
movl $0xa, %eax
movl $0x14, %r14d
cmovel %eax, %r14d
cmpb $0x4, %bpl
cmovbl %eax, %r14d
addl %edx, %r14d
leaq 0xb27de(%rip), %rsi     # 0x1283bd
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe93cf
movq 0x28(%rbx), %rax
movl %r14d, 0x18(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: unescape_id3v2_data
static void unescape_id3v2_data(deark *c, dbuf *inf, i64 inf_start,
	i64 inf_len, dbuf *outf)
{
	i64 srcpos = inf_start;
	u8 b0;

	de_dbg(c, "unescaping \"unsynchronised\" ID3v2 data");
	de_dbg_indent(c, 1);

	while(srcpos<inf_start+inf_len) {
		b0 = dbuf_getbyte(inf, srcpos++);
		if(b0==0xff && srcpos<(inf_start+inf_len-1) && dbuf_getbyte(inf, srcpos)==0x00) {
			srcpos++;
		}
		dbuf_writebyte(outf, b0);
	}

	de_dbg(c, "unescaped %d bytes to %d bytes", (int)inf_len, (int)outf->len);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
leaq 0xb1c97(%rip), %rsi     # 0x1278be
xorl %eax, %eax
callq 0xe9226
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r14, (%rsp)
testq %r14, %r14
jle 0x75ca5
movq (%rsp), %rax
leaq (%rax,%r13), %rbx
leaq -0x1(%rbx), %r15
leaq 0x1(%r13), %rbp
movq %r12, %rdi
movq %r13, %rsi
callq 0xef0d5
movl %eax, %r14d
cmpb $-0x1, %al
sete %al
cmpq %r15, %rbp
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x75c8f
movq %r12, %rdi
movq %rbp, %rsi
callq 0xef0d5
testb %al, %al
jne 0x75c8f
addq $0x2, %r13
movq %r13, %rbp
movzbl %r14b, %esi
movq 0x8(%rsp), %rdi
callq 0xf11be
movq %rbp, %r13
cmpq %rbx, %rbp
jl 0x75c55
movq 0x8(%rsp), %rax
movl 0x18(%rax), %ecx
leaq 0xb1c31(%rip), %rsi     # 0x1278e5
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9585
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame_text
static void decode_id3v2_frame_text(deark *c, id3v2ctx *d,
	dbuf *f, i64 pos1, i64 len, struct de_fourcc *tag4cc)
{
	u8 id3_encoding;
	de_ucstring *s = NULL;
	i64 pos = pos1;

	if(len<1) goto done;
	id3_encoding = dbuf_getbyte(f, pos++);
	de_dbg(c, "text encoding: %d (%s)", (int)id3_encoding,
		get_id3v2_textenc_name(d, id3_encoding));

	s = ucstring_create(c);
	id3v2_read_to_ucstring(c, f, pos, pos1+len-pos, s, id3_encoding);
	de_dbg(c, "text: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %r8, %r8
jle 0x75fd6
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x1(%rcx), %r12
movq %rdx, %rdi
movq %rcx, %rsi
callq 0xef0d5
movzbl %al, %r13d
cmpb $0x3, %r13b
ja 0x76015
leaq 0xb16f0(%rip), %rax     # 0x1276b4
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xb1d20(%rip), %rcx     # 0x127cf4
jmp 0x7601c
xorl %ebp, %ebp
jmp 0x76071
leaq 0xb1d3a(%rip), %rcx     # 0x127d1e
jmp 0x7601c
leaq 0xae0ec(%rip), %rcx     # 0x1240d9
jmp 0x7601c
movb 0x30(%rbp), %al
cmpb $0x3, %al
leaq 0xb1d0a(%rip), %rcx     # 0x127d05
leaq 0xb1d0f(%rip), %rdx     # 0x127d11
cmoveq %rcx, %rdx
cmpb $0x2, %al
leaq 0xb1cf0(%rip), %rcx     # 0x127cff
cmovneq %rdx, %rcx
jmp 0x7601c
leaq 0xb5e4d(%rip), %rcx     # 0x12be69
leaq 0xb1cb6(%rip), %rsi     # 0x127cd9
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6870
movq %rax, %rbp
decq %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
movl %r13d, %r9d
callq 0x76a8c
movq %rbp, %rdi
callq 0xf74bd
leaq 0xc4ca8(%rip), %rsi     # 0x13ad0c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbp, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame_urllink
static void decode_id3v2_frame_urllink(deark *c, id3v2ctx *d,
	dbuf *f, i64 pos1, i64 len, struct de_fourcc *tag4cc)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring(f, pos1, len, s, 0, DE_ENCODING_LATIN1);
	de_dbg(c, "url: \"%s\"", ucstring_getpsz(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %r13
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x5, %r9d
callq 0xf01b0
movq %r13, %rdi
callq 0xf74bd
leaq 0x9c7aa(%rip), %rsi     # 0x112877
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame_pop_popm
static void decode_id3v2_frame_pop_popm(deark *c, id3v2ctx *d,
	dbuf *f, i64 pos1, i64 len)
{
	i64 bytes_consumed = 0;
	de_ucstring *email = NULL;
	i64 pos = pos1;
	int rating;
	int ret;

	email = ucstring_create(c);
	ret = read_id3v2_terminated_string(c, d, f, pos, pos1+len-pos, 256, ID3ENC_ISO_8859_1,
		email, &bytes_consumed);
	if(!ret) goto done;
	de_dbg(c, "email/id: \"%s\"", ucstring_getpsz(email));
	pos += bytes_consumed;

	if(pos1+len-pos < 1) goto done;
	rating = (int)dbuf_getbyte(f, pos++);
	de_dbg(c, "rating: %d%s", rating, (rating==0)?" (unknown)":"/255");

	// TODO: There can be a "counter" field here.

done:
	ucstring_destroy(email);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsp), %rbp
movq $0x0, (%rbp)
callq 0xf6870
movq %rax, %rbx
movq %rbp, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x769ce
testl %eax, %eax
je 0x7689a
movq %rbx, %rdi
callq 0xf74bd
leaq 0xb1699(%rip), %rsi     # 0x127ee9
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%rsp), %rsi
cmpq %r13, %rsi
jge 0x7689a
addq %r12, %rsi
movq %r15, %rdi
callq 0xef0d5
movzbl %al, %edx
testb %dl, %dl
leaq 0xb1687(%rip), %rax     # 0x127f05
leaq 0xb168b(%rip), %rcx     # 0x127f10
cmoveq %rax, %rcx
leaq 0xb1668(%rip), %rsi     # 0x127ef8
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6bb0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: decode_id3v2_frame_priv
static void decode_id3v2_frame_priv(deark *c, id3v2ctx *d,
	dbuf *f, i64 pos1, i64 len)
{
	struct de_stringreaderdata *owner = NULL;
	i64 pos = pos1;
	i64 nbytes_to_scan;
	i64 payload_len;

	nbytes_to_scan = pos1+len-pos;
	if(nbytes_to_scan>256) nbytes_to_scan=256;

	owner = dbuf_read_string(f, pos, nbytes_to_scan, nbytes_to_scan,
		DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_LATIN1);
	if(!owner->found_nul) goto done;

	de_dbg(c, "owner: \"%s\"", ucstring_getpsz(owner->str));
	pos += owner->bytes_consumed;

	payload_len = pos1+len-pos;
	if(payload_len<1) goto done;

	de_dbg(c, "private frame data at %"I64_FMT", len=%"I64_FMT, pos, payload_len);
	if(!de_strcmp(owner->sz, "XMP")) {
		dbuf_create_file_from_slice(f, pos, payload_len, "xmp", NULL, DE_CREATEFLAG_IS_AUX);
	}
	else if(c->debug_level>=2) {
		de_dbg_indent(c, 1);
		de_dbg_hexdump(c, f, pos, payload_len, 256, NULL, 0x1);
		de_dbg_indent(c, -1);
	}

done:
	de_destroy_stringreaderdata(c, owner);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %rbx
movl $0x100, %ecx            # imm = 0x100
cmpq %rcx, %r15
cmovlq %r15, %rcx
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movl $0x1, %r8d
movl $0x5, %r9d
callq 0xefe67
movq %rax, %r14
cmpl $0x0, 0x34(%rax)
je 0x769b5
movq 0x18(%r14), %rdi
callq 0xf74bd
leaq 0xb160a(%rip), %rsi     # 0x127f15
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq (%r14), %r13
subq %r13, %r15
testq %r15, %r15
jle 0x769b5
addq %rbp, %r13
leaq 0xb15f0(%rip), %rsi     # 0x127f21
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%r14), %rdi
leaq 0xb4e22(%rip), %rsi     # 0x12b76e
callq 0x181a0
testl %eax, %eax
je 0x76997
cmpl $0x2, (%rbx)
jl 0x769b5
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xe975a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0x769b5
leaq 0xc0db8(%rip), %rcx     # 0x137756
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf0321
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf00aa
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: read_id3v2_terminated_string
static int read_id3v2_terminated_string(deark *c, id3v2ctx *d, dbuf *f,
	i64 pos, i64 nbytes_avail, i64 nbytes_to_scan, u8 id3_encoding,
	de_ucstring *s, i64 *bytes_consumed)
{
	i64 foundpos = 0;
	i64 stringlen;
	int ret;
	int retval = 0;

	if(nbytes_to_scan > nbytes_avail)
		nbytes_to_scan = nbytes_avail;
	if(nbytes_to_scan < 0)
		nbytes_to_scan = 0;

	if(id3_encoding==ID3ENC_UTF16 || id3_encoding==ID3ENC_UTF16BE) {
		// A 2-byte encoding
		int foundflag = 0;

		foundflag = dbuf_get_utf16_NULterm_len(f, pos, nbytes_to_scan, bytes_consumed);
		if(!foundflag) goto done;
		stringlen = (*bytes_consumed)-2;
	}
	else {
		// A 1-byte encoding
		ret = dbuf_search_byte(f, 0x00, pos, nbytes_to_scan, &foundpos);
		if(!ret) goto done;
		stringlen = foundpos - pos;
		*bytes_consumed = stringlen + 1;
	}

	id3v2_read_to_ucstring(c, f, pos, stringlen, s, id3_encoding);

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %r15d
movq %rcx, %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq 0x40(%rsp), %r8
xorl %ebp, %ebp
movq %rbp, (%rsp)
movl $0x100, %ecx            # imm = 0x100
cmpq %rcx, %rax
cmovlq %rax, %rcx
testq %rcx, %rcx
cmovleq %rbp, %rcx
leal -0x1(%r15), %eax
cmpb $0x1, %al
ja 0x76a34
movq %r12, %rdi
movq %r14, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0xf1c0a
testl %eax, %eax
je 0x76a5d
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
addq $-0x2, %rcx
jmp 0x76a5d
movq %rsp, %r8
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xf0057
testl %eax, %eax
je 0x76a7b
movq (%rsp), %rcx
subq %r14, %rcx
leaq 0x1(%rcx), %rax
movq 0x40(%rsp), %rdx
movq %rax, (%rdx)
jmp 0x76a61
testl %eax, %eax
je 0x76a7b
movzbl %r15b, %r9d
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %r8
callq 0x76a8c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: id3v2_read_to_ucstring
static void id3v2_read_to_ucstring(deark *c, dbuf *f, i64 pos1, i64 len,
	de_ucstring *s, u8 id3_encoding)
{
	i64 pos = pos1;
	const char *bomdesc = "none";
	de_encoding encoding_to_use = DE_ENCODING_UNKNOWN;

	if(len<=0) goto done;

	if(id3_encoding==ID3ENC_ISO_8859_1) {
		encoding_to_use = DE_ENCODING_LATIN1;
	}
	else if(id3_encoding==ID3ENC_UTF16) {
		u32 bom_id;

		if(len<2) goto done;
		bom_id = (u32)dbuf_getu16be(f, pos);

		if(bom_id==0xfeff) {
			encoding_to_use = DE_ENCODING_UTF16BE;
			bomdesc = "BE";
		}
		else if(bom_id==0xfffe) {
			encoding_to_use = DE_ENCODING_UTF16LE;
			bomdesc = "LE";
		}
		else {
			// TODO: What should we do if there's no BOM?
			// v2.2.x does not say anything about a BOM, but it also does not
			// say anything about what byte order is used.
			// v2.3.x and 2.4.x require a BOM.
			goto done;
		}
		pos += 2;
	}
	else if(id3_encoding==ID3ENC_UTF16BE) {
		encoding_to_use = DE_ENCODING_UTF16BE;
	}
	else if(id3_encoding==ID3ENC_UTF8) { // UTF-8
		encoding_to_use = DE_ENCODING_UTF8;
	}
	else {
		goto done; // Error
	}

	// TODO: Maybe shouldn't use DE_DBG_MAX_STRLEN here.
	dbuf_read_to_ucstring_n(f, pos, pos1+len-pos, DE_DBG_MAX_STRLEN, s, 0, encoding_to_use);
	ucstring_truncate_at_NUL(s);

done:
	if(id3_encoding==ID3ENC_UTF16 && c->debug_level>=2) {
		de_dbg2(c, "BOM: %s", bomdesc);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %rdi, %rbx
testq %rcx, %rcx
jle 0x76ad6
movq %r8, %r15
leaq 0x99c79(%rip), %r8      # 0x110725
cmpb $0x3, %bpl
ja 0x76b1b
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r13
movzbl %bpl, %eax
leaq 0xb0c2e(%rip), %rcx     # 0x1276f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x5, %ecx
jmp 0x76aeb
leaq 0x99c48(%rip), %r8      # 0x110725
jmp 0x76b1b
movl $0x4, %ecx
jmp 0x76aeb
movl $0x2, %ecx
movq %r14, %rsi
addq %r14, %r12
subq %rsi, %r12
movl %ecx, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rdi
movq %r12, %rdx
movq %r8, %r14
movq %r15, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf68c1
movq %r14, %r8
cmpb $0x1, %bpl
jne 0x76b48
cmpl $0x2, (%rbx)
jl 0x76b48
leaq 0xb11fa(%rip), %rsi     # 0x127d27
movq %rbx, %rdi
movq %r8, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe93cf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
leaq 0x99bc5(%rip), %r8      # 0x110725
cmpq $0x1, %r12
jne 0x76b6d
movq %r14, %rsi
xorl %edx, %edx
jmp 0x76bb7
movq %r13, %rdi
movq %r14, %rsi
callq 0xef169
cmpl $0xfeff, %eax           # imm = 0xFEFF
je 0x76ba5
xorl %ecx, %ecx
movq %r14, %rsi
movl $0x0, %edx
cmpl $0xfffe, %eax           # imm = 0xFFFE
leaq 0x99b90(%rip), %r8      # 0x110725
jne 0x76bb7
movl $0x3, %ecx
leaq 0xa5ec2(%rip), %r8      # 0x11ca65
jmp 0x76bb1
movl $0x4, %ecx
leaq 0xada14(%rip), %r8      # 0x1245c5
leaq 0x2(%r14), %rsi
movb $0x1, %dl
testb %dl, %dl
jne 0x76aee
jmp 0x76b1b
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/id3.c
// Function: extract_pic_apic
static void extract_pic_apic(deark *c, id3v2ctx *d, dbuf *f,
	 i64 pos, i64 len, const struct apic_type_info *ptinfo)
{
	char fullext[32];
	const char *token = NULL;
	struct fmtutil_fmtid_ctx *idctx = NULL;

	idctx = de_malloc(c, sizeof(struct fmtutil_fmtid_ctx));
	idctx->inf = f;
	idctx->inf_pos = pos;
	idctx->inf_len = len;
	idctx->mode = FMTUTIL_FMTIDMODE_ALL_IMG; // expecting PNG or JPEG
	fmtutil_fmtid(c, idctx);

	if(ptinfo && ptinfo->token) token = ptinfo->token;
	if(!token) {
		if(d->wmpicture_mode) token = "wmpic";
	}
	if(!token) token = "id3pic";

	de_snprintf(fullext, sizeof(fullext), "%s.%s", token, idctx->ext_sz);

	dbuf_create_file_from_slice(f, pos, len, fullext, NULL, DE_CREATEFLAG_IS_AUX);

	de_free(c, idctx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movl $0x78, %esi
callq 0xe969b
movq %rax, %r12
movq %r13, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
movb $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfa395
testq %rbp, %rbp
je 0x76c18
movq 0x10(%rbp), %rax
jmp 0x76c1a
xorl %eax, %eax
testq %rax, %rax
jne 0x76c35
xorl %eax, %eax
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x1(%rcx)
leaq 0xb12ab(%rip), %rcx     # 0x127edc
cmovneq %rcx, %rax
testq %rax, %rax
leaq 0xb12a3(%rip), %rcx     # 0x127ee2
cmovneq %rax, %rcx
movq %r12, %r8
addq $0x6c, %r8
leaq 0xc3b31(%rip), %rdx     # 0x13a782
leaq 0x10(%rsp), %rbp
movl $0x20, %esi
movq %rbp, %rdi
xorl %eax, %eax
callq 0xe8d67
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf0321
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe9752
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ico.c
// Function: de_module_ico
void de_module_ico(deark *c, struct deark_module_info *mi)
{
	mi->id = "ico";
	mi->desc = "Windows icon/cursor";
	mi->run_fn = de_run_ico;
	mi->identify_fn = de_identify_ico;
}

// Assembly:
leaq 0xaa3a6(%rip), %rax     # 0x121049
movq %rax, (%rsi)
leaq 0xb173d(%rip), %rax     # 0x1283ea
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x76cc8
movq %rax, 0x18(%rsi)
leaq 0x82e(%rip), %rax       # 0x774f1
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ico.c
// Function: de_module_win1ico
void de_module_win1ico(deark *c, struct deark_module_info *mi)
{
	mi->id = "win1ico";
	mi->desc = "Windows 1.0 icon/cursor";
	mi->run_fn = de_run_win1ico;
	mi->identify_fn = de_identify_win1ico;
}

// Assembly:
leaq 0xb0e24(%rip), %rax     # 0x1283fe
movq %rax, (%rsi)
leaq 0xb0f86(%rip), %rax     # 0x12856a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x775ff
movq %rax, 0x18(%rsi)
leaq 0x10d(%rip), %rax       # 0x77707
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ico.c
// Function: de_run_win1ico
static void de_run_win1ico(deark *c, de_module_params *mparams)
{
	win1ctx *d = NULL;
	i64 pos = 0;

	d = de_malloc(c, sizeof(win1ctx));
	d->type_code = (unsigned int)de_getu16le_p(&pos);
	de_dbg(c, "type code: 0x%04x", d->type_code);
	if(d->type_code==0x0003 || d->type_code==0x0103 || d->type_code==0x0203) {
		d->is_cur = 1;
		d->type_name = "cursor";
	}
	else if(d->type_code==0x0001 || d->type_code==0x0101 || d->type_code==0x0201) {
		d->type_name = "icon";
	}
	else {
		de_err(c, "Not a Windows 1.0 icon/cursor");
		goto done;
	}
	de_declare_fmtf(c, "Windows 1.0 %s", d->type_name);

	if(!decode_win1_icon(c, d, pos)) goto done;
	pos += d->bytes_consumed;
	if((d->type_code & 0xff00)==0x0200) {
		// In this case there are supposed to be two icons (this is untested).
		if(!decode_win1_icon(c, d, pos)) goto done;
	}

done:
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
movl $0x18, %esi
callq 0xe969b
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef1ed
movl %eax, (%r14)
leaq 0xb0f18(%rip), %rsi     # 0x128552
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl (%r14), %eax
leaq 0xad75a(%rip), %rdx     # 0x124daa
cmpl $0x102, %eax            # imm = 0x102
jg 0x7766a
cmpl $0x1, %eax
je 0x7768e
cmpl $0x3, %eax
je 0x7767f
cmpl $0x101, %eax            # imm = 0x101
je 0x7768e
jmp 0x776e1
cmpl $0x203, %eax            # imm = 0x203
je 0x7767f
cmpl $0x201, %eax            # imm = 0x201
je 0x7768e
cmpl $0x103, %eax            # imm = 0x103
jne 0x776e1
movl $0x1, 0x4(%r14)
leaq 0xc2b9b(%rip), %rdx     # 0x13a229
movq %rdx, 0x8(%r14)
leaq 0xb0ee9(%rip), %rsi     # 0x128582
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb703
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x777fc
testl %eax, %eax
je 0x776f2
movq 0x8(%rsp), %rdx
addq 0x10(%r14), %rdx
movq %rdx, 0x8(%rsp)
movzbl 0x1(%r14), %eax
shll $0x8, %eax
cmpl $0x200, %eax            # imm = 0x200
jne 0x776f2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x777fc
jmp 0x776f2
leaq 0xb0e7c(%rip), %rsi     # 0x128564
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ico.c
// Function: de_identify_win1ico
static int de_identify_win1ico(deark *c)
{
	u8 tclo, tchi;
	i64 w, h, wb;
	int has_ext;

	tclo = de_getbyte(0);
	tchi = de_getbyte(1);
	if((tclo==1 || tclo==3) && (tchi<=2)) {
		;
	}
	else {
		return 0;
	}

	w = de_getu16le(6);
	h = de_getu16le(8);
	wb = de_getu16le(10);
	if(w<16 || h<16 || w>256 || h>256) return 0;
	if(wb != ((w+15)/16)*2) return 0;
	has_ext = de_input_file_has_ext(c, (tclo==3)?"cur":"ico");
	if((w==32 || w==64) && h==w && has_ext) return 100;
	return has_ext ? 70 : 6;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef0d5
movl %eax, %r15d
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0xef0d5
leal -0x1(%r15), %ecx
testb $-0x3, %cl
jne 0x777f0
cmpb $0x2, %al
ja 0x777f0
movq 0x18(%r14), %rdi
movl $0x6, %esi
callq 0xef1ca
movq %rax, %r12
movq 0x18(%r14), %rdi
movl $0x8, %esi
callq 0xef1ca
movq %rax, %r13
movq 0x18(%r14), %rdi
movl $0xa, %esi
callq 0xef1ca
movq $-0x101, %rcx           # imm = 0xFEFF
leaq (%r12,%rcx), %rdx
movq $-0xf1, %rsi
cmpq %rsi, %rdx
setb %dl
addq %r13, %rcx
cmpq %rsi, %rcx
setb %cl
orb %dl, %cl
jne 0x777f0
leal 0xf(%r12), %ecx
shrl $0x3, %ecx
andl $0x7e, %ecx
cmpq %rcx, %rax
jne 0x777f0
cmpb $0x3, %r15b
leaq 0xa5acd(%rip), %rax     # 0x11d283
leaq 0xa988c(%rip), %rsi     # 0x121049
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0xea936
cmpq $0x40, %r12
je 0x777d5
cmpq $0x20, %r12
jne 0x777e3
cmpq %r12, %r13
jne 0x777e3
movl $0x64, %ebx
testl %eax, %eax
jne 0x777f0
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
shll $0x6, %ebx
orl $0x6, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_module_iff
void de_module_iff(deark *c, struct deark_module_info *mi)
{
	mi->id = "iff";
	mi->desc = "IFF (Interchange File Format)";
	mi->run_fn = de_run_iff;
	mi->identify_fn = de_identify_iff;
	mi->help_fn = de_help_iff;
}

// Assembly:
leaq 0xc24a1(%rip), %rax     # 0x13a074
movq %rax, (%rsi)
leaq 0xb09ef(%rip), %rax     # 0x1285cc
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x77c03
movq %rax, 0x18(%rsi)
leaq 0x123(%rip), %rax       # 0x77d16
movq %rax, 0x20(%rsi)
leaq 0x133(%rip), %rax       # 0x77d31
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_run_iff
static void de_run_iff(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	struct de_iffctx *ictx = NULL;
	const char *s;
	i64 pos;
	int confidence = 0;

	d = de_malloc(c, sizeof(lctx));

	ictx = fmtutil_create_iff_decoder(c);
	ictx->has_standard_iff_chunks = 1;
	ictx->alignment = 2; // default

	d->fmt = identify_internal(c, &confidence);

	if(d->fmt==FMT_FOR4) {
		ictx->alignment = 4;
	}

	d->decode_hint = (u8)de_get_ext_option_bool(c, "iff:decode", 0);
	s = de_get_ext_option(c, "iff:align");
	if(s) {
		ictx->alignment = de_atoi(s);
	}

	if(d->fmt==FMT_DJVU) {
		de_declare_fmt(c, "DjVu");
		pos = 4;
	}
	else {
		pos = 0;
	}

	ictx->userdata = (void*)d;
	ictx->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_ASCII);
	ictx->handle_chunk_fn = my_iff_chunk_handler;
	ictx->on_std_container_start_fn = my_std_container_start_fn;
	ictx->f = c->infile;

	fmtutil_read_iff_format(ictx, pos, c->infile->len - pos);

	fmtutil_destroy_iff_decoder(ictx);
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %r12
movl $0x0, (%r12)
movl $0x8, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0x107b04
movq %rax, %r15
movb $0x1, 0x5d(%rax)
movq $0x2, 0x48(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x77f17
movl %eax, (%r14)
cmpl $0x4, %eax
jne 0x77c5a
movq $0x4, 0x48(%r15)
leaq 0xc495b(%rip), %rsi     # 0x13c5bc
movq %rbx, %rdi
xorl %edx, %edx
callq 0xea727
movb %al, 0x4(%r14)
leaq 0xb0997(%rip), %rsi     # 0x12860d
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x77c91
movq %rax, %rdi
callq 0xea781
cltq
movq %rax, 0x48(%r15)
cmpl $0xa, (%r14)
jne 0x77cae
leaq 0xb0979(%rip), %rsi     # 0x128617
movq %rbx, %rdi
callq 0xeb6d6
movl $0x4, %r12d
jmp 0x77cb1
xorl %r12d, %r12d
movq %r14, 0x10(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xeb7d1
movl %eax, 0x60(%r15)
leaq 0x30f(%rip), %rax       # 0x77fde
movq %rax, 0x20(%r15)
leaq 0x801(%rip), %rax       # 0x784db
movq %rax, 0x30(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r15)
movq 0x18(%rax), %rdx
subq %r12, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x107b28
movq %r15, %rdi
callq 0x107b17
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_module_midi
void de_module_midi(deark *c, struct deark_module_info *mi)
{
	mi->id = "midi";
	mi->desc = "MIDI audio";
	mi->run_fn = de_run_midi;
	mi->identify_fn = de_identify_midi;
}

// Assembly:
leaq 0xb088e(%rip), %rax     # 0x1285ea
movq %rax, (%rsi)
leaq 0xb0889(%rip), %rax     # 0x1285ef
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x77d81
movq %rax, 0x18(%rsi)
leaq 0x6a(%rip), %rax        # 0x77de6
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_run_midi
static void de_run_midi(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	struct de_iffctx *ictx = NULL;

	d = de_malloc(c, sizeof(lctx));

	ictx = fmtutil_create_iff_decoder(c);
	ictx->alignment = 1;
	ictx->userdata = (void*)d;
	ictx->handle_chunk_fn = my_midi_chunk_handler;
	ictx->f = c->infile;

	fmtutil_read_iff_format(ictx, 0, c->infile->len);

	fmtutil_destroy_iff_decoder(ictx);
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x8, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0x107b04
movq %rax, %r15
movq $0x1, 0x48(%rax)
movq %r14, 0x10(%rax)
leaq 0x852(%rip), %rax       # 0x78606
movq %rax, 0x20(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r15)
movq 0x18(%rax), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x107b28
movq %r15, %rdi
callq 0x107b17
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_module_rgfx
void de_module_rgfx(deark *c, struct deark_module_info *mi)
{
	mi->id = "rgfx";
	mi->desc = "RGFX graphics";
	mi->run_fn = de_run_rgfx;
	mi->identify_fn = de_identify_rgfx;
	mi->flags |= DE_MODFLAG_HIDDEN;
}

// Assembly:
leaq 0xb07e7(%rip), %rax     # 0x1285fa
movq %rax, (%rsi)
leaq 0xb07e2(%rip), %rax     # 0x1285ff
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x77e3c
movq %rax, 0x18(%rsi)
leaq 0xa9(%rip), %rax        # 0x77edc
movq %rax, 0x20(%rsi)
orb $0x1, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: de_run_rgfx
static void de_run_rgfx(deark *c, de_module_params *mparams)
{
	struct rgfx_ctx *d = NULL;
	struct de_iffctx *ictx = NULL;

	de_declare_fmt(c, "IFF-RGFX");
	d = de_malloc(c, sizeof(struct rgfx_ctx));

	ictx = fmtutil_create_iff_decoder(c);
	ictx->alignment = 2;
	ictx->userdata = (void*)d;
	ictx->handle_chunk_fn = my_rgfx_chunk_handler;
	ictx->f = c->infile;

	fmtutil_read_iff_format(ictx, 0, c->infile->len);

	fmtutil_destroy_iff_decoder(ictx);
	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Unsupported or bad RGFX file");
		}
		dbuf_close(d->unc_image);
		de_free(c, d);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xb0926(%rip), %rsi     # 0x128771
callq 0xeb6d6
movl $0x448, %esi            # imm = 0x448
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0x107b04
movq %rax, %r15
movq $0x2, 0x48(%rax)
movq %r14, 0x10(%rax)
leaq 0x828(%rip), %rax       # 0x786a6
movq %rax, 0x20(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r15)
movq 0x18(%rax), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x107b28
movq %r15, %rdi
callq 0x107b17
testq %r14, %r14
je 0x77ed6
cmpb $0x0, 0x1(%r14)
je 0x77ebd
leaq 0xb08c7(%rip), %rsi     # 0x12877a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq 0x40(%r14), %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: identify_internal
static int identify_internal(deark *c, int *pconfidence)
{
	UI n1, n2, n4;

	n1 = (UI)de_getu32be(0);
	n2 = (UI)de_getu32be(4);

	if(n1==CODE_AT_T && n2==CODE_FORM) {
		*pconfidence = 100;
		return FMT_DJVU;
	}

	if(n1==CODE_FOR4) {
		*pconfidence = 25;
		return FMT_FOR4;
	}

	// Try to screen out plain text files.
	if(n2>=0x20202020U && c->infile->len<0x20000000) goto done_nomatch;

	if(n1==CODE_FORM) {
		// Must use a lower confidence than other IFF-like formats
		// (ilbm, anim, cdi_imag, nsl, ...).
		*pconfidence = 9;
		return FMT_FORM;
	}

	if(n1==CODE_CAT) {
		n4 = (UI)de_getu32be(12);
		if(n4==CODE_FORM) {
			*pconfidence = 19;
			return FMT_FORM;
		}
		*pconfidence = 9;
		return FMT_FORM;
	}

	// TODO: LIST. (The problem is that the only LIST files I've found don't seem
	// to conform to the spec.)

done_nomatch:
	*pconfidence = 0;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %esi, %esi
callq 0xef32a
movq %rax, %r15
movq 0x18(%r14), %rdi
movl $0x4, %esi
callq 0xef32a
movl %r15d, %ecx
xorl $0x41542654, %ecx       # imm = 0x41542654
movl %eax, %edx
xorl $0x464f524d, %edx       # imm = 0x464F524D
orl %ecx, %edx
jne 0x77f61
movl $0xa, %ebp
movl $0x64, %eax
jmp 0x77fcf
cmpl $0x464f5234, %r15d      # imm = 0x464F5234
jne 0x77f76
movl $0x4, %ebp
movl $0x19, %eax
jmp 0x77fcf
cmpl $0x20202020, %eax       # imm = 0x20202020
jb 0x77f8b
movq 0x18(%r14), %rax
cmpq $0x20000000, 0x18(%rax) # imm = 0x20000000
jl 0x77fc4
movl $0x1, %ebp
cmpl $0x464f524d, %r15d      # imm = 0x464F524D
je 0x77fca
cmpl $0x43415420, %r15d      # imm = 0x43415420
jne 0x77fc4
movq 0x18(%r14), %rdi
movl $0xc, %esi
callq 0xef32a
cmpl $0x464f524d, %eax       # imm = 0x464F524D
movl $0x13, %ecx
movl $0x9, %eax
cmovel %ecx, %eax
jmp 0x77fcf
xorl %eax, %eax
xorl %ebp, %ebp
jmp 0x77fcf
movl $0x9, %eax
movl %eax, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: my_std_container_start_fn
static int my_std_container_start_fn(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	lctx *d = (lctx*)ictx->userdata;

	if(ictx->level>0 && d->decode_hint==0 && ictx->chunkctx->parent) {
		if(ictx->chunkctx->parent->chunk4cc.id==CODE_CAT) {
			if(ictx->curr_container_fmt4cc.id==CODE_FORM) {
				// TODO: Extract more formats.
				if(ictx->curr_container_contentstype4cc.id==CODE_ILBM) {
					extract_iff_item(c, d, ictx, "ilbm");
					return 0; // = Stop processing this container
				}
			}
		}
	}

	if(ictx->level==0 &&
		ictx->curr_container_fmt4cc.id==CODE_FORM &&
		ictx->main_fmt4cc.id==CODE_FORM)
	{
		const char *fmtname = NULL;

		switch(ictx->main_contentstype4cc.id) {
		case CODE_8SVX: fmtname = "8SVX"; break;
		case CODE_AIFF: fmtname = "AIFF"; break;
		case CODE_YAFA: fmtname = "YAFA"; break;
		}

		if(fmtname) {
			de_declare_fmt(c, fmtname);
		}
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rax
movq (%rdi), %rdi
movl 0x64(%rax), %ecx
testl %ecx, %ecx
jle 0x784f3
movq 0x10(%rax), %rdx
cmpb $0x0, 0x4(%rdx)
je 0x78541
movl $0x1, %ebx
testl %ecx, %ecx
jne 0x7859f
cmpl $0x464f524d, 0xcc(%rax) # imm = 0x464F524D
jne 0x7859f
cmpl $0x464f524d, 0x6c(%rax) # imm = 0x464F524D
jne 0x7859f
movl 0x9c(%rax), %eax
cmpl $0x59414641, %eax       # imm = 0x59414641
je 0x78587
cmpl $0x41494646, %eax       # imm = 0x41494646
je 0x7857e
cmpl $0x38535658, %eax       # imm = 0x38535658
jne 0x78592
leaq 0xb018b(%rip), %rsi     # 0x1286ca
jmp 0x7858e
movq 0x128(%rax), %rdx
movq 0x50(%rdx), %rdx
testq %rdx, %rdx
je 0x784f3
cmpl $0x43415420, 0x4(%rdx)  # imm = 0x43415420
jne 0x784f3
cmpl $0x464f524d, 0xcc(%rax) # imm = 0x464F524D
jne 0x784f3
cmpl $0x494c424d, 0xfc(%rax) # imm = 0x494C424D
jne 0x784f3
movq %rax, %rdi
callq 0x785a3
xorl %ebx, %ebx
jmp 0x7859f
leaq 0xb014a(%rip), %rsi     # 0x1286cf
jmp 0x7858e
leaq 0xb0146(%rip), %rsi     # 0x1286d4
xorl %eax, %eax
jmp 0x78596
movb $0x1, %al
xorl %esi, %esi
testb %al, %al
jne 0x7859f
callq 0xeb6d6
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: extract_iff_item
static void extract_iff_item(deark *c, lctx *d, struct de_iffctx *ictx, const char *ext)
{
	i64 pos, len;

	pos = ictx->chunkctx->pos;
	// chunkctx->len isn't set correctly yet.
	// (TODO: That's probably something that could be improved.)
	len = 8 + de_pad_to_n(ictx->chunkctx->dlen, ictx->alignment);
	if(pos+len >= ictx->f->len+100) return;
	dbuf_create_file_from_slice(ictx->f, pos, len, ext, NULL, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x48(%rdi), %rsi
movq 0x128(%rdi), %rax
movq 0x30(%rax), %rbx
movq 0x48(%rax), %rdi
callq 0xea80b
leaq (%rax,%rbx), %rcx
addq $0x8, %rcx
movq 0x18(%r14), %rdi
movq 0x18(%rdi), %rdx
addq $0x64, %rdx
cmpq %rdx, %rcx
jge 0x785fe
addq $0x8, %rax
leaq 0xb00df(%rip), %rcx     # 0x1286c5
movq %rbx, %rsi
movq %rax, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf0321
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iff.c
// Function: my_midi_chunk_handler
static int my_midi_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_MThd:
		do_midi_MThd(c, ictx, ictx->chunkctx);
		break;
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x128(%rdi), %r15
cmpl $0x4d546864, 0x4(%r15)  # imm = 0x4D546864
jne 0x7869b
cmpq $0x6, 0x48(%r15)
jl 0x7869b
movq %rdi, %r14
movl $0x1, 0x130(%rdi)
movq (%rdi), %rbx
movq 0x18(%rdi), %rdi
movq 0x40(%r15), %rsi
callq 0xef169
leaq 0xa9138(%rip), %rsi     # 0x12177f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
movq 0x40(%r15), %rsi
addq $0x2, %rsi
callq 0xef169
leaq 0xb00ea(%rip), %rsi     # 0x128755
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
movq 0x40(%r15), %rsi
addq $0x4, %rsi
callq 0xef169
leaq 0xb00d0(%rip), %rsi     # 0x12875f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_module_ilbm
void de_module_ilbm(deark *c, struct deark_module_info *mi)
{
	mi->id = "ilbm";
	mi->desc = "IFF-ILBM and related image formats";
	mi->run_fn = de_run_ilbm;
	mi->identify_fn = de_identify_ilbm;
	mi->help_fn = de_help_ilbm;
}

// Assembly:
leaq 0xafb42(%rip), %rax     # 0x1286c5
movq %rax, (%rsi)
leaq 0xafd33(%rip), %rax     # 0x1288c0
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x78bb3
movq %rax, 0x18(%rsi)
leaq 0x15(%rip), %rax        # 0x78bb8
movq %rax, 0x20(%rsi)
leaq 0x70(%rip), %rax        # 0x78c1e
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_identify_ilbm
static int de_identify_ilbm(deark *c)
{
	u32 id;

	id = (u32)de_getu32be(0);
	if(id!=CODE_FORM) return 0;
	id = (u32)de_getu32be(8);
	switch(id) {
	case CODE_ILBM:
	case CODE_PBM:
	case CODE_ACBM:
	case CODE_RGBN:
	case CODE_RGB8:
		return 100;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef32a
cmpl $0x464f524d, %eax       # imm = 0x464F524D
jne 0x78c14
movq 0x18(%r14), %rdi
movl $0x8, %esi
callq 0xef32a
movl $0x64, %ebx
cmpl $0x50424d1f, %eax       # imm = 0x50424D1F
jle 0x78c04
cmpl $0x50424d20, %eax       # imm = 0x50424D20
je 0x78c14
cmpl $0x52474238, %eax       # imm = 0x52474238
je 0x78c14
cmpl $0x5247424e, %eax       # imm = 0x5247424E
je 0x78c14
jmp 0x78c12
cmpl $0x4143424d, %eax       # imm = 0x4143424D
je 0x78c14
cmpl $0x494c424d, %eax       # imm = 0x494C424D
je 0x78c14
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_module_anim
void de_module_anim(deark *c, struct deark_module_info *mi)
{
	mi->id = "anim";
	mi->desc = "IFF-ANIM animation";
	mi->run_fn = de_run_anim;
	mi->identify_fn = de_identify_anim;
	mi->help_fn = de_help_anim;
}

// Assembly:
leaq 0xafcb7(%rip), %rax     # 0x1288e3
movq %rax, (%rsi)
leaq 0xafcb2(%rip), %rax     # 0x1288e8
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x78c5c
movq %rax, 0x18(%rsi)
leaq 0x15(%rip), %rax        # 0x78c61
movq %rax, 0x20(%rsi)
leaq 0x4c(%rip), %rax        # 0x78ca3
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_identify_anim
static int de_identify_anim(deark *c)
{
	u32 id;

	id = (u32)de_getu32be(0);
	if(id!=CODE_FORM) return 0;
	id = (u32)de_getu32be(8);
	if(id==CODE_ANIM) return 100;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef32a
cmpl $0x464f524d, %eax       # imm = 0x464F524D
jne 0x78c99
movq 0x18(%r14), %rdi
movl $0x8, %esi
callq 0xef32a
xorl %ecx, %ecx
cmpl $0x414e494d, %eax       # imm = 0x414E494D
movl $0x64, %ebx
cmovnel %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_module_deep
void de_module_deep(deark *c, struct deark_module_info *mi)
{
	mi->id = "deep";
	mi->desc = "IFF-DEEP";
	mi->run_fn = de_run_deep;
	mi->identify_fn = de_identify_deep;
	mi->help_fn = de_help_deep;
}

// Assembly:
leaq 0xa4413(%rip), %rax     # 0x11d0c7
movq %rax, (%rsi)
leaq 0xafc3d(%rip), %rax     # 0x1288fb
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x78ce4
movq %rax, 0x18(%rsi)
leaq 0x106(%rip), %rax       # 0x78dda
movq %rax, 0x20(%rsi)
leaq 0x145(%rip), %rax       # 0x78e24
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: de_run_deep
static void de_run_deep(deark *c, de_module_params *mparams)
{
	struct deep_ctx *d = NULL;
	struct de_iffctx *ictx = NULL;
	const char *opt_trans_str;

	d = de_malloc(c, sizeof(struct deep_ctx));

	d->trans_setting = TRANS_AUTO; // default
	opt_trans_str = de_get_ext_option(c, "deep:trans");
	if(opt_trans_str) {
		if(!de_strcmp(opt_trans_str, "auto")) {
			d->trans_setting = TRANS_AUTO;
		}
		else if(!de_strcmp(opt_trans_str, "")) {
			d->trans_setting = TRANS_RESPECT;
		}
		else {
			int opt_trans_n;

			opt_trans_n = de_atoi(opt_trans_str);
			if(opt_trans_n==0) {
				d->trans_setting = TRANS_REMOVE;
			}
			else if(opt_trans_n>0) {
				d->trans_setting = TRANS_RESPECT;
			}
		}
	}

	de_declare_fmt(c, "IFF-DEEP");

	ictx = fmtutil_create_iff_decoder(c);
	ictx->has_standard_iff_chunks = 1;
	ictx->alignment = 2;
	ictx->userdata = (void*)d;
	ictx->handle_chunk_fn = my_deep_chunk_handler;
	ictx->f = c->infile;

	fmtutil_read_iff_format(ictx, 0, c->infile->len);
	de_dbg(c, "image count: %d", d->DBOD_count);

	fmtutil_destroy_iff_decoder(ictx);
	if(d) {
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xd8, %esi
callq 0xe969b
movq %rax, %r14
movb $0x2, 0x8(%rax)
leaq 0xb086a(%rip), %rsi     # 0x129570
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x78d4d
movq %rax, %r15
leaq 0x9786e(%rip), %rsi     # 0x11058b
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0x78d42
movb $0x1, %bpl
cmpb $0x0, (%r15)
je 0x78d49
movq %r15, %rdi
callq 0xea781
testl %eax, %eax
je 0x78d47
jg 0x78d49
jmp 0x78d4d
movb $0x2, %bpl
jmp 0x78d49
xorl %ebp, %ebp
movb %bpl, 0x8(%r14)
leaq 0xafba7(%rip), %rsi     # 0x1288fb
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
callq 0x107b04
movq %rax, %r15
movb $0x1, 0x5d(%rax)
movq $0x2, 0x48(%rax)
movq %r14, 0x10(%rax)
leaq 0x4889(%rip), %rax      # 0x7d607
movq %rax, 0x20(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r15)
movq 0x18(%rax), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x107b28
movl 0x4(%r14), %edx
leaq 0xb07d8(%rip), %rsi     # 0x12957b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
callq 0x107b17
testq %r14, %r14
je 0x78dcf
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe9752
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ilbm.c
// Function: my_preprocess_iff_chunk_fn
static int my_preprocess_iff_chunk_fn(struct de_iffctx *ictx)
{
	lctx *d = (lctx*)ictx->userdata;
	const char *name = NULL;

	// frctx will be set if we're in an "image" container, such as FORM:ILBM.
	// It is possible, e.g., for an ANIM file to contain FORM:8SVX containers
	// which contain BODY chunks that are not "image data".
	if(d->frctx) {
		switch(ictx->chunkctx->chunk4cc.id) {
		case CODE_ANHD: name="animation header"; break;
		case CODE_BMHD: name="bitmap header"; break;
		case CODE_BODY: name="image data"; break;
		case CODE_CAMG: name="Amiga viewport mode"; break;
		case CODE_CMAP: name="color map"; break;
		case CODE_CRNG: name="color register range info"; break;
		case CODE_DLTA: name="delta-compressed data"; break;
		case CODE_DPI : name="dots/inch"; break;
		case CODE_DRNG: name="color cycle"; break;
		case CODE_GRAB: name="hotspot"; break;
		case CODE_TINY: name="thumbnail"; break;
		}
	}

	if(name) {
		ictx->chunkctx->chunk_name = name;
	}
	return 1;
}

// Assembly:
movq 0x10(%rdi), %rax
movb $0x1, %cl
cmpq $0x0, 0xb0(%rax)
je 0x79877
movq 0x128(%rdi), %rax
movl 0x4(%rax), %edx
xorl %eax, %eax
cmpl $0x43524e46, %edx       # imm = 0x43524E46
jle 0x7987e
cmpl $0x44524e46, %edx       # imm = 0x44524E46
jg 0x798ab
cmpl $0x43524e47, %edx       # imm = 0x43524E47
je 0x79912
cmpl $0x444c5441, %edx       # imm = 0x444C5441
je 0x798f7
cmpl $0x44504920, %edx       # imm = 0x44504920
jne 0x79924
leaq 0xafa55(%rip), %rax     # 0x1292c7
jmp 0x79922
xorl %eax, %eax
jmp 0x79924
cmpl $0x424f4458, %edx       # imm = 0x424F4458
jle 0x798cc
cmpl $0x424f4459, %edx       # imm = 0x424F4459
je 0x79909
cmpl $0x43414d47, %edx       # imm = 0x43414D47
je 0x798ee
cmpl $0x434d4150, %edx       # imm = 0x434D4150
jne 0x79924
leaq 0xaf9e4(%rip), %rax     # 0x12928d
jmp 0x79922
cmpl $0x44524e47, %edx       # imm = 0x44524E47
je 0x7991b
cmpl $0x47524142, %edx       # imm = 0x47524142
je 0x79900
cmpl $0x54494e59, %edx       # imm = 0x54494E59
jne 0x79924
leaq 0xafd99(%rip), %rax     # 0x129663
jmp 0x79922
cmpl $0x414e4844, %edx       # imm = 0x414E4844
je 0x798e5
cmpl $0x424d4844, %edx       # imm = 0x424D4844
jne 0x79924
leaq 0xaf988(%rip), %rax     # 0x12926b
jmp 0x79922
leaq 0xaf96e(%rip), %rax     # 0x12925a
jmp 0x79922
leaq 0xaf984(%rip), %rax     # 0x129279
jmp 0x79922
leaq 0xaf9b3(%rip), %rax     # 0x1292b1
jmp 0x79922
leaq 0xbda8f(%rip), %rax     # 0x137396
jmp 0x79922
leaq 0xbdb2d(%rip), %rax     # 0x13743d
jmp 0x79922
leaq 0xaf97e(%rip), %rax     # 0x129297
jmp 0x79922
leaq 0xaf9af(%rip), %rax     # 0x1292d1
xorl %ecx, %ecx
testb %cl, %cl
jne 0x79933
movq 0x128(%rdi), %rcx
movq %rax, 0x58(%rcx)
movl $0x1, %eax
retq