LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: do_rar4_block_archiveheader
static void do_rar4_block_archiveheader(deark *c, de_arch_lctx *d, struct rar4_block *rb)
{
	i64 pos;

	pos = rb->data1_pos;
	pos += 2; // reserved1
	pos += 4; // reserved2

	if(rb->flags & 0x0002) {
		struct rar4_block *cmt_rb;

		cmt_rb = de_malloc(c, sizeof(struct rar4_block));
		cmt_rb->block_pos = pos;
		cmt_rb->block_max_endpos = rb->data2_pos;
		cmt_rb->parent_type = rb->type;
		rar_read_v4_block(c, d, cmt_rb);
		rar4_free_block(c, cmt_rb);
	}
}

// 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
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x151af0
movq -0x8(%rbp), %rdi
movl $0x50, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movb 0x18(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x19(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1511d0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1511a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: do_rar4_block_oldcomment
static void do_rar4_block_oldcomment(deark *c, de_arch_lctx *d, struct rar4_block *rb)
{
	i64 cmpr_len;
	i64 orig_len;
	i64 pos = rb->data1_pos;
	u8 ver_needed;
	u8 cmpr_meth;
	u32 crc_reported;
	int is_file_comment;

	is_file_comment = (rb->parent_type==0x74);
	orig_len = de_getu16le_p(&pos);
	de_dbg(c, "uncompr. comment len: %"I64_FMT, orig_len);
	ver_needed = de_getbyte_p(&pos);
	de_dbg(c, "ver needed to read comment: %u", (UI)ver_needed);
	cmpr_meth = de_getbyte_p(&pos);
	de_dbg(c, "cmpr. method: 0x%02x (%s)", (UI)cmpr_meth, rar4_get_cmpr_name(cmpr_meth));
	crc_reported = (u32)de_getu16le_p(&pos);
	de_dbg(c, "crc (reported): 0x%04x", (UI)crc_reported);

	cmpr_len = rb->data2_pos - pos;
	de_dbg(c, "%s comment at %"I64_FMT", len=%"I64_FMT,
		(is_file_comment?"file":"archive"), pos, cmpr_len);
	if(cmpr_len<1) goto done;
	if(cmpr_meth!=48) goto done; // compressed
	rar_handle_noncmpr_comment(c, d, pos, cmpr_len, d->input_encoding, is_file_comment);

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 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x19(%rax), %eax
cmpl $0x74, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x7f0dc(%rip), %rsi     # 0x1d1006
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %edx
leaq 0x7f0cc(%rip), %rsi     # 0x1d1020
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x32(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movzbl -0x32(%rbp), %eax
movl %eax, -0x40(%rbp)
movzbl -0x32(%rbp), %edi
callq 0x152160
movq -0x48(%rbp), %rdi
movl -0x40(%rbp), %edx
movq %rax, %rcx
leaq 0x7f037(%rip), %rsi     # 0x1d0fcf
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %edx
leaq 0x7e98b(%rip), %rsi     # 0x1d094c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
subq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %ecx
leaq 0x50bbd(%rip), %rdx     # 0x1a2ba3
leaq 0x82e1a(%rip), %rax     # 0x1d4e07
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x7f03c(%rip), %rsi     # 0x1d103f
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x20(%rbp)
jge 0x152013
jmp 0x15203f
movzbl -0x32(%rbp), %eax
cmpl $0x30, %eax
je 0x15201e
jmp 0x15203f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r8d
movl -0x3c(%rbp), %r9d
callq 0x150d10
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: rar4_get_OS_name
static const char *rar4_get_OS_name(u8 n)
{
	const char *name = NULL;

	switch(n) {
	case 0: name = "DOS"; break;
	case 1: name = "OS/2"; break;
	case 2: name = "Windows"; break;
	case 3: name = "Unix"; break;
	case 4: name = "Mac"; break;
	}
	return name?name:"?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x1(%rbp)
movq $0x0, -0x10(%rbp)
movzbl -0x1(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0x152133
movq -0x18(%rbp), %rax
leaq 0x7ebc5(%rip), %rcx     # 0x1d0cb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7d443(%rip), %rax     # 0x1cf53e
movq %rax, -0x10(%rbp)
jmp 0x152133
leaq 0x520d0(%rip), %rax     # 0x1a41d8
movq %rax, -0x10(%rbp)
jmp 0x152133
leaq 0x859b7(%rip), %rax     # 0x1d7acc
movq %rax, -0x10(%rbp)
jmp 0x152133
leaq 0x7d974(%rip), %rax     # 0x1cfa96
movq %rax, -0x10(%rbp)
jmp 0x152133
leaq 0x4e9a1(%rip), %rax     # 0x1a0ad0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x152144
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x152151
leaq 0x65ae2(%rip), %rax     # 0x1b7c2d
movq %rax, -0x20(%rbp)
jmp 0x152151
movq -0x20(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: rar_get_vint_i64_p
static i64 rar_get_vint_i64_p(de_arch_lctx *d, dbuf *f, i64 *ppos)
{
	u64 v1u;
	i64 v1i;

	v1u = rar_get_vint_p(d, f, ppos);
	v1i = (i64)v1u;
	if(v1i<0) v1i = 0;
	return v1i;
}

// 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 -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x152690
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x152680
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: rar_get_vint_p
static u64 rar_get_vint_p(de_arch_lctx *d, dbuf *f, i64 *ppos)
{
	u64 val = 0;
	UI nbits_set = 0;

	// TODO: Better handling of errors & oversized ints
	while(1) {
		u8 b;

		if(nbits_set>=64) { val = 0; break; }
		b = dbuf_getbyte_p(f, ppos);
		if(nbits_set < 64) {
			val |= (((u64)(b&0x7f))<<nbits_set);
			nbits_set += 7;
		}
		if((b&0x80)==0) break;
	}
	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x40, -0x24(%rbp)
jb 0x1526c3
movq $0x0, -0x20(%rbp)
jmp 0x15270b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x165170
movb %al, -0x25(%rbp)
cmpl $0x40, -0x24(%rbp)
jae 0x1526f9
movzbl -0x25(%rbp), %eax
andl $0x7f, %eax
cltq
movl -0x24(%rbp), %ecx
shlq %cl, %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x7, %eax
movl %eax, -0x24(%rbp)
movzbl -0x25(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x152709
jmp 0x15270b
jmp 0x1526b3
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: rar_get_v5_hdrtype_name
static const char *rar_get_v5_hdrtype_name(UI n)
{
	const char *name = NULL;

	switch(n) {
	case RAR5_HDRTYPE_ARCHIVE: name = "archive header"; break;
	case RAR5_HDRTYPE_FILE: name = "file header"; break;
	case RAR5_HDRTYPE_SERVICE: name = "service header"; break;
	case 4: name = "encryption header"; break;
	case RAR5_HDRTYPE_EOA: name = "end of archive"; break;
	}

	return name?name:"?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x4, %eax
ja 0x152792
movq -0x18(%rbp), %rax
leaq 0x7e57a(%rip), %rcx     # 0x1d0cc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x51d82(%rip), %rax     # 0x1a44dc
movq %rax, -0x10(%rbp)
jmp 0x152792
leaq 0x6fa8d(%rip), %rax     # 0x1c21f4
movq %rax, -0x10(%rbp)
jmp 0x152792
leaq 0x7e974(%rip), %rax     # 0x1d10e8
movq %rax, -0x10(%rbp)
jmp 0x152792
leaq 0x7e976(%rip), %rax     # 0x1d10f7
movq %rax, -0x10(%rbp)
jmp 0x152792
leaq 0x5198a(%rip), %rax     # 0x1a4118
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1527a3
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1527b0
leaq 0x65483(%rip), %rax     # 0x1b7c2d
movq %rax, -0x20(%rbp)
jmp 0x1527b0
movq -0x20(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: do_rar5_comment
static void do_rar5_comment(deark *c, de_arch_lctx *d, struct rar5_block *rb,
	struct rar5_file_or_svc_hdr_data *hd)
{
	i64 cmt_len;
	de_ucstring *comment = NULL;

	if(hd->cmpr_meth!=0) goto done;
	cmt_len = de_min_int(rb->data_area_size, hd->orig_len);
	if(cmt_len<1) goto done;

	rar_handle_noncmpr_comment(c, d, rb->data_area_pos, cmt_len, DE_ENCODING_UTF8, 0);

done:
	ucstring_destroy(comment);
}

// 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, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x152e2c
jmp 0x152e70
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x15ccf0
movq %rax, -0x28(%rbp)
cmpq $0x1, -0x28(%rbp)
jge 0x152e4e
jmp 0x152e70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x28(%rbp), %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x150d10
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rar.c
// Function: get_rar5_extra_record_name
static const char *get_rar5_extra_record_name(struct rar5_block *rb, UI t)
{
	const char *name = NULL;

	if(rb->type==RAR5_HDRTYPE_FILE || rb->type==RAR5_HDRTYPE_SERVICE) {
		switch(t) {
		case 1: name="encryption"; break;
		case 2: name="hash"; break;
		case 3: name="timestamps"; break;
		case 4: name="version"; break;
		case 5: name="redirection"; break;
		case 6: name="owner (Unix)"; break;
		case 7: name="service data"; break;
		}
	}
	else if(rb->type==RAR5_HDRTYPE_ARCHIVE) {
		if(t==1) name="locator";
	}
	return name?name:"?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x14(%rax)
je 0x152ea7
movq -0x8(%rbp), %rax
cmpl $0x3, 0x14(%rax)
jne 0x152f26
movl -0xc(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x6, %eax
ja 0x152f24
movq -0x20(%rbp), %rax
leaq 0x7de16(%rip), %rcx     # 0x1d0cd8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7e2fc(%rip), %rax     # 0x1d11ce
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x7e2fa(%rip), %rax     # 0x1d11d9
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x4da38(%rip), %rax     # 0x1a0924
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x59670(%rip), %rax     # 0x1ac569
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x7e2d8(%rip), %rax     # 0x1d11de
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x7e2d7(%rip), %rax     # 0x1d11ea
movq %rax, -0x18(%rbp)
jmp 0x152f24
leaq 0x7e2d7(%rip), %rax     # 0x1d11f7
movq %rax, -0x18(%rbp)
jmp 0x152f45
movq -0x8(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jne 0x152f43
cmpl $0x1, -0xc(%rbp)
jne 0x152f41
leaq 0x69878(%rip), %rax     # 0x1bc7b5
movq %rax, -0x18(%rbp)
jmp 0x152f43
jmp 0x152f45
cmpq $0x0, -0x18(%rbp)
je 0x152f56
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x152f63
leaq 0x64cd0(%rip), %rax     # 0x1b7c2d
movq %rax, -0x28(%rbp)
jmp 0x152f63
movq -0x28(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: de_module_rodraw
void de_module_rodraw(deark *c, struct deark_module_info *mi)
{
	mi->id = "rodraw";
	mi->desc = "RISC OS Draw, Acorn Draw";
	mi->run_fn = de_run_rodraw;
	mi->identify_fn = de_identify_rodraw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x7e08d(%rip), %rcx     # 0x1d1204
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x7e086(%rip), %rcx     # 0x1d120b
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x1531b0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xad(%rip), %rcx        # 0x153250
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: de_run_rodraw
static void de_run_rodraw(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;

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

	pos = 0;
	if(!do_header(c, d, pos)) goto done;
	pos += 40;

	if(!do_object_sequence(c, d, pos, c->infile->len-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 -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1532d0
cmpl $0x0, %eax
jne 0x1531fa
jmp 0x153230
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
subq -0x20(%rbp), %rcx
callq 0x1533b0
cmpl $0x0, %eax
jne 0x15322e
jmp 0x153230
jmp 0x153230
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: de_identify_rodraw
static int de_identify_rodraw(deark *c)
{
	if(!dbuf_memcmp(c->infile, 0, "Draw", 4)) {
		if(!dbuf_memcmp(c->infile, 4, "\xc9\0\0\0\0\0\0\0", 8)) {
			return 100;
		}
		return 49;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x7dfb0(%rip), %rdx     # 0x1d121f
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1532b3
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
leaq 0x7e059(%rip), %rdx     # 0x1d12eb
movl $0x8, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1532aa
movl $0x64, -0x4(%rbp)
jmp 0x1532ba
movl $0x31, -0x4(%rbp)
jmp 0x1532ba
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: do_header
static int do_header(deark *c, lctx *d, i64 pos1)
{
	i64 pos = pos1;

	de_dbg(c, "header at %d", (int)pos1);
	de_dbg_indent(c, 1);
	pos += 4; // file signature
	d->majver = (unsigned int)de_getu32le_p(&pos);
	d->minver = (unsigned int)de_getu32le_p(&pos);
	de_dbg(c, "format version: %u,%u", d->majver, d->minver);
	pos += 12; // app name
	pos += 16; // bounding box
	de_dbg_indent(c, -1);
	return 1;
}

// 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 %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0x71c91(%rip), %rsi     # 0x1c4f8e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x7debb(%rip), %rsi     # 0x1d1224
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: do_object_sequence
static int do_object_sequence(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;

	d->nesting_level++;
	if(d->nesting_level>16) goto done;

	while(1) {
		struct objinfo oi;

		de_zeromem(&oi, sizeof(struct objinfo));
		oi.objpos = pos;
		if((oi.objpos+24) > (pos1+len)) break;
		oi.objtype = (u32)de_getu32le_p(&pos);
		oi.objsize = de_getu32le_p(&pos);
		if(oi.objsize<8 || (oi.objpos+oi.objsize)>(pos1+len)) {
			de_err(c, "Bad object size (%u) at %"I64_FMT, (unsigned int)oi.objsize, oi.objpos);
			goto done;
		}

		get_objtype_info(&oi);

		de_dbg(c, "object at %"I64_FMT", type=%u (%s), len=%"I64_FMT, oi.objpos,
			oi.objtype, oi.tyname, oi.objsize);

		if(oi.hasbbox) {
			pos += 16;
		}
		oi.dpos = pos;
		oi.dlen = oi.objpos+oi.objsize - oi.dpos;
		if(oi.dlen<0) goto done_obj;

		de_dbg_indent(c, 1);
		do_object(c, d, &oi);
		de_dbg_indent(c, -1);

done_obj:
		pos = oi.objpos + oi.objsize;
	}

done:
	d->nesting_level--;
	return 1;
}

// 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 -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x8(%rax)
jle 0x1533ec
jmp 0x153523
jmp 0x1533ee
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x19140
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x18, %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0x153420
jmp 0x153521
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, -0x50(%rbp)
cmpq $0x8, -0x50(%rbp)
jl 0x153465
movq -0x48(%rbp), %rax
addq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0x153486
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rcx
leaq 0x7ddc0(%rip), %rsi     # 0x1d123a
movb $0x0, %al
callq 0x15bfb0
jmp 0x153523
leaq -0x58(%rbp), %rdi
callq 0x153540
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x30(%rbp), %r8
movq -0x50(%rbp), %r9
leaq 0x7ddad(%rip), %rsi     # 0x1d1256
movb $0x0, %al
callq 0x15b0d0
cmpl $0x0, -0x54(%rbp)
je 0x1534c2
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq -0x50(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x1534e3
jmp 0x153510
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x153760
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x48(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1533ee
jmp 0x153523
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: do_object
static int do_object(deark *c, lctx *d, struct objinfo *oi)
{
	if(oi->objtype==6) { // group
		// TODO: group name, 12 bytes
		do_object_sequence(c, d, oi->dpos+12, oi->dlen-12);
	}
	else if(oi->objtype==5) { // sprite
		do_object_sprite(c, d, oi);
	}
	else if(oi->objtype==13) { // transformed sprite
		do_object_sprite(c, d, oi);
	}
	// TODO: objtype 7 (tagged object)

	return 1;
}

// 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
cmpl $0x6, (%rax)
jne 0x1537a4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
addq $0xc, %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
subq $0xc, %rcx
callq 0x1533b0
jmp 0x1537de
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x1537c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1537f0
jmp 0x1537dc
movq -0x18(%rbp), %rax
cmpl $0xd, (%rax)
jne 0x1537da
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1537f0
jmp 0x1537dc
jmp 0x1537de
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rodraw.c
// Function: do_object_sprite
static void do_object_sprite(deark *c, lctx *d, struct objinfo *oi)
{
	i64 dpos, dlen;
	dbuf *outf = NULL;
	de_finfo *fi = NULL;

	fi = de_finfo_create(c);

	dpos = oi->dpos;
	dlen = oi->dlen;

	if(oi->objtype==13) {
		// Skip transformation matrix
		dpos += 24;
		dlen -= 24;
	}

	if(dlen>=16) {
		// Peek at the sprite name, to use in the output filename.
		de_ucstring *s = NULL;
		s = ucstring_create(c);
		dbuf_read_to_ucstring(c->infile, dpos+4, 12, s,
			DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_RISCOS);
		de_finfo_set_name_from_ucstring(c, fi, s, 0);
		ucstring_destroy(s);
	}

	// An .acorn extension may be needed to open these files with XnView.
	outf = dbuf_create_output_file(c, "acorn", fi, 0x0);

	// Manufacture a sprite file, by adding a 12-byte header.
	dbuf_writeu32le(outf, 1); // number of sprites
	dbuf_writeu32le(outf, 12+4); // offset of sprite data (+4)
	dbuf_writeu32le(outf, 12+dlen+4); // file size (+4)
	dbuf_copy(c->infile, dpos, dlen, outf);

	dbuf_close(outf);
	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 $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xd, (%rax)
jne 0x15385a
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
subq $0x18, %rax
movq %rax, -0x28(%rbp)
cmpq $0x10, -0x28(%rbp)
jl 0x1538bc
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movq -0x40(%rbp), %rcx
movl $0xc, %edx
movl $0x1, %r8d
movl $0x14, %r9d
callq 0x1669f0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x40(%rbp), %rdi
callq 0x171750
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x7da1a(%rip), %rsi     # 0x1d12e5
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x168c30
movq -0x30(%rbp), %rdi
movl $0x10, %esi
callq 0x168c30
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0xc, %rsi
addq $0x4, %rsi
callq 0x168c30
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x166070
movq -0x30(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/unifont.c
// Function: de_linereader_readnextline
static int de_linereader_readnextline(deark *c, struct de_linereader *lr,
	char *buf, size_t buf_len, unsigned int flags)
{
	int ret;
	i64 content_len = 0;
	i64 total_len = 0;

	buf[0] = '\0';

	ret = dbuf_find_line(lr->f, lr->f_pos, &content_len, &total_len);
	if(!ret) return 0;
	if(content_len > (i64)buf_len-1) {
		lr->f_pos += total_len;
		return 0;
	}
	dbuf_read(lr->f, (u8*)buf, lr->f_pos, content_len);
	buf[content_len] = '\0';
	lr->f_pos += total_len;
	return 1;
}

// 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)
movl %r8d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x169640
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x153e61
movl $0x0, -0x4(%rbp)
jmp 0x153eca
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jle 0x153e8b
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x153eca
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x38(%rbp), %rcx
callq 0x164d10
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
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/unifont.c
// Function: decode_fontdata
static void decode_fontdata(deark *c, const char *hexdata,
	struct de_bitmap_font_char *ch)
{
	i64 ndstbytes;
	i64 srcpos = 0;
	i64 dstpos = 0;

	ndstbytes = ch->rowspan*ch->height;
	while(1) {
		int errorflag;
		u8 h0, h1;

		h0 = de_decode_hex_digit((unsigned char)hexdata[srcpos++], &errorflag);
		if(errorflag) break;
		h1 = de_decode_hex_digit((unsigned char)hexdata[srcpos++], &errorflag);
		if(errorflag) break;
		ch->bitmap[dstpos++] = (h0<<4)|h1;
		if(dstpos>=ndstbytes) break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
leaq -0x34(%rbp), %rsi
movzbl (%rax,%rcx), %edi
callq 0x1600b0
movb %al, -0x35(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x153f47
jmp 0x153fac
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
leaq -0x34(%rbp), %rsi
movzbl (%rax,%rcx), %edi
callq 0x1600b0
movb %al, -0x36(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x153f72
jmp 0x153fac
movzbl -0x35(%rbp), %eax
shll $0x4, %eax
movzbl -0x36(%rbp), %ecx
orl %ecx, %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x30(%rbp)
movb %dl, (%rax,%rcx)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jl 0x153fa7
jmp 0x153fac
jmp 0x153f1c
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rm.c
// Function: de_module_rm
void de_module_rm(deark *c, struct deark_module_info *mi)
{
	mi->id = "rm";
	mi->desc = "RealMedia";
	mi->run_fn = de_run_rm;
	mi->identify_fn = de_identify_rm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x52d9b(%rip), %rcx     # 0x1a6da2
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x7d340(%rip), %rcx     # 0x1d1355
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x154040
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x8d(%rip), %rcx        # 0x1540c0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rm.c
// Function: de_run_rm
static void de_run_rm(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);
	do_rm_chunk_sequence(c, d, 0, c->infile->len);
	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 -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x9, %edx
callq 0x15e4a0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x154110
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rm.c
// Function: do_rm_chunk_sequence
static int do_rm_chunk_sequence(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;

	while(1) {
		int ret;
		i64 bytes_consumed = 0;

		if(pos >= pos1+len) break;
		de_dbg(c, "chunk at %"I64_FMT, pos);
		de_dbg_indent(c, 1);
		ret = do_rm_chunk(c, d, pos, pos1+len-pos, &bytes_consumed);
		de_dbg_indent(c, -1);
		if((!ret) || (bytes_consumed<1)) goto done;
		pos += bytes_consumed;
	}

done:
	return 1;
}

// 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 -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jl 0x15414b
jmp 0x1541c1
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x82648(%rip), %rsi     # 0x1d67a2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x28(%rbp), %rcx
leaq -0x38(%rbp), %r8
callq 0x1541d0
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x2c(%rbp)
je 0x1541ae
cmpq $0x1, -0x38(%rbp)
jge 0x1541b0
jmp 0x1541c3
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x154130
jmp 0x1541c3
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rm.c
// Function: do_chunk_CONT
static void do_chunk_CONT(deark *c, lctx *d, struct chunkinfo *ci)
{
	i64 pos = ci->dpos;
	de_ucstring *s = NULL;
	i64 slen;

	read_chunk_version_p(c, d, ci, &pos);
	if(ci->version != 0) goto done;

	s = ucstring_create(c);
	slen = de_getu16be_p(&pos);
	dbuf_read_to_ucstring(c->infile, pos, slen, s, 0, d->input_encoding);
	de_dbg(c, "title: \"%s\"", ucstring_getpsz_d(s));
	pos += slen;

	ucstring_empty(s);
	slen = de_getu16be_p(&pos);
	dbuf_read_to_ucstring(c->infile, pos, slen, s, 0, d->input_encoding);
	de_dbg(c, "author: \"%s\"", ucstring_getpsz_d(s));
	pos += slen;

	ucstring_empty(s);
	slen = de_getu16be_p(&pos);
	dbuf_read_to_ucstring(c->infile, pos, slen, s, 0, d->input_encoding);
	de_dbg(c, "copyright: \"%s\"", ucstring_getpsz_d(s));
	pos += slen;

done:
	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 -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x154900
movq -0x18(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x15442c
jmp 0x154589
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165210
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x5f491(%rip), %rsi     # 0x1b3921
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165210
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x5a44e(%rip), %rsi     # 0x1ae951
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165210
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x56495(%rip), %rsi     # 0x1aaa0b
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/rm.c
// Function: do_chunk_PROP
static void do_chunk_PROP(deark *c, lctx *d, struct chunkinfo *ci)
{
	i64 pos = ci->dpos;
	i64 n;

	read_chunk_version_p(c, d, ci, &pos);
	if(ci->version!=0 || ci->dlen<42) goto done;

	pos += 7*4; // TODO: other fields

	n = de_getu32be_p(&pos);
	de_dbg(c, "index offset: %"I64_FMT, n);
	n = de_getu32be_p(&pos);
	de_dbg(c, "data offset: %"I64_FMT, n);
	n = de_getu16be_p(&pos);
	de_dbg(c, "num streams: %d", (int)n);
	n = de_getu16be_p(&pos);
	de_dbg(c, "flags: 0x%04x", (unsigned int)n);
done:
	;
}

// 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
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x154900
movq -0x18(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jne 0x15482a
movq -0x18(%rbp), %rax
cmpq $0x2a, 0x40(%rax)
jge 0x15482f
jmp 0x1548eb
movq -0x20(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x7cb97(%rip), %rsi     # 0x1d13f6
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x683bf(%rip), %rsi     # 0x1bcc49
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165210
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x7cb51(%rip), %rsi     # 0x1d1408
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165210
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x60377(%rip), %rsi     # 0x1b4c5b
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/reko.c
// Function: de_module_reko
void de_module_reko(deark *c, struct deark_module_info *mi)
{
	mi->id = "reko";
	mi->desc = "REKO cardset";
	mi->run_fn = de_run_reko;
	mi->identify_fn = de_identify_reko;
	mi->help_fn = de_help_reko;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x7caa7(%rip), %rcx     # 0x1d141e
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x7ca9e(%rip), %rcx     # 0x1d1423
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x1549c0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x22d(%rip), %rcx       # 0x154bd0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x25e(%rip), %rcx       # 0x154c10
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: de_module_wizsolitaire
void de_module_wizsolitaire(deark *c, struct deark_module_info *mi)
{
	mi->id = "wizsolitaire";
	mi->desc = "Wiz Solitaire deck";
	mi->run_fn = de_run_wizsolitaire;
	mi->identify_fn = de_identify_wizsolitaire;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x7c7d9(%rip), %rcx     # 0x1d1430
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x7c7d8(%rip), %rcx     # 0x1d143d
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x154c90
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x2cd(%rip), %rcx       # 0x154f50
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: reko_fmt_from_sig
static u8 reko_fmt_from_sig(deark *c)
{
	u8 buf[8];

	de_read(buf, 0, sizeof(buf));

	if(!de_memcmp(buf, (const void*)"REKO", 4)) {
		// Just to screen out text files, I think we can assume the high byte
		// of the cardsize field is 0.
		if(de_getbyte(8) == 0) {
			return RKFMT_AMIGA;
		}
	}
	if(!de_memcmp(buf, (const void*)"PCREKO", 6)) {
		if(buf[6]=='D' && buf[7]==0x20) return RKFMT_RKP8;
		if(buf[6]==0 && buf[7]==0) return RKFMT_RKP16;
	}
	if(!de_memcmp(buf, (const void*)"PCRKP\0", 6)) {
		return RKFMT_RKP24;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x8, %ecx
callq 0x164d10
leaq -0x18(%rbp), %rax
movl (%rax), %eax
subl $0x4f4b4552, %eax       # imm = 0x4F4B4552
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x154ffe
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x154ffc
movb $0x1, -0x1(%rbp)
jmp 0x15506e
jmp 0x154ffe
leaq -0x18(%rbp), %rdi
leaq 0x7c493(%rip), %rsi     # 0x1d149c
movl $0x6, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x15504a
movzbl -0x12(%rbp), %eax
cmpl $0x44, %eax
jne 0x155030
movzbl -0x11(%rbp), %eax
cmpl $0x20, %eax
jne 0x155030
movb $0x4, -0x1(%rbp)
jmp 0x15506e
movzbl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x155048
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x155048
movb $0x5, -0x1(%rbp)
jmp 0x15506e
jmp 0x15504a
leaq -0x18(%rbp), %rdi
leaq 0x7c65d(%rip), %rsi     # 0x1d16b2
movl $0x6, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x15506a
movb $0x6, -0x1(%rbp)
jmp 0x15506e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: read_header_rkp24
static void read_header_rkp24(deark *c, lctx *d)
{
	i64 pos = 0;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	pos += 8;

	d->cardsize = de_getu32le_p(&pos);
	de_dbg(c, "card size: %"I64_FMT, d->cardsize);
	d->bodysize = de_getu32le_p(&pos);
	de_dbg(c, "body size: %"I64_FMT, d->bodysize);
	d->w = de_getu32le_p(&pos);
	d->h = de_getu32le_p(&pos);
	de_dbg_dimensions(c, d->w, d->h);
	d->depth_pixel = (UI)de_getu32le_p(&pos);
	de_dbg(c, "depth: %u", d->depth_pixel);
	d->depth_color = d->depth_pixel;
	d->numcards = (i64)de_getu32le_p(&pos);
	de_dbg(c, "num cards: %"I64_FMT, d->numcards);
	d->hdrsize = 1104;

	de_dbg_indent_restore(c, saved_indent_level);
}

// 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
leaq -0x1c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x59caf(%rip), %rsi     # 0x1aed63
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x7c39f(%rip), %rsi     # 0x1d14a3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x7c378(%rip), %rsi     # 0x1d14b2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
callq 0x15bba0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %edx
leaq 0x5a8cc(%rip), %rsi     # 0x1afa8a
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x7c2bf(%rip), %rsi     # 0x1d14c1
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq $0x450, 0x50(%rax)      # imm = 0x450
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x15b5a0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: read_header_pc
static void read_header_pc(deark *c, lctx *d)
{
	i64 pos = 0;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	pos += 8;

	d->bodysize = de_getu32le_p(&pos);
	de_dbg(c, "body size: %"I64_FMT, d->bodysize);
	d->cardsize = de_getu32le_p(&pos);
	de_dbg(c, "card size: %"I64_FMT, d->cardsize);
	d->w = de_getu16le_p(&pos);
	d->h = de_getu16le_p(&pos);
	de_dbg_dimensions(c, d->w, d->h);
	d->depth_pixel = (UI)de_getbyte_p(&pos);
	de_dbg(c, "depth: %u", d->depth_pixel);
	d->depth_color = d->depth_pixel;
	d->numcards = (i64)de_getbyte_p(&pos);
	de_dbg(c, "num cards: %"I64_FMT, d->numcards);
	d->hdrsize = pos;

	de_dbg_indent_restore(c, saved_indent_level);
}

// 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
leaq -0x1c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x59aff(%rip), %rsi     # 0x1aed63
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x7c1fe(%rip), %rsi     # 0x1d14b2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x7c1b9(%rip), %rsi     # 0x1d14a3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
callq 0x15bba0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165170
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %edx
leaq 0x5a71b(%rip), %rsi     # 0x1afa8a
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x7c10c(%rip), %rsi     # 0x1d14c1
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x15b5a0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: read_palette_amiga
static void read_palette_amiga(deark *c, lctx *d)
{
	i64 pos;
	i64 numentries;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	pos = d->hdrsize;
	de_dbg(c, "global palette at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	numentries = 1LL<<d->depth_color;
	d->globalpal_nbytes = numentries*3;
	de_read_simple_palette(c, c->infile, pos, numentries, 3, d->pal, 256,
		DE_RDPALTYPE_24BIT, DE_RDPALFLAG_NOHEADER);
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x15b580
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7be08(%rip), %rsi     # 0x1d1510
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x20(%rbp)
imulq $0x3, -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %r9
addq $0x70, %r9
movl $0x3, %r8d
movq $0x100, (%rsp)          # imm = 0x100
movl $0x1, 0x8(%rsp)
movl $0x8, 0x10(%rsp)
callq 0x16c160
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x15b5a0
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/reko.c
// Function: set_reko_card_filename
static void set_reko_card_filename(deark *c, i64 idx_of_first_main_card,
	i64 cardidx, de_finfo *fi)
{
	static const char *cnames = "a23456789tjqk";
	static const char *snames = "cdhs";
	char nbuf[16];

	if(cardidx>=idx_of_first_main_card && cardidx<idx_of_first_main_card+52) {
		nbuf[0] = cnames[(cardidx-idx_of_first_main_card)/4];
		nbuf[1] = snames[(cardidx-idx_of_first_main_card)%4];
		nbuf[2] = '\0';
	}
	else if(cardidx==0) {
		de_strlcpy(nbuf, "back", sizeof(nbuf));
	}
	else {
		de_strlcpy(nbuf, "other", sizeof(nbuf));
	}

	de_finfo_set_name_from_sz(c, fi, nbuf, 0, DE_ENCODING_LATIN1);
}

// 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 -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x15622a
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x34, %rcx
cmpq %rcx, %rax
jge 0x15622a
movq 0xcf826(%rip), %rax     # 0x225a00
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
subq -0x10(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x40(%rbp), %rax
movb (%rax,%rcx), %al
movb %al, -0x30(%rbp)
movq 0xcf804(%rip), %rax     # 0x225a08
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
subq -0x10(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq -0x38(%rbp), %rax
movb (%rax,%rdx), %al
movb %al, -0x2f(%rbp)
movb $0x0, -0x2e(%rbp)
jmp 0x15625f
cmpq $0x0, -0x18(%rbp)
jne 0x156248
leaq -0x30(%rbp), %rdi
leaq 0x7b31b(%rip), %rsi     # 0x1d1557
movl $0x10, %edx
callq 0x15aa30
jmp 0x15625d
leaq -0x30(%rbp), %rdi
leaq 0x81fea(%rip), %rsi     # 0x1d823d
movl $0x10, %edx
callq 0x15aa30
jmp 0x15625f
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
movl $0x5, %r8d
callq 0x15d4c0
addq $0x40, %rsp
popq %rbp
retq
nop