LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/qtif.c
// Function: do_qtif_file_format
static void do_qtif_file_format(deark *c, lctx *d)
{
	struct de_boxesctx *bctx = NULL;

	bctx = de_malloc(c, sizeof(struct de_boxesctx));

	bctx->userdata = (void*)d;
	bctx->f = c->infile;
	bctx->handle_box_fn = quicktime_box_handler;

	fmtutil_read_boxes_format(c, bctx);

	if(d->idat_found) {
		do_write_image(c, d);
	}

	de_free(c, bctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
leaq 0x750(%rip), %rcx       # 0x11ea40
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x174300
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x11e318
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x11e5a0
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/qtif.c
// Function: quicktime_box_handler
static int quicktime_box_handler(deark *c, struct de_boxesctx *bctx)
{
	lctx *d = (lctx*)bctx->userdata;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->boxtype==BOX_idat) {
		d->idat_found = 1;
		d->idat_pos = curbox->payload_pos;
		d->idat_size = curbox->payload_len;
	}
	else if(curbox->boxtype==BOX_idsc) {
		do_read_idsc(c, d, curbox->payload_pos, curbox->payload_len);
	}
	else if(curbox->is_uuid) {
		return fmtutil_default_box_handler(c, bctx);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x69646174, 0xc(%rax)  # imm = 0x69646174
jne 0x11eaa1
movq -0x20(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x11eaed
movq -0x28(%rbp), %rax
cmpl $0x69647363, 0xc(%rax)  # imm = 0x69647363
jne 0x11eacd
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rcx
callq 0x11e330
jmp 0x11eaeb
movq -0x28(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x11eae9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x174080
movl %eax, -0x4(%rbp)
jmp 0x11eaf4
jmp 0x11eaeb
jmp 0x11eaed
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: de_module_riff
void de_module_riff(deark *c, struct deark_module_info *mi)
{
	mi->id = "riff";
	mi->desc = "RIFF-based formats";
	mi->run_fn = de_run_riff;
	mi->identify_fn = de_identify_riff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xa7183(%rip), %rcx     # 0x1c5c9a
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xa717a(%rip), %rcx     # 0x1c5c9f
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x11eb50
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1cd(%rip), %rcx       # 0x11ed10
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: de_identify_riff
static int de_identify_riff(deark *c)
{
	u8 buf[4];
	int has_sig;
	i64 dlen;

	de_read(buf, 0, 4);
	has_sig = (!de_memcmp(buf, "RIFF", 4)) ||
		(!de_memcmp(buf, "XFIR", 4)) ||
		(!de_memcmp(buf, "RIFX", 4));
	if(!has_sig) return 0;

	dlen = de_getu32le(4);
	// This check screens out .AMV format, for example.
	if(dlen==0 && c->infile->len!=8) return 0;

	return 50;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x14(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
callq 0x164d10
leaq -0x14(%rbp), %rax
movl (%rax), %eax
subl $0x46464952, %eax       # imm = 0x46464952
setne %al
movzbl %al, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0x11ed88
leaq -0x14(%rbp), %rax
movl (%rax), %eax
subl $0x52494658, %eax       # imm = 0x52494658
setne %al
movzbl %al, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0x11ed88
leaq -0x14(%rbp), %rax
movl (%rax), %eax
subl $0x58464952, %eax       # imm = 0x58464952
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x11eda2
movl $0x0, -0x4(%rbp)
jmp 0x11edde
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x11edd7
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x8, 0x18(%rax)
je 0x11edd7
movl $0x0, -0x4(%rbp)
jmp 0x11edde
movl $0x32, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: my_preprocess_riff_chunk_fn
static int my_preprocess_riff_chunk_fn(struct de_iffctx *ictx)
{
	const char *name = NULL;

	// TODO: Need a better way to do this.
	switch(ictx->chunkctx->chunk4cc.id) {
	case CHUNK_DISP: name="display"; break;
	case CHUNK_IART: name="artist"; break;
	case CHUNK_ICOP: name="copyright"; break;
	case CHUNK_ICMT: name="comments"; break;
	case CHUNK_IKEY: name="keywords"; break;
	case CHUNK_ISBJ: name="subject"; break;
	case CHUNK_JUNK: name="filler"; break;
	case CHUNK_LIST: name="subchunk container"; break;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x44495350, %eax       # imm = 0x44495350
je 0x11ee6e
jmp 0x11ee1a
movl -0x14(%rbp), %eax
subl $0x49415254, %eax       # imm = 0x49415254
je 0x11ee7b
jmp 0x11ee26
movl -0x14(%rbp), %eax
subl $0x49434d54, %eax       # imm = 0x49434D54
je 0x11ee95
jmp 0x11ee32
movl -0x14(%rbp), %eax
subl $0x49434f50, %eax       # imm = 0x49434F50
je 0x11ee88
jmp 0x11ee3e
movl -0x14(%rbp), %eax
subl $0x494b4559, %eax       # imm = 0x494B4559
je 0x11eea2
jmp 0x11ee4a
movl -0x14(%rbp), %eax
subl $0x4953424a, %eax       # imm = 0x4953424A
je 0x11eeaf
jmp 0x11ee56
movl -0x14(%rbp), %eax
subl $0x4a554e4b, %eax       # imm = 0x4A554E4B
je 0x11eebc
jmp 0x11ee62
movl -0x14(%rbp), %eax
subl $0x4c495354, %eax       # imm = 0x4C495354
je 0x11eec9
jmp 0x11eed4
leaq 0x83195(%rip), %rax     # 0x1a200a
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0x9497a(%rip), %rax     # 0x1b37fc
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0x7f920(%rip), %rax     # 0x19e7af
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0x7f211(%rip), %rax     # 0x19e0ad
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0xa6e35(%rip), %rax     # 0x1c5cde
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0x98d2c(%rip), %rax     # 0x1b7be2
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0xa6e24(%rip), %rax     # 0x1c5ce7
movq %rax, -0x10(%rbp)
jmp 0x11eed4
leaq 0xa6e1e(%rip), %rax     # 0x1c5cee
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x11eeee
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rax
movq %rcx, 0x58(%rax)
movl $0x1, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: my_on_container_end_fn
static int my_on_container_end_fn(struct de_iffctx *ictx)
{
	lctx *d = (lctx*)ictx->userdata;

	if(ictx->curr_container_contentstype4cc.id==CODE_movi &&
		d->in_movi && ictx->level==d->in_movi_level)
	{
		d->in_movi = 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x6d6f7669, 0xfc(%rax) # imm = 0x6D6F7669
jne 0x11f729
movq -0x10(%rbp), %rax
movzbl 0xe(%rax), %eax
cmpl $0x0, %eax
je 0x11f729
movq -0x8(%rbp), %rax
movl 0x64(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x11f729
movq -0x10(%rbp), %rax
movb $0x0, 0xe(%rax)
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_INFO_item
static void do_INFO_item(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len, u32 chunk_id)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);

	// TODO: Decode the chunk_id (e.g. ICRD = Creation date).

	// TODO: Support the CSET chunk
	dbuf_read_to_ucstring_n(ictx->f, pos, len, 500, s,
		DE_CONVFLAG_STOP_AT_NUL, ictx->input_encoding);
	de_dbg(c, "value: \"%s\"", ucstring_getpsz_d(s));

	if(chunk_id==CHUNK_INAM) { // Save for possible later use
		if(d->INAM_data) {
			ucstring_empty(d->INAM_data);
		}
		else {
			d->INAM_data = ucstring_create(c);
		}
		if(s->len>64) {
			ucstring_truncate(s, 64);
		}
		ucstring_append_ucstring(d->INAM_data, s);
	}

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %r8
movq -0x18(%rbp), %rax
movl 0x60(%rax), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
movl $0x1, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x7f079(%rip), %rsi     # 0x19e82b
movb $0x0, %al
callq 0x15b0d0
cmpl $0x494e414d, -0x2c(%rbp) # imm = 0x494E414D
jne 0x11f81a
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11f7dc
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x171210
jmp 0x11f7f0
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
cmpq $0x40, 0x10(%rax)
jle 0x11f809
movq -0x38(%rbp), %rdi
movl $0x40, %esi
callq 0x171230
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x171460
movq -0x38(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_DISP
static void do_DISP(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	unsigned int ty;
	i64 dpos, dlen;

	if(!ictx->is_le) return;
	if(len<4) return;
	ty = (unsigned int)de_getu32le(pos);
	de_dbg(c, "data type: %u (%s)", ty,
		fmtutil_get_windows_cb_data_type_name(ty));

	dpos = pos+4;
	dlen = len-4;
	switch(ty) {
	case 1:
	case 7:
		do_DISP_TEXT(c, d, ictx, dpos, dlen);
		break;
	case 8:
	case 17:
		do_DISP_DIB(c, d, ictx, dpos, dlen);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jne 0x11f85b
jmp 0x11f916
cmpq $0x4, -0x28(%rbp)
jge 0x11f867
jmp 0x11f916
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x2c(%rbp), %edi
movl %edi, -0x4c(%rbp)
callq 0x174fd0
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %edx
movq %rax, %rcx
leaq 0x7ef4e(%rip), %rsi     # 0x19e7ed
xorl %eax, %eax
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x10, %eax
ja 0x11f916
movq -0x48(%rbp), %rax
leaq 0xa6373(%rip), %rcx     # 0x1c5c4c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
callq 0x120220
jmp 0x11f916
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
callq 0x1202d0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: extract_ani_frame
static void extract_ani_frame(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	u8 buf[4];
	const char *ext;

	de_dbg(c, "frame at %d, len=%d", (int)pos, (int)len);

	de_read(buf, pos, 4);

	// Try to identify the format of this frame.
	if(!de_memcmp(buf, "\x00\x00\x01\x00", 4)) {
		ext = "ico";
	}
	else if(!de_memcmp(buf, "\x00\x00\x02\x00", 4)) {
		ext = "cur";
	}
	else {
		ext = "bin";
	}

	dbuf_create_file_from_slice(ictx->f, pos, len, ext, NULL, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rax
movl %eax, %ecx
leaq 0xa629b(%rip), %rsi     # 0x1c5d0e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x2c(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x4, %ecx
callq 0x164d10
leaq -0x2c(%rbp), %rax
movl (%rax), %eax
subl $0x10000, %eax          # imm = 0x10000
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x11fab7
leaq 0x8d24d(%rip), %rax     # 0x1accfe
movq %rax, -0x38(%rbp)
jmp 0x11fae7
leaq -0x2c(%rbp), %rax
movl (%rax), %eax
subl $0x20000, %eax          # imm = 0x20000
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x11fada
leaq 0x89470(%rip), %rax     # 0x1a8f44
movq %rax, -0x38(%rbp)
jmp 0x11fae5
leaq 0xa1726(%rip), %rax     # 0x1c1207
movq %rax, -0x38(%rbp)
jmp 0x11fae7
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x166be0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_RDIB_data
static void do_RDIB_data(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	de_finfo *fi = NULL;

	if(!ictx->chunkctx->parent) goto done;
	if(ictx->chunkctx->parent->user_flags & 0x1) goto done; // Extraction suppressed, or already done
	ictx->chunkctx->parent->user_flags |= 0x1;

	fi = de_finfo_create(c);
	if(ucstring_isnonempty(d->INAM_data)) {
		// In CorelMOVE format, at least, the INAM chunk seems to have a usable
		// name for the RDIB bitmap.
		de_finfo_set_name_from_ucstring(c, fi, d->INAM_data, 0);
		ucstring_empty(d->INAM_data);
	}
	do_extract_raw(c, d, ictx, pos, len, "bmp", fi, 0);
done:
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
cmpq $0x0, 0x50(%rax)
jne 0x11fdbb
jmp 0x11fe68
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x50(%rax), %rax
movl 0x60(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x11fdda
jmp 0x11fe68
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x50(%rax), %rax
movl 0x60(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x11fe35
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
leaq 0x8ceb3(%rip), %r9      # 0x1acd07
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x11fb10
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_wav_fact
static void do_wav_fact(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	i64 n;

	if(!ictx->is_le) return;
	if(len<4) return;
	n = de_getu32le(pos);
	de_dbg(c, "number of samples: %u", (unsigned int)n);
}

// 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 %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jne 0x11fee8
jmp 0x11ff1e
cmpq $0x4, -0x28(%rbp)
jge 0x11fef1
jmp 0x11ff1e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xa5eb2(%rip), %rsi     # 0x1c5dc9
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/riff.c
// Function: do_avi_avih
static void do_avi_avih(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	i64 n, n2;

	if(len<40) return;
	n = de_getu32le(pos);
	de_dbg(c, "microseconds/frame: %u", (unsigned int)n);
	n = de_getu32le(pos+12);
	de_dbg(c, "flags: 0x%08x", (unsigned int)n);
	n = de_getu32le(pos+16);
	de_dbg(c, "number of frames: %u", (unsigned int)n);
	n = de_getu32le(pos+24);
	de_dbg(c, "number of streams: %u", (unsigned int)n);
	n = de_getu32le(pos+32);
	n2 = de_getu32le(pos+36);
	de_dbg_dimensions(c, n, n2);
	// TODO: There are more fields in this chunk.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x28, -0x28(%rbp)
jge 0x11ff58
jmp 0x12005b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xa5e61(%rip), %rsi     # 0x1c5ddf
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x920cf(%rip), %rsi     # 0x1b207e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xa5e16(%rip), %rsi     # 0x1c5df6
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x18, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xa5dfa(%rip), %rsi     # 0x1c5e0b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x20, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x24, %rsi
callq 0x165540
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x15bba0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_avi_strh
static void do_avi_strh(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	struct de_fourcc type4cc;
	struct de_fourcc codec4cc;

	if(len<8) return;

	dbuf_read_fourcc(ictx->f, pos, &type4cc, 4, 0x0);
	de_dbg(c, "stream type: '%s'", type4cc.id_dbgstr);
	// Hack. TODO: Need a better way to track state.
	d->curr_avi_stream_type = type4cc.id;

	dbuf_read_fourcc(ictx->f, pos+4, &codec4cc, 4, 0x0);
	de_dbg(c, "codec: '%s'", codec4cc.id_dbgstr);

	// TODO: There are more fields here.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jge 0x12009b
jmp 0x12011d
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq -0x58(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
leaq -0x58(%rbp), %rdx
addq $0x10, %rdx
leaq 0xa5d56(%rip), %rsi     # 0x1c5e21
movb $0x0, %al
callq 0x15b0d0
movl -0x54(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
leaq -0x88(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
leaq -0x88(%rbp), %rdx
addq $0x10, %rdx
leaq 0xa5d1d(%rip), %rsi     # 0x1c5e33
movb $0x0, %al
callq 0x15b0d0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_avi_strf
static void do_avi_strf(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	if(d->curr_avi_stream_type==CODE_vids) {
		struct de_bmpinfo bi;
		// For video streams, this is a BITMAPINFO.
		fmtutil_get_bmpinfo(c, ictx->f, &bi, pos, len,
			DE_BMPINFO_CMPR_IS_4CC | DE_BMPINFO_NOERR);
		// This chunk contains just a bitmap header, so we can't extract a bitmap.
	}
	else if(d->curr_avi_stream_type==CODE_auds) {
		// For audio streams, this is a WAVEFORMATEX.
		decode_WAVEFORMATEX(c, d, ictx, pos, len);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x76696473, 0x8(%rax)  # imm = 0x76696473
jne 0x120184
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
leaq -0xc8(%rbp), %rdx
movl $0x18, %r9d
callq 0x172d70
jmp 0x1201ac
movq -0x10(%rbp), %rax
cmpl $0x61756473, 0x8(%rax)  # imm = 0x61756473
jne 0x1201aa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x120360
jmp 0x1201ac
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_DISP_TEXT
static void do_DISP_TEXT(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len1)
{
	i64 foundpos;
	i64 len = len1;

	// Stop at NUL
	if(dbuf_search_byte(ictx->f, 0x00, pos, len1, &foundpos)) {
		len = foundpos - pos;
	}
	de_dbg(c, "text length: %d", (int)len);
	if(len<1) return;

	do_extract_raw(c, d, ictx, pos, len, "disp.txt", NULL, DE_CREATEFLAG_IS_AUX);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %esi, %esi
leaq -0x30(%rbp), %r8
callq 0x1667a0
cmpl $0x0, %eax
je 0x120270
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x85132(%rip), %rsi     # 0x1a53b3
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x38(%rbp)
jge 0x120291
jmp 0x1202c3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq 0xa5a59(%rip), %r9      # 0x1c5d05
xorl %eax, %eax
movq $0x0, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x11fb10
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_DISP_DIB
static void do_DISP_DIB(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 len)
{
	de_module_params *mparams = NULL;

	if(len<12) return;

	mparams = de_malloc(c, sizeof(de_module_params));
	mparams->in_params.codes = "X"; // "auxiliary"
	mparams->in_params.flags = 0x80; // ".preview.bmp"
	de_run_module_by_id_on_slice(c, "dib", mparams, ictx->f, pos, len);
	de_free(c, mparams);
}

// 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 %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0xc, -0x28(%rbp)
jge 0x1202fd
jmp 0x120359
movq -0x8(%rbp), %rdi
movl $0x70, %esi
callq 0x15b780
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
leaq 0xaf255(%rip), %rcx     # 0x1cf56f
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl $0x80, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
leaq 0x8eaac(%rip), %rsi     # 0x1aedf3
callq 0x15c9f0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: get_wav_fmt_name
static const char *get_wav_fmt_name(unsigned int n)
{
	const char *name = NULL;
	switch(n) {
	case 0x0001: name="PCM"; break;
	case 0x0002: name="ADPCM"; break;
	case 0x0050: name="MPEG"; break;
	case 0x0055: name="MPEGLAYER3"; break;
	case 0xFFFE: name="EXTENSIBLE"; break;
		// TODO: There are lots more formats.
	}

	return name?name:"?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x14(%rbp)
subl $0x1, %eax
je 0x120556
jmp 0x12052c
movl -0x14(%rbp), %eax
subl $0x2, %eax
je 0x120563
jmp 0x120536
movl -0x14(%rbp), %eax
subl $0x50, %eax
je 0x120570
jmp 0x120540
movl -0x14(%rbp), %eax
subl $0x55, %eax
je 0x12057d
jmp 0x12054a
movl -0x14(%rbp), %eax
subl $0xfffe, %eax           # imm = 0xFFFE
je 0x12058a
jmp 0x120595
leaq 0xa5852(%rip), %rax     # 0x1c5daf
movq %rax, -0x10(%rbp)
jmp 0x120595
leaq 0xa5843(%rip), %rax     # 0x1c5dad
movq %rax, -0x10(%rbp)
jmp 0x120595
leaq 0x98238(%rip), %rax     # 0x1b87af
movq %rax, -0x10(%rbp)
jmp 0x120595
leaq 0xa582f(%rip), %rax     # 0x1c5db3
movq %rax, -0x10(%rbp)
jmp 0x120595
leaq 0xa582d(%rip), %rax     # 0x1c5dbe
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1205a6
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1205b3
leaq 0x97680(%rip), %rax     # 0x1b7c2d
movq %rax, -0x20(%rbp)
jmp 0x1205b3
movq -0x20(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: my_handle_nonchunk_riff_data_fn
static int my_handle_nonchunk_riff_data_fn(struct de_iffctx *ictx,
	i64 pos, i64 *plen)
{
	deark *c = ictx->c;
	lctx *d = (lctx*)ictx->userdata;

	if(d->cmx_parse_hack) {
		return do_cmx_parse_hack(c, d, ictx, pos, plen);
	}
	else if(d->cmv_parse_hack) {
		return do_cmv_parse_hack(c, d, ictx, pos, plen);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x120613
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x120650
movl %eax, -0x4(%rbp)
jmp 0x120644
movq -0x30(%rbp), %rax
cmpb $0x0, 0xd(%rax)
je 0x12063b
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x120710
movl %eax, -0x4(%rbp)
jmp 0x120644
jmp 0x12063d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: do_cmx_parse_hack
static int do_cmx_parse_hack(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 *plen)
{
	i64 n, n_padded;

	// Some CMX chunks seem to be followed by a non-RIFF segment starting with either
	// 04 00 (4 bytes) or 10 00 (16 bytes). I'm just guessing how to parse them.
	n = dbuf_getu16le(ictx->f, pos);
	if(n>256 || n==0) return 0;

	n_padded = de_pad_to_2(n);
	if(is_fourcc_at(c, ictx, pos + n_padded)) {
		de_dbg(c, "[%d non-RIFF bytes at %"I64_FMT"]", (int)n_padded, pos);
		*plen = n_padded;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x165280
movq %rax, -0x38(%rbp)
cmpq $0x100, -0x38(%rbp)     # imm = 0x100
jg 0x120692
cmpq $0x0, -0x38(%rbp)
jne 0x12069b
movl $0x0, -0x4(%rbp)
jmp 0x1206f9
movq -0x38(%rbp), %rdi
callq 0x15cdf0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq -0x40(%rbp), %rdx
callq 0x1207c0
cmpl $0x0, %eax
je 0x1206f2
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
leaq 0xa57ec(%rip), %rsi     # 0x1c5ec3
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1206f9
movl $0x0, -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/riff.c
// Function: do_cmv_parse_hack
static int do_cmv_parse_hack(deark *c, lctx *d, struct de_iffctx *ictx, i64 pos, i64 *plen)
{
	if(ictx->level!=0) return 0;
	if(dbuf_getu32be(ictx->f, pos)!=0) return 0;
	if(dbuf_getu32be(ictx->f, pos+4)!=CHUNK_RIFF) return 0;
	de_dbg(c, "[%d non-RIFF bytes at %"I64_FMT"]", 4, pos);
	*plen = 4;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x64(%rax)
je 0x12073f
movl $0x0, -0x4(%rbp)
jmp 0x1207b2
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x165470
cmpq $0x0, %rax
je 0x12075f
movl $0x0, -0x4(%rbp)
jmp 0x1207b2
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
callq 0x165470
cmpq $0x52494646, %rax       # imm = 0x52494646
je 0x120785
movl $0x0, -0x4(%rbp)
jmp 0x1207b2
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rcx
leaq 0xa572f(%rip), %rsi     # 0x1c5ec3
movl $0x4, %edx
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
movq $0x4, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/riff.c
// Function: is_fourcc_at
static int is_fourcc_at(deark *c, struct de_iffctx *ictx, i64 pos)
{
	u8 b[4];
	size_t i;

	dbuf_read(ictx->f, b, pos, 4);
	for(i=0; i<4; i++) {
		if(b[i]<32 || b[i]>126) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x24(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x4, %ecx
callq 0x164d10
movq $0x0, -0x30(%rbp)
cmpq $0x4, -0x30(%rbp)
jae 0x120832
movq -0x30(%rbp), %rax
movzbl -0x24(%rbp,%rax), %eax
cmpl $0x20, %eax
jl 0x120819
movq -0x30(%rbp), %rax
movzbl -0x24(%rbp,%rax), %eax
cmpl $0x7e, %eax
jle 0x120822
movl $0x0, -0x4(%rbp)
jmp 0x120839
jmp 0x120824
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1207f6
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: de_module_rosprite
void de_module_rosprite(deark *c, struct deark_module_info *mi)
{
	mi->id = "rosprite";
	mi->desc = "RISC OS Sprite, a.k.a. Acorn Sprite";
	mi->run_fn = de_run_rosprite;
	mi->identify_fn = de_identify_rosprite;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xa5677(%rip), %rcx     # 0x1c5ede
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xa5672(%rip), %rcx     # 0x1c5ee7
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x1208a0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x24d(%rip), %rcx       # 0x120ae0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: de_identify_rosprite
static int de_identify_rosprite(deark *c)
{
	i64 num_images, first_sprite_offset, implied_file_size;
	i64 offset2;

	num_images = de_getu32le(0);
	if(num_images<1 || num_images>1000) return 0;

	first_sprite_offset = de_getu32le(4) - 4;
	// I've only ever seen this be 12 or (rarely) 28, though it's legal
	// for it to have other values
	if(first_sprite_offset!=12 && first_sprite_offset!=28) return 0;
	if(first_sprite_offset+48 > c->infile->len) return 0;

	implied_file_size = de_getu32le(8) - 4;
	if(implied_file_size > c->infile->len) return 0;

	if(num_images!=1) {
		// TODO?: A multi-sprite file with extra junk at EOF will not be detected.
		// To better detect multi-sprite files, we'd probably have to walk through
		// the file.
		if(implied_file_size != c->infile->len) return 0;
		return 55;
	}

	offset2 = de_getu32le(first_sprite_offset);
	if(offset2==implied_file_size && implied_file_size==c->infile->len) {
		// Found some bad files where this pointer is absolute when it should be
		// relative.
		return 15;
	}
	offset2 += first_sprite_offset;
	if(offset2 != implied_file_size) return 0;
	if(implied_file_size == c->infile->len) return 80;
	return 30;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165540
movq %rax, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
jl 0x120b12
cmpq $0x3e8, -0x18(%rbp)     # imm = 0x3E8
jle 0x120b1e
movl $0x0, -0x4(%rbp)
jmp 0x120c55
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165540
subq $0x4, %rax
movq %rax, -0x20(%rbp)
cmpq $0xc, -0x20(%rbp)
je 0x120b52
cmpq $0x1c, -0x20(%rbp)
je 0x120b52
movl $0x0, -0x4(%rbp)
jmp 0x120c55
movq -0x20(%rbp), %rax
addq $0x30, %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x120b74
movl $0x0, -0x4(%rbp)
jmp 0x120c55
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x165540
subq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x120bac
movl $0x0, -0x4(%rbp)
jmp 0x120c55
cmpq $0x1, -0x18(%rbp)
je 0x120bda
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
je 0x120bd1
movl $0x0, -0x4(%rbp)
jmp 0x120c55
movl $0x37, -0x4(%rbp)
jmp 0x120c55
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x120c14
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x120c14
movl $0xf, -0x4(%rbp)
jmp 0x120c55
movq -0x20(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x120c33
movl $0x0, -0x4(%rbp)
jmp 0x120c55
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x120c4e
movl $0x50, -0x4(%rbp)
jmp 0x120c55
movl $0x1e, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: read_sprite_name
static void read_sprite_name(deark *c, lctx *d, de_finfo *fi, i64 pos)
{
	de_ucstring *s = NULL;
	if(c->debug_level<1 && !c->filenames_from_file) return;

	s = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, 12, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_RISCOS);
	de_dbg(c, "sprite name: \"%s\"", ucstring_getpsz(s));

	if(c->filenames_from_file) {
		de_finfo_set_name_from_ucstring(c, fi, s, 0);
	}

	ucstring_destroy(s);
}

// 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), %rax
cmpl $0x1, (%rax)
jge 0x12156b
movq -0x8(%rbp), %rax
cmpb $0x0, 0xd0(%rax)
jne 0x12156b
jmp 0x1215ed
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0xc, %edx
movl $0x1, %r8d
movl $0x14, %r9d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0xa4ba9(%rip), %rsi     # 0x1c6166
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
cmpb $0x0, 0xd0(%rax)
je 0x1215e4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: average_color
static de_color average_color(de_color c1, de_color c2)
{
	u8 a, r, g, b;
	a = ((de_color)DE_COLOR_A(c1) + DE_COLOR_A(c2))/2;
	r = ((de_color)DE_COLOR_R(c1) + DE_COLOR_R(c2))/2;
	g = ((de_color)DE_COLOR_G(c1) + DE_COLOR_G(c2))/2;
	b = ((de_color)DE_COLOR_B(c1) + DE_COLOR_B(c2))/2;
	return DE_MAKE_RGBA(r,g,b,a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movzbl %al, %eax
movl -0x8(%rbp), %ecx
shrl $0x18, %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
addl %ecx, %eax
shrl %eax
movb %al, -0x9(%rbp)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movzbl %al, %eax
movl -0x8(%rbp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
addl %ecx, %eax
shrl %eax
movb %al, -0xa(%rbp)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movzbl %al, %eax
movl -0x8(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
addl %ecx, %eax
shrl %eax
movb %al, -0xb(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
movzbl %al, %eax
movl -0x8(%rbp), %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
addl %ecx, %eax
shrl %eax
movb %al, -0xc(%rbp)
movzbl -0x9(%rbp), %eax
shll $0x18, %eax
movzbl -0xa(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movzbl -0xb(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0xc(%rbp), %ecx
orl %ecx, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: getpal256
static de_color getpal256(int k)
{
	u8 r, g, b;
	if(k<0 || k>255) return 0;
	r = k%8 + ((k%32)/16)*8;
	g = k%4 + ((k%128)/32)*4;
	b = (u8)(k%4 + ((k%16)/8)*4 + (k/128)*8);
	r = (r<<4)|r;
	g = (g<<4)|g;
	b = (b<<4)|b;
	return DE_MAKE_RGB(r,g,b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jl 0x121db6
cmpl $0xff, -0x8(%rbp)
jle 0x121dc2
movl $0x0, -0x4(%rbp)
jmp 0x121eb6
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
movl -0x8(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl -0x1c(%rbp), %edx
shll $0x3, %eax
addl %eax, %edx
movb %dl, %al
movb %al, -0x9(%rbp)
movl -0x8(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
movl -0x8(%rbp), %eax
movl $0x80, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl -0x18(%rbp), %edx
shll $0x2, %eax
addl %eax, %edx
movb %dl, %al
movb %al, -0xa(%rbp)
movl -0x8(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl -0x14(%rbp), %edx
shll $0x2, %eax
addl %eax, %edx
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl $0x80, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10(%rbp), %eax
shll $0x3, %ecx
addl %ecx, %eax
movb %al, -0xb(%rbp)
movzbl -0x9(%rbp), %eax
shll $0x4, %eax
movzbl -0x9(%rbp), %ecx
orl %ecx, %eax
movb %al, -0x9(%rbp)
movzbl -0xa(%rbp), %eax
shll $0x4, %eax
movzbl -0xa(%rbp), %ecx
orl %ecx, %eax
movb %al, -0xa(%rbp)
movzbl -0xb(%rbp), %eax
shll $0x4, %eax
movzbl -0xb(%rbp), %ecx
orl %ecx, %eax
movb %al, -0xb(%rbp)
movzbl -0x9(%rbp), %eax
shll $0x10, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
movzbl -0xa(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0xb(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: convert_image_16bit
static void convert_image_16bit(deark *c, lctx *d, struct page_ctx *pg, de_bitmap *img)
{
	i64 i, j;

	for(j=0; j<pg->height; j++) {
		for(i=0; i<pg->width_1; i++) {
			de_color clr;

			clr = (de_color)de_getu16le(pg->image_offset + 4*pg->width_in_words*j + i*2);
			clr = de_bgr555_to_888(clr);
			de_bitmap_setpixel_rgba(pg->img, i, j, clr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x122008
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jge 0x121ff5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x2, %rax
imulq -0x30(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rax
shlq %rax
addq %rax, %rsi
callq 0x165280
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edi
callq 0x161940
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x34(%rbp), %ecx
callq 0x16b350
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x121f7a
jmp 0x121ff7
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x121f60
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rosprite.c
// Function: remove_left_padding
static void remove_left_padding(deark *c, struct page_ctx *pg)
{
	de_bitmap *imgtmp;

	if(pg->num_padding_pixels_at_start_of_row<1) return;

	// Create a replacement bitmap, and copy the important pixels from the old
	// one to it.
	imgtmp = de_bitmap_create(c, pg->npwidth, pg->height, pg->img->bytes_per_pixel);
	de_bitmap_copy_rect(pg->img, imgtmp, pg->num_padding_pixels_at_start_of_row, 0,
		pg->npwidth, pg->height, 0, 0, 0);

	de_bitmap_destroy(pg->img);
	pg->img = imgtmp;
	imgtmp = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x50(%rax)
jge 0x122030
jmp 0x1220cd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movl 0x24(%rax), %ecx
callq 0x16b750
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %r9
xorl %eax, %eax
movl %eax, %ecx
xorl %eax, %eax
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x16ce50
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x16af60
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq $0x0, -0x18(%rbp)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rpm.c
// Function: de_module_rpm
void de_module_rpm(deark *c, struct deark_module_info *mi)
{
	mi->id = "rpm";
	mi->desc = "RPM Package Manager";
	mi->run_fn = de_run_rpm;
	mi->identify_fn = de_identify_rpm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xa4229(%rip), %rcx     # 0x1c6320
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xa421f(%rip), %rcx     # 0x1c6324
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x122130
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x34d(%rip), %rcx       # 0x122470
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rpm.c
// Function: do_lead_section
static int do_lead_section(deark *c, lctx *d)
{
	int retval = 0;

	de_dbg(c, "lead section at %d", 0);
	de_dbg_indent(c, 1);

	d->ver_major = de_getbyte(4);
	d->ver_minor = de_getbyte(5);
	de_dbg(c, "RPM format version: %d.%d", (int)d->ver_major, (int)d->ver_minor);
	if(d->ver_major < 3) {
		de_err(c, "Unsupported RPM version (%d.%d)", (int)d->ver_major, (int)d->ver_minor);
		goto done;
	}

	retval = 1;
done:
	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xa3eb6(%rip), %rsi     # 0x1c6398
xorl %edx, %edx
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165060
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x5, %esi
callq 0x165060
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %edx
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %ecx
leaq 0xa3e63(%rip), %rsi     # 0x1c63ab
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3, %eax
jge 0x12257e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %edx
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %ecx
leaq 0xa3e50(%rip), %rsi     # 0x1c63c5
movb $0x0, %al
callq 0x15bfb0
jmp 0x122585
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rpm.c
// Function: read_compression_type
static void read_compression_type(deark *c, lctx *d, i64 pos)
{
	u8 buf[16];

	de_dbg(c, "compression type at %d", (int)pos);

	de_read(buf, pos, sizeof(buf));

	if(!de_memcmp(buf, "lzma\0", 5)) {
		d->cmpr_type = DE_RPM_CMPR_LZMA;
	}
	// Other valid compression types are "gzip", "bzip2", and "xz".
	// We'll autodetect most of them, but lzma is hard to detect.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0xa3a1b(%rip), %rsi     # 0x1c64b0
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x10, %ecx
callq 0x164d10
leaq -0x30(%rbp), %rdi
leaq 0xa3a0b(%rip), %rsi     # 0x1c64cc
movl $0x5, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x122adb
movq -0x10(%rbp), %rax
movl $0x3, 0x4(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rsc.c
// Function: de_module_rsc
void de_module_rsc(deark *c, struct deark_module_info *mi)
{
	mi->id = "rsc";
	mi->desc = "GEM resource file";
	mi->run_fn = de_run_rsc;
	mi->identify_fn = de_identify_rsc;
	mi->help_fn = de_help_rsc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xa3b01(%rip), %rcx     # 0x1c6608
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xa3af7(%rip), %rcx     # 0x1c660c
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x122b50
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x4dd(%rip), %rcx       # 0x123010
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x53e(%rip), %rcx       # 0x123080
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rsc.c
// Function: de_identify_rsc
static int de_identify_rsc(deark *c)
{
	i64 ver;

	if(!de_input_file_has_ext(c, "rsc")) return 0;
	ver = de_getu16be(0);
	if(ver==0 || ver==1 || ver==4) return 70;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xa35e1(%rip), %rsi     # 0x1c6608
callq 0x15d180
cmpl $0x0, %eax
jne 0x12303a
movl $0x0, -0x4(%rbp)
jmp 0x123074
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1651d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x123064
cmpq $0x1, -0x18(%rbp)
je 0x123064
cmpq $0x4, -0x18(%rbp)
jne 0x12306d
movl $0x46, -0x4(%rbp)
jmp 0x123074
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)