LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ogg.c
// Function: do_theora_vorbis_after_headers
static void do_theora_vorbis_after_headers(deark *c, lctx *d, struct stream_info *si)
{
	i64 pos = 0;
	int saved_indent_level;
	dbuf *f = NULL;

	de_dbg_indent_save(c, &saved_indent_level);
	if(si->stream_state!=0) goto done;
	if(!si->header_stream) goto done;
	if(!si->sti) goto done;
	f = si->header_stream;

	de_dbg(c, "[decoding %s comment/setup headers, %d bytes]",
		si->sti->name, (int)si->header_stream->len);
	de_dbg_indent(c, 1);

	// Make sure the comment header signature is present.
	if(si->stream_type==STREAMTYPE_VORBIS) {
		if(dbuf_memcmp(f, 0, "\x03" "vorbis", 7)) {
			goto done;
		}
		pos += 7;
	}
	else if(si->stream_type==STREAMTYPE_THEORA) {
		if(dbuf_memcmp(f, 0, "\x81" "theora", 7)) {
			goto done;
		}
		pos += 7;
	}

	do_vorbis_comment_block(c, d, f, pos);

	// TODO: "Setup" header

done:
	si->stream_state = 1;
	dbuf_close(si->header_stream);
	si->header_stream = NULL;
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
callq 0xe958c
cmpl $0x0, 0x20(%r14)
je 0x89fba
movl $0x1, 0x20(%r14)
movq 0x28(%r14), %rdi
callq 0xf0b13
movq $0x0, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x89f89
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x89f89
movq 0x18(%rax), %rdx
movl 0x18(%r15), %ecx
leaq 0xa2ac6(%rip), %rsi     # 0x12caa1
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl (%r14), %eax
cmpl $0x2, %eax
je 0x8a00b
cmpl $0x1, %eax
jne 0x8a02f
leaq 0xa2ac6(%rip), %rdx     # 0x12cacf
jmp 0x8a012
leaq 0xa2ac5(%rip), %rdx     # 0x12cad7
movl $0x7, %r12d
movl $0x7, %ecx
movq %r15, %rdi
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
jne 0x89f89
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x8a042
jmp 0x89f89
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ogg.c
// Function: do_vorbis_comment_block
static void do_vorbis_comment_block(deark *c, lctx *d, dbuf *f, i64 pos1)
{
	i64 pos = pos1;
	i64 n;
	i64 ncomments;
	i64 k;
	de_ucstring *s = NULL;

	n = dbuf_getu32le_p(f, &pos);
	if(pos+n > f->len) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(f, pos, n, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF8);
	de_dbg(c, "vendor: \"%s\"", ucstring_getpsz_d(s));
	pos += n;

	ncomments = dbuf_getu32le_p(f, &pos);
	de_dbg(c, "number of comments: %d", (int)ncomments);

	for(k=0; k<ncomments; k++) {
		if(pos+4 > f->len) goto done;
		n = dbuf_getu32le_p(f, &pos);
		if(pos+n > f->len) goto done;
		ucstring_empty(s);
		dbuf_read_to_ucstring_n(f, pos, n, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF8);
		de_dbg(c, "comment[%d]: \"%s\"", (int)k, ucstring_getpsz_d(s));
		pos += n;
	}

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %rdx, (%r15)
movq %rsi, %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, %r12
movq (%r15), %rax
addq %r12, %rax
cmpq 0x18(%rbx), %rax
jle 0x8a080
xorl %r15d, %r15d
jmp 0x8a184
movq %r14, %rdi
callq 0xf6870
movq %rax, %r15
leaq 0x10(%rsp), %r13
movq (%r13), %rsi
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf7557
leaq 0xa2a1f(%rip), %rsi     # 0x12cadf
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r12, (%r13)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xef3a0
movq %rax, %r12
leaq 0xa2a06(%rip), %rsi     # 0x12caec
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
testq %r12, %r12
jle 0x8a184
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
addq $0x4, %rax
cmpq 0x18(%rbx), %rax
jg 0x8a184
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0xef3a0
movq %rax, %r13
movq 0x10(%rsp), %rax
addq %r13, %rax
cmpq 0x18(%rbx), %rax
jg 0x8a184
movq %r15, %rdi
callq 0xf6883
movq 0x10(%rsp), %rsi
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf7557
movq %r14, %rdi
leaq 0xa299c(%rip), %rsi     # 0x12cb03
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
addq %r13, 0x10(%rsp)
incq %rbp
cmpq %rbp, %r12
jne 0x8a0fe
movq %r15, %rdi
callq 0xf6bb0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ogg.c
// Function: declare_ogg_format
static void declare_ogg_format(deark *c, lctx *d)
{
	char tmps[80];
	const char *name = NULL;

	if(d->format_declared) return;
	d->format_declared = 1;

	// There's no nice way, that I know of, to characterize the contents of an Ogg
	// file. But I think it's worth trying.

	if(d->bitstream_count<1) {
		// If there are zero streams : "other"
	}
	else if(d->found_ogm) {
		// else if there's an OGM stream of any kind...
		name="OGM";
	}
	else if(d->found_skeleton) {
		// else If there's a Skeleton stream...
		name="Skeleton";
	}
	else if(d->first_stream_type_valid && d->first_stream_sti &&
		!d->has_unknown_or_multiple_stream_types)
	{
		// else if all streams are the same known type: that stream type
		name = d->first_stream_sti->name;
	}
	else if(d->found_theora && d->found_vorbis && !d->has_non_vorbis_non_theora_stream) {
		// else if there are Theora and Vorbis streams and nothing else...
		name="Theora+Vorbis";
	}
	else if(d->found_theora) {
		// else if there's a Theora stream...
		name="Theora+other";
	}
	// (else "other")

	de_snprintf(tmps, sizeof(tmps), "Ogg %s", name?name:"(other)");
	de_declare_fmt(c, tmps);
}

// Assembly:
cmpb $0x0, 0x20(%rsi)
je 0x8a1a2
retq
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movb $0x1, 0x20(%rsi)
cmpq $0x0, 0x10(%rsi)
jle 0x8a20e
cmpb $0x0, 0x22(%rsi)
je 0x8a1c6
leaq 0xa2b44(%rip), %rax     # 0x12cd08
jmp 0x8a210
cmpb $0x0, 0x21(%rsi)
je 0x8a1d5
leaq 0xa27cf(%rip), %rax     # 0x12c9a2
jmp 0x8a210
cmpl $0x0, 0x28(%rsi)
je 0x8a1ea
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0x8a1ea
cmpl $0x0, 0x30(%rsi)
je 0x8a253
cmpb $0x0, 0x24(%rsi)
je 0x8a20e
cmpb $0x0, 0x23(%rsi)
je 0x8a24a
cmpl $0x0, 0x34(%rsi)
leaq 0xa2b0b(%rip), %rcx     # 0x12cd0c
leaq 0xa2b12(%rip), %rax     # 0x12cd1a
cmoveq %rcx, %rax
jmp 0x8a210
xorl %eax, %eax
testq %rax, %rax
leaq 0xa1304(%rip), %rcx     # 0x12b51e
cmovneq %rax, %rcx
leaq 0xa2b02(%rip), %rdx     # 0x12cd27
movq %rsp, %r14
movl $0x50, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8d67
movq %rbx, %rdi
movq %r14, %rsi
callq 0xeb6d6
addq $0x58, %rsp
popq %rbx
popq %r14
retq
leaq 0xa2ac9(%rip), %rax     # 0x12cd1a
jmp 0x8a210
movq 0x18(%rax), %rax
jmp 0x8a210
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/olepropset.c
// Function: de_module_olepropset
void de_module_olepropset(deark *c, struct deark_module_info *mi)
{
	mi->id = "olepropset";
	mi->desc = "OLE Property Set";
	mi->run_fn = de_run_olepropset;
	mi->flags |= DE_MODFLAG_HIDDEN;
}

// Assembly:
leaq 0x8fbcc(%rip), %rax     # 0x119e2f
movq %rax, (%rsi)
leaq 0xa2beb(%rip), %rax     # 0x12ce58
movq %rax, 0x8(%rsi)
leaq 0x9(%rip), %rax         # 0x8a281
movq %rax, 0x18(%rsi)
orb $0x1, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_CodePageString2
static void do_prop_CodePageString2(deark *c, lctx *d, struct propset_struct *si,
	const char *name, i64 dpos, int is_dict_name, i64 *bytes_consumed,
	de_ucstring *s)
{
	i64 n_raw;
	int is_utf16 = (si->code_page==1200);
	de_encoding encoding = si->encoding;

	if(is_utf16 && is_dict_name && d->asciipropnames) {
		// A hack that the user can enable. Some dictionaries use an 8-bit
		// encoding even though they have CodePage=1200, and I don't know
		// how to detect this.
		is_utf16 = 0;
		encoding = DE_ENCODING_ASCII;
	}

	n_raw = dbuf_getu32le(d->f, dpos);

	if(is_utf16) {
		i64 n;

		if(is_dict_name) {
			n = n_raw*2;
		}
		else {
			n = n_raw;
		}
		dbuf_read_to_ucstring_n(d->f, dpos+4, n, DE_DBG_MAX_STRLEN*2, s,
			0, encoding);
		ucstring_truncate_at_NUL(s);
		if(is_dict_name) {
			*bytes_consumed = 4 + de_pad_to_4(n_raw*2);
		}
		else {
			*bytes_consumed = 4 + de_pad_to_4(n_raw);
		}
	}
	else {
		dbuf_read_to_ucstring_n(d->f, dpos+4, n_raw, DE_DBG_MAX_STRLEN, s,
			DE_CONVFLAG_STOP_AT_NUL, encoding);
		*bytes_consumed = 4 + n_raw;
	}
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r12
movq %rcx, 0x30(%rsp)
movq %rsi, %rbx
movq %rdi, 0x28(%rsp)
movl 0x10(%rdx), %r14d
cmpl $0x4b0, 0xc(%rdx)       # imm = 0x4B0
sete %r15b
setne %al
movl %r9d, 0x14(%rsp)
testl %r9d, %r9d
sete %cl
orb %al, %cl
jne 0x8aeaf
cmpl $0x0, 0xc(%rbx)
sete %r15b
movl $0x1, %eax
cmovnel %eax, %r14d
movq 0x78(%rsp), %rbp
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movq (%rbx), %rdi
movq %r12, %rsi
callq 0xef37e
movq %rax, %r13
testb %r15b, %r15b
je 0x8af1f
leaq (,%r13,2), %rax
movl 0x14(%rsp), %r15d
testl %r15d, %r15d
movq %r13, %rdx
movq %rax, 0x18(%rsp)
cmovneq %rax, %rdx
movq (%rbx), %rdi
addq $0x4, %r12
movl %r14d, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r12, %rsi
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %rbp, %rdi
callq 0xf68c1
testl %r15d, %r15d
je 0x8af45
movq 0x18(%rsp), %rdi
jmp 0x8af48
movq (%rbx), %rdi
addq $0x4, %r12
movl %r14d, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %r8
movl $0x1, %r9d
callq 0xf0203
jmp 0x8af50
movq %r13, %rdi
callq 0xea7de
movq %rax, %r13
addq $0x4, %r13
movq 0x20(%rsp), %rax
movq %r13, (%rax)
movq %rbp, %rdi
callq 0xf74bd
leaq 0xa0ed7(%rip), %rsi     # 0x12be42
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9226
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/olepropset.c
// Function: get_prop_data_type_name
static char *get_prop_data_type_name(char *buf, size_t buf_len, u32 dt)
{
	const char *name = NULL;
	const char *prefix = "";
	size_t k;

	if(dt>=0x1000 && dt<0x2000) {
		prefix = "vector of ";
		dt -= 0x1000;
	}
	else if(dt>=0x2000 && dt<0x3000) {
		prefix = "array of ";
		dt -= 0x2000;
	}

	for(k=0; k<DE_ARRAYCOUNT(prop_data_type_info_arr); k++) {
		if(prop_data_type_info_arr[k].dt == dt) {
			name = prop_data_type_info_arr[k].name;
			break;
		}
	}

	if(name) {
		de_snprintf(buf, buf_len, "%s%s", prefix, name);
	}
	else {
		de_strlcpy(buf, "?", buf_len);
	}

	return buf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, %eax
andl $0xfffff000, %eax       # imm = 0xFFFFF000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x8afae
addl $0xfffff000, %esi       # imm = 0xFFFFF000
leaq 0xa25f0(%rip), %rcx     # 0x12d59c
jmp 0x8afd0
leal -0x2000(%rsi), %edx
cmpl $0x2000, %eax           # imm = 0x2000
cmovnel %esi, %edx
leaq 0xa25e4(%rip), %rax     # 0x12d5a7
leaq 0xb9c06(%rip), %rcx     # 0x144bd0
cmoveq %rax, %rcx
movl %edx, %esi
movl $0x8, %eax
leaq 0xfa194(%rip), %rdx     # 0x185170
xorl %r8d, %r8d
cmpl %esi, -0x8(%rax,%rdx)
je 0x8aff3
addq $0x10, %rax
cmpq $0x158, %rax            # imm = 0x158
jne 0x8afdf
jmp 0x8aff7
movq (%rax,%rdx), %r8
testq %r8, %r8
je 0x8b014
leaq 0xbaffa(%rip), %rdx     # 0x145ffd
movl $0x50, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8d67
jmp 0x8b028
leaq 0xa0e4e(%rip), %rsi     # 0x12be69
movl $0x50, %edx
movq %rbx, %rdi
callq 0xe8ded
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_any_int
static void do_prop_any_int(deark *c, lctx *d, struct propset_struct *si,
	struct prop_info_struct *pinfo, const char *name, i64 pos,
	unsigned int nbytes, int is_signed)
{
	i64 n;
	char descr[200];

	// FIXME: This doesn't really support uint64.
	n = dbuf_getint_ext(d->f, pos, nbytes, 1, is_signed);

	descr[0] = '\0';

	if(pinfo->prop_id==0x00000001U) { // code page
		// Code page is usually a *signed* 16-bit int, which means the maximum
		// value is 32767, even though code pages can go up to 65535.
		// Apparently, code pages over 32767 are stored as negative numbers.
		if(de_int_in_range(n, -32768, -1)) {
			si->code_page = (int)(n + 65536);
		}
		else {
			si->code_page = (int)n;
		}

		si->encoding = de_windows_codepage_to_encoding(c, si->code_page,
			descr, sizeof(descr), 0x1);
		if(si->encoding==DE_ENCODING_UNKNOWN) {
			si->encoding = DE_ENCODING_ASCII;
		}
	}

	if(descr[0]) {
		de_dbg(c, "%s: %"I64_FMT" (%s)", name, n, descr);
	}
	else {
		de_dbg(c, "%s: %"I64_FMT, name, n);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rdi, %r14
movl 0x100(%rsp), %edx
movl 0x108(%rsp), %r8d
movq (%rsi), %rdi
movq %r9, %rsi
movl $0x1, %ecx
callq 0xef6f2
movq %rax, %r15
movb $0x0, (%rsp)
cmpl $0x1, (%r13)
jne 0x8b792
movq %r15, %rdi
movq $-0x8000, %rsi          # imm = 0x8000
movq $-0x1, %rdx
callq 0xea7a8
leal 0x10000(%r15), %esi
testl %eax, %eax
cmovel %r15d, %esi
movl %esi, 0xc(%r12)
movq %rsp, %rdx
movl $0xc8, %ecx
movq %r14, %rdi
movl $0x1, %r8d
callq 0xed1c6
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, 0x10(%r12)
cmpb $0x0, (%rsp)
je 0x8b7b4
leaq 0x8b3e2(%rip), %rsi     # 0x116b81
movq %rsp, %r8
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
jmp 0x8b7cb
leaq 0x968f4(%rip), %rsi     # 0x1220af
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_module_iso9660
void de_module_iso9660(deark *c, struct deark_module_info *mi)
{
	mi->id = "iso9660";
	mi->desc = "ISO 9660 (CD-ROM) image";
	mi->run_fn = de_run_iso9660;
	mi->identify_fn = de_identify_iso9660;
	mi->help_fn = de_help_iso9660;
}

// Assembly:
leaq 0xa1f75(%rip), %rax     # 0x12d758
movq %rax, (%rsi)
leaq 0xa1f73(%rip), %rax     # 0x12d760
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x8b813
movq %rax, 0x18(%rsi)
leaq 0x706(%rip), %rax       # 0x8bf09
movq %rax, 0x20(%rsi)
leaq 0x730(%rip), %rax       # 0x8bf3e
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_identify_iso9660
static int de_identify_iso9660(deark *c)
{
	if(cdsig_at2(c->infile, 32768, 32768+2048)) {
		// Confidence is practically 100%, but since hybrid formats are
		// possible, we want other modules to be able to have precedence.
		return 80;
	}
	return 0;
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rbx
movl $0x8000, %esi           # imm = 0x8000
movq %rbx, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8bf3a
movl $0x8800, %esi           # imm = 0x8800
movq %rbx, %rdi
callq 0x8e774
movl %eax, %ecx
testl %eax, %eax
movl $0x50, %eax
cmovel %ecx, %eax
jmp 0x8bf3c
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_module_cd_raw
void de_module_cd_raw(deark *c, struct deark_module_info *mi)
{
	mi->id = "cd_raw";
	mi->desc = "Raw CD image";
	mi->run_fn = de_run_cd_raw;
	mi->identify_fn = de_identify_cd_raw;
}

// Assembly:
leaq 0xa17fe(%rip), %rax     # 0x12d778
movq %rax, (%rsi)
leaq 0xa17fb(%rip), %rax     # 0x12d77f
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x8bf9f
movq %rax, 0x18(%rsi)
leaq 0x1c8(%rip), %rax       # 0x8c162
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_run_cd_raw
static void de_run_cd_raw(deark *c, de_module_params *mparams)
{
	struct cdraw_params cdrp;

	cdraw_setdefaults(&cdrp);
	cdraw_detect_params(c->infile, &cdrp);
	if(!cdrp.ok) {
		de_err(c, "Failed to detect raw CD format");
		goto done;
	}

	de_dbg(c, "total bytes/sector: %"I64_FMT, cdrp.sector_total_len);
	de_dbg(c, "data bytes/sector: %"I64_FMT, cdrp.sector_dlen);
	de_dbg(c, "data offset: %"I64_FMT, cdrp.sector_data_offset);

	do_cdraw_convert(c, &cdrp);

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movl $0x0, (%r14)
movl $0x800, %eax            # imm = 0x800
movq %rax, 0x8(%r14)
movq %rax, 0x10(%r14)
movq $0x0, 0x18(%r14)
leaq 0xa9459(%rip), %rax     # 0x135431
movq %rax, 0x20(%r14)
movq 0x18(%rdi), %rdi
movq %r14, %rsi
callq 0x8e7e7
cmpl $0x0, (%r14)
je 0x8c143
movq 0x18(%rsp), %r13
leaq 0xa248d(%rip), %rsi     # 0x12e48b
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x20(%rsp), %r15
leaq 0xa248a(%rip), %rsi     # 0x12e4a3
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x28(%rsp), %r12
leaq 0xa4e9b(%rip), %rsi     # 0x130ecd
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xea9a9
movq %rax, 0x8(%rsp)
movq %r13, %r14
shlq $0x4, %r14
addq %r12, %r14
movq 0x18(%rbx), %rdi
leaq 0xa245d(%rip), %rdx     # 0x12e4be
movl $0x6, %ecx
movq %r14, %rsi
callq 0xf025e
testl %eax, %eax
jne 0x8c0e3
movq %rbx, %rdi
callq 0xf6870
movq %rax, %rbp
movq 0x18(%rbx), %rdi
addq $0x28, %r14
movl $0x20, %edx
movq %r14, %rsi
movq %rax, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xf01b0
movq %rbp, %rdi
callq 0xf6900
movq %rbp, %rdi
callq 0xf6c00
testl %eax, %eax
je 0x8c0e3
movq %rbp, %rdi
callq 0xf7557
leaq 0xa2401(%rip), %rsi     # 0x12e4c5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0xea9e4
movq %rbp, %rdi
callq 0xf6bb0
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
movq 0x8(%rsp), %rbp
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r14
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r12
jge 0x8c122
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xefabc
addq %r13, %r12
jmp 0x8c105
movq %r14, %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %rbp, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea9b3
leaq 0xa2322(%rip), %rsi     # 0x12e46c
movq %rbx, %rdi
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9df7
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_identify_cd_raw
static int de_identify_cd_raw(deark *c)
{
	struct cdraw_params cdrp;

	cdraw_setdefaults(&cdrp);
	cdraw_detect_params(c->infile, &cdrp);
	if(cdrp.ok) return 70;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq 0x8(%rsp), %rbx
movl $0x0, (%rbx)
movl $0x800, %eax            # imm = 0x800
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
leaq 0xa92a3(%rip), %rax     # 0x135431
movq %rax, 0x20(%rbx)
movq 0x18(%rdi), %rdi
movq %rbx, %rsi
callq 0x8e7e7
movl (%rbx), %ecx
testl %ecx, %ecx
movl $0x46, %eax
cmovel %ecx, %eax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: de_module_nrg
void de_module_nrg(deark *c, struct deark_module_info *mi)
{
	mi->id = "nrg";
	mi->desc = "NRG CD-ROM image";
	mi->run_fn = de_run_nrg;
	mi->identify_fn = de_identify_nrg;
}

// Assembly:
leaq 0xa15d5(%rip), %rax     # 0x12d78c
movq %rax, (%rsi)
leaq 0xa15cf(%rip), %rax     # 0x12d790
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x8c1dc
movq %rax, 0x18(%rsi)
leaq 0x213(%rip), %rax       # 0x8c3ea
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: read_datetime17
static void read_datetime17(deark *c, lctx *d, i64 pos, int fieldlen,
	struct de_timestamp *ts)
{
	i64 yr, mo, da;
	i64 hr, mi, se, hs;
	i64 offs;

	de_zeromem(ts, sizeof(struct de_timestamp));
	yr = read_decimal_substr(c->infile, pos, 4);
	if(yr==0) return;
	mo = read_decimal_substr(c->infile, pos+4, 2);
	da = read_decimal_substr(c->infile, pos+6, 2);
	hr = read_decimal_substr(c->infile, pos+8, 2);
	mi = read_decimal_substr(c->infile, pos+10, 2);
	se = read_decimal_substr(c->infile, pos+12, 2);
	hs = read_decimal_substr(c->infile, pos+14, 2);
	if(fieldlen==16) {
		offs = 0;
	}
	else {
		offs = dbuf_geti8(c->infile, pos+16);
	}
	de_make_timestamp(ts, yr, mo, da, hr, mi, se);
	de_timestamp_set_subsec(ts, ((double)hs)/100.0);
	de_timestamp_cvt_to_utc(ts, -offs*60*15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r12
xorpd %xmm0, %xmm0
movupd %xmm0, (%rcx)
movq 0x18(%rdi), %rdi
leaq 0x10(%rsp), %r15
movl $0x4, %ecx
movq %r15, %rsi
movq %r14, %rdx
callq 0xeeee8
movb $0x0, 0x4(%r15)
movq %r15, %rdi
callq 0xea786
testq %rax, %rax
je 0x8e253
movq %rbx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x18(%r12), %rdi
leaq 0x4(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
xorl %r13d, %r13d
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, 0x40(%rsp)
movq 0x18(%r12), %rdi
leaq 0x6(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, 0x38(%rsp)
movq 0x18(%r12), %rdi
leaq 0x8(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, 0x30(%rsp)
movq 0x18(%r12), %rdi
leaq 0xa(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, 0x28(%rsp)
movq 0x18(%r12), %rdi
leaq 0xc(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, %rbx
movq 0x18(%r12), %rdi
leaq 0xe(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xeeee8
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xea786
movq %rax, %r15
cmpl $0x10, %ebp
je 0x8e209
movq 0x18(%r12), %rdi
addq $0x10, %r14
movq %r14, %rsi
callq 0xef135
imulq $-0x384, %rax, %r13     # imm = 0xFC7C
movq %rbx, (%rsp)
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x28(%rsp), %r9
callq 0xeae97
cvtsi2sd %r15, %xmm0
divsd 0x8c338(%rip), %xmm0    # 0x11a578
movq %rbx, %rdi
callq 0xead3a
movq %rbx, %rdi
movq %r13, %rsi
callq 0xeb2ca
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: dbg_timestamp
static void dbg_timestamp(deark *c, struct de_timestamp *ts, const char *field_name)
{
	char timestamp_buf[64];

	if(ts->is_valid) {
		de_dbg_timestamp_to_string(c, ts, timestamp_buf, sizeof(timestamp_buf), 0);
		de_dbg(c, "%s: %s", field_name, timestamp_buf);
	}
	else {
		de_dbg(c, "%s: (not set)", field_name);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rdi, %r14
cmpb $0x0, (%rsi)
je 0x8e2ad
movq %rsp, %r15
movl $0x40, %ecx
movq %r14, %rdi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xeb687
leaq 0xbab57(%rip), %rsi     # 0x148dea
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9db23(%rip), %rsi     # 0x12bdd7
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: free_dir_record
static void free_dir_record(deark *c, struct dir_record *dr)
{
	if(!dr) return;
	ucstring_destroy(dr->fname);
	ucstring_destroy(dr->rr_name);
	de_free(c, dr);
}

// Assembly:
testq %rsi, %rsi
je 0x8e2fd
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rsi), %rdi
callq 0xf6bb0
movq 0x40(%rbx), %rdi
callq 0xf6bb0
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: read_datetime7
static void read_datetime7(deark *c, lctx *d, i64 pos, int fieldlen,
	struct de_timestamp *ts)
{
	i64 yr, mo, da;
	i64 hr, mi, se;
	i64 offs;

	ts->is_valid = 0;

	yr = de_getbyte(pos);
	mo = de_getbyte(pos+1);
	if(mo==0) return;
	da = de_getbyte(pos+2);
	hr = de_getbyte(pos+3);
	mi = de_getbyte(pos+4);
	se = de_getbyte(pos+5);
	if(fieldlen==6) {
		offs = 0;
	}
	else {
		offs = dbuf_geti8(c->infile, pos+6);
	}

	de_make_timestamp(ts, 1900+yr, mo, da, hr, mi, se);
	de_timestamp_cvt_to_utc(ts, -offs*60*15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r13
movb $0x0, (%rcx)
movq 0x18(%rdi), %rdi
callq 0xef0d5
movl %eax, %r15d
movq 0x18(%r13), %rdi
leaq 0x1(%r14), %rsi
callq 0xef0d5
testb %al, %al
je 0x8e39a
movzbl %r15b, %r15d
movzbl %al, %eax
movq %rax, 0x20(%rsp)
movq 0x18(%r13), %rdi
leaq 0x2(%r14), %rsi
callq 0xef0d5
movzbl %al, %eax
movq %rax, 0x18(%rsp)
movq 0x18(%r13), %rdi
leaq 0x3(%r14), %rsi
callq 0xef0d5
movzbl %al, %eax
movq %rax, 0x10(%rsp)
movq 0x18(%r13), %rdi
leaq 0x4(%r14), %rsi
callq 0xef0d5
movzbl %al, %r12d
movq 0x18(%r13), %rdi
leaq 0x5(%r14), %rsi
callq 0xef0d5
movl %ebp, %ecx
movzbl %al, %ebp
cmpl $0x6, %ecx
jne 0x8e3a9
xorl %r14d, %r14d
jmp 0x8e3c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r13), %rdi
addq $0x6, %r14
movq %r14, %rsi
callq 0xef135
imulq $-0x384, %rax, %r14     # imm = 0xFC7C
addq $0x76c, %r15            # imm = 0x76C
movq %rbp, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq %r12, %r9
callq 0xeae97
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeb2ca
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: do_Apple_AA_HFS
static void do_Apple_AA_HFS(deark *c, lctx *d, struct dir_record *dr, i64 pos1, i64 len)
{
	unsigned int finder_flags;
	struct de_fourcc type4cc;
	struct de_fourcc creator4cc;
	i64 pos = pos1+4;

	de_dbg(c, "Apple AA/HFS extension at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);
	dbuf_read_fourcc(c->infile, pos, &type4cc, 4, 0x0);
	de_dbg(c, "type: '%s'", type4cc.id_dbgstr);
	pos += 4;
	dbuf_read_fourcc(c->infile, pos, &creator4cc, 4, 0x0);
	de_dbg(c, "creator: '%s'", creator4cc.id_dbgstr);
	pos += 4;
	finder_flags = (unsigned int)de_getu16be_p(&pos);
	de_dbg(c, "finder flags: 0x%04x", finder_flags);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x4(%rsi), %rax
movq %rsp, %r14
movq %rax, (%r14)
leaq 0x9fa33(%rip), %rsi     # 0x12e0ca
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
leaq 0x38(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
leaq 0x48(%rsp), %rdx
leaq 0x9366a(%rip), %rsi     # 0x121d3a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq (%r14), %rsi
addq $0x4, %rsi
movq %rsi, (%r14)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
leaq 0x18(%rsp), %rdx
leaq 0xa57ed(%rip), %rsi     # 0x133ef3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%r14)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef193
leaq 0x86148(%rip), %rsi     # 0x11486f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: cdsig_at
static int cdsig_at(dbuf *f, i64 pos)
{
	u8 buf[14];
	u8 ty;

	dbuf_read(f, buf, pos, sizeof(buf));
	if(!de_memcmp(&buf[1], g_sig_CD001, 5)) {
		ty = buf[0];
	}
	else if(!de_memcmp(&buf[1], g_sig_CD_I, 5)) {
		ty = buf[0];
	}
	else if(!de_memcmp(&buf[9], g_sig_CDROM, 5)) {
		ty = buf[8];
	}
	else {
		return 0;
	}
	if(ty>3 && ty<255) return 0;
	return 1;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
leaq 0x2(%rsp), %rbx
movl $0xe, %ecx
movq %rbx, %rsi
callq 0xeeee8
movl $0x30304443, %eax       # imm = 0x30304443
xorl 0x1(%rbx), %eax
movzbl 0x5(%rbx), %ecx
xorl $0x31, %ecx
orl %eax, %ecx
je 0x8e7d3
movl $0x492d4443, %eax       # imm = 0x492D4443
xorl 0x3(%rsp), %eax
movzbl 0x7(%rsp), %ecx
xorl $0x20, %ecx
orl %eax, %ecx
je 0x8e7d3
movl $0x4f524443, %ecx       # imm = 0x4F524443
xorl 0xb(%rsp), %ecx
movzbl 0xf(%rsp), %edx
xorl $0x4d, %edx
xorl %eax, %eax
orl %ecx, %edx
jne 0x8e7e1
movb 0xa(%rsp), %cl
jmp 0x8e7d7
movb 0x2(%rsp), %cl
incb %cl
xorl %eax, %eax
cmpb $0x5, %cl
setb %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: my_preprocess_nrg_chunk_fn
static int my_preprocess_nrg_chunk_fn(struct de_iffctx *ictx)
{
	const char *name = NULL;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_CDTX: name = "CD-text"; break;
	case CODE_CUES: case CODE_CUEX: name = "cue sheet"; break;
	case CODE_DAOI: case CODE_DAOX: name = "DAO info"; break;
	case CODE_ETNF: name = "extended track info"; break;
	case CODE_SINF: name = "session info"; break;
	}

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

// Assembly:
movq 0x128(%rdi), %rax
movl 0x4(%rax), %esi
movb $0x1, %dl
xorl %ecx, %ecx
cmpl $0x44414f48, %esi       # imm = 0x44414F48
jle 0x8e9f3
cmpl $0x45544e45, %esi       # imm = 0x45544E45
jg 0x8ea14
cmpl $0x44414f49, %esi       # imm = 0x44414F49
je 0x8e9ea
cmpl $0x44414f58, %esi       # imm = 0x44414F58
jne 0x8ea3f
leaq 0x9fb63(%rip), %rcx     # 0x12e554
jmp 0x8ea3d
cmpl $0x43445458, %esi       # imm = 0x43445458
je 0x8ea2d
cmpl $0x43554553, %esi       # imm = 0x43554553
je 0x8ea0b
cmpl $0x43554558, %esi       # imm = 0x43554558
jne 0x8ea3f
leaq 0x9fb38(%rip), %rcx     # 0x12e54a
jmp 0x8ea3d
cmpl $0x45544e46, %esi       # imm = 0x45544E46
je 0x8ea36
cmpl $0x53494e46, %esi       # imm = 0x53494E46
jne 0x8ea3f
leaq 0x9fb46(%rip), %rcx     # 0x12e571
jmp 0x8ea3d
leaq 0x9fb0e(%rip), %rcx     # 0x12e542
jmp 0x8ea3d
leaq 0x9fb20(%rip), %rcx     # 0x12e55d
xorl %edx, %edx
testb %dl, %dl
jne 0x8ea47
movq %rcx, 0x58(%rax)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/iso9660.c
// Function: my_nrg_chunk_handler
static int my_nrg_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	struct nrg_ctx *nrg = (struct nrg_ctx*)ictx->userdata;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_ETNF:
		do_nrg_ETNF(c, ictx, ictx->chunkctx);
		ictx->handled = 1;
		break;
	case CODE_DAOX:
		do_nrg_DAOX(c, ictx, nrg);
		ictx->handled = 1;
		break;
	case CODE_END_:
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x128(%rdi), %r12
movl 0x4(%r12), %eax
cmpl $0x44414f58, %eax       # imm = 0x44414F58
je 0x8eb64
cmpl $0x454e4421, %eax       # imm = 0x454E4421
je 0x8eb60
cmpl $0x45544e46, %eax       # imm = 0x45544E46
jne 0x8ebbe
movq %rdi, (%rsp)
movq 0x40(%r12), %r15
xorl %r13d, %r13d
movq 0x40(%r12), %rbx
subq %r15, %rbx
addq 0x48(%r12), %rbx
cmpq $0x14, %rbx
jl 0x8eb54
movq %r14, %rdi
leaq 0x8f3d5(%rip), %rsi     # 0x11de8a
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xef32a
movq %rax, %rbp
movq 0x18(%r14), %rdi
leaq 0x4(%r15), %rsi
callq 0xef32a
movq %r14, %rdi
leaq 0x9fa8c(%rip), %rsi     # 0x12e57e
movq %rbp, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
leaq 0x8(%r15), %rsi
callq 0xef32a
movq %r14, %rdi
leaq 0x9ad66(%rip), %rsi     # 0x12987c
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
leaq 0xc(%r15), %rsi
callq 0xef32a
movq %r14, %rdi
leaq 0x9fa5e(%rip), %rsi     # 0x12e594
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0x14, %r15
incq %r13
cmpq $0x13, %rbx
jg 0x8ea94
jmp 0x8ebb0
xorl %eax, %eax
jmp 0x8ebc3
movq %rdi, (%rsp)
movq 0x40(%r12), %rsi
cmpq $0x38, %rsi
jl 0x8ebb0
movq (%rsp), %rax
movq 0x10(%rax), %r15
movq 0x18(%rax), %rdi
addq $0x30, %rsi
callq 0xef4c3
movq %rax, 0x18(%r15)
addq $0x18, %r15
leaq 0x9fa0c(%rip), %rsi     # 0x12e5a3
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeeb0
movq (%rsp), %rax
movl $0x1, 0x130(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/macbinary.c
// Function: de_module_macbinary
void de_module_macbinary(deark *c, struct deark_module_info *mi)
{
	mi->id = "macbinary";
	mi->desc = "MacBinary";
	mi->run_fn = de_run_macbinary;
	mi->identify_fn = de_identify_macbinary;
	mi->flags = DE_MODFLAG_SHAREDDETECTION;
}

// Assembly:
leaq 0xa0b16(%rip), %rax     # 0x12f6f1
movq %rax, (%rsi)
leaq 0x9f9cb(%rip), %rax     # 0x12e5b0
movq %rax, 0x8(%rsi)
leaq 0x17(%rip), %rax        # 0x8ec07
movq %rax, 0x18(%rsi)
leaq 0x751(%rip), %rax       # 0x8f34c
movq %rax, 0x20(%rsi)
movl $0x10, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/macbinary.c
// Function: do_prepare_one_fork
static void do_prepare_one_fork(deark *c, lctx *d, struct de_advfile_forkinfo *advfki,
	struct fork_info *fki)
{
	de_dbg(c, "%s fork at %"I64_FMT", len=%"I64_FMT, fork_name(fki->is_rsrc, 0),
		fki->pos, advfki->fork_len);

	if(fki->pos+advfki->fork_len>c->infile->len) {
		de_err(c, "%s fork at %"I64_FMT" goes beyond end of file.",
			fork_name(fki->is_rsrc, 1), fki->pos);
		if(fki->pos+advfki->fork_len > c->infile->len+1024) {
			fki->extract_error_flag = 1;
			goto done;
		}
	}

done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpb $0x0, (%rdx)
leaq 0xaa8f9(%rip), %rax     # 0x139fa1
leaq 0xa0f66(%rip), %rdx     # 0x130615
cmoveq %rax, %rdx
movq 0x8(%rbx), %rcx
movq 0x8(%rsi), %r8
leaq 0x9f0fe(%rip), %rsi     # 0x12e7c0
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rbx), %rcx
movq 0x8(%r15), %rax
addq %rcx, %rax
movq 0x18(%r14), %rdx
cmpq 0x18(%rdx), %rax
jle 0x8f722
cmpb $0x0, (%rbx)
leaq 0xa4554(%rip), %rax     # 0x133c3c
leaq 0x9f111(%rip), %rdx     # 0x12e800
cmoveq %rax, %rdx
leaq 0x9f0de(%rip), %rsi     # 0x12e7d8
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9df7
movq 0x8(%r15), %rax
addq 0x8(%rbx), %rax
movq 0x18(%r14), %rcx
movl $0x400, %edx            # imm = 0x400
addq 0x18(%rcx), %rdx
cmpq %rdx, %rax
jle 0x8f722
movb $0x1, 0x1(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/macrsrc.c
// Function: de_module_macrsrc
void de_module_macrsrc(deark *c, struct deark_module_info *mi)
{
	mi->id = "macrsrc";
	mi->desc = "Macintosh Resource Manager";
	mi->run_fn = de_run_macrsrc;
	mi->identify_fn = de_identify_macrsrc;
	mi->help_fn = de_help_macrsrc;
}

// Assembly:
leaq 0x8739d(%rip), %rax     # 0x116b1c
movq %rax, (%rsi)
leaq 0x9f085(%rip), %rax     # 0x12e80e
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x8f7af
movq %rax, 0x18(%rsi)
leaq 0x1abe(%rip), %rax      # 0x9125d
movq %rax, 0x20(%rsi)
leaq 0x1b6b(%rip), %rax      # 0x91315
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/macrsrc.c
// Function: de_identify_macrsrc
static int de_identify_macrsrc(deark *c)
{
	u8 b[16];
	i64 n[4];
	size_t k;

	if(de_getu32be(0)!=256) return 0;
	de_read(b, 0, 16);
	for(k=0; k<4; k++) {
		n[k] = de_getu32be_direct(&b[4*k]);
	}
	if(n[0]+n[2]>n[1]) return 0; // data can't go past map start
	if(n[3]<30) return 0; // minimum map len
	if(n[1]+n[3]>c->infile->len) return 0; // map can't go past eof
	// map should start with a copy of the header
	if(dbuf_memcmp(c->infile, n[1], (const void*)b, 16)) return 0;
	if(n[1]+n[3]==c->infile->len) return 100;
	return 75;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xef32a
cmpq $0x100, %rax            # imm = 0x100
jne 0x91308
movq 0x18(%rbx), %rdi
xorl %r14d, %r14d
movq %rsp, %rsi
movl $0x10, %ecx
xorl %edx, %edx
callq 0xeeee8
leaq (%rsp,%r14), %rdi
callq 0xef325
movq %rax, 0x10(%rsp,%r14,2)
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x91299
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
addq 0x10(%rsp), %rax
xorl %r14d, %r14d
cmpq %rsi, %rax
jg 0x91308
movq 0x28(%rsp), %r15
cmpq $0x1e, %r15
jl 0x91308
addq %rsi, %r15
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r15
jg 0x91308
movq %rsp, %rdx
movl $0x10, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x91308
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r15
movl $0x64, %eax
movl $0x4b, %r14d
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/macrsrc.c
// Function: set_resource_filename
static void set_resource_filename(deark *c, lctx *d, de_finfo *fi,
	struct rsrctypeinfo *rti, struct rsrcinstanceinfo *rii, const char *token)
{
	de_ucstring *tmpname = NULL;

	tmpname = ucstring_create(c);
	if(c->filenames_from_file && ucstring_isnonempty(rii->name)) {
		ucstring_append_ucstring(tmpname, rii->name);
		ucstring_append_sz(tmpname, ".", DE_ENCODING_LATIN1);
	}

	if(token) {
		ucstring_append_sz(tmpname, token, DE_ENCODING_LATIN1);
	}
	else {
		ucstring_append_sz(tmpname, rti->fcc.id_sanitized_sz, DE_ENCODING_LATIN1);
	}
	de_finfo_set_name_from_ucstring(c, fi, tmpname, 0);
	ucstring_destroy(tmpname);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
callq 0xf6870
movq %rax, %r14
cmpb $0x0, 0xd0(%r15)
je 0x91392
movq 0x28(%rbp), %rdi
callq 0xf6c00
testl %eax, %eax
je 0x91392
movq 0x28(%rbp), %rsi
movq %r14, %rdi
callq 0xf6969
leaq 0xaa231(%rip), %rsi     # 0x13b5b6
movq %r14, %rdi
movl $0x5, %edx
callq 0xf6a40
addq $0x8, %r12
testq %r13, %r13
cmovneq %r13, %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0x5, %edx
callq 0xf6a40
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xea9e4
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/lzexe.c
// Function: de_module_lzexe
void de_module_lzexe(deark *c, struct deark_module_info *mi)
{
	mi->id = "lzexe";
	mi->desc = "LZEXE-compressed EXE";
	mi->run_fn = de_run_lzexe;
	mi->help_fn = de_help_lzexe;
}

// Assembly:
leaq 0x9da49(%rip), %rax     # 0x12ee24
movq %rax, (%rsi)
leaq 0x9da45(%rip), %rax     # 0x12ee2a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x91400
movq %rax, 0x18(%rsi)
leaq 0x50a(%rip), %rax       # 0x91905
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/lzexe.c
// Function: read_reloc_tbl
static void read_reloc_tbl(deark *c, lctx *d)
{
	d->end_of_reloc_tbl = d->ephdr_pos + d->ephdr.field6;
	if(d->end_of_reloc_tbl > c->infile->len) {
		d->errflag = 1;
		goto done;
	}
	if(d->ver==LZEXE_VER_090) {
		do_decode_reloc_tbl_v090(c, d);
	}
	else {
		do_decode_reloc_tbl_v091(c, d);
	}
done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0x28(%rsi), %rdx
movq 0x68(%rsi), %rax
addq %rdx, %rax
movq %rax, 0x30(%rsi)
movq 0x18(%rdi), %rcx
cmpq 0x18(%rcx), %rax
jle 0x91960
movl $0x1, 0x4(%r14)
jmp 0x91ac4
movq %rdi, %rbx
cmpl $0x1, (%r14)
jne 0x9198f
addq $0x19d, %rdx            # imm = 0x19D
movq 0x80(%r14), %rcx
movq %rbx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xfbe66
testl %eax, %eax
jne 0x91ac4
jmp 0x91953
addq $0x158, %rdx            # imm = 0x158
leaq 0x8(%rsp), %r13
movq %rdx, (%r13)
leaq 0x9d5f6(%rip), %rsi     # 0x12ef9c
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x4, %eax
movl %eax, %eax
movq %rax, 0x10(%rsp)
leaq 0x9d426(%rip), %r15     # 0x12edf8
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
cmpq 0x30(%r14), %rax
setge %al
cmpl $0x10000, %r12d         # imm = 0x10000
setge %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x91a08
movl $0x1, 0x4(%r14)
movq 0x10(%rsp), %rax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef14d
testb %al, %al
je 0x91a1f
movzbl %al, %eax
addl %eax, %ebp
jmp 0x91a57
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef1ed
cmpl $0x1, %eax
je 0x91a42
testl %eax, %eax
jne 0x91a4c
addl $0xfff0, %ebp           # imm = 0xFFF0
movl $0x2, %r13d
jmp 0x91a48
movl $0x3, %r13d
xorl %eax, %eax
jmp 0x91a53
addl %eax, %ebp
xorl %r13d, %r13d
movb $0x1, %al
testb %al, %al
je 0x91a92
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0x9d558(%rip), %rsi     # 0x12efbc
movl %ebp, %edx
xorl %eax, %eax
callq 0xe93cf
movq 0x80(%r14), %rdi
movl %ebp, %esi
andl $0xf, %esi
callq 0xf1598
movq 0x80(%r14), %rdi
movl %ebp, %esi
shrl $0x4, %esi
callq 0xf1598
incl %r12d
movl %r13d, %eax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
leaq 0x8(%rsp), %r13
jmpq *%rax
leaq 0x9d51e(%rip), %rsi     # 0x12efc8
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/lzexe.c
// Function: fill_bitbuf
static void fill_bitbuf(deark *c, lctx *d)
{
	UI i;

	if(d->errflag) return;
	if(d->dcmpr_cur_ipos+2 > d->ephdr_pos)
	{
		d->errflag = 1;
		return;
	}

	for(i=0; i<2; i++) {
		u8 b;
		b = de_getbyte_p(&d->dcmpr_cur_ipos);
		de_bitbuf_lowlevel_add_byte(&d->bbll, b);
	}
}

// Assembly:
cmpl $0x0, 0x4(%rsi)
je 0x92034
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x90(%rsi), %rax
addq $0x2, %rax
cmpq 0x28(%rsi), %rax
jle 0x92058
movl $0x1, 0x4(%rbx)
jmp 0x92089
movq %rdi, %r14
leaq 0x90(%rbx), %r15
addq $0x98, %rbx
movl $0x1, %ebp
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xef14d
movzbl %al, %esi
movq %rbx, %rdi
callq 0xf21e9
decl %ebp
je 0x9206e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/nufx.c
// Function: de_module_nufx
void de_module_nufx(deark *c, struct deark_module_info *mi)
{
	mi->id = "nufx";
	mi->desc = "NuFX / ShrinkIt";
	mi->run_fn = de_run_nufx;
	mi->identify_fn = de_identify_nufx;
}

// Assembly:
leaq 0x9d002(%rip), %rax     # 0x12f09d
movq %rax, (%rsi)
leaq 0x9cffd(%rip), %rax     # 0x12f0a2
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x920c0
movq %rax, 0x18(%rsi)
leaq 0xea3(%rip), %rax       # 0x92f5e
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/nufx.c
// Function: destroy_record
static void destroy_record(deark *c, struct nufx_record *rec)
{
	if(!rec) return;
	ucstring_destroy(rec->filename);
	ucstring_destroy(rec->filename_old);
	de_free(c, rec->threads);
	de_free(c, rec);
}

// Assembly:
testq %rsi, %rsi
je 0x92fcc
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x98(%rsi), %rdi
callq 0xf6bb0
movq 0x90(%rbx), %rdi
callq 0xf6bb0
movq 0xa0(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/nufx.c
// Function: nufx_read_datetime_to_timestamp_p
static void nufx_read_datetime_to_timestamp_p(dbuf *f, i64 *ppos,
	struct de_timestamp *ts)
{
	i64 yr, mo, da, hr, mi, se;
	i64 pos;

	pos = *ppos;
	*ppos += 8;

	se = (i64)dbuf_getbyte_p(f, &pos);
	mi = (i64)dbuf_getbyte_p(f, &pos);
	hr = (i64)dbuf_getbyte_p(f, &pos);
	yr = 1900 + (i64)dbuf_getbyte_p(f, &pos);
	da = 1 + (i64)dbuf_getbyte_p(f, &pos);
	mo = 1 + (i64)dbuf_getbyte_p(f, &pos);

	if(yr==1900) {
		de_zeromem(ts, sizeof(struct de_timestamp));
		ts->is_valid = 0;
		return;
	}
	de_make_timestamp(ts, yr, mo, da, hr, mi, se);
	ts->precision = DE_TSPREC_1SEC;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r15
movq (%rsi), %rax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
addq $0x8, %rax
movq %rax, (%rsi)
movq %r12, %rsi
callq 0xef14d
movb %al, 0xf(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xef14d
movb %al, 0xe(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xef14d
movl %eax, %r13d
movq %r15, %rdi
movq %r12, %rsi
callq 0xef14d
movl %eax, %r14d
movq %r15, %rdi
movq %r12, %rsi
callq 0xef14d
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0xef14d
testb %r14b, %r14b
je 0x93081
movzbl %r14b, %esi
addq $0x76c, %rsi            # imm = 0x76C
movzbl %al, %edx
incq %rdx
movzbl %bpl, %ecx
incq %rcx
movzbl %r13b, %r8d
movzbl 0xe(%rsp), %r9d
movzbl 0xf(%rsp), %eax
movq %rax, (%rsp)
movq %rbx, %rdi
callq 0xeae97
movb $0x1e, 0x2(%rbx)
jmp 0x93087
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/nufx.c
// Function: nufx_filename_to_ucstring
static void nufx_filename_to_ucstring(deark *c, struct nufx_ctx *d,
	struct nufx_record *rec, dbuf *inf, i64 pos1, i64 fnlen1,
	de_ucstring *s)
{
	i64 fnlen;
	u8 strip_high_bit = 0;
	dbuf *tmpdbuf = NULL;

	fnlen = de_min_int(fnlen1, 255);
	if(fnlen<1) return;

	// Documentation says only 7 bits are significant in ProDOS pathnames.
	// This is probably not the best we could do. I suspect filesys_id is not
	// always set correctly.
	if(d->using_default_encoding && rec->filesys_id==0x0001) { // 0x0001 = ProDOS
		strip_high_bit = 1;
	}

	if(strip_high_bit) {
		i64 i;
		i64 pos = pos1;

		tmpdbuf = dbuf_create_membuf(c, fnlen, 0);
		for(i=0; i<fnlen; i++) {
			u8 b;

			b = dbuf_getbyte_p(inf, &pos);
			b &= 0x7f;
			dbuf_writebyte(tmpdbuf, b);
		}
		dbuf_read_to_ucstring(tmpdbuf, 0, fnlen, s, 0, d->input_encoding);
	}
	else {
		dbuf_read_to_ucstring(inf, pos1, fnlen, s, 0, d->input_encoding);
	}

	dbuf_close(tmpdbuf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
movl $0xff, %esi
movq %r9, %rdi
callq 0xea792
testq %rax, %rax
jle 0x93147
movq %rax, %r14
movq 0x40(%rsp), %rcx
cmpb $0x0, 0x3(%r15)
je 0x93127
cmpl $0x1, 0x30(%r12)
jne 0x93127
movq %rsp, %r12
movq %rbp, (%r12)
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xf0faf
movq %rax, %r13
movq %r14, %rbp
movq %rbx, %rdi
movq %r12, %rsi
callq 0xef14d
andb $0x7f, %al
movzbl %al, %esi
movq %r13, %rdi
callq 0xf11be
decq %rbp
jne 0x930f7
movl 0x8(%r15), %r9d
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq 0x40(%rsp), %rcx
jmp 0x93137
movl 0x8(%r15), %r9d
xorl %r13d, %r13d
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xf01b0
movq %r13, %rdi
callq 0xf0b13
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq