LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arj.c
// Function: do_arj_volume
static void do_arj_volume(deark *c, lctx *d, struct arjvol_struct *v)
{
	i64 pos;
	i64 bytes_consumed = 0;

	d->cv = v;
	d->inf = v->inf;
	pos = v->archive_start;
	if(do_header_or_member(c, d, pos, 1, &bytes_consumed) != 1) goto done;
	pos += bytes_consumed;
	if(d->cv->is_secured) {
		do_security_envelope(c, d);
	}

	do_member_sequence(c, d, pos);

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq %rdx, 0x8(%rsi)
movq (%rdx), %rax
movq %rax, (%rsi)
movq 0x10(%rdx), %r14
movq %r14, %rdx
movl $0x1, %ecx
callq 0x367bd
cmpl $0x1, %eax
jne 0x36710
movq 0x8(%r15), %rax
addq 0x18(%rsp), %r14
cmpb $0x0, 0x19(%rax)
je 0x3665d
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0x3665d
movq 0x20(%rax), %rdx
leaq 0xe1fd3(%rip), %rsi     # 0x1185e5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r15), %rsi
movq 0x8(%r15), %rax
movq 0x20(%rax), %rdx
movq 0x28(%rax), %rcx
movl $0x0, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xe975a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
leaq 0x10(%rsp), %r12
movq $0x0, 0x10(%rsp)
leaq 0x2(%r14), %rax
movq (%r15), %rcx
movl $0x4, %ebp
cmpq 0x18(%rcx), %rax
jg 0x366b5
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x367bd
testl %eax, %eax
sete %dl
movq 0x10(%rsp), %rcx
cmpq $0x2, %rcx
setl %sil
orb %dl, %sil
jne 0x366b5
addq %rcx, %r14
xorl %ecx, %ecx
cmpl $0x2, %eax
sete %cl
leal (%rcx,%rcx,2), %ebp
testl %ebp, %ebp
je 0x36662
cmpl $0x4, %ebp
je 0x36710
movq 0x8(%r15), %rax
cmpb $0x0, 0x1b(%rax)
jne 0x36710
movq 0x28(%rax), %rsi
testq %rsi, %rsi
jle 0x366e0
addq 0x20(%rax), %rsi
movq %r14, %rdi
callq 0xea79d
movq %rax, %r14
movq (%r15), %rax
movq 0x18(%rax), %rdx
subq %r14, %rdx
cmpq $0x2, %rdx
jl 0x36710
leaq 0xe1f10(%rip), %rsi     # 0x118607
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe9226
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arj.c
// Function: arj_logical_member_finish_and_free
static void arj_logical_member_finish_and_free(deark *c, lctx *d, u8 errflag)
{
	if(!d->clm) return;

	if(errflag) {
		if(d->mp_opt_used) {
			de_err(c, "%s: Incomplete file; not all fragments were found",
				ucstring_getpsz_d(d->clm->filename));
		}
		else {
			if(!d->clm->warned_incomplete) {
				de_warn(c, "%s: Incomplete file; use \"-mp\" for multi-volume support",
					ucstring_getpsz_d(d->clm->filename));
				d->clm->warned_incomplete = 1;
			}
		}
	}
	dbuf_close(d->clm->outf);
	ucstring_destroy(d->clm->filename);
	de_free(c, d->clm);
	d->clm = NULL;
}

// Assembly:
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x367bc
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testb %dl, %dl
je 0x36788
cmpb $0x0, 0x14(%rbx)
je 0x3675d
movq 0x8(%rax), %rdi
callq 0xf7557
leaq 0xe1ee3(%rip), %rsi     # 0x118631
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0x36788
cmpb $0x0, 0x10(%rax)
jne 0x36788
movq 0x8(%rax), %rdi
callq 0xf7557
leaq 0xe1de4(%rip), %rsi     # 0x118557
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9b27
movq 0x28(%rbx), %rax
movb $0x1, 0x10(%rax)
movq 0x28(%rbx), %rax
movq (%rax), %rdi
callq 0xf0b13
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0xf6bb0
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arj.c
// Function: read_arj_datetime
static void read_arj_datetime(deark *c, lctx *d, struct member_data *md,
	i64 pos, struct de_timestamp *ts1, const char *name)
{
	i64 dosdt, dostm;
	char timestamp_buf[64];

	dostm = dbuf_getu16le(d->inf, pos);
	dosdt = dbuf_getu16le(d->inf, pos+2);
	if(dostm==0 && dosdt==0) {
		de_snprintf(timestamp_buf, sizeof(timestamp_buf), "[not set]");
	}
	else if(md->unix_timestamp_format) {
		i64 ut;

		// Unix time is usually signed, but it seems that Open Source ARJ makes
		// it unsigned, so the valid dates are from 1970-2106.
		ut = (dosdt<<16) | dostm;
		de_unix_time_to_timestamp(ut, ts1, 0x1);
		de_timestamp_to_string(ts1, timestamp_buf, sizeof(timestamp_buf), 0);
	}
	else {
		de_dos_datetime_to_timestamp(ts1, dosdt, dostm);
		ts1->tzcode = DE_TZCODE_LOCAL;
		de_timestamp_to_string(ts1, timestamp_buf, sizeof(timestamp_buf), 0);
	}
	de_dbg(c, "%s time: %s", name, timestamp_buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
movq %rcx, %rsi
callq 0xef1ca
movq %rax, %r12
movq (%rbx), %rdi
addq $0x2, %rbp
movq %rbp, %rsi
callq 0xef1ca
movq %r12, %rcx
orq %rax, %rcx
jne 0x37de6
leaq 0xfa095(%rip), %rdx     # 0x131e68
leaq 0x10(%rsp), %rdi
movl $0x40, %esi
xorl %eax, %eax
callq 0xe8d67
jmp 0x37e2d
cmpb $0x0, 0x10(%r13)
je 0x37e06
shlq $0x10, %rax
orq %r12, %rax
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xeace2
jmp 0x37e19
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xeae33
movb $0x2, 0x1(%r15)
leaq 0x10(%rsp), %rsi
movl $0x40, %edx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0xeb4f8
leaq 0xe05ba(%rip), %rsi     # 0x1183ee
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arj.c
// Function: decompress_method_1
static void decompress_method_1(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)
{
	struct de_lh5x_params lzhparams;

	de_zeromem(&lzhparams, sizeof(struct de_lh5x_params));
	if(md->min_ver_to_extract==51) {
		lzhparams.fmt = DE_LH5X_FMT_LH7; // For ARJZ
	}
	else {
		lzhparams.fmt = DE_LH5X_FMT_LH6;
	}

	// ARJ does not appear to allow LZ77 offsets that point to data before
	// the beginning of the file, so it doesn't matter what we initialize the
	// history buffer to.
	lzhparams.history_fill_val = 0x00;

	lzhparams.zero_codes_block_behavior = DE_LH5X_ZCB_65536;
	lzhparams.warn_about_zero_codes_block = 1;
	fmtutil_decompress_lh5x(c, dcmpri, dcmpro, dres, &lzhparams);

	de_dbg3(c, "max dist: %"I64_FMT, lzhparams.max_offset_used);
	if(!dres->errcode) {
		if(lzhparams.max_offset_used>26624 && md->min_ver_to_extract<=11) {
			// Open-source ARJ can make files like this, with "-hdd32750" option.
			de_warn(c, "%s: Non-portable compression detected (max dist=%"I64_FMT", "
				"expected "DE_CHAR_LEQ"26624)",
				ucstring_getpsz_d(md->name_srd->str), lzhparams.max_offset_used);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
xorl %eax, %eax
cmpb $0x33, 0xe(%rsi)
sete %al
orl $0x6, %eax
movl %eax, (%r12)
movb $0x0, 0x6(%r12)
movw $0x103, 0x4(%r12)       # imm = 0x103
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movq %r12, %r8
callq 0xff330
movq 0x8(%r12), %rdx
leaq 0xe06de(%rip), %rsi     # 0x11858f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9461
cmpl $0x0, (%r15)
jne 0x37efc
cmpq $0x6801, 0x8(%rsp)      # imm = 0x6801
jl 0x37efc
cmpb $0xb, 0xe(%r14)
ja 0x37efc
movq 0x98(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xf7557
movq 0x8(%rsp), %rcx
leaq 0xe06ae(%rip), %rsi     # 0x11859d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9b27
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arj.c
// Function: method4_lz77buf_writebytecb
static void method4_lz77buf_writebytecb(struct de_lz77buffer *rb, const u8 n)
{
	struct method4_ctx *cctx = (struct method4_ctx*)rb->userdata;

	if(cctx->stop_flag) return;
	if(cctx->dcmpro->len_known) {
		if(cctx->nbytes_written >= cctx->dcmpro->expected_len) {
			cctx->stop_flag = 1;
			return;
		}
	}

	dbuf_writebyte(cctx->dcmpro->f, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpl $0x0, 0x8(%rbx)
jne 0x38167
movq 0x10(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0x3814f
movq (%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x38160
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf11be
incq (%rbx)
jmp 0x38167
movl $0x1, 0x8(%rbx)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bpg.c
// Function: de_module_bpg
void de_module_bpg(deark *c, struct deark_module_info *mi)
{
	mi->id = "bpg";
	mi->desc = "BPG (Better Portable Graphics)";
	mi->desc2 = "resources only";
	mi->run_fn = de_run_bpg;
	mi->identify_fn = de_identify_bpg;
}

// Assembly:
leaq 0xe0718(%rip), %rax     # 0x11888b
movq %rax, (%rsi)
leaq 0xe061b(%rip), %rax     # 0x118798
movq %rax, 0x8(%rsi)
leaq 0xdd159(%rip), %rax     # 0x1152e1
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0x381a3
movq %rax, 0x18(%rsi)
leaq 0x354(%rip), %rax       # 0x384f2
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bpg.c
// Function: get_ue7
static i64 get_ue7(deark *c, i64 *pos)
{
	u8 b;
	i64 val = 0;
	int bytecount = 0;

	// TODO: Better error handling
	while(1) {
		b = de_getbyte(*pos);
		(*pos)++;
		bytecount++;

		// A quick hack to prevent 64-bit integer overflow.
		// 5 bytes are enough for 35 bits, and none of the fields in
		// BPG v0.9.4.1 require more than 32.
		if(bytecount<=5)
			val = (val<<7)|(b&0x7f);

		if(b<0x80) {
			break;
		}
	}
	return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
xorl %r15d, %r15d
movq %rax, %r12
movq 0x18(%r14), %rdi
movq (%rbx), %rsi
callq 0xef0d5
movl %eax, %ecx
incq (%rbx)
movq %r12, %rdx
shlq $0x7, %rdx
andb $0x7f, %al
movzbl %al, %eax
orq %rdx, %rax
cmpl $0x5, %r15d
leal 0x1(%r15), %edx
cmovaeq %r12, %rax
movl %edx, %r15d
testb %cl, %cl
js 0x3852b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: de_module_bsave
void de_module_bsave(deark *c, struct deark_module_info *mi)
{
	mi->id = "bsave";
	mi->desc = "BSAVE/BLOAD image";
	mi->run_fn = de_run_bsave;
	mi->identify_fn = de_identify_bsave;
	mi->help_fn = de_help_bsave;
}

// Assembly:
leaq 0xe0372(%rip), %rax     # 0x1188e9
movq %rax, (%rsi)
leaq 0xe036e(%rip), %rax     # 0x1188ef
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x385a7
movq %rax, 0x18(%rsi)
leaq 0x8ee(%rip), %rax       # 0x38e85
movq %rax, 0x20(%rsi)
leaq 0x919(%rip), %rax       # 0x38ebb
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: de_help_bsave
static void de_help_bsave(deark *c)
{
	size_t k;

	de_msg(c, "-opt bsave:fmt=...");
	for(k=0; k<DE_ARRAYCOUNT(bsave_fmt_arr); k++) {
		const struct bsave_fmt_arr_item *item;

		item = &bsave_fmt_arr[k];
		if(item->flags & FMTFLAG_UNLISTED) continue;
		de_msg(c, " %-5s : %s", item->name, item->descr);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xdfeb9(%rip), %rsi     # 0x118d86
xorl %eax, %eax
callq 0xe9fc3
movl $0x18, %r15d
leaq 0x14660f(%rip), %r12    # 0x17f4f0
leaq 0xdfeb1(%rip), %r14     # 0x118d99
testb $-0x80, -0x14(%r15,%r12)
jne 0x38f06
movq -0x8(%r15,%r12), %rdx
movq (%r15,%r12), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xe9fc3
addq $0x20, %r15
cmpq $0x1b8, %r15            # imm = 0x1B8
jne 0x38ee8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: identify_bsave_internal
static void identify_bsave_internal(deark *c, struct bsave_id_info *idi)
{
	u32 load_segment;
	i64 data_size;
	// Known signatures: "PCPaint V1.0", "PCPaint V1.5".
	static const u8 *pcpaintsig = (const u8*)"PCPaint V1.";

	de_zeromem(idi, sizeof(struct bsave_id_info));
	if(c->infile->len<12) return;
	if(de_getbyte(0)!=0xfd) return;
	idi->might_be_bsave = 1;

	load_segment = (u32)de_getu16le(1);
	data_size = de_getu16le(5);
	if(data_size > c->infile->len) {
		// Mas data_size *should* be filesize-7, but there are a few bad files
		// that set it to filesize.
		idi->probably_not_bsave = 1;
		return;
	}
	if(data_size==0) {
		idi->probably_not_bsave = 1;
		return;
	}

	if(load_segment==0xb800 && (c->infile->len>=8007+14)) {
		i64 pos;

		pos = 8007;
		if(!dbuf_memcmp(c->infile, pos, pcpaintsig, 11)) {
			idi->pcpaint_sig_found = 1;
			idi->pcpaint_sig_pos = pos;
			return;
		}
	}

	if(data_size > c->infile->len) {
		idi->probably_not_bsave = 1;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq 0x18(%rdi), %rdi
cmpq $0xc, 0x18(%rdi)
jl 0x38fc3
movq %rsi, %rbx
xorl %esi, %esi
callq 0xef0d5
cmpb $-0x3, %al
jne 0x38fc3
movb $0x1, (%rbx)
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0xef1ca
movq %rax, %r12
movq 0x18(%r14), %rdi
movl $0x5, %esi
callq 0xef1ca
movq %rax, %r15
movq 0x18(%r14), %rdi
movq 0x18(%rdi), %rax
cmpq %rax, %r15
jg 0x38fbf
testq %r15, %r15
je 0x38fbf
cmpl $0xb800, %r12d          # imm = 0xB800
setne %cl
cmpq $0x1f55, %rax           # imm = 0x1F55
setl %al
orb %cl, %al
jne 0x38fb5
leaq 0xdfb0a(%rip), %rdx     # 0x118aac
movl $0x1f47, %esi           # imm = 0x1F47
movl $0xb, %ecx
callq 0xf025e
testl %eax, %eax
je 0x38fcf
movq 0x18(%r14), %rax
cmpq 0x18(%rax), %r15
jle 0x38fc3
movb $0x1, 0x1(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb $0x1, 0x2(%rbx)
movq $0x1f47, 0x8(%rbx)      # imm = 0x1F47
jmp 0x38fc3
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: use_fmt_by_id
static void use_fmt_by_id(deark *c, lctx *d, UI fmt_id)
{
	if(fmt_id==FMT_UNKNOWN) return;
	d->fmt_info = get_fmt_info_by_id(fmt_id);
	if(d->fmt_info) {
		d->decoder_fn = d->fmt_info->decoder_fn;
		d->has_dimension_fields = (d->fmt_info->flags & FMTFLAG_HAS_DIMENSION_FIELDS)?1:0;
		d->interlaced = (d->fmt_info->flags & FMTFLAG_INTERLACED)?1:0;
	}
}

// Assembly:
testl %esi, %esi
je 0x39029
xorl %eax, %eax
leaq 0x146506(%rip), %rcx    # 0x17f4f0
xorl %edx, %edx
cmpl %esi, (%rdx,%rcx)
je 0x39000
addq $0x20, %rdx
cmpq $0x1a0, %rdx            # imm = 0x1A0
jne 0x38fec
jmp 0x39006
addq %rdx, %rcx
movq %rcx, %rax
movq %rax, 0x20(%rdi)
testq %rax, %rax
je 0x39029
movq 0x8(%rax), %rcx
movq %rcx, 0x30(%rdi)
movb 0x4(%rax), %al
movl %eax, %ecx
andb $0x1, %cl
movb %cl, 0x2d(%rdi)
shrb %al
andb $0x1, %al
movb %al, 0x2c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: do_2color
static void do_2color(deark *c, lctx *d)
{
	i64 w, h;
	i64 j;
	i64 src_rowspan;
	i64 pos;
	de_bitmap *img = NULL;

	pos = BSAVE_HDRSIZE;

	if(d->has_dimension_fields) {
		// 11-byte header that includes width & height
		w = d->metrics.maybe_bitsperrow;
		h = d->metrics.maybe_nrows;
		pos+=4;
	}
	else if(!d->interlaced) {
		w = get_width(c, d, 640);
		src_rowspan = (w+7)/8;
		h = d->data_size / src_rowspan;
		h = get_height(c, d, h);
	}
	else {
		w = get_width(c, d, 640);
		h = get_height(c, d, 200);
	}

	de_dbg_dimensions(c, w, h);
	src_rowspan = (w+7)/8;

	if(!de_good_image_dimensions(c, w, h)) goto done;
	img = de_bitmap_create(c, w, h, 1);

	for(j=0; j<h; j++) {
		if(d->interlaced) {
			de_convert_row_bilevel(c->infile, pos + (j%2)*8192 + (j/2)*src_rowspan,
				img, j, 0);
		}
		else {
			de_convert_row_bilevel(c->infile, pos + j*src_rowspan, img, j, 0);
		}
	}

	de_bitmap_write_to_file(img, NULL, 0);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r13
cmpb $0x0, 0x2d(%rsi)
je 0x3937a
movq 0x440(%r14), %r12
movq 0x448(%r14), %rbp
movl $0xb, %eax
jmp 0x393cf
movb 0x2c(%r14), %bl
movl $0x280, %esi            # imm = 0x280
movq %r13, %rdi
callq 0x39c55
movq %rax, %r12
testb %bl, %bl
je 0x3939c
movl $0xc8, %esi
movq %r13, %rdi
jmp 0x393c2
leaq 0x7(%r12), %rax
movq %r12, %rcx
addq $0xe, %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x3, %rcx
movq 0x10(%r14), %rax
cqto
idivq %rcx
movq %r13, %rdi
movq %rax, %rsi
callq 0x39c9e
movq %rax, %rbp
movl $0x7, %eax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xe9b05
leaq 0x7(%r12), %rax
leaq 0xe(%r12), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xf241d
testl %eax, %eax
je 0x394a6
movq %r14, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
callq 0xf2cab
movq %rax, %r12
testq %rbp, %rbp
jle 0x39498
movq %rbp, %r15
sarq $0x3, %rbx
xorl %r14d, %r14d
movq (%rsp), %r13
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
cmpb $0x0, 0x2c(%rax)
je 0x3946c
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movl %r14d, %eax
andl $0x2000, %eax           # imm = 0x2000
addq (%rsp), %rax
movq %rbp, %rsi
shrq %rsi
imulq %rbx, %rsi
addq %rax, %rsi
jmp 0x39478
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0xf3069
incq %rbp
addq %rbx, %r13
addq $0x2000, %r14           # imm = 0x2000
cmpq %rbp, %r15
jne 0x3943d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x394a9
xorl %r12d, %r12d
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf28d4
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: do_256color
static void do_256color(deark *c, lctx *d)
{
	i64 w, h;
	i64 pos = BSAVE_HDRSIZE;
	de_bitmap *img = NULL;

	if(d->has_dimension_fields) {
		w = d->metrics.maybe_bytesperrow;
		h = d->metrics.maybe_nrows;
		pos += 4;
	}
	else {
		w = get_width(c, d, 320);
		h = d->data_size / w;
		h = get_height(c, d, h);
	}
	de_dbg_dimensions(c, w, h);

	if(!d->pal_valid) {
		de_copy_std_palette(DE_PALID_VGA256, 0, 0, d->pal, 256, 0);
	}

	if(!de_good_image_dimensions(c, w, h)) goto done;
	img = de_bitmap_create(c, w, h, 3);
	de_convert_image_paletted(c->infile, pos, 8, w, d->pal, img, 0);
	de_bitmap_write_to_file(img, NULL, 0);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x2d(%rsi)
je 0x39964
movq 0x448(%rbx), %r13
movq 0x450(%rbx), %r15
movl $0xb, %r12d
jmp 0x39991
movl $0x140, %esi            # imm = 0x140
movq %r14, %rdi
callq 0x39c55
movq %rax, %r15
movq 0x10(%rbx), %rax
cqto
idivq %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x39c9e
movq %rax, %r13
movl $0x7, %r12d
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xe9b05
cmpl $0x0, 0x38(%rbx)
jne 0x399c0
leaq 0x3c(%rbx), %rcx
movl $0x100, %r8d            # imm = 0x100
movl $0x28, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0xecbbc
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xf241d
testl %eax, %eax
je 0x39a1b
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl $0x3, %ecx
callq 0xf2cab
movq %rax, %r13
movq 0x18(%r14), %rdi
addq $0x3c, %rbx
movl $0x0, (%rsp)
movl $0x8, %edx
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
movq %rax, %r9
callq 0xf35b8
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x39a1e
xorl %r13d, %r13d
movq %r13, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf28d4
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: do_wh16
static void do_wh16(deark *c, lctx *d)
{
	de_bitmap *img = NULL;
	i64 w, h;
	i64 src_planespan;
	i64 src_rowspan;
	i64 pos;

	pos = BSAVE_HDRSIZE;
	w = d->metrics.maybe_bitsperrow;
	h = d->metrics.maybe_nrows;
	pos += 4;
	de_dbg_dimensions(c, w, h);
	if(!de_good_image_dimensions(c, w, h)) goto done;

	img = de_bitmap_create(c, w, h, 3);
	src_planespan = (w+7)/8;
	src_rowspan = src_planespan*4;

	de_copy_std_palette(DE_PALID_PC16, 0, 0, d->pal, 16, 0);
	de_convert_image_paletted_planar(c->infile, pos, 4, src_rowspan, src_planespan,
		d->pal, img, 0x2);
	de_bitmap_write_to_file(img, NULL, 0);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x440(%rsi), %r14
movq 0x448(%rsi), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0xe9b05
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xf241d
testl %eax, %eax
je 0x39af2
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl $0x3, %ecx
callq 0xf2cab
leaq 0x7(%r14), %rcx
addq $0xe, %r14
testq %rcx, %rcx
cmovnsq %rcx, %r14
movq %rax, %r12
sarq $0x3, %r14
leaq (,%r14,4), %r13
addq $0x3c, %rbx
movl $0x10, %r8d
movl $0x14, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r9d, %r9d
callq 0xecbbc
movq 0x18(%r15), %rdi
movl $0xb, %esi
movl $0x4, %edx
movq %r13, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq $0x2
pushq %r12
callq 0xf36f9
addq $0x10, %rsp
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x39af5
xorl %r12d, %r12d
movq %r12, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf28d4
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: do_b265
static void do_b265(deark *c, lctx *d)
{
	static const de_color palette1[4] = { 0xffffff, 0x55ffff, 0x000000, 0xffffff };
	static const de_color palette2[4] = { 0xffffff, 0x000000, 0x000000, 0x000000 };
	int palent;
	i64 w, h;
	i64 i,j;
	i64 bits_per_scanline;
	de_bitmap *img = NULL;
	i64 fakewidth;

	w = 320;
	fakewidth = w/2;
	h = d->data_size * 4 / fakewidth;
	bits_per_scanline = w;

	de_dbg_dimensions(c, w, h);
	if(!de_good_image_dimensions(c, w, h)) goto done;
	img = de_bitmap_create(c, w, h, 3);

	for(j=0; j<h; j++) {
		for(i=0; i<fakewidth; i++) {
			palent = (int)de_get_bits_symbol(c->infile, 2,
				BSAVE_HDRSIZE + (j/8)*bits_per_scanline + (i/4)*8 + j%8, i%4);
			de_bitmap_setpixel_rgb(img, 2*i  , j, palette1[palent]);
			de_bitmap_setpixel_rgb(img, 2*i+1, j, palette2[palent]);
		}
	}

	de_bitmap_write_to_file(img, NULL, 0);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbp
movq 0x10(%rsi), %r12
movabsq $0x6666666666666667, %rcx # imm = 0x6666666666666667
movq %r12, %rax
imulq %rcx
movq %rdx, %r14
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x4, %r14
addq %rax, %r14
movl $0x140, %esi            # imm = 0x140
movq %r14, %rdx
callq 0xe9b05
movl $0x140, %esi            # imm = 0x140
movq %rbp, %rdi
movq %r14, %rdx
callq 0xf241d
testl %eax, %eax
je 0x39c3b
movl $0x140, %esi            # imm = 0x140
movq %rbp, %rdi
movq %r14, %rdx
movl $0x3, %ecx
callq 0xf2cab
movq %rax, %r15
cmpq $0x28, %r12
jl 0x39c2d
xorl %r12d, %r12d
movq %r14, 0x8(%rsp)
leaq (,%r12,8), %rax
andq $-0x40, %rax
leaq (%rax,%rax,4), %rax
movl %r12d, %ecx
andl $0x7, %ecx
addq %rcx, %rax
addq $0x7, %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x18(%rbp), %rdi
movl %r13d, %edx
andl $0x1f8, %edx            # imm = 0x1F8
addq 0x10(%rsp), %rdx
movl %r14d, %ecx
andl $0x3, %ecx
movl $0x2, %esi
callq 0xf2d3a
movzbl %al, %ebx
shll $0x2, %ebx
leaq 0xdf1de(%rip), %rax     # 0x118dc0
movl (%rbx,%rax), %ecx
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xf2afd
leaq 0x1(%r13), %rsi
leaq 0xdf1d2(%rip), %rax     # 0x118dd0
movl (%rbx,%rax), %ecx
movq %r15, %rdi
movq %r12, %rdx
callq 0xf2afd
incq %r14
addq $0x2, %r13
cmpq $0xa0, %r14
jne 0x39bb3
incq %r12
movq 0x8(%rsp), %r14
cmpq %r14, %r12
jne 0x39b8b
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x39c3e
xorl %r15d, %r15d
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf28d4
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bsave.c
// Function: detect_cga16_cbfn
static int detect_cga16_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct detect_cga16_struct *ctx = (struct detect_cga16_struct*)brctx->userdata;
	i64 k;

	for(k=0; k<buf_len; k++) {
		if(ctx->flag0) break;
		if(((brctx->offset+k)%2)==0) { // Even-numbered byte
			if(buf[k]==0xdd) ctx->count1++;
			else if(buf[k]==0xde) ctx->count2++;
			else ctx->flag0 = 1;
		}
		else { // Odd-numbered (color) byte.
			// We want to make sure there is a color byte that isn't one of the
			// special screen codes.
			if(ctx->flag1==0 && buf[k]!=0xdd && buf[k]!=0xde) {
				ctx->flag1 = 1;
			}
		}
	}

	return (ctx->flag0) ? 0 : 1;
}

// Assembly:
movq (%rdi), %rcx
testq %rdx, %rdx
jle 0x39d50
movb 0x8(%rcx), %r8b
xorl %eax, %eax
testb %r8b, %r8b
jne 0x39d50
movl 0x10(%rdi), %r9d
addl %eax, %r9d
testb $0x1, %r9b
jne 0x39d22
movzbl (%rsi,%rax), %r9d
cmpl $0xde, %r9d
je 0x39d3c
cmpl $0xdd, %r9d
jne 0x39d41
incl (%rcx)
jmp 0x39d48
cmpb $0x0, 0x9(%rcx)
jne 0x39d48
movb (%rsi,%rax), %r9b
addb $0x23, %r9b
cmpb $0x2, %r9b
jb 0x39d48
movb $0x1, 0x9(%rcx)
jmp 0x39d48
incl 0x4(%rcx)
jmp 0x39d48
movb $0x1, 0x8(%rcx)
movb $0x1, %r8b
incq %rax
cmpq %rax, %rdx
jne 0x39cf5
xorl %eax, %eax
cmpb $0x0, 0x8(%rcx)
sete %al
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/aldus.c
// Function: de_module_aldus_inst
void de_module_aldus_inst(deark *c, struct deark_module_info *mi)
{
	mi->id = "aldus_inst";
	mi->desc = "Aldus LZW and PKZP";
	mi->run_fn = de_run_aldus_inst;
	mi->identify_fn = de_identify_aldus_inst;
}

// Assembly:
leaq 0xdf07d(%rip), %rax     # 0x118de0
movq %rax, (%rsi)
leaq 0xdf07e(%rip), %rax     # 0x118deb
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x39d88
movq %rax, 0x18(%rsi)
leaq 0x4a(%rip), %rax        # 0x39dcd
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/aldus.c
// Function: de_identify_aldus_inst
static int de_identify_aldus_inst(deark *c)
{
	if(dbuf_memcmp(c->infile, 0, (const u8*)"ALDUS ", 6)) return 0;

	if(!dbuf_memcmp(c->infile, 6, (const u8*)"PKZP  2.", 8))
		return 100;
	if(!dbuf_memcmp(c->infile, 6, (const u8*)"LZW   1.", 8))
		return 100;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0xdf1ff(%rip), %rdx     # 0x118fde
xorl %r14d, %r14d
movl $0x6, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
jne 0x39e40
movq 0x18(%rbx), %rdi
leaq 0xdf1e8(%rip), %rdx     # 0x118fe5
movl $0x6, %esi
movl $0x8, %ecx
callq 0xf025e
testl %eax, %eax
je 0x39e3a
movq 0x18(%rbx), %rdi
leaq 0xdf1d3(%rip), %rdx     # 0x118fee
movl $0x6, %esi
movl $0x8, %ecx
callq 0xf025e
xorl %ecx, %ecx
testl %eax, %eax
movl $0x64, %r14d
cmovnel %ecx, %r14d
jmp 0x39e40
movl $0x64, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/adex.c
// Function: de_module_adex
void de_module_adex(deark *c, struct deark_module_info *mi)
{
	mi->id = "adex";
	mi->desc = "ADEX IMG/RLE";
	mi->run_fn = de_run_adex;
	mi->identify_fn = de_identify_adex;
}

// Assembly:
leaq 0xde8c0(%rip), %rax     # 0x118ff7
movq %rax, (%rsi)
leaq 0xde8bb(%rip), %rax     # 0x118ffc
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x3a75c
movq %rax, 0x18(%rsi)
leaq 0x4b6(%rip), %rax       # 0x3ac0d
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/adex.c
// Function: de_identify_adex
static int de_identify_adex(deark *c)
{
	u8 b;

	if((u32)de_getu32be(0)!=0x50494354U) return 0; // "PICT"
	b = de_getbyte(4);
	if(b!=0 && b!=1) return 0;
	b = de_getbyte(5);
	if(b!=4 && b!=8) return 0;
	return 65;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef32a
cmpl $0x50494354, %eax       # imm = 0x50494354
jne 0x3ac56
movq 0x18(%r14), %rdi
movl $0x4, %esi
callq 0xef0d5
cmpb $0x1, %al
ja 0x3ac56
movq 0x18(%r14), %rdi
movl $0x5, %esi
callq 0xef0d5
addb $-0x4, %al
xorl %ecx, %ecx
testb $-0x5, %al
movl $0x41, %ebx
cmovnel %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cab.c
// Function: de_module_cab
void de_module_cab(deark *c, struct deark_module_info *mi)
{
	mi->id = "cab";
	mi->desc = "Microsoft Cabinet (CAB)";
	mi->run_fn = de_run_cab;
	mi->identify_fn = de_identify_cab;
	mi->flags |= DE_MODFLAG_WARNPARSEONLY;
}

// Assembly:
leaq 0xde40a(%rip), %rax     # 0x119071
movq %rax, (%rsi)
leaq 0xde404(%rip), %rax     # 0x119075
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x3ac90
movq %rax, 0x18(%rsi)
leaq 0xc72(%rip), %rax       # 0x3b8f9
movq %rax, 0x20(%rsi)
orb $0x20, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cardfile.c
// Function: de_module_cardfile
void de_module_cardfile(deark *c, struct deark_module_info *mi)
{
	mi->id = "cardfile";
	mi->desc = "Windows Cardfile address book";
	mi->run_fn = de_run_cardfile;
	mi->identify_fn = de_identify_cardfile;
}

// Assembly:
leaq 0xddb65(%rip), %rax     # 0x11948c
movq %rax, (%rsi)
leaq 0xddb64(%rip), %rax     # 0x119495
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x3b94c
movq %rax, 0x18(%rsi)
leaq 0x7d7(%rip), %rax       # 0x3c11e
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cardfile.c
// Function: detect_crd_fmt
static int detect_crd_fmt(deark *c)
{
	u8 buf[4];
	de_read(buf, 0, 4);

	if(!de_memcmp(buf, "MGC", 3)) return DE_CRDFMT_MGC;
	if(!de_memcmp(buf, "RRG", 3)) return DE_CRDFMT_RRG;
	if(!de_memcmp(buf, "DKO", 3)) return DE_CRDFMT_DKO;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x18(%rdi), %rdi
leaq 0xc(%rsp), %rbx
movl $0x4, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0xeeee8
movzwl (%rbx), %eax
xorl $0x474d, %eax           # imm = 0x474D
movzbl 0x2(%rbx), %ecx
xorl $0x43, %ecx
orw %ax, %cx
je 0x3c197
movzwl 0xc(%rsp), %eax
xorl $0x5252, %eax           # imm = 0x5252
movzbl 0xe(%rsp), %ecx
xorl $0x47, %ecx
orw %ax, %cx
je 0x3c19e
movzwl 0xc(%rsp), %eax
xorl $0x4b44, %eax           # imm = 0x4B44
movzbl 0xe(%rsp), %ecx
xorl $0x4f, %ecx
xorl %edx, %edx
orw %ax, %cx
sete %dl
leal (%rdx,%rdx,2), %eax
jmp 0x3c1a3
movl $0x1, %eax
jmp 0x3c1a3
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cardfile.c
// Function: do_text
static void do_text(deark *c, lctx *d, struct page_ctx *pg,
	i64 text_pos, i64 text_len)
{
	de_finfo *fi_text = NULL;

	if(text_len<1) goto done;

	if(c->extract_level>=2) {
		fi_text = de_finfo_create(c);
		if(c->filenames_from_file)
			de_finfo_set_name_from_ucstring(c, fi_text, pg->name, 0);

		do_extract_text_data(c, d, fi_text, text_pos, text_len);
	}
	else {
		do_dbg_text_data(c, d, text_pos, text_len);
	}

done:
	de_finfo_destroy(c, fi_text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %r8, %r8
jle 0x3c20b
movq %r8, %r15
movq %rcx, %r12
movq %rsi, %r13
cmpl $0x2, 0x90(%rbx)
jl 0x3c213
movq %rdx, %rbp
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r14
cmpb $0x0, 0xd0(%rbx)
je 0x3c1f6
movq 0x20(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xea9e4
leaq (%r15,%r12), %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x3c268
xorl %ebp, %ebp
jmp 0x3c2a2
xorl %r14d, %r14d
jmp 0x3c2aa
movq %rbx, %rdi
callq 0xf6870
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movl 0x4(%r13), %eax
movl %eax, (%rsp)
xorl %r14d, %r14d
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %rbp, %rdi
callq 0xf7557
leaq 0xfeabb(%rip), %rsi     # 0x13ad0c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbp, %rdi
callq 0xf6bb0
jmp 0x3c2aa
leaq 0xeddd1(%rip), %rsi     # 0x12a040
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movzbl 0x4(%r13), %ecx
orl $0x300, %ecx            # imm = 0x300
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %r8
movl $0x6, %r9d
callq 0xf1f28
movq %rbp, %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea9b3
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: de_module_cfb
void de_module_cfb(deark *c, struct deark_module_info *mi)
{
	mi->id = "cfb";
	mi->desc = "Microsoft Compound File Binary File";
	mi->run_fn = de_run_cfb;
	mi->identify_fn = de_identify_cfb;
	mi->help_fn = de_help_cfb;
}

// Assembly:
leaq 0xdd455(%rip), %rax     # 0x119720
movq %rax, (%rsi)
leaq 0xdd44f(%rip), %rax     # 0x119724
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x3c2fb
movq %rax, 0x18(%rsi)
leaq 0x105(%rip), %rax       # 0x3c3f0
movq %rax, 0x20(%rsi)
leaq 0x120(%rip), %rax       # 0x3c416
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: de_run_cfb
static void de_run_cfb(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *cfbfmt_opt;

	d = de_malloc(c, sizeof(lctx));
	d->decode_streams = 1;
	d->subformat_req = SUBFMT_AUTO;

	if(de_get_ext_option(c, "cfb:extractstreams")) {
		d->extract_raw_streams = 1;
		d->decode_streams = 0;
	}
	if(de_get_ext_option(c, "cfb:dumpdir")) {
		d->dump_dir_structure = 1; // A low-level debugging feature
	}

	if(de_havemodcode(c, mparams, 'T')) {
		// TIFF tag 37680 mode
		// TODO: Handle 'OLE Property Set Storage' more generally.
		d->subformat_req = SUBFMT_TIFF37680;
	}

	if(d->subformat_req == SUBFMT_AUTO) {
		// If we haven't set subformat_req yet, look at the command-line option

		cfbfmt_opt = de_get_ext_option(c, "cfb:fmt");
		if(cfbfmt_opt) {
			if(!de_strcmp(cfbfmt_opt, "auto")) {
				d->subformat_req = SUBFMT_AUTO;
			}
			else if(!de_strcmp(cfbfmt_opt, "raw")) {
				d->subformat_req = SUBFMT_RAW;
			}
			else if(!de_strcmp(cfbfmt_opt, "thumbsdb")) {
				d->subformat_req = SUBFMT_THUMBSDB;
			}
		}
	}

	de_run_cfb_internal(c, d);

	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0xc8, %esi
callq 0xe969b
movq %rax, %r14
movb $0x1, 0xd(%rax)
movl $0x0, (%rax)
leaq 0xdd424(%rip), %rsi     # 0x119748
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x3c338
movw $0x1, 0xc(%r14)
leaq 0xdd41c(%rip), %rsi     # 0x11975b
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x3c351
movb $0x1, 0xe(%r14)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x54, %edx
callq 0xea97e
testl %eax, %eax
je 0x3c36c
movl $0x3, (%r14)
cmpl $0x0, (%r14)
jne 0x3c3d5
leaq 0xdd3ee(%rip), %rsi     # 0x119767
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x3c3d5
movq %rax, %r15
leaq 0xd41fb(%rip), %rsi     # 0x11058b
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0x3c3c9
leaq 0xfc14c(%rip), %rsi     # 0x1384ef
movq %r15, %rdi
callq 0x181a0
testl %eax, %eax
je 0x3c3cd
leaq 0xdd3b9(%rip), %rsi     # 0x11976f
movq %r15, %rdi
callq 0x181a0
testl %eax, %eax
jne 0x3c3d5
movl $0x2, %eax
jmp 0x3c3d2
xorl %eax, %eax
jmp 0x3c3d2
movl $0x1, %eax
movl %eax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c45c
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: de_help_cfb
static void de_help_cfb(deark *c)
{
	de_msg(c, "-opt cfb:extractstreams : Extract raw streams, instead of decoding");
	de_msg(c, "-opt cfb:fmt=raw : Do not try to detect the document type");
	de_msg(c, "-opt cfb:fmt=thumbsdb : Assume Thumbs.db format");
	de_msg(c, "-opt cfb:msrgbamode=0 : Disable special processing of nonstandard-"
		"JPEG Thumbs.db thumbnails");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xddc6f(%rip), %rsi     # 0x11a090
xorl %eax, %eax
callq 0xe9fc3
leaq 0xddca4(%rip), %rsi     # 0x11a0d3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
leaq 0xddccd(%rip), %rsi     # 0x11a10d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
leaq 0xddcec(%rip), %rsi     # 0x11a13d
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0xe9fc3
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: describe_sec_id
static void describe_sec_id(deark *c, lctx *d, i64 sec_id,
	char *buf, size_t buf_len)
{
	i64 sec_offset;

	if(sec_id >= 0) {
		sec_offset = sec_id_to_offset(c, d, sec_id);
		de_snprintf(buf, buf_len, "offs=%d", (int)sec_offset);
	}
	else if(sec_id == -1) {
		de_strlcpy(buf, "free", buf_len);
	}
	else if(sec_id == -2) {
		de_strlcpy(buf, "end of chain", buf_len);
	}
	else if(sec_id == -3) {
		de_strlcpy(buf, "FAT SecID", buf_len);
	}
	else if(sec_id == -4) {
		de_strlcpy(buf, "DIFAT SecID", buf_len);
	}
	else {
		de_strlcpy(buf, "?", buf_len);
	}
}

// Assembly:
movq %rdx, %rax
movq %rsi, %rcx
testq %rsi, %rsi
js 0x3e960
incl %ecx
imull 0x20(%rdi), %ecx
leaq 0xee699(%rip), %rdx     # 0x12cfea
movl $0x50, %esi
movq %rax, %rdi
xorl %eax, %eax
jmp 0xe8d67
addq $0x4, %rcx
cmpq $0x3, %rcx
ja 0x3e99e
leaq 0xdad5f(%rip), %rdx     # 0x1196d0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0xdaf71(%rip), %rsi     # 0x1198f2
jmp 0x3e9a5
leaq 0xdaf5b(%rip), %rsi     # 0x1198e5
jmp 0x3e9a5
leaq 0xdaf4d(%rip), %rsi     # 0x1198e0
jmp 0x3e9a5
leaq 0xdaf58(%rip), %rsi     # 0x1198f4
jmp 0x3e9a5
leaq 0xed4c4(%rip), %rsi     # 0x12be69
movl $0x50, %edx
movq %rax, %rdi
jmp 0xe8ded
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: read_and_cvt_timestamp
static void read_and_cvt_timestamp(deark *c, dbuf *f, i64 pos,
	struct de_timestamp *ts)
{
	i64 ts_as_FILETIME;

	de_zeromem(ts, sizeof(struct de_timestamp));
	ts_as_FILETIME = dbuf_geti64le(f, pos);
	if(ts_as_FILETIME!=0) {
		de_FILETIME_to_timestamp(ts_as_FILETIME, ts, 0x1);
	}
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
callq 0xef536
testq %rax, %rax
je 0x3e9d7
movq %rax, %rdi
movq %rbx, %rsi
movl $0x1, %edx
popq %rbx
jmp 0xead1a
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: do_dump_dir_structure
static void do_dump_dir_structure(deark *c, lctx *d)
{
	i64 i;

	de_dbg(c, "dir structure:");
	de_dbg_indent(c, 1);
	for(i=0; i<d->num_dir_entries; i++) {
		de_dbg(c, "[%d] t=%d p=%d c=%d s=%d,%d", (int)i,
			(int)d->dir_entry[i].entry_type,
			(int)d->dir_entry[i].parent_id,
			(int)d->dir_entry[i].child_id,
			(int)d->dir_entry[i].sibling_id[0],
			(int)d->dir_entry[i].sibling_id[1]);
		de_dbg_indent(c, 1);
		if(d->dir_entry[i].fname_srd && d->dir_entry[i].fname_srd->str) {
			de_dbg(c, "fname: \"%s\"",
				ucstring_getpsz(d->dir_entry[i].fname_srd->str));
		}
		if(d->dir_entry[i].path) {
			de_dbg(c, "path: \"%s\"",
				ucstring_getpsz(d->dir_entry[i].path));
		}
		de_dbg_indent(c, -1);
	}
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xdb233(%rip), %rsi     # 0x119c24
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x70(%r14)
jle 0x3eae2
leaq 0xdb21c(%rip), %r15     # 0x119c33
leaq 0x10542b(%rip), %r12    # 0x143e49
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x98(%r14), %rax
movzbl 0x4(%rax,%r13), %ecx
movl 0x70(%rax,%r13), %r8d
movl 0x64(%rax,%r13), %r9d
movl 0x68(%rax,%r13), %r10d
movl 0x6c(%rax,%r13), %r11d
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0xe9226
addq $0x10, %rsp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x98(%r14), %rax
movq 0x28(%rax,%r13), %rax
testq %rax, %rax
je 0x3ea9b
movq 0x18(%rax), %rdi
testq %rdi, %rdi
je 0x3ea9b
callq 0xf74bd
movq %rbx, %rdi
leaq 0xdb1be(%rip), %rsi     # 0x119c4f
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x98(%r14), %rax
movq 0x78(%rax,%r13), %rdi
testq %rdi, %rdi
je 0x3eac1
callq 0xf74bd
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
incq %rbp
addq $0x88, %r13
cmpq 0x70(%r14), %rbp
jl 0x3ea23
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9585
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: do_mark_dir_entries_recursively
static void do_mark_dir_entries_recursively(deark *c, lctx *d, i32 parent_id,
	i32 dir_entry_idx, int level)
{
	struct dir_entry_info *dei;
	int k;

	if(dir_entry_idx<0 || (i64)dir_entry_idx>=d->num_dir_entries) return;

	dei = &d->dir_entry[dir_entry_idx];

	if(dei->entry_type!=OBJTYPE_STORAGE && dei->entry_type!=OBJTYPE_STREAM) return;

	dei->parent_id = parent_id;

	if(dei->entry_type==OBJTYPE_STORAGE && dei->fname_srd && dei->fname_srd->str && !dei->path) {
		// Set the full pathname
		dei->path = ucstring_create(c);
		if(parent_id>0 && d->dir_entry[parent_id].path) {
			ucstring_append_ucstring(dei->path, d->dir_entry[parent_id].path);
			ucstring_append_sz(dei->path, "/", DE_ENCODING_LATIN1);
		}
		ucstring_append_ucstring(dei->path, dei->fname_srd->str);
	}

	if(level>50) return;
	for(k=0; k<2; k++) {
		do_mark_dir_entries_recursively(c, d, parent_id, dei->sibling_id[k], level+1);
	}

	if(dei->entry_type==OBJTYPE_STORAGE) {
		// This is a "subdirectory" entry, so examine its children (starting with the
		// one that we know about).
		do_mark_dir_entries_recursively(c, d, dir_entry_idx, dei->child_id, level+1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %r15
testl %ebp, %ebp
js 0x3ec17
movl %ebp, %eax
cmpq %rax, 0x70(%r14)
jle 0x3ec17
movq 0x98(%r14), %r12
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rcx
movb 0x4(%r12,%rcx), %al
leal -0x1(%rax), %edx
cmpb $0x1, %dl
ja 0x3ec17
addq %rcx, %r12
movl %r13d, 0x70(%r12)
cmpb $0x1, %al
jne 0x3ebd4
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x3ebd4
cmpq $0x0, 0x18(%rax)
je 0x3ebd4
cmpq $0x0, 0x78(%r12)
jne 0x3ebd4
movq %r15, %rdi
callq 0xf6870
movq %rax, 0x78(%r12)
testl %r13d, %r13d
jle 0x3ebc1
movq 0x98(%r14), %rcx
movl %r13d, %edx
movq %rdx, %rsi
shlq $0x7, %rsi
leaq (%rsi,%rdx,8), %rdx
movq 0x78(%rcx,%rdx), %rsi
testq %rsi, %rsi
je 0x3ebc1
movq %rax, %rdi
callq 0xf6969
movq 0x78(%r12), %rdi
leaq 0xd34b7(%rip), %rsi     # 0x11206e
movl $0x5, %edx
callq 0xf6a40
movq 0x28(%r12), %rax
movq 0x78(%r12), %rdi
movq 0x18(%rax), %rsi
callq 0xf6969
cmpl $0x32, %ebx
jg 0x3ec17
movl %ebp, 0x4(%rsp)
incl %ebx
xorl %ebp, %ebp
movl 0x68(%r12,%rbp,4), %ecx
movq %r15, %rdi
movq %r14, %rsi
movl %r13d, %edx
movl %ebx, %r8d
callq 0x3eafd
incq %rbp
cmpq $0x1, %rbp
je 0x3ebe1
cmpb $0x1, 0x4(%r12)
movl 0x4(%rsp), %r13d
jne 0x3ec17
movl 0x64(%r12), %ebp
jmp 0x3eb16
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: copy_normal_stream_to_dbuf
static void copy_normal_stream_to_dbuf(deark *c, lctx *d, i64 first_sec_id,
	i64 stream_startpos, i64 stream_size,
	dbuf *outf)
{
	i64 sec_id;
	i64 bytes_left_to_copy;
	i64 bytes_left_to_skip;

	if(stream_size<=0) return;
	if(stream_startpos+stream_size > c->infile->len) {
		// This is a not-too-strict emergency brake. If the file has been
		// truncated, we might still be able to process some of the data
		// that is there.
		stream_size = c->infile->len - stream_startpos;
	}

	bytes_left_to_copy = stream_size;
	bytes_left_to_skip = stream_startpos;
	sec_id = first_sec_id;
	while(bytes_left_to_copy > 0) {
		i64 sec_offs;
		i64 bytes_to_copy;
		i64 bytes_to_skip;

		if(sec_id<0) break;
		sec_offs = sec_id_to_offset(c, d, sec_id);

		bytes_to_skip = bytes_left_to_skip;
		if(bytes_to_skip > d->sec_size) bytes_to_skip = d->sec_size;

		bytes_to_copy = d->sec_size - bytes_to_skip;
		if(bytes_to_copy > bytes_left_to_copy) bytes_to_copy = bytes_left_to_copy;

		dbuf_copy(c->infile, sec_offs + bytes_to_skip, bytes_to_copy, outf);

		bytes_left_to_copy -= bytes_to_copy;
		bytes_left_to_skip -= bytes_to_skip;
		sec_id = get_next_sec_id(c, d, sec_id);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testq %r8, %r8
jle 0x3ed31
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
leaq (%r8,%rcx), %rax
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, %rbx
subq %r14, %rbx
cmpq %rcx, %rax
cmovleq %r8, %rbx
testq %rbx, %rbx
jle 0x3ed31
testq %r12, %r12
jns 0x3ecc7
movq %r12, %rax
jmp 0x3ed29
movq 0x20(%r15), %rbp
leaq 0x1(%r12), %rsi
imulq %rbp, %rsi
cmpq %rbp, %r14
movq %rbp, %r13
cmovlq %r14, %r13
subq %r13, %rbp
cmpq %rbx, %rbp
cmovgeq %rbx, %rbp
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
addq %r13, %rsi
movq %rbp, %rdx
movq 0x10(%rsp), %rcx
callq 0xefabc
subq %rbp, %rbx
subq %r13, %r14
movq 0x80(%r15), %rdi
testq %rdi, %rdi
je 0x3ed22
leaq (,%r12,4), %rsi
callq 0xef417
jmp 0x3ed29
movq $-0x2, %rax
testq %r12, %r12
movq %rax, %r12
jns 0x3ecb8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cfb.c
// Function: copy_any_stream_to_dbuf
static void copy_any_stream_to_dbuf(deark *c, lctx *d, struct dir_entry_info *dei,
	i64 stream_startpos, i64 stream_size,
	dbuf *outf)
{
	if(dei->is_mini_stream) {
		copy_mini_stream_to_dbuf(c, d, dei->minisec_id, stream_startpos, stream_size, outf);
	}
	else {
		copy_normal_stream_to_dbuf(c, d, dei->normal_sec_id, stream_startpos, stream_size, outf);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
cmpl $0x0, 0x8(%rdx)
je 0x3ee25
movq 0xa0(%r12), %rax
testq %rax, %rax
sete %cl
testq %r14, %r14
setle %sil
orb %cl, %sil
jne 0x3ee16
movq 0x18(%rdi), %rcx
cmpq %r14, 0x18(%rcx)
jl 0x3ee16
cmpq %r14, 0x18(%rax)
jl 0x3ee16
movq 0x20(%rdx), %rbp
movq %r9, (%rsp)
testq %r14, %r14
jle 0x3ee16
testq %rbp, %rbp
jns 0x3edab
movq %rbp, %rax
jmp 0x3ee0e
movq 0x50(%r12), %r13
movq 0xa0(%r12), %rdi
movq %r13, %rsi
imulq %rbp, %rsi
cmpq %r13, %r15
movq %r13, %rbx
cmovlq %r15, %rbx
subq %rbx, %r13
cmpq %r14, %r13
cmovgeq %r14, %r13
addq %rbx, %rsi
movq %r13, %rdx
movq %r9, %rcx
callq 0xefabc
subq %r13, %r14
subq %rbx, %r15
movq 0x88(%r12), %rdi
testq %rdi, %rdi
je 0x3ee03
leaq (,%rbp,4), %rsi
callq 0xef417
jmp 0x3ee0a
movq $-0x2, %rax
movq (%rsp), %r9
testq %rbp, %rbp
movq %rax, %rbp
jns 0x3ed9c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rdx), %rdx
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ec70
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cpio.c
// Function: de_module_cpio
void de_module_cpio(deark *c, struct deark_module_info *mi)
{
	mi->id = "cpio";
	mi->desc = "cpio archive";
	mi->run_fn = de_run_cpio;
	mi->identify_fn = de_identify_cpio;
}

// Assembly:
leaq 0xdafbd(%rip), %rax     # 0x11a1cc
movq %rax, (%rsi)
leaq 0xdafb8(%rip), %rax     # 0x11a1d1
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x3f234
movq %rax, 0x18(%rsi)
leaq 0x7e2(%rip), %rax       # 0x3fa11
movq %rax, 0x20(%rsi)
retq