LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: do_check_header_crc
static void do_check_header_crc(deark *c, lctx *d, struct member_data *md)
{
	// LHA members don't have to have a header CRC field, though it's probably
	// considered best practice to have one when the checksum field doesn't
	// exist, or there are any extended headers.
	if(!md->have_hdr_crc_reported) return;
	de_crcobj_reset(d->crco);

	// Everything before the CRC field:
	de_crcobj_addslice(d->crco, c->infile, md->member_pos,
		md->hdr_crc_field_pos - md->member_pos);

	// The zeroed-out CRC field:
	de_crcobj_addzeroes(d->crco, 2);

	// Everything after the CRC field:
	de_crcobj_addslice(d->crco, c->infile, md->hdr_crc_field_pos+2,
		md->compressed_data_pos - (md->hdr_crc_field_pos+2));

	md->hdr_crc_calc = de_crcobj_getval(d->crco);
	de_dbg(c, "header crc (calculated): 0x%04x", (UI)md->hdr_crc_calc);
	if(md->hdr_crc_calc != md->hdr_crc_reported) {
		de_err(c, "Wrong header CRC: reported=0x%04x, calculated=0x%04x",
				(UI)md->hdr_crc_reported, (UI)md->hdr_crc_calc);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x34(%rax)
jne 0xc46a3
jmp 0xc4786
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15f250
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x18(%rbp), %rax
subq 0x8(%rax), %rcx
callq 0x15f500
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x2, %esi
callq 0x15f4d0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
addq $0x2, %rdx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x2, %rax
subq %rax, %rcx
callq 0x15f500
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15f340
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edx
leaq 0xf6922(%rip), %rsi     # 0x1bb071
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
je 0xc4786
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %ecx
leaq 0xf37a6(%rip), %rsi     # 0x1b7f25
movb $0x0, %al
callq 0x15bfb0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0xc47b4
jmp 0xc48b7
movq -0x18(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0xc47d3
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xc4817
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc(%rax)
je 0xc4817
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x171460
jmp 0xc48b7
movq -0x18(%rbp), %rax
cmpb $0x0, 0x20(%rax)
je 0xc4838
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x171460
jmp 0xc48b5
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0xc4878
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x171460
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
leaq 0xd98d0(%rip), %rsi     # 0x19e13e
movl $0x5, %edx
callq 0x1715e0
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0xc48a1
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x171460
jmp 0xc48b3
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movl $0x5f, %esi
callq 0x1714c0
jmp 0xc48b5
jmp 0xc48b7
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: pakleo_classify_whats_next
static enum lha_whats_next_enum pakleo_classify_whats_next(deark *c, lctx *d,
	i64 pos, i64 len)
{
	u8 b[7];
	if(len<=0) return LHA_WN_NOTHING;
	de_read(b, pos, sizeof(b));
	if(is_possible_cmpr_meth(&b[2])) return LHA_WN_MEMBER;
	return LHA_WN_JUNK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jg 0xc4d38
movl $0x4, -0x4(%rbp)
jmp 0xc4d74
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x2f(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x7, %ecx
callq 0x164d10
leaq -0x2f(%rbp), %rdi
addq $0x2, %rdi
callq 0xc4d80
cmpl $0x0, %eax
je 0xc4d6d
movl $0x0, -0x4(%rbp)
jmp 0xc4d74
movl $0x3, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
cmpl %ecx, %eax
je 0xc4dab
movl $0x0, -0x4(%rbp)
jmp 0xc4e47
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jne 0xc4dec
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x4c, %eax
jne 0xc4dec
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x48, %eax
jne 0xc4dec
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %edi
callq 0xc4e50
cmpl $0x0, %eax
je 0xc4dec
movl $0x1, -0x4(%rbp)
jmp 0xc4e47
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2d, %eax
je 0xc4e01
movl $0x0, -0x4(%rbp)
jmp 0xc4e47
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0xc4e80
cmpl $0x0, %eax
je 0xc4e37
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %edi
callq 0xc4ed0
cmpl $0x0, %eax
je 0xc4e37
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %edi
callq 0xc4ed0
cmpl $0x0, %eax
jne 0xc4e40
movl $0x0, -0x4(%rbp)
jmp 0xc4e47
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x13(%rax), %eax
addl $-0x34, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x4, %eax
ja 0xc5004
movq -0x40(%rbp), %rax
leaq 0xf26eb(%rip), %rcx     # 0x1b7690
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x5, -0x34(%rbp)
jmp 0xc5006
movl $0x6, -0x34(%rbp)
jmp 0xc5006
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0xc4fdf
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xc51f0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0xc4ff2
movl $0x64, -0x34(%rbp)
jmp 0xc4ff9
movl $0x7, -0x34(%rbp)
jmp 0xc5006
movl $0x7, -0x34(%rbp)
jmp 0xc5006
jmp 0xc5023
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
callq 0xc5370
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x4, 0x10(%rax)
jge 0xc5105
movb $0x1, -0x31(%rbp)
jmp 0xc516b
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x165540
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x28(%rcx), %rax
je 0xc5131
movb $0x1, -0x31(%rbp)
jmp 0xc516b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
subq $0x4, %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x18b940
cmpb $0x0, -0x31(%rbp)
je 0xc5182
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x177560
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: detect_lhark
static void detect_lhark(deark *c, lctx *d, struct member_data *md,
	struct de_dfilter_in_params *dcmpri)
{
	int ret;
	int ok = 0;
	const char *fmt_name;

	if(d->lhark_policy>=0) goto done; // shouldn't get here
	if(d->lhark_req>=0) {
		d->lhark_policy = d->lhark_req; // shouldn't get here
		goto done;
	}

	de_dbg(c, "[detecting lh7 format]");
	de_dbg_indent(c, 1);

	if(md->hlev!=1 || md->os_id!=0x20) {
		d->lhark_policy = 0;
		ok = 1;
		goto done;
	}

	ret = decompress_lh5x_dry_run(c, d, md, dcmpri, DE_LH5X_FMT_LH7);
	if(ret) {
		d->lhark_policy = 0;
		ok = 1;
		goto done;
	}

	ret = decompress_lh5x_dry_run(c, d, md, dcmpri, DE_LH5X_FMT_LHARK);
	if(ret) {
		d->lhark_policy = 1;
		ok = 1;
		goto done;
	}

	d->lhark_policy = 0;

done:
	if(ok) {
		if(d->lhark_policy>0)
			fmt_name = "LHARK";
		else
			fmt_name = "standard lh7";
	}
	else {
		fmt_name = "unknown, assuming standard lh7";
	}
	de_dbg(c, "detected lh7 format: %s", fmt_name);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0xc521e
jmp 0xc5303
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jl 0xc523b
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0xc5303
movq -0x8(%rbp), %rdi
leaq 0xf2901(%rip), %rsi     # 0x1b7b47
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xc5274
movq -0x18(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x20, %eax
je 0xc5288
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x1, -0x28(%rbp)
jmp 0xc5303
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x7, %r8d
callq 0xc53e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xc52c0
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x1, -0x28(%rbp)
jmp 0xc5303
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x64, %r8d
callq 0xc53e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xc52f8
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
movl $0x1, -0x28(%rbp)
jmp 0xc5303
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
cmpl $0x0, -0x28(%rbp)
je 0xc532d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0xc5320
leaq 0xf2844(%rip), %rax     # 0x1b7b5e
movq %rax, -0x30(%rbp)
jmp 0xc532b
leaq 0xf284f(%rip), %rax     # 0x1b7b76
movq %rax, -0x30(%rbp)
jmp 0xc5338
leaq 0xf2830(%rip), %rax     # 0x1b7b64
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0xf283c(%rip), %rsi     # 0x1b7b83
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: decompress_lh5x_internal
static void decompress_lh5x_internal(deark *c, lctx *d,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres, int fmt)
{
	struct de_lh5x_params lzhparams;

	de_zeromem(&lzhparams, sizeof(struct de_lh5x_params));
	lzhparams.fmt = fmt;
	lzhparams.zero_codes_block_behavior = DE_LH5X_ZCB_65536;
	lzhparams.warn_about_zero_codes_block = 1;
	lzhparams.history_fill_val = 0x20;
	fmtutil_decompress_lh5x(c, dcmpri, dcmpro, dres, &lzhparams);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
movb $0x3, -0x3c(%rbp)
movb $0x1, -0x3b(%rbp)
movb $0x20, -0x3a(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x17ecb0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x169220
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x167b90
movq -0x8(%rbp), %rdi
movl $0x21, %esi
callq 0x15eac0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0xa3e7d(%rip), %rsi     # 0x1692d0
callq 0x169280
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
callq 0x1773f0
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $0x1, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %r9d
leaq -0x58(%rbp), %rcx
leaq -0xb8(%rbp), %r8
callq 0xc5370
movl -0x40(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rdi
callq 0x167c30
cmpl $0x0, -0xb8(%rbp)
je 0xc54d8
jmp 0xc550d
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x28(%rcx), %rax
je 0xc54ec
jmp 0xc550d
movq -0x38(%rbp), %rdi
callq 0x15f340
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
je 0xc5506
jmp 0xc550d
movl $0x1, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x1676a0
movq -0x38(%rbp), %rdi
callq 0x15f2e0
movl -0x28(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: apply_timestamp
static void apply_timestamp(deark *c, lctx *d, struct member_data *md,
	int tsidx, const struct de_timestamp *ts, int quality)
{
	if(!ts->is_valid) return;
	if(tsidx<0 || tsidx>=DE_TIMESTAMPIDX_COUNT) return;
	if(quality < md->tsdata[tsidx].quality) return;
	md->tsdata[tsidx].ts = *ts;
	md->tsdata[tsidx].quality = quality;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xc5556
jmp 0xc55c6
cmpl $0x0, -0x1c(%rbp)
jl 0xc5562
cmpl $0x5, -0x1c(%rbp)
jl 0xc5564
jmp 0xc55c6
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
addq $0x80, %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0xc5584
jmp 0xc55c6
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x2c(%rbp), %ecx
movq -0x18(%rbp), %rax
addq $0x80, %rax
movslq -0x1c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movzbl %al, %eax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jle 0xc5625
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x18(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq 0xf2579(%rip), %rsi     # 0x1b7c02
movb $0x0, %al
callq 0x15b0d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: fixup_tpk_path
static void fixup_tpk_path(de_ucstring *s)
{
	i64 i;

	for(i=0; i<s->len; i++) {
		if(s->str[i]=='\\') {
			s->str[i] = '/';
		}
	}

	if(s->len>0 && s->str[s->len-1]=='/') {
		ucstring_truncate(s, s->len-1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xc56f7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpl $0x5c, (%rax,%rcx,4)
jne 0xc56e7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl $0x2f, (%rax,%rcx,4)
jmp 0xc56e9
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xc56b4
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jle 0xc5731
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq $0x1, %rcx
cmpl $0x2f, (%rax,%rcx,4)
jne 0xc5731
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
subq $0x1, %rsi
callq 0x171230
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x166070
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xc5888
movq -0x38(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x165060
movb %al, -0x59(%rbp)
movzbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0xc57f0
jmp 0xc5888
cmpl $0x0, 0x18(%rbp)
je 0xc5801
movzbl -0x59(%rbp), %eax
cmpl $0xff, %eax
je 0xc5819
cmpl $0x0, 0x18(%rbp)
jne 0xc5869
movzbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
je 0xc5819
movzbl -0x59(%rbp), %eax
cmpl $0x2f, %eax
jne 0xc5869
movq -0x58(%rbp), %rax
subq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq 0x10(%rbp), %r10
movq -0x40(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc58d0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
jmp 0xc5875
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xc5877
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xc57c4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq 0x10(%rbp), %r10
movq -0x40(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc58d0
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x40(%rbp), %rdi
callq 0x171750
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x1, -0x30(%rbp)
jge 0xc5901
jmp 0xc5937
movq 0x18(%rbp), %rdi
callq 0x171210
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
callq 0x1728d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: interpret_unix_perms
static void interpret_unix_perms(deark *c, lctx *d, struct member_data *md, UI mode)
{
	if(mode & 0100000) { // regular file
		if(mode & 0111) { // executable
			md->is_executable = 1;
		}
		else {
			md->is_nonexecutable = 1;
		}
	}

	if((mode & 0170000) == 0120000) {
		md->is_special = 1; // symlink
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0xc597f
movl -0x1c(%rbp), %eax
andl $0x49, %eax
cmpl $0x0, %eax
je 0xc5975
movq -0x18(%rbp), %rax
movb $0x1, 0x23(%rax)
jmp 0xc597d
movq -0x18(%rbp), %rax
movb $0x1, 0x22(%rax)
jmp 0xc597f
movl -0x1c(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0xc5996
movq -0x18(%rbp), %rax
movb $0x1, 0x21(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: do_read_ext_header
static void do_read_ext_header(deark *c, lctx *d, struct member_data *md,
	i64 pos1, i64 len, i64 dlen)
{
	u8 id = 0;
	const char *name;
	const struct exthdr_type_info_struct *e = NULL;

	if(dlen>=1) {
		id = de_getbyte(pos1);
		e = get_exthdr_type_info(id);
	}
	name = e ? e->name : "?";

	de_dbg(c, "ext header at %"I64_FMT", len=%"I64_FMT" (1+%"I64_FMT"+%"I64_FMT"), id=0x%02x (%s)",
		pos1, len, dlen-1, len-dlen, (UI)id, name);

	if(dlen<1) return; // Invalid header, too short to even have an id field

	de_dbg_indent(c, 1);
	if(e && e->decoder_fn) {
		e->decoder_fn(c, d, md, id, e, pos1+1, dlen-1);
	}
	else {
		if(c->debug_level>=2) {
			de_dbg_hexdump(c, c->infile, pos1+1, dlen-1, 256, NULL, 0x1);
		}
	}
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x1, -0x30(%rbp)
jl 0xc59f4
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %edi
callq 0xc5b10
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xc5a09
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xc5a16
leaq 0xf221d(%rip), %rax     # 0x1b7c2d
movq %rax, -0x50(%rbp)
jmp 0xc5a16
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
subq $0x1, %r8
movq -0x28(%rbp), %r9
subq -0x30(%rbp), %r9
movzbl -0x31(%rbp), %r10d
movq -0x40(%rbp), %rax
leaq 0xf22b0(%rip), %rsi     # 0x1b7cfa
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x30(%rbp)
jge 0xc5a66
jmp 0xc5b08
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
cmpq $0x0, -0x48(%rbp)
je 0xc5abc
movq -0x48(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xc5abc
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movb -0x31(%rbp), %cl
movq -0x48(%rbp), %r8
movq -0x20(%rbp), %r9
addq $0x1, %r9
movq -0x30(%rbp), %r10
subq $0x1, %r10
movzbl %cl, %ecx
movq %r10, (%rsp)
callq *%rax
jmp 0xc5afa
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jl 0xc5af8
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
addq $0x1, %rdx
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, (%rsp)
callq 0x15b840
jmp 0xc5afa
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: get_exthdr_type_info
static const struct exthdr_type_info_struct *get_exthdr_type_info(u8 id)
{
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(exthdr_type_info_arr); i++) {
		if(id == exthdr_type_info_arr[i].id) {
			return &exthdr_type_info_arr[i];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x15, -0x18(%rbp)
jae 0xc5b68
movzbl -0x9(%rbp), %eax
leaq 0x1545dc(%rip), %rcx    # 0x21a110
imulq $0x18, -0x18(%rbp), %rdx
addq %rdx, %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xc5b58
leaq 0x1545c6(%rip), %rax    # 0x21a110
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xc5b70
jmp 0xc5b5a
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xc5b22
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x2, 0x10(%rbp)
jge 0xc5bae
jmp 0xc5bf5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165280
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x34(%rax)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edx
leaq 0xf254b(%rip), %rsi     # 0x1b8139
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0xc5c97
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x171210
jmp 0xc5cab
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x1727a0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %r8
movq 0x10(%rbp), %r9
movq -0x38(%rbp), %rax
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0xc5740
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
movl $0x1, %edx
callq 0x1729c0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq 0xf210f(%rip), %rsi     # 0x1b7e46
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rdi
callq 0x1727f0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x2, 0x10(%rbp)
jge 0xc5d86
jmp 0xc5df8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165280
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x40(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15d9f0
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rdi
callq 0x172650
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rdx
movl -0x44(%rbp), %ecx
movq %rax, %r8
leaq 0xf2067(%rip), %rsi     # 0x1b7e58
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rdi
callq 0x171750
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x18, 0x10(%rbp)
jge 0xc5e3e
jmp 0xc5ea9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x1, %r8d
leaq 0xf50c1(%rip), %r9      # 0x1baf1c
callq 0xc6190
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq $0x8, %rcx
xorl %r8d, %r8d
leaq 0xf1fea(%rip), %r9      # 0x1b7e68
callq 0xc6190
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq $0x10, %rcx
movl $0x2, %r8d
leaq 0xf1fd0(%rip), %r9      # 0x1b7e74
callq 0xc6190
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x4, 0x10(%rbp)
je 0xc5f21
jmp 0xc5f7f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165600
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
leaq -0xa0(%rbp), %rdx
movl $0x64, %ecx
xorl %r8d, %r8d
callq 0x161e60
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq -0xa0(%rbp), %rcx
leaq 0xf1f8d(%rip), %rsi     # 0x1b7ef5
movb $0x0, %al
callq 0x15b0d0
cmpl $0x0, -0x38(%rbp)
je 0xc5f7f
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x2, 0x10(%rbp)
jge 0xc5fbe
jmp 0xc5ffb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165280
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0xd8104(%rip), %rsi     # 0x19e0e4
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x34(%rbp), %ecx
callq 0xc5940
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x4, 0x10(%rbp)
jge 0xc603e
jmp 0xc609c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165280
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0xf1c2d(%rip), %rsi     # 0x1b7c91
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0xf1bf4(%rip), %rsi     # 0x1b7c89
movb $0x0, %al
callq 0x15b0d0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x1, %edx
callq 0x15d580
cmpq $0x0, -0x38(%rbp)
jg 0xc61eb
movb $0x0, -0x90(%rbp)
leaq -0x80(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0x80(%rbp), %r8
leaq 0xdc834(%rip), %rsi     # 0x1a2a4d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %ecx
leaq -0x90(%rbp), %r8
movl $0x5a, %r9d
callq 0xc5530
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: do_swg_footer
static void do_swg_footer(deark *c, lctx *d, i64 pos1)
{
	i64 pos = pos1;
	i64 n;
	de_ucstring *s = NULL;

	de_dbg(c, "SWG footer at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);
	s = ucstring_create(c);
	do_swg_string_field(c, d, s, pos, 61, "message");
	pos += 61;
	do_swg_string_field(c, d, s, pos, 66, "title");
	pos += 66;
	n = de_getu16le_p(&pos);
	de_dbg(c, "SWG number of items: %d", (int)n);
	de_dbg_indent(c, -1);
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xf1d4f(%rip), %rsi     # 0x1b7fd2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x3d, %r8d
leaq 0xed137(%rip), %r9      # 0x1b33f9
callq 0xc55d0
movq -0x20(%rbp), %rax
addq $0x3d, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x42, %r8d
leaq 0xdaf97(%rip), %r9      # 0x1a1287
callq 0xc55d0
movq -0x20(%rbp), %rax
addq $0x42, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xf1cbd(%rip), %rsi     # 0x1b7fe4
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x10, %ecx
callq 0x164d10
movzbl -0x2e(%rbp), %eax
cmpl $0x2d, %eax
jne 0xc649e
movzbl -0x2d(%rbp), %eax
cmpl $0x6c, %eax
jne 0xc649e
movzbl -0x2c(%rbp), %eax
cmpl $0x68, %eax
jne 0xc649e
movzbl -0x2a(%rbp), %eax
cmpl $0x2d, %eax
je 0xc64a7
movl $0x0, -0x4(%rbp)
jmp 0xc6517
movzbl -0x2b(%rbp), %eax
cmpl $0x30, %eax
je 0xc64c2
movzbl -0x2b(%rbp), %eax
cmpl $0x35, %eax
je 0xc64c2
movl $0x0, -0x4(%rbp)
jmp 0xc6517
movzbl -0x30(%rbp), %eax
movzbl -0x21(%rbp), %ecx
addl $0x19, %ecx
cmpl %ecx, %eax
je 0xc64da
movl $0x0, -0x4(%rbp)
jmp 0xc6517
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x21(%rbp), %eax
addq %rax, %rsi
addq $0x18, %rsi
leaq 0xf1d32(%rip), %rdx     # 0x1b822a
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xc6510
movl $0x0, -0x4(%rbp)
jmp 0xc6517
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: looks_like_arx_member
static int looks_like_arx_member(deark *c, i64 pos)
{
	u8 b[22];

	de_read(b, pos, sizeof(b));
	if(b[2]!='-' || b[3]!='l'|| b[4]!='h' || b[6]!='-') return 0;
	if(b[21]!=0) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x16, %ecx
callq 0x164d10
movzbl -0x2e(%rbp), %eax
cmpl $0x2d, %eax
jne 0xc683e
movzbl -0x2d(%rbp), %eax
cmpl $0x6c, %eax
jne 0xc683e
movzbl -0x2c(%rbp), %eax
cmpl $0x68, %eax
jne 0xc683e
movzbl -0x2a(%rbp), %eax
cmpl $0x2d, %eax
je 0xc6847
movl $0x0, -0x4(%rbp)
jmp 0xc6860
movzbl -0x1b(%rbp), %eax
cmpl $0x0, %eax
je 0xc6859
movl $0x0, -0x4(%rbp)
jmp 0xc6860
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/lha.c
// Function: arx_recalc_crc
static void arx_recalc_crc(deark *c, struct arx_ctx *d, struct arx_member_data *md)
{
	de_crcobj_reset(d->crco);
	if(md->is_uncompressed) {
		de_crcobj_addslice(d->crco, c->infile, md->hdr_endpos, md->compressed_data_len);
	}
	else {
		arx_recalc_lh1(c, d, md);
	}
	md->crc_calc = de_crcobj_getval(d->crco);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x15f250
movq -0x18(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0xc6ca2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0x15f500
jmp 0xc6cb3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xc6cd0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x15f340
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop