LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: make_fullfilename
static void make_fullfilename(deark *c, lctx *d, struct member_data *md)
{
	if(md->fullfilename) return;

	if(!md->filename) {
		md->filename = ucstring_create(c);
	}
	md->fullfilename = ucstring_create(c);

	if(md->hlev==0 && d->basefmt!=BASEFMT_TPK) {
		ucstring_append_ucstring(md->fullfilename, md->filename);
	}
	else {
		if(md->is_dir) {
			ucstring_append_ucstring(md->fullfilename, md->dirname);
		}
		else {
			if(ucstring_isnonempty(md->dirname)) {
				ucstring_append_ucstring(md->fullfilename, md->dirname);
				ucstring_append_sz(md->fullfilename, "/", DE_ENCODING_LATIN1);
			}
			if(ucstring_isnonempty(md->filename)) {
				ucstring_append_ucstring(md->fullfilename, md->filename);
			}
			else {
				ucstring_append_char(md->fullfilename, '_');
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x78(%rdx)
je 0x82091
popq %rbx
popq %r14
popq %r15
retq
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, 0x70(%rdx)
jne 0x820ad
movq %r15, %rdi
callq 0xeac74
movq %rax, 0x70(%rbx)
movq %r15, %rdi
callq 0xeac74
movq %rax, 0x78(%rbx)
cmpb $0x0, (%rbx)
jne 0x820c5
cmpl $0x2, 0xc(%r14)
jne 0x82112
cmpb $0x0, 0x20(%rbx)
movq 0x68(%rbx), %rsi
jne 0x82116
movq %rsi, %rdi
callq 0xeaf8a
testl %eax, %eax
je 0x820fb
movq 0x68(%rbx), %rsi
movq 0x78(%rbx), %rdi
callq 0xead71
movq 0x78(%rbx), %rdi
leaq 0x82f6b(%rip), %rsi     # 0x10505e
pushq $0x5
popq %rdx
callq 0xeae42
movq 0x70(%rbx), %rdi
callq 0xeaf8a
movq 0x78(%rbx), %rdi
testl %eax, %eax
je 0x82123
movq 0x70(%rbx), %rsi
jmp 0x82119
movq 0x70(%rbx), %rsi
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xead71
pushq $0x5f
popq %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xeada5
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: is_possible_cmpr_meth
static int is_possible_cmpr_meth(const u8 m[5])
{
	if(m[0]!=m[4]) return 0;
	if(m[0]==' ' && m[1]=='L' && m[2]=='H' && lha_isdigit(m[3])) return 1;
	if(m[0]!='-') return 0;
	if(!lha_isalpha(m[1]) ||
		!lha_isalnum(m[2]) ||
		!lha_isalnum(m[3]))
	{
		return 0;
	}
	return 1;
}

// Assembly:
movzbl (%rdi), %ecx
xorl %eax, %eax
cmpb 0x4(%rdi), %cl
jne 0x82484
cmpl $0x2d, %ecx
je 0x82460
cmpl $0x20, %ecx
jne 0x82484
cmpb $0x4c, 0x1(%rdi)
jne 0x82484
cmpb $0x48, 0x2(%rdi)
jne 0x82484
movb 0x3(%rdi), %cl
addb $-0x3a, %cl
cmpb $-0xb, %cl
jbe 0x82484
pushq $0x1
popq %rax
retq
movb 0x1(%rdi), %cl
andb $-0x21, %cl
addb $-0x5b, %cl
cmpb $-0x1a, %cl
jb 0x82484
movb 0x2(%rdi), %cl
leal -0x3a(%rcx), %edx
cmpb $-0xb, %dl
ja 0x82485
andb $-0x21, %cl
addb $-0x5b, %cl
cmpb $-0x1a, %cl
jae 0x82485
retq
movb 0x3(%rdi), %al
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
andb $-0x21, %al
addb $-0x41, %al
cmpb $0x1a, %al
setb %al
orb %cl, %al
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: decompress_lh5x_auto
static void decompress_lh5x_auto(deark *c, lctx *d, struct member_data *md,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres)
{
	int fmt;

	switch(md->cmi->id_raw[3]) {
	case '4': case '5':
		fmt = DE_LH5X_FMT_LH5;
		break;
	case '6':
		fmt = DE_LH5X_FMT_LH6;
		break;
	case '7':
		if(d->lhark_policy<0) {
			detect_lhark(c, d, md, dcmpri);
		}
		if(d->lhark_policy>0) {
			fmt = DE_LH5X_FMT_LHARK;
		}
		else {
			fmt = DE_LH5X_FMT_LH7;
		}
		break;
	case '8':
		fmt = DE_LH5X_FMT_LH7;
		break;
	default:
		return;
	}

	decompress_lh5x_internal(c, d, dcmpri, dcmpro, dres, fmt);
}

// Assembly:
movq 0x18(%rdx), %rax
movzbl 0x13(%rax), %eax
addl $-0x34, %eax
cmpl $0x4, %eax
ja 0x82532
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdi, %r12
leaq 0x9c44d(%rip), %rcx     # 0x11e92c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x5
jmp 0x824f2
pushq $0x7
jmp 0x824f2
pushq $0x6
popq %r8
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x826ae
movq %rsi, %r13
movl 0x4(%rsi), %eax
testl %eax, %eax
jns 0x825d3
movl 0x8(%r13), %eax
testl %eax, %eax
js 0x82533
leaq 0x9c8e8(%rip), %rdx     # 0x11ee18
jmp 0x825af
retq
movq %rdx, %rbp
leaq 0x9c8be(%rip), %rsi     # 0x11edfb
movq %r12, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0xdeba7
leaq 0x9c8d1(%rip), %rdx     # 0x11ee2a
cmpb $0x1, (%rbp)
jne 0x825ad
cmpb $0x20, 0x50(%rbp)
jne 0x825ad
pushq $0x7
popq %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x826d5
leaq 0x9c8ad(%rip), %rdx     # 0x11ee2a
testl %eax, %eax
movl $0x0, %eax
jne 0x825af
pushq $0x64
popq %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x826d5
testl %eax, %eax
leaq 0x9c878(%rip), %rcx     # 0x11ee18
leaq 0x9c86b(%rip), %rdx     # 0x11ee12
cmoveq %rcx, %rdx
jmp 0x825af
xorl %eax, %eax
movl %eax, 0x4(%r13)
leaq 0x9c87d(%rip), %rsi     # 0x11ee37
movq %r12, %rdi
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %r12, %rdi
callq 0xdeba7
movl 0x4(%r13), %eax
testl %eax, %eax
pushq $0x64
popq %rax
pushq $0x7
popq %r8
cmovgl %eax, %r8d
jmp 0x824f4
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: decompress_tk1
static void decompress_tk1(deark *c, lctx *d, struct member_data *md,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres)
{
	u8 need_errmsg = 0;
	i64 lzhuf_orig_len;

	if(dcmpri->len < 4) {
		need_errmsg = 1;
		goto done;
	}


	lzhuf_orig_len = dbuf_getu32le(dcmpri->f, dcmpri->pos);
	if(lzhuf_orig_len != md->orig_size) {
		need_errmsg = 1;
		goto done;
	}

	dcmpri->len -= 4;
	dcmpri->pos += 4;

	fmtutil_lh1_codectype1(c, dcmpri, dcmpro, dres, NULL);

done:
	if(need_errmsg) {
		de_dfilter_set_generic_error(c, dres, NULL);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %rdi, %r15
cmpq $0x4, 0x10(%rcx)
jl 0x8266d
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq (%rcx), %rdi
movq 0x8(%rcx), %rsi
callq 0xe409f
cmpq 0x28(%r13), %rax
jne 0x8266d
movdqu 0x8(%r12), %xmm0
paddq 0x9c357(%rip), %xmm0    # 0x11e9a0
movdqu %xmm0, 0x8(%r12)
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xfa3ca
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xee91c
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: decompress_lh5x_dry_run
static int decompress_lh5x_dry_run(deark *c, lctx *d, struct member_data *md,
	struct de_dfilter_in_params *dcmpri, int fmt)
{
	int retval = 0;
	dbuf *outf = NULL;
	struct de_crcobj *crco = NULL;
	u32 crc_calc;
	int old_debug_level;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	// Make a "dummy" dbuf to write to, which doesn't store the data, but
	// tracks the size and CRC.
	outf = dbuf_create_custom_dbuf(c, 0, 0);
	dbuf_enable_wbuffer(outf);
	crco = de_crcobj_create(c, DE_CRCOBJ_CRC16_ARC);
	dbuf_set_writelistener(outf, de_writelistener_for_crc, crco);

	de_dfilter_init_objects(c, NULL, &dcmpro, &dres);
	dcmpro.f = outf;
	dcmpro.len_known = 1;
	dcmpro.expected_len = md->orig_size;

	old_debug_level = c->debug_level;
	c->debug_level = 0; // hack
	decompress_lh5x_internal(c, d, dcmpri, &dcmpro, &dres, fmt);
	c->debug_level = old_debug_level;
	dbuf_flush(outf);

	if(dres.errcode) goto done;
	if(outf->len != md->orig_size) goto done;
	// Note: Another possible test would be if
	//  (dres.bytes_consumed == md->compressed_data_len).
	crc_calc = de_crcobj_getval(crco);
	if(crc_calc != md->crc_reported) goto done;
	retval = 1;

done:
	dbuf_close(outf);
	de_crcobj_destroy(crco);
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
xorl %esi, %esi
xorl %edx, %edx
callq 0xe6277
movq %rax, %r14
movq %rax, %rdi
callq 0xe589c
pushq $0x21
popq %rsi
movq %r13, %rdi
callq 0xe0ae9
movq %rax, %r12
leaq 0x63ba3(%rip), %rsi     # 0xe62c1
movq %r14, %rdi
movq %rax, %rdx
callq 0xe629a
leaq 0x20(%rsp), %rbp
leaq 0x38(%rsp), %r15
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xee7ee
movq %r14, (%rbp)
movb $0x1, 0x8(%rbp)
movq %rbx, 0x10(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x10(%rbp)
movl (%r13), %ebx
andl $0x0, (%r13)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
movl 0xc(%rsp), %r8d
callq 0x826ae
movl %ebx, (%r13)
movq %r14, %rdi
callq 0xe58e8
cmpl $0x0, (%r15)
je 0x8278f
xorl %ebx, %ebx
jmp 0x827b4
movq 0x18(%r14), %rax
movq 0x10(%rsp), %r15
cmpq 0x28(%r15), %rax
movl $0x0, %ebx
jne 0x827b4
movq %r12, %rdi
callq 0xe0e95
xorl %ebx, %ebx
cmpl 0x4c(%r15), %eax
sete %bl
movq %r14, %rdi
callq 0xe5591
movq %r12, %rdi
callq 0xe0e8d
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: do_swg_string_field
static void do_swg_string_field(deark *c, lctx *d,
	de_ucstring *s, i64 pos, i64 fldlen, const char *name)
{
	i64 dlen = (i64)de_getbyte(pos);
	if(dlen>fldlen-1) dlen = fldlen-1;
	ucstring_empty(s);
	dbuf_read_to_ucstring(c->infile, pos+1, dlen, s, 0, d->input_encoding);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "SWG %s: \"%s\"", name, ucstring_getpsz_d(s));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rcx, %rsi
callq 0xe3eb4
movzbl %al, %eax
leaq -0x1(%r12), %rbx
cmpq %r12, %rax
cmovlq %rax, %rbx
movq %r15, %rdi
callq 0xeac85
movq 0x18(%r14), %rdi
incq %r13
movl (%rbp), %r9d
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xe4c9a
movq %r15, %rdi
callq 0xead03
movq %r15, %rdi
callq 0xeb877
leaq 0x9c66a(%rip), %rsi     # 0x11eeb6
movq %r14, %rdi
movq (%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xde896
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: read_path_to_strarray
static void read_path_to_strarray(deark *c, lctx *d, struct member_data *md,
	dbuf *inf, i64 pos, i64 len, struct de_strarray *sa, int is_exthdr_dirname)
{
	dbuf *tmpdbuf = NULL;
	de_ucstring *tmpstr = NULL;
	i64 component_startpos;
	i64 component_len;
	i64 i;

	tmpstr = ucstring_create(c);

	tmpdbuf = dbuf_create_membuf(c, len, 0);
	dbuf_copy(inf, pos, len, tmpdbuf);

	component_startpos = 0;
	component_len = 0;

	for(i=0; i<len; i++) {
		u8 ch;

		ch = dbuf_getbyte(tmpdbuf, i);
		if(ch==0x00) break; // Tolerate NUL termination
		if((is_exthdr_dirname && ch==0xff) ||
			(!is_exthdr_dirname && (ch=='\\' || ch=='/')))
		{
			component_len = i - component_startpos;
			rp_add_component(c, d, md, tmpdbuf, component_startpos, component_len, sa, tmpstr);
			component_startpos = i+1;
			component_len = 0;
		}
		else {
			component_len++;
		}
	}
	rp_add_component(c, d, md, tmpdbuf, component_startpos, component_len, sa, tmpstr);

	dbuf_close(tmpdbuf);
	ucstring_destroy(tmpstr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, (%rsp)
movq %rdi, %r13
movl 0x50(%rsp), %r14d
callq 0xeac74
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xe59cd
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0xe45f4
testq %r15, %r15
cmovleq %rbp, %r15
movq %r15, %r12
subq %rbp, %r12
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x82927
leaq (%rbx,%rbp), %rsi
movq %r13, %rdi
callq 0xe3eb4
testb %al, %al
je 0x82927
testl %r14d, %r14d
je 0x828ed
cmpb $-0x1, %al
je 0x82903
testl %r14d, %r14d
jne 0x828fe
cmpb $0x5c, %al
je 0x82903
movzbl %al, %eax
cmpl $0x2f, %eax
je 0x82903
incq %rbx
jmp 0x828cf
movq (%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x82964
addq %rbx, %rbp
incq %rbp
jmp 0x828c7
movq (%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rbx
movq %rbx, %r9
callq 0x82964
movq %r13, %rdi
callq 0xe5591
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeaf3c
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: rp_add_component
static void rp_add_component(deark *c, lctx *d, struct member_data *md,
	dbuf *f, i64 pos, i64 len, struct de_strarray *sa, de_ucstring *tmpstr)
{
	if(len<1) return;
	ucstring_empty(tmpstr);
	dbuf_read_to_ucstring(f, pos, len, tmpstr, 0, md->encoding);
	de_strarray_push(sa, tmpstr);
}

// Assembly:
testq %rcx, %rcx
jle 0x829bf
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq %r9, %rdi
callq 0xeac85
movl 0x4(%rbp), %r9d
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0xe4c9a
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeb9f5
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_common
static void exthdr_common(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	if(dlen<2) return;
	md->hdr_crc_reported = (u32)de_getu16le(pos);
	md->have_hdr_crc_reported = 1;
	md->hdr_crc_field_pos = pos;
	de_dbg(c, "header crc (reported): 0x%04x", (UI)md->hdr_crc_reported);
	// TODO: Additional information
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x2, 0x20(%rsp)
jge 0x829fb
popq %rbx
popq %r14
popq %r15
retq
movq %r9, %r14
movq %rdx, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xe3fa3
movl %eax, 0x38(%r15)
movb $0x1, 0x34(%r15)
movq %r14, 0x40(%r15)
leaq 0x9c9c9(%rip), %rsi     # 0x11f3ed
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xde896
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_dirname
static void exthdr_dirname(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	struct de_strarray *dirname_sa = NULL;

	if(md->dirname) {
		ucstring_empty(md->dirname);
	}
	else {
		md->dirname = ucstring_create(c);
	}

	dirname_sa = de_strarray_create(c, MAX_SUBDIR_LEVEL+2);
	// 0xff is used as the path separator. Don't know what happens if a directory
	// name contains an actual 0xff byte.
	read_path_to_strarray(c, d, md, c->infile, pos, dlen, dirname_sa, 1);
	de_strarray_make_path(dirname_sa, md->dirname, DE_MPFLAG_NOTRAILINGSLASH);
	de_dbg(c, "%s (parsed): \"%s\"", e->name, ucstring_getpsz_d(md->dirname));

	de_strarray_destroy(dirname_sa);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %r15
movq %rdx, %r14
movq %rdi, %rbx
movq 0x40(%rsp), %rbp
movq 0x68(%rdx), %rdi
testq %rdi, %rdi
je 0x82a71
callq 0xeac85
jmp 0x82a7d
movq %rbx, %rdi
callq 0xeac74
movq %rax, 0x68(%r14)
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xeb95d
movq %rax, %r12
movq 0x18(%rbx), %rdx
movl $0x1, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rcx
movq %rbp, %r8
movq %rax, %r9
callq 0x8286b
movq 0x68(%r14), %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
callq 0xeba55
movq 0x8(%r15), %r15
movq 0x68(%r14), %rdi
callq 0xeb877
leaq 0x9c62d(%rip), %rsi     # 0x11f0fa
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeb97e
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_msdosattribs
static void exthdr_msdosattribs(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	u32 attribs;
	de_ucstring *descr = NULL;

	if(dlen<2) goto done;
	attribs = (u32)de_getu16le(pos);
	descr = ucstring_create(c);
	de_describe_dos_attribs(c, (UI)attribs, descr, 0);
	de_dbg(c, "%s: 0x%04x (%s)", e->name, (UI)attribs, ucstring_getpsz_d(descr));
done:
	ucstring_destroy(descr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x2, 0x30(%rsp)
jge 0x82b08
xorl %r14d, %r14d
jmp 0x82b5e
movq %r8, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xe3fa3
movq %rax, %r12
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq %rbx, %rdi
movl %r12d, %esi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0xe0298
movq 0x8(%r15), %r15
movq %r14, %rdi
callq 0xeb877
leaq 0x9c5c1(%rip), %rsi     # 0x11f10c
movq %rbx, %rdi
movq %r15, %rdx
movl %r12d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xeaf3c
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_windowstimestamp
static void exthdr_windowstimestamp(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	if(dlen<24) return;
	read_windows_FILETIME(c, d, md, pos,    DE_TIMESTAMPIDX_CREATE, "create time");
	read_windows_FILETIME(c, d, md, pos+8,  DE_TIMESTAMPIDX_MODIFY, "mod time   ");
	read_windows_FILETIME(c, d, md, pos+16, DE_TIMESTAMPIDX_ACCESS, "access time");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x18, 0x20(%rsp)
jge 0x82b84
popq %rbx
popq %r14
popq %r15
retq
movq %r9, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0x9f604(%rip), %r8      # 0x122198
pushq $0x1
popq %rcx
movq %rdx, %rsi
movq %r9, %rdx
callq 0x82d78
leaq 0x8(%rbx), %rdx
leaq 0x9c56f(%rip), %r8      # 0x11f11c
movq %r15, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x82d78
addq $0x10, %rbx
leaq 0x9c563(%rip), %r8      # 0x11f128
pushq $0x2
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x82d78
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_codepage
static void exthdr_codepage(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	int n_codepage;
	de_encoding n_encoding;
	char descr[100];

	if(dlen!=4) return;
	n_codepage = (int)de_geti32le(pos);
	n_encoding = de_windows_codepage_to_encoding(c, n_codepage, descr, sizeof(descr), 0);
	de_dbg(c, "codepage: %d (%s)", n_codepage, descr);
	if(n_encoding != DE_ENCODING_UNKNOWN) {
		md->encoding = n_encoding;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
cmpq $0x4, 0xa0(%rsp)
jne 0x82c4c
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xe40f2
movq %rax, %r15
movq %rsp, %r12
pushq $0x64
popq %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0xe206c
movl %eax, %ebp
leaq 0x9c574(%rip), %rsi     # 0x11f1a9
movq %r14, %rdi
movl %r15d, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
testl %ebp, %ebp
je 0x82c4c
movl %ebp, 0x4(%rbx)
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_unixperms
static void exthdr_unixperms(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	UI mode;

	if(dlen<2) return;
	mode = (UI)de_getu16le(pos);
	de_dbg(c, "mode: octal(%06o)", mode);
	interpret_unix_perms(c, d, md, mode);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x2, 0x20(%rsp)
jge 0x82c6c
popq %rbx
popq %r14
popq %r15
retq
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xe3fa3
movq %rax, %r15
leaq 0x8237c(%rip), %rsi     # 0x105004
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x829c0
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_unixuidgid
static void exthdr_unixuidgid(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	i64 uid, gid;
	if(dlen<4) return;

	// It's strange that the GID comes first, while the UID comes first in the
	// level-0 "extended area".
	gid = de_getu16le(pos);
	de_dbg(c, "gid: %d", (int)gid);
	uid = de_getu16le(pos+2);
	de_dbg(c, "uid: %d", (int)uid);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x4, 0x20(%rsp)
jge 0x82cb9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r9, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xe3fa3
leaq 0x9c273(%rip), %rsi     # 0x11ef45
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
addq $0x2, %r14
movq %r14, %rsi
callq 0xe3fa3
leaq 0x9c248(%rip), %rsi     # 0x11ef3d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xde896
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: exthdr_lev3newattribs2
static void exthdr_lev3newattribs2(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	if(dlen<20) return;

	// TODO: Permission
	// TODO: GID/UID

	// [Documented as "creation time", but this is a Unix-style header, so I
	// wonder if someone mistranslated "ctime" (=change time).]
	read_unix_timestamp(c, d, md, pos+12, TIMESTAMPIDX_INVALID, "create(?) time");

	read_unix_timestamp(c, d, md, pos+16, DE_TIMESTAMPIDX_ACCESS, "access time   ");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x14, 0x20(%rsp)
jge 0x82d38
popq %rbx
popq %r14
popq %r15
retq
movq %r9, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0xc(%r9), %rdx
leaq 0x9c46f(%rip), %r8      # 0x11f1bb
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x81b48
addq $0x10, %rbx
leaq 0x9c468(%rip), %r8      # 0x11f1ca
pushq $0x2
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x81b48
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: read_windows_FILETIME
static void read_windows_FILETIME(deark *c, lctx *d, struct member_data *md,
	i64 pos, int tsidx, const char *name)
{
	i64 t_FILETIME;
	char timestamp_buf[64];
	struct de_timestamp tmp_timestamp;

	t_FILETIME = de_geti64le(pos);
	de_FILETIME_to_timestamp(t_FILETIME, &tmp_timestamp, 0x1);
	if(t_FILETIME<=0) tmp_timestamp.is_valid = 0;
	de_timestamp_to_string(&tmp_timestamp, timestamp_buf, sizeof(timestamp_buf), 0);
	de_dbg(c, "%s: %"I64_FMT" (%s)", name, t_FILETIME, timestamp_buf);
	apply_timestamp(c, d, md, tsidx, &tmp_timestamp, 90);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xe418b
movq %rax, %r12
movq %rsp, %rsi
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0xe0051
testq %r12, %r12
jg 0x82db7
movb $0x0, (%rsp)
movq %rsp, %rdi
leaq 0x10(%rsp), %r13
pushq $0x40
popq %rdx
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xe0644
leaq 0x86dce(%rip), %rsi     # 0x109ba1
movq %r15, %rdi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
testl %ebp, %ebp
js 0x82e17
cmpb $0x0, (%rsp)
je 0x82e17
movl %ebp, %eax
imulq $0x18, %rax, %rax
cmpl $0x5a, 0x90(%rbx,%rax)
jg 0x82e17
addq %rbx, %rax
addq $0x80, %rax
movups (%rsp), %xmm0
movups %xmm0, (%rax)
movl $0x5a, 0x10(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: looks_like_car_member
static int looks_like_car_member(deark *c, i64 pos)
{
	u8 b[16];

	de_read(b, pos, 16);
	if(b[2]!='-' || b[3]!='l'|| b[4]!='h' || b[6]!='-') return 0;
	if(b[5]!='0' && b[5]!='5') return 0;
	if((int)b[0] != (int)b[15] + 25) return 0;
	if(dbuf_memcmp(c->infile, pos + (i64)b[15] + 24, (const u8*)"\x20\x00\x00", 3)) return 0;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rsp, %r15
pushq $0x10
popq %rcx
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe3cb7
xorl %eax, %eax
cmpb $0x2d, 0x2(%r15)
jne 0x82ed3
cmpb $0x6c, 0x3(%rsp)
jne 0x82ed3
cmpb $0x68, 0x4(%rsp)
jne 0x82ed3
cmpb $0x2d, 0x6(%rsp)
jne 0x82ed3
movzbl 0x5(%rsp), %ecx
cmpl $0x35, %ecx
je 0x82e9f
cmpl $0x30, %ecx
jne 0x82ed3
movzbl (%rsp), %edx
movzbl 0xf(%rsp), %ecx
leal 0x19(%rcx), %esi
cmpl %edx, %esi
jne 0x82ed3
movq 0x18(%r14), %rdi
leaq (%rbx,%rcx), %rsi
addq $0x18, %rsi
leaq 0x9c61c(%rip), %rdx     # 0x11f4de
pushq $0x3
popq %rcx
callq 0xe4d48
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: looks_like_lharc_sfx_com
static int looks_like_lharc_sfx_com(deark *c, int *is_larc)
{
	u64 v;
	i64 pos = 0;
	u8 b;

	b = de_getbyte_p(&pos);
	if(b!=0xeb) return 0;
	b = de_getbyte_p(&pos);
	pos += (i64)b;
	// I don't know how good this test is, but I don't trust the text signature.
	// It's not formatted consistently. And because the source code was released,
	// who knows what weirdness is out there?
	if(b==0x60 || b==0x6c) {
		v = dbuf_getu64be(c->infile, pos);
		if(v==0xfcbc0001bb0601e8ULL) {
			return 1;
		}
	}
	else if(b==0x1c) {
		v = dbuf_getu64be(c->infile, pos);
		if(v==0xfc8cc8030602018eULL) {
			*is_larc = 1;
			return 1;
		}
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %rsi
andq $0x0, (%rsi)
movq 0x18(%rdi), %rdi
callq 0xe3f2a
xorl %ebx, %ebx
cmpb $-0x15, %al
jne 0x82fac
movq 0x18(%r15), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xe3f2a
movzbl %al, %eax
movq (%r12), %rsi
addq %rax, %rsi
movq %rsi, (%r12)
cmpb $0x1c, %al
je 0x82f8a
cmpl $0x6c, %eax
je 0x82f70
cmpl $0x60, %eax
jne 0x82fac
movq 0x18(%r15), %rdi
callq 0xe41f2
movabsq $-0x343fffe44f9fe18, %rcx # imm = 0xFCBC0001BB0601E8
cmpq %rcx, %rax
je 0x82fa9
jmp 0x82fac
movq 0x18(%r15), %rdi
callq 0xe41f2
movabsq $-0x37337fcf9fdfe72, %rcx # imm = 0xFC8CC8030602018E
cmpq %rcx, %rax
jne 0x82fac
movl $0x1, (%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/lha.c
// Function: is_lharc_data_at
static int is_lharc_data_at(deark *c, i64 pos, i64 *pfoundpos)
{
	u8 b[5];

	if(pos+21 > c->infile->len) return 0;
	de_read(b, pos+2, sizeof(b));
	if(b[0]!='-' || b[1]!='l' || b[4]!='-') return 0;
	if(b[2]!='h' && b[2]!='z') return 0;
	*pfoundpos = pos;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x15(%rsi), %rax
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq 0x18(%rdi), %rax
jg 0x83016
movq %rdx, %r14
movq %rsi, %r15
leaq 0x2(%rsi), %rdx
leaq 0x3(%rsp), %r12
pushq $0x5
popq %rcx
movq %r12, %rsi
callq 0xe3cb7
cmpb $0x2d, (%r12)
jne 0x83016
cmpb $0x6c, 0x4(%rsp)
jne 0x83016
cmpb $0x2d, 0x7(%rsp)
jne 0x83016
movzbl 0x5(%rsp), %eax
cmpl $0x7a, %eax
je 0x83010
cmpl $0x68, %eax
jne 0x83016
movq %r15, (%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: de_module_j2c
void de_module_j2c(deark *c, struct deark_module_info *mi)
{
	mi->id = "j2c";
	mi->desc = "JPEG 2000 codestream";
	mi->run_fn = de_run_j2c;
	mi->identify_fn = de_identify_j2c;
}

// Assembly:
leaq 0x86103(%rip), %rax     # 0x10912e
movq %rax, (%rsi)
leaq 0x9c4ad(%rip), %rax     # 0x11f4e2
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x83050
movq %rax, 0x18(%rsi)
leaq 0x3e8(%rip), %rax       # 0x83433
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: handler_cod
static void handler_cod(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	u8 coding_style;
	de_ucstring *s = NULL;
	u8 b;
	i64 n;

	if(len<5) goto done;
	coding_style = de_getbyte_p(&pos);
	s = ucstring_create(c);

	if((coding_style&0xf8)==0) {
		switch(coding_style&0x01) {
		case 0x0: ucstring_append_flags_item(s, "entropy coder, without partitions"); break;
		case 0x1: ucstring_append_flags_item(s, "entropy coder, with partitions"); break;
		}
		switch((coding_style&0x02)>>1) {
		case 0x0: ucstring_append_flags_item(s, "no SOP segments"); break;
		case 0x1: ucstring_append_flags_item(s, "has SOP segments"); break;
		}
		switch((coding_style&0x04)>>2) {
		case 0x0: ucstring_append_flags_item(s, "no EPH segments"); break;
		case 0x1: ucstring_append_flags_item(s, "has EPH segments"); break;
		}
	}
	else {
		ucstring_append_flags_item(s, "?");
	}
	de_dbg(c, "coding style: 0x%02x (%s)", (unsigned int)coding_style,
		ucstring_getpsz(s));

	b = de_getbyte_p(&pos);
	de_dbg(c, "progression order: %d", (int)b);
	n = de_getu16be_p(&pos);
	de_dbg(c, "number of layers: %d", (int)n);
	(void)de_getbyte_p(&pos);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
cmpq $0x5, %r9
jge 0x83650
xorl %r14d, %r14d
jmp 0x83766
movq %r9, %r15
movq %r8, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xe3f2a
movl %eax, %r13d
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movzbl %r13b, %ebp
cmpb $0x7, %bpl
ja 0x836d1
leaq 0x9c168(%rip), %rax     # 0x11f7ec
leaq 0x9c13f(%rip), %rsi     # 0x11f7ca
testb $0x1, %r13b
cmovneq %rax, %rsi
movq %r14, %rdi
callq 0xeb884
testb $0x2, %r13b
leaq 0x9c165(%rip), %rax     # 0x11f80b
leaq 0x9c16e(%rip), %rsi     # 0x11f81b
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0xeb884
cmpb $0x4, %r13b
leaq 0x9c168(%rip), %rax     # 0x11f82c
leaq 0x9c171(%rip), %rsi     # 0x11f83c
cmovbq %rax, %rsi
jmp 0x836d8
leaq 0x9b809(%rip), %rsi     # 0x11eee1
movq %r14, %rdi
callq 0xeb884
movq %r14, %rdi
callq 0xeb7e4
leaq 0x9c15e(%rip), %rsi     # 0x11f84d
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0xe3f2a
movzbl %al, %edx
leaq 0x9c150(%rip), %rsi     # 0x11f867
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3f6e
leaq 0x9c149(%rip), %rsi     # 0x11f87d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xe3f2a
addq %r12, %r15
cmpq %r15, (%r13)
jge 0x83766
leaq 0x9c136(%rip), %rsi     # 0x11f892
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
movq %r14, %rdi
callq 0xeaf3c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: handler_qcd
static void handler_qcd(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	u8 q_style;

	if(len<1) goto done;
	q_style = de_getbyte_p(&pos);
	de_dbg(c, "quantization style: 0x%02x", (unsigned int)q_style);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}
done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
testq %r9, %r9
jle 0x839ca
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xe3f2a
movzbl %al, %edx
leaq 0x9bfa8(%rip), %rsi     # 0x11f94e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
addq %r15, %r14
cmpq %r14, (%r12)
jge 0x839ca
leaq 0x9bed2(%rip), %rsi     # 0x11f892
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: handler_qcc
static void handler_qcc(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	i64 compnum;

	if(pg->ncomp<257) {
		compnum = de_getbyte_p(&pos);
	}
	else {
		compnum = de_getu16be_p(&pos);
	}
	de_dbg(c, "component number: %d", (int)compnum);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq %r8, 0x8(%rsp)
cmpq $0x100, (%rdx)          # imm = 0x100
movq 0x18(%rdi), %rdi
leaq 0x8(%rsp), %rsi
jg 0x83a09
callq 0xe3f2a
movzbl %al, %edx
jmp 0x83a11
callq 0xe3f6e
movq %rax, %rdx
leaq 0x9bf51(%rip), %rsi     # 0x11f969
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
addq %r15, %r14
cmpq %r14, 0x8(%rsp)
jge 0x83a3d
leaq 0x9be5f(%rip), %rsi     # 0x11f892
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: handler_cme
static void handler_cme(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos, i64 data_size)
{
	i64 reg_val;
	i64 comment_pos;
	i64 comment_size;
	const char *name;

	if(data_size<2) goto done;

	reg_val = de_getu16be(pos);
	switch(reg_val) {
	case 0: name="binary"; break;
	case 1: name="text"; break;
	default: name="?";
	}
	de_dbg(c, "comment/extension type: %d (%s)", (int)reg_val, name);

	comment_pos = pos+2;
	comment_size = data_size-2;

	if(reg_val==1) {
		handle_comment(c, d, comment_pos, comment_size);
	}
	else {
		de_dbg_hexdump(c, c->infile, comment_pos, comment_size, 256, NULL, 0x1);
	}

done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x2, %r9
jl 0x83b4f
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r8, %rsi
callq 0xe3f46
movq %rax, %r12
cmpq $0x1, %rax
leaq 0x9c00f(%rip), %rax     # 0x11fa8b
leaq 0x9b45e(%rip), %rdx     # 0x11eee1
cmoveq %rax, %rdx
testq %r12, %r12
leaq 0xaf5b8(%rip), %rcx     # 0x133049
cmovneq %rdx, %rcx
leaq 0x9bee2(%rip), %rsi     # 0x11f97e
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
addq $0x2, %r15
addq $-0x2, %r14
cmpq $0x1, %r12
jne 0x83b2d
cmpl $0x1, 0x90(%rbx)
jg 0x83b5b
testq %r14, %r14
je 0x83b4f
cmpl $0x0, (%rbx)
jle 0x83b4f
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r12
movq 0x18(%rbx), %rdi
movl $0x5, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r12, %rdi
callq 0xeb877
leaq 0x83ce8(%rip), %rsi     # 0x1077f5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xeaf3c
movq 0x18(%rbx), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %r9d, %r9d
callq 0xded3a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r14, %r14
je 0x83b4f
leaq 0x878dc(%rip), %rsi     # 0x10b443
pushq $0x1
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xe4e62
movq %rax, %r12
movq 0x18(%rbx), %rdi
pushq $0x5
popq %rcx
pushq $0x2
popq %r9
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %r8
callq 0xe66ec
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe5591
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/j2c.c
// Function: handler_sot
static void handler_sot(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 x;
	i64 b;
	i64 pos = pos1;

	pg->j2c_sot_pos = 0;
	pg->j2c_sot_length = 0;
	if(len<8) return;

	pg->j2c_sot_pos = pos1 - 4;
	x = de_getu16be_p(&pos);
	de_dbg(c, "tile number: %d", (int)x);
	pg->j2c_sot_length = de_getu32be_p(&pos);
	de_dbg(c, "length: %u", (unsigned int)pg->j2c_sot_length);
	b = de_getbyte_p(&pos);
	de_dbg(c, "tile-part instance: %d", (int)b);
	b = de_getbyte_p(&pos);
	de_dbg(c, "number of tile-parts: %d", (int)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
cmpq $0x8, %r9
jl 0x83c57
movq %rdx, %r15
movq %rdi, %rbx
addq $-0x4, %r8
movq %r8, 0x8(%rdx)
movq 0x18(%rdi), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xe3f6e
leaq 0x9bdb6(%rip), %rsi     # 0x11f99e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe4071
movq %rax, 0x10(%r15)
leaq 0x9d13e(%rip), %rsi     # 0x120d49
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %al, %edx
leaq 0x9bd81(%rip), %rsi     # 0x11f9ae
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %al, %edx
leaq 0x9bd78(%rip), %rsi     # 0x11f9c5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/ogg.c
// Function: de_module_ogg
void de_module_ogg(deark *c, struct deark_module_info *mi)
{
	mi->id = "ogg";
	mi->desc = "Ogg multimedia";
	mi->run_fn = de_run_ogg;
	mi->identify_fn = de_identify_ogg;
	mi->help_fn = de_help_ogg;
}

// Assembly:
leaq 0x91bd3(%rip), %rax     # 0x115c0a
movq %rax, (%rsi)
leaq 0x9ba78(%rip), %rax     # 0x11fab9
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x84067
movq %rax, 0x18(%rsi)
leaq 0x68a(%rip), %rax       # 0x846e1
movq %rax, 0x20(%rsi)
leaq 0x6ca(%rip), %rax       # 0x8472c
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/ogg.c
// Function: de_identify_ogg
static int de_identify_ogg(deark *c)
{
	i64 pos = 0;

	if(!c->detection_data->id3.detection_attempted) {
		de_err(c, "ogg detection requires id3 module");
		return 0;
	}

	if(c->detection_data->id3.has_id3v2) {
		pos = (i64)c->detection_data->id3.bytes_at_start;
	}

	if(!dbuf_memcmp(c->infile, pos, "OggS", 4))
		return 100;

	return 0;
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rax
cmpb $0x0, 0x14(%rax)
je 0x846f9
xorl %ebx, %ebx
cmpb $0x0, 0x15(%rax)
je 0x8470b
movl 0x18(%rax), %esi
jmp 0x8470d
leaq 0x9b6a6(%rip), %rsi     # 0x11fda6
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x84728
xorl %esi, %esi
movq 0x18(%rdi), %rdi
leaq 0x9b6b0(%rip), %rdx     # 0x11fdc8
pushq $0x4
popq %rcx
callq 0xe4d48
testl %eax, %eax
pushq $0x64
popq %rax
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xdebae
cmpl $0x0, 0x20(%r14)
je 0x84787
movl $0x1, 0x20(%r14)
movq 0x28(%r14), %rdi
callq 0xe5591
andq $0x0, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x84759
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x84759
movq 0x18(%rax), %rdx
movl 0x18(%r15), %ecx
leaq 0x9b371(%rip), %rsi     # 0x11fb19
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movl (%r14), %eax
cmpl $0x2, %eax
je 0x847d6
cmpl $0x1, %eax
jne 0x847f6
leaq 0x9b373(%rip), %rdx     # 0x11fb47
jmp 0x847dd
leaq 0x9b372(%rip), %rdx     # 0x11fb4f
pushq $0x7
popq %r12
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0xe4d48
testl %eax, %eax
jne 0x84759
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x84809
jmp 0x84759
// File: /workspace/github_c_makefile_star2_O2/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 0xe40bf
movq %rax, %r12
movq (%r15), %rax
addq %r12, %rax
cmpq 0x18(%rbx), %rax
jle 0x84859
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xeaf3c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xeac74
movq %rax, %r15
leaq 0x10(%rsp), %r13
movq (%r13), %rsi
movl $0x2, (%rsp)
xorl %ebp, %ebp
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r15, %rdi
callq 0xeb877
leaq 0x9b2bc(%rip), %rsi     # 0x11fb57
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq %r12, (%r13)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe40bf
movq %rax, %r13
leaq 0x9b2a3(%rip), %rsi     # 0x11fb64
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
testq %r13, %r13
cmovleq %rbp, %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x84842
movq 0x10(%rsp), %rax
addq $0x4, %rax
cmpq 0x18(%rbx), %rax
jg 0x84842
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0xe40bf
movq %rax, %rbp
movq 0x10(%rsp), %rax
addq %rbp, %rax
cmpq 0x18(%rbx), %rax
jg 0x84842
movq %r15, %rdi
callq 0xeac85
movq 0x10(%rsp), %rsi
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %rbp, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r15, %rdi
callq 0xeb877
movq %r14, %rdi
leaq 0x9b229(%rip), %rsi     # 0x11fb7b
movl %r12d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
addq %rbp, 0x10(%rsp)
incq %r12
jmp 0x848d8
// File: /workspace/github_c_makefile_star2_O2/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 0x8498d
retq
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movb $0x1, 0x20(%rsi)
cmpq $0x0, 0x10(%rsi)
jle 0x849f9
cmpb $0x0, 0x22(%rsi)
je 0x849b1
leaq 0x9b3d1(%rip), %rax     # 0x11fd80
jmp 0x849fb
cmpb $0x0, 0x21(%rsi)
je 0x849c0
leaq 0x9b05c(%rip), %rax     # 0x11fa1a
jmp 0x849fb
cmpl $0x0, 0x28(%rsi)
je 0x849d5
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0x849d5
cmpl $0x0, 0x30(%rsi)
je 0x84a3c
cmpb $0x0, 0x24(%rsi)
je 0x849f9
cmpb $0x0, 0x23(%rsi)
je 0x84a33
cmpl $0x0, 0x34(%rsi)
leaq 0x9b398(%rip), %rcx     # 0x11fd84
leaq 0x9b39f(%rip), %rax     # 0x11fd92
cmoveq %rcx, %rax
jmp 0x849fb
xorl %eax, %eax
testq %rax, %rax
leaq 0x99b79(%rip), %rcx     # 0x11e57e
cmovneq %rax, %rcx
leaq 0x9b38f(%rip), %rdx     # 0x11fd9f
movq %rsp, %r14
pushq $0x50
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xde40c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe07f7
addq $0x58, %rsp
popq %rbx
popq %r14
retq
leaq 0x9b358(%rip), %rax     # 0x11fd92
jmp 0x849fb
movq 0x18(%rax), %rax
jmp 0x849fb
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x88414(%rip), %rax     # 0x10ce5f
movq %rax, (%rsi)
leaq 0x9b47b(%rip), %rax     # 0x11fed0
movq %rax, 0x8(%rsi)
leaq 0x9(%rip), %rax         # 0x84a69
movq %rax, 0x18(%rsi)
orb $0x1, 0x30(%rsi)
retq