LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x18, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
leaq 0x107ece(%rip), %rsi    # 0x1b3f2a
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
je 0xac084
movq -0x18(%rbp), %rax
cmpl $0x103, (%rax)          # imm = 0x103
je 0xac084
movq -0x18(%rbp), %rax
cmpl $0x203, (%rax)          # imm = 0x203
jne 0xac0a0
movq -0x18(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x18(%rbp), %rax
leaq 0x119db6(%rip), %rcx    # 0x1c5e50
movq %rcx, 0x8(%rax)
jmp 0xac0e8
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
je 0xac0c1
movq -0x18(%rbp), %rax
cmpl $0x101, (%rax)          # imm = 0x101
je 0xac0c1
movq -0x18(%rbp), %rax
cmpl $0x201, (%rax)          # imm = 0x201
jne 0xac0d2
movq -0x18(%rbp), %rax
leaq 0x10437e(%rip), %rcx    # 0x1b044a
movq %rcx, 0x8(%rax)
jmp 0xac0e6
movq -0x8(%rbp), %rdi
leaq 0x107e5f(%rip), %rsi    # 0x1b3f3c
movb $0x0, %al
callq 0x15bfb0
jmp 0xac158
jmp 0xac0e8
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x107e5f(%rip), %rsi    # 0x1b3f5a
movb $0x0, %al
callq 0x15e3d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xacf40
cmpl $0x0, %eax
jne 0xac11a
jmp 0xac158
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x200, %eax            # imm = 0x200
jne 0xac156
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xacf40
cmpl $0x0, %eax
jne 0xac154
jmp 0xac158
jmp 0xac156
jmp 0xac158
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165060
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x1, %esi
callq 0x165060
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x1, %eax
je 0xac1b7
movzbl -0x11(%rbp), %eax
cmpl $0x3, %eax
jne 0xac1c2
movzbl -0x12(%rbp), %eax
cmpl $0x2, %eax
jg 0xac1c2
jmp 0xac1ce
movl $0x0, -0x4(%rbp)
jmp 0xac2d2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x6, %esi
callq 0x165280
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x165280
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xa, %esi
callq 0x165280
movq %rax, -0x30(%rbp)
cmpq $0x10, -0x20(%rbp)
jl 0xac232
cmpq $0x10, -0x28(%rbp)
jl 0xac232
cmpq $0x100, -0x20(%rbp)     # imm = 0x100
jg 0xac232
cmpq $0x100, -0x28(%rbp)     # imm = 0x100
jle 0xac23e
movl $0x0, -0x4(%rbp)
jmp 0xac2d2
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
addq $0xf, %rax
movl $0x10, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x40(%rbp), %rax
shlq %rcx
cmpq %rcx, %rax
je 0xac270
movl $0x0, -0x4(%rbp)
jmp 0xac2d2
movq -0x10(%rbp), %rdi
movzbl -0x11(%rbp), %ecx
leaq 0x100a7f(%rip), %rsi    # 0x1accfe
leaq 0xfccbe(%rip), %rax     # 0x1a8f44
cmpl $0x3, %ecx
cmoveq %rax, %rsi
callq 0x15d180
movl %eax, -0x34(%rbp)
cmpq $0x20, -0x20(%rbp)
je 0xac2a3
cmpq $0x40, -0x20(%rbp)
jne 0xac2bc
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xac2bc
cmpl $0x0, -0x34(%rbp)
je 0xac2bc
movl $0x64, -0x4(%rbp)
jmp 0xac2d2
movl -0x34(%rbp), %edx
movl $0x6, %eax
movl $0x46, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ico.c
// Function: do_image_dir_entry
static void do_image_dir_entry(deark *c, lctx *d, i64 img_num, i64 pos)
{
	struct page_ctx *pg = NULL;

	pg = de_malloc(c, sizeof(struct page_ctx));
	pg->img_num = img_num;

	de_dbg(c, "image #%d, index at %d", (int)pg->img_num, (int)pos);
	de_dbg_indent(c, 1);
	if(d->is_cur) {
		pg->hotspot_x = (int)de_getu16le(pos+4);
		pg->hotspot_y = (int)de_getu16le(pos+6);
		de_dbg(c, "hotspot: %d,%d", pg->hotspot_x, pg->hotspot_y);
	}
	pg->data_size = de_getu32le(pos+8);
	pg->data_offset = de_getu32le(pos+12);
	de_dbg(c, "offset=%"I64_FMT", size=%"I64_FMT, pg->data_offset, pg->data_size);

	do_image_data(c, d, pg);

	de_free(c, pg);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x500, %esi            # imm = 0x500
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x107aea(%rip), %rsi    # 0x1b3e21
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0xac3b1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165280
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x6, %rsi
callq 0x165280
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %ecx
leaq 0xfcb9e(%rip), %rsi     # 0x1a8f48
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0xfc94f(%rip), %rsi     # 0x1a8d5b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xac450
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ico.c
// Function: do_extract_png
static void do_extract_png(deark *c, lctx *d, i64 pos, i64 len)
{
	char ext[64];
	i64 w, h;

	// Peek at the PNG data, to figure out the dimensions.
	w = de_getu32be(pos+16);
	h = de_getu32be(pos+20);

	de_snprintf(ext, sizeof(ext), "%dx%d.png", (int)w, (int)h);

	// TODO?: Might be nice to edit the PNG file to add an htSP chunk for the
	// hotspot, but it seems like more trouble than it's worth.
	dbuf_create_file_from_slice(c->infile, pos, len, ext, NULL, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x165470
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x14, %rsi
callq 0x165470
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %ecx
movq -0x70(%rbp), %rax
movl %eax, %r8d
movl $0x40, %esi
leaq 0x1074bb(%rip), %rdx    # 0x1b3ed2
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x60(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x166be0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ico.c
// Function: decode_fg_image_32
static void decode_fg_image_32(deark *c, lctx *d, struct page_ctx *pg)
{
	i64 i, j;
	i64 pos;
	de_bitmap *img = pg->img;

	for(j=0; j<img->height; j++) {
		pos = pg->fg_start + pg->bi.rowspan*j;

		for(i=0; i<pg->pdwidth; i++) {
			u8 cr, cg, cb, ca;

			cb = de_getbyte_p(&pos);
			cg = de_getbyte_p(&pos);
			cr = de_getbyte_p(&pos);
			ca = de_getbyte_p(&pos);
			de_bitmap_setpixel_rgba(img, i, j, DE_MAKE_RGBA(cr,cg,cb,ca));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xacb6a
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0xb0(%rcx), %rcx
imulq -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0xacb57
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x3b(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x3a(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movzbl -0x3c(%rbp), %ecx
shll $0x18, %ecx
movzbl -0x39(%rbp), %eax
shll $0x10, %eax
orl %eax, %ecx
movzbl -0x3a(%rbp), %eax
shll $0x8, %eax
orl %eax, %ecx
movzbl -0x3b(%rbp), %eax
orl %eax, %ecx
callq 0x16b350
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xacab4
jmp 0xacb59
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xaca7b
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ico.c
// Function: is_windows_ico_or_cur
static int is_windows_ico_or_cur(deark *c)
{
	i64 numicons;
	i64 i;
	i64 size, offset;
	u8 buf[4];

	de_read(buf, 0, 4);
	if(de_memcmp(buf, "\x00\x00\x01\x00", 4) &&
		de_memcmp(buf, "\x00\x00\x02\x00", 4))
	{
		return 0;
	}

	numicons = de_getu16le(4);

	// Each icon must use at least 16 bytes for the directory, 40 for the
	// info header, 4 for the foreground, and 4 for the mask.
	if(numicons<1 || (6+numicons*64)>c->infile->len) return 0;

	// Examine the first few icon index entries.
	for(i=0; i<numicons && i<8; i++) {
		size = de_getu32le(6+16*i+8);
		offset = de_getu32le(6+16*i+12);
		if(size<48) return 0;
		if(offset < 6+numicons*16) return 0;
		if(offset+size > c->infile->len) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x34(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
callq 0x164d10
leaq -0x34(%rbp), %rax
movl (%rax), %eax
subl $0x10000, %eax          # imm = 0x10000
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xace0e
leaq -0x34(%rbp), %rax
movl (%rax), %eax
subl $0x20000, %eax          # imm = 0x20000
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xace0e
movl $0x0, -0x4(%rbp)
jmp 0xacf28
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165280
movq %rax, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
jl 0xace45
movq -0x18(%rbp), %rax
shlq $0x6, %rax
addq $0x6, %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xace51
movl $0x0, -0x4(%rbp)
jmp 0xacf28
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x35(%rbp)
jge 0xace73
cmpq $0x8, -0x20(%rbp)
setl %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0xace7f
jmp 0xacf21
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
shlq $0x4, %rsi
addq $0x6, %rsi
addq $0x8, %rsi
callq 0x165540
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
shlq $0x4, %rsi
addq $0x6, %rsi
addq $0xc, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
cmpq $0x30, -0x28(%rbp)
jge 0xaced1
movl $0x0, -0x4(%rbp)
jmp 0xacf28
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq $0x6, %rcx
cmpq %rcx, %rax
jge 0xaceef
movl $0x0, -0x4(%rbp)
jmp 0xacf28
movq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xacf0e
movl $0x0, -0x4(%rbp)
jmp 0xacf28
jmp 0xacf10
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xace59
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x1188d4(%rip), %rcx    # 0x1c5c9b
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x106bc3(%rip), %rcx    # 0x1b3f98
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xad410
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1ad(%rip), %rcx       # 0xad5a0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x1ee(%rip), %rcx       # 0xad5f0
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18c8b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x1, 0x5d(%rax)
movq -0x20(%rbp), %rax
movq $0x2, 0x48(%rax)
movq -0x8(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xad930
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xad494
movq -0x20(%rbp), %rax
movq $0x4, 0x48(%rax)
movq -0x8(%rbp), %rdi
leaq 0x11b18d(%rip), %rsi    # 0x1c862c
xorl %edx, %edx
callq 0x15cbc0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rdi
leaq 0x106b1f(%rip), %rsi    # 0x1b3fd9
callq 0x15cb30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xad4de
movq -0x28(%rbp), %rdi
callq 0x15cca0
movslq %eax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
cmpl $0xa, (%rax)
jne 0xad501
movq -0x8(%rbp), %rdi
leaq 0x106af1(%rip), %rsi    # 0x1b3fe3
callq 0x15e380
movq $0x4, -0x30(%rbp)
jmp 0xad509
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x15e4a0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x60(%rax)
movq -0x20(%rbp), %rax
leaq 0x525(%rip), %rcx       # 0xada60
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
leaq 0x666(%rip), %rcx       # 0xadbb0
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdx
subq -0x30(%rbp), %rdx
callq 0x18c920
movq -0x20(%rbp), %rdi
callq 0x18c8f0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: de_identify_iff
static int de_identify_iff(deark *c)
{
	int confidence = 0;
	int fmt;

	fmt = identify_internal(c, &confidence);
	if(fmt!=0) {
		return confidence;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0xad930
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xad5d1
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xad5d8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x10696f(%rip), %rcx    # 0x1b3fb6
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x106966(%rip), %rcx    # 0x1b3fbb
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0xad680
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xbd(%rip), %rcx        # 0xad730
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18c8b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x1, 0x48(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
leaq 0xe3e(%rip), %rcx       # 0xae520
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x18c920
movq -0x20(%rbp), %rdi
callq 0x18c8f0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x10682f(%rip), %rcx    # 0x1b3fc6
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x106826(%rip), %rcx    # 0x1b3fcb
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xad7e0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x10d(%rip), %rcx       # 0xad8d0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x30(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x106932(%rip), %rsi    # 0x1b413d
callq 0x15e380
movq -0x8(%rbp), %rdi
movl $0x448, %esi            # imm = 0x448
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18c8b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x2, 0x48(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
leaq 0xe0e(%rip), %rcx       # 0xae660
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x18c920
movq -0x20(%rbp), %rdi
callq 0x18c8f0
cmpq $0x0, -0x18(%rbp)
je 0xad8c5
movq -0x18(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0xad8ab
movq -0x8(%rbp), %rdi
leaq 0x1068a2(%rip), %rsi    # 0x1b4146
movb $0x0, %al
callq 0x15bfb0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165470
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165470
movl %eax, -0x20(%rbp)
cmpl $0x41542654, -0x1c(%rbp) # imm = 0x41542654
jne 0xad991
cmpl $0x464f524d, -0x20(%rbp) # imm = 0x464F524D
jne 0xad991
movq -0x18(%rbp), %rax
movl $0x64, (%rax)
movl $0xa, -0x4(%rbp)
jmp 0xada49
cmpl $0x464f5234, -0x1c(%rbp) # imm = 0x464F5234
jne 0xad9b0
movq -0x18(%rbp), %rax
movl $0x19, (%rax)
movl $0x4, -0x4(%rbp)
jmp 0xada49
cmpl $0x20202020, -0x20(%rbp) # imm = 0x20202020
jb 0xad9cd
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x20000000, 0x18(%rax) # imm = 0x20000000
jge 0xad9cd
jmp 0xada38
cmpl $0x464f524d, -0x1c(%rbp) # imm = 0x464F524D
jne 0xad9e9
movq -0x18(%rbp), %rax
movl $0x9, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0xada49
cmpl $0x43415420, -0x1c(%rbp) # imm = 0x43415420
jne 0xada36
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xc, %esi
callq 0x165470
movl %eax, -0x24(%rbp)
cmpl $0x464f524d, -0x24(%rbp) # imm = 0x464F524D
jne 0xada23
movq -0x18(%rbp), %rax
movl $0x13, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0xada49
movq -0x18(%rbp), %rax
movl $0x9, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0xada49
jmp 0xada38
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: my_iff_chunk_handler
static int my_iff_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	lctx *d = (lctx*)ictx->userdata;

	ictx->is_std_container = is_container_chunk(c, d, ictx->chunkctx->chunk4cc.id);
	if(ictx->is_std_container) goto done;

	if(ictx->main_contentstype4cc.id==CODE_8SVX) {
		switch(ictx->chunkctx->chunk4cc.id) {
		case CODE_NAME:
			// In 8SVX, the NAME chunk means "voice name". In other types
			// of files, it presumably means some other sort of name.
			do_text_chunk(c, ictx, "voice name");
			ictx->handled = 1;
			break;
		}
	}
	else if(ictx->main_contentstype4cc.id==CODE_AIFF) {
		switch(ictx->chunkctx->chunk4cc.id) {
		case CODE_COMT:
			do_aiff_comt_chunk(c, ictx);
			ictx->handled = 1;
			break;
		case CODE_ID3:
			do_id3_chunk(c, ictx);
			ictx->handled = 1;
			break;
		}
	}
	else if(ictx->main_contentstype4cc.id==CODE_YAFA) {
		do_YAFA_chunk(c, d, ictx);
	}

done:
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %edx
callq 0xadd10
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x134(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x134(%rax)
je 0xadabc
jmp 0xadba1
movq -0x8(%rbp), %rax
cmpl $0x38535658, 0x9c(%rax) # imm = 0x38535658
jne 0xadb0a
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
subl $0x4e414d45, %eax       # imm = 0x4E414D45
jne 0xadb05
jmp 0xadae3
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x1064f6(%rip), %rdx    # 0x1b3fe8
callq 0xadd80
movq -0x8(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xadb9f
movq -0x8(%rbp), %rax
cmpl $0x41494646, 0x9c(%rax) # imm = 0x41494646
jne 0xadb7a
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0x434f4d54, %eax       # imm = 0x434F4D54
je 0xadb40
jmp 0xadb34
movl -0x1c(%rbp), %eax
subl $0x49443320, %eax       # imm = 0x49443320
je 0xadb5d
jmp 0xadb78
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xade30
movq -0x8(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xadb78
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xae000
movq -0x8(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xadb9d
movq -0x8(%rbp), %rax
cmpl $0x59414641, 0x9c(%rax) # imm = 0x59414641
jne 0xadb9b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0xae0e0
jmp 0xadb9d
jmp 0xadb9f
jmp 0xadba1
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jle 0xadc62
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0xadc62
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
cmpq $0x0, 0x50(%rax)
je 0xadc62
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x50(%rax), %rax
cmpl $0x43415420, 0x4(%rax)  # imm = 0x43415420
jne 0xadc60
movq -0x10(%rbp), %rax
cmpl $0x464f524d, 0xcc(%rax) # imm = 0x464F524D
jne 0xadc5e
movq -0x10(%rbp), %rax
cmpl $0x494c424d, 0xfc(%rax) # imm = 0x494C424D
jne 0xadc5c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x106446(%rip), %rcx    # 0x1b4091
callq 0xae480
movl $0x0, -0x4(%rbp)
jmp 0xadd05
jmp 0xadc5e
jmp 0xadc60
jmp 0xadc62
movq -0x10(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0xadcfe
movq -0x10(%rbp), %rax
cmpl $0x464f524d, 0xcc(%rax) # imm = 0x464F524D
jne 0xadcfe
movq -0x10(%rbp), %rax
cmpl $0x464f524d, 0x6c(%rax) # imm = 0x464F524D
jne 0xadcfe
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x38535658, %eax       # imm = 0x38535658
je 0xadcc3
jmp 0xadcab
movl -0x2c(%rbp), %eax
subl $0x41494646, %eax       # imm = 0x41494646
je 0xadcd0
jmp 0xadcb7
movl -0x2c(%rbp), %eax
subl $0x59414641, %eax       # imm = 0x59414641
je 0xadcdd
jmp 0xadce8
leaq 0x1063cc(%rip), %rax    # 0x1b4096
movq %rax, -0x28(%rbp)
jmp 0xadce8
leaq 0x1063c4(%rip), %rax    # 0x1b409b
movq %rax, -0x28(%rbp)
jmp 0xadce8
leaq 0x1063bc(%rip), %rax    # 0x1b40a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xadcfc
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15e380
jmp 0xadcfe
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: is_container_chunk
static int is_container_chunk(deark *c, lctx *d, u32 ct)
{
	if(d->fmt==FMT_FOR4) {
		if(ct==CODE_FOR4 || ct==CODE_LIS4 || ct==CODE_CAT4) return 1;
	}
	else {
		if(ct==CODE_FORM || ct==CODE_LIST || ct==CODE_CAT) return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xadd4e
cmpl $0x464f5234, -0x1c(%rbp) # imm = 0x464F5234
je 0xadd43
cmpl $0x4c495334, -0x1c(%rbp) # imm = 0x4C495334
je 0xadd43
cmpl $0x43415434, -0x1c(%rbp) # imm = 0x43415434
jne 0xadd4c
movl $0x1, -0x4(%rbp)
jmp 0xadd7b
jmp 0xadd74
cmpl $0x464f524d, -0x1c(%rbp) # imm = 0x464F524D
je 0xadd69
cmpl $0x4c495354, -0x1c(%rbp) # imm = 0x4C495354
je 0xadd69
cmpl $0x43415420, -0x1c(%rbp) # imm = 0x43415420
jne 0xadd72
movl $0x1, -0x4(%rbp)
jmp 0xadd7b
jmp 0xadd74
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_text_chunk
static void do_text_chunk(deark *c, struct de_iffctx *ictx, const char *name)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	// TODO: Sometimes this text is clearly not ASCII, but I've never seen
	// a file with a "CSET" chunk, and I don't know how else I would know
	// the character encoding.
	dbuf_read_to_ucstring_n(c->infile,
		ictx->chunkctx->dpos, ictx->chunkctx->dlen, DE_DBG_MAX_STRLEN,
		s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x48(%rax), %rdx
movq -0x20(%rbp), %r8
movl $0x1f4, %ecx            # imm = 0x1F4
movl $0x1, %r9d
movl $0x1, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq %rax, %rcx
leaq 0x109df1(%rip), %rsi    # 0x1b7c06
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_id3_chunk
static void do_id3_chunk(deark *c, struct de_iffctx *ictx)
{
	if(dbuf_memcmp(ictx->f, ictx->chunkctx->dpos, "ID3", 3)) {
		return;
	}
	de_dbg(c, "ID3v2 data at %"I64_FMT", len=%"I64_FMT, ictx->chunkctx->dpos, ictx->chunkctx->dlen);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "id3", "I", ictx->f,
		ictx->chunkctx->dpos, ictx->chunkctx->dlen);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rsi
leaq 0xf0830(%rip), %rdx     # 0x19e85e
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xae042
jmp 0xae0cb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x48(%rax), %rcx
leaq 0x105f99(%rip), %rsi    # 0x1b4004
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x48(%rax), %r9
leaq 0xf07e5(%rip), %rsi     # 0x19e896
leaq 0x10e9e3(%rip), %rdx    # 0x1bca9b
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_YAFA_chunk
static void do_YAFA_chunk(deark *c, lctx *d, struct de_iffctx *ictx)
{
	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_ANNO:
		do_YAFA_ANNO(c, ictx);
		break;
	case CODE_BODY:
		if(d->yafa_XPK) {
			do_XPK_data_chunk(c, ictx, "cmpr method of 1st frame");
		}
		break;
	case CODE_INFO:
		do_YAFA_INFO(c, d, ictx);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0x414e4e4f, %eax       # imm = 0x414E4E4F
je 0xae126
jmp 0xae10e
movl -0x1c(%rbp), %eax
subl $0x424f4459, %eax       # imm = 0x424F4459
je 0xae135
jmp 0xae11a
movl -0x1c(%rbp), %eax
subl $0x494e464f, %eax       # imm = 0x494E464F
je 0xae155
jmp 0xae166
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xae170
jmp 0xae166
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5(%rax)
je 0xae153
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x105ed1(%rip), %rdx    # 0x1b401f
callq 0xae250
jmp 0xae166
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xae300
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_YAFA_ANNO
static void do_YAFA_ANNO(deark *c, struct de_iffctx *ictx)
{
	i64 tlen;
	i64 pos = ictx->chunkctx->dpos;
	de_ucstring *s = NULL;

	ictx->handled = 1;
	if(ictx->chunkctx->dlen<4) goto done;
	tlen = dbuf_getu32be_p(ictx->f, &pos);
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(ictx->f, pos, tlen, DE_DBG_MAX_STRLEN, s, 0, ictx->input_encoding);
	ucstring_strip_trailing_NUL(s);
	de_dbg(c, "annotation: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
cmpq $0x4, 0x48(%rax)
jge 0xae1bd
jmp 0xae239
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x28(%rbp), %rdi
callq 0x171310
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x105e06(%rip), %rsi    # 0x1b4038
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_XPK_data_chunk
static void do_XPK_data_chunk(deark *c, struct de_iffctx *ictx, const char *label)
{
	struct de_fourcc tmp4cc;

	if(ictx->chunkctx->dlen<12) goto done;
	if((UI)dbuf_getu32be(ictx->f, ictx->chunkctx->dpos) != CODE_XPKF) goto done;
	dbuf_read_fourcc(ictx->f, ictx->chunkctx->dpos+8, &tmp4cc, 4, 0);
	de_dbg(c, "%s: XPK '%s'", label, tmp4cc.id_dbgstr);
	ictx->handled = 1;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
cmpq $0xc, 0x48(%rax)
jge 0xae278
jmp 0xae2f5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rsi
callq 0x165470
cmpl $0x58504b46, %eax       # imm = 0x58504B46
je 0xae29d
jmp 0xae2f5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rsi
addq $0x8, %rsi
leaq -0x48(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rcx
addq $0x10, %rcx
leaq 0x105d69(%rip), %rsi    # 0x1b4049
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_YAFA_INFO
static void do_YAFA_INFO(deark *c, lctx *d, struct de_iffctx *ictx)
{
	i64 x1, x2;
	i64 pos = ictx->chunkctx->dpos;
	const char *name;

	if(ictx->chunkctx->dlen<14) goto done;

	x1 = dbuf_getu16be_p(ictx->f, &pos);
	x2 = dbuf_getu16be_p(ictx->f, &pos);
	de_dbg_dimensions(c, x1, x2);
	pos += 2; // depth
	pos += 2; // speed
	x1 = dbuf_getu16be_p(ictx->f, &pos);
	de_dbg(c, "frames: %u", (UI)x1);

	x1 = dbuf_getu16be_p(ictx->f, &pos);
	switch(x1) {
	case 0: name="planar"; break;
	case 1: name="planar XPK"; d->yafa_XPK=1; break;
	case 3: name="chunky 8bit XPK"; d->yafa_XPK=1; break;
	case 4: name="chunky 8bit"; break;
	default: name="?";
	}
	de_dbg(c, "frame type: %u (%s)", (UI)x1, name);

	ictx->handled = 1;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
cmpq $0xe, 0x48(%rax)
jge 0xae33e
jmp 0xae46f
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
movq %rsi, -0x48(%rbp)
callq 0x165210
movq -0x48(%rbp), %rsi
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x165210
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x15bba0
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x165210
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %edx
leaq 0x117a48(%rip), %rsi    # 0x1c5e00
xorl %eax, %eax
callq 0x15b0d0
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x165210
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
subq $0x4, %rax
ja 0xae43a
movq -0x40(%rbp), %rax
leaq 0x105b97(%rip), %rcx    # 0x1b3f84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x113304(%rip), %rax    # 0x1c1701
movq %rax, -0x38(%rbp)
jmp 0xae445
leaq 0x105c4c(%rip), %rax    # 0x1b4056
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movb $0x1, 0x5(%rax)
jmp 0xae445
leaq 0x105c42(%rip), %rax    # 0x1b4061
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movb $0x1, 0x5(%rax)
jmp 0xae445
leaq 0x105c3d(%rip), %rax    # 0x1b4071
movq %rax, -0x38(%rbp)
jmp 0xae445
leaq 0x1097ec(%rip), %rax    # 0x1b7c2d
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rcx
leaq 0x105c23(%rip), %rsi    # 0x1b407d
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movl $0x1, 0x130(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x48(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x15ce90
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
addq $0x64, %rcx
cmpq %rcx, %rax
jl 0xae4ee
jmp 0xae50f
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x166be0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
subl $0x4d546864, %eax       # imm = 0x4D546864
jne 0xae566
jmp 0xae54e
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rdx
callq 0xae580
movl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: do_midi_MThd
static void do_midi_MThd(deark *c, struct de_iffctx *ictx,
	const struct de_iffchunkctx *chunkctx)
{
	i64 format_field, ntrks_field, division_field;

	if(chunkctx->dlen<6) return;
	ictx->handled = 1;
	format_field = dbuf_getu16be(ictx->f, chunkctx->dpos);
	de_dbg(c, "format: %d", (int)format_field);
	ntrks_field = dbuf_getu16be(ictx->f, chunkctx->dpos+2);
	de_dbg(c, "ntrks: %d", (int)ntrks_field);
	division_field = dbuf_getu16be(ictx->f, chunkctx->dpos+4);
	de_dbg(c, "division: %d", (int)division_field);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x6, 0x48(%rax)
jge 0xae5a4
jmp 0xae64d
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x1651d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xfee58(%rip), %rsi     # 0x1ad434
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
addq $0x2, %rsi
callq 0x1651d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x105b10(%rip), %rsi    # 0x1b4121
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
addq $0x4, %rsi
callq 0x1651d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x105ae5(%rip), %rsi    # 0x1b412b
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iff.c
// Function: my_rgfx_chunk_handler
static int my_rgfx_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	struct rgfx_ctx *d = (struct rgfx_ctx*)ictx->userdata;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_FORM:
		ictx->is_std_container = 1;
		goto done;
	}

	if(ictx->level != 1) goto done;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_RBOD:
		do_RGFX_RBOD(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RCOL:
		do_RGFX_RCOL(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RGHD:
		do_RGFX_RGHD(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RSCM:
		do_RGFX_RSCM(c, d, ictx);
		ictx->handled = 1;
		break;
	}

done:
	if(d->errflag) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
subl $0x464f524d, %eax       # imm = 0x464F524D
jne 0xae6ad
jmp 0xae69a
movq -0x10(%rbp), %rax
movl $0x1, 0x134(%rax)
jmp 0xae781
movq -0x10(%rbp), %rax
cmpl $0x1, 0x64(%rax)
je 0xae6bc
jmp 0xae781
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
subl $0x52424f44, %eax       # imm = 0x52424F44
je 0xae6fd
jmp 0xae6d6
movl -0x24(%rbp), %eax
subl $0x52434f4c, %eax       # imm = 0x52434F4C
je 0xae71e
jmp 0xae6e2
movl -0x24(%rbp), %eax
subl $0x52474844, %eax       # imm = 0x52474844
je 0xae73f
jmp 0xae6ee
movl -0x24(%rbp), %eax
subl $0x5253434d, %eax       # imm = 0x5253434D
je 0xae760
jmp 0xae77f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xae7b0
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xae77f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xae9e0
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xae77f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xaeab0
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xae77f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xaece0
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
jmp 0xae781
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0xae793
movl $0x0, -0x4(%rbp)
jmp 0xae79a
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)