LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cardfile.c
// Function: do_extract_text_data
static void do_extract_text_data(deark *c, lctx *d, de_finfo *fi, i64 text_pos, i64 text_len)
{
	dbuf *outf = NULL;

	if(text_len<1) goto done;
	if(text_pos + text_len > c->infile->len) goto done;

	outf = dbuf_create_output_file(c, "txt", fi, 0);
	dbuf_copy_slice_convert_to_utf8(c->infile, text_pos, text_len,
		DE_EXTENC_MAKE(d->crd_encoding, DE_ENCSUBTYPE_HYBRID),
		outf, 0x2|0x4);
done:
	dbuf_close(outf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x1, -0x28(%rbp)
jge 0x50e7d
jmp 0x50ee1
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x50e95
jmp 0x50ee1
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x164d4d(%rip), %rsi    # 0x1b5bf1
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0xff, %ecx
orl $0x300, %ecx            # imm = 0x300
movq -0x30(%rbp), %r8
movl $0x6, %r9d
callq 0x169da0
movq -0x30(%rbp), %rdi
callq 0x1676a0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cardfile.c
// Function: do_dbg_text_data
static void do_dbg_text_data(deark *c, lctx *d, i64 text_pos, i64 text_len)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, text_pos, text_len, DE_DBG_MAX_STRLEN, s,
		0, d->crd_encoding);
	de_dbg(c, "text: \"%s\"", ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// 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 $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %r8
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x175aeb(%rip), %rsi    # 0x1c6a52
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cardfile.c
// Function: do_bitmap_mgc
static int do_bitmap_mgc(deark *c, lctx *d, struct page_ctx *pg)
{
	int retval = 0;
	i64 w, h;
	i64 src_rowspan;
	de_bitmap *img = NULL;
	de_finfo *fi_bitmap = NULL;

	fi_bitmap = de_finfo_create(c);
	if(c->filenames_from_file)
		de_finfo_set_name_from_ucstring(c, fi_bitmap, pg->name, 0);

	w = de_getu16le(pg->datapos+2);
	h = de_getu16le(pg->datapos+4);
	de_dbg(c, "bitmap dimensions: %d"DE_CHAR_TIMES"%d", (int)w, (int)h);

	src_rowspan = ((w+15)/16)*2;
	if(pg->datapos+10 + src_rowspan*h > pg->text_item_pos) {
		goto done;
	}
	if(w==0 || h==0) {
		goto done;
	}

	img = de_bitmap_create(c, w, h, 1);

	de_convert_and_write_image_bilevel2(c->infile, pg->datapos+10,
		w, h, src_rowspan, 0, fi_bitmap, 0);

	de_bitmap_destroy(img);
	de_finfo_destroy(c, fi_bitmap);
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xd0(%rax)
je 0x50fdc
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x4, %rsi
callq 0x165280
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0x17457d(%rip), %rsi    # 0x1c55aa
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0xf, %rax
movl $0x10, %ecx
cqto
idivq %rcx
shlq %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
addq $0xa, %rax
movq -0x38(%rbp), %rcx
imulq -0x30(%rbp), %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x51071
jmp 0x510f0
cmpq $0x0, -0x28(%rbp)
je 0x5107f
cmpq $0x0, -0x30(%rbp)
jne 0x51081
jmp 0x510f0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x1, %ecx
callq 0x16b750
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0xa, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x48(%rbp), %rax
xorl %r9d, %r9d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x16c000
movq -0x40(%rbp), %rdi
callq 0x16af60
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x15d260
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x15439d(%rip), %rcx    # 0x1a54b4
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x154393(%rip), %rcx    # 0x1a54b8
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x51160
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x17d(%rip), %rcx       # 0x512c0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x1be(%rip), %rcx       # 0x51310
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xc8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, 0xd(%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
leaq 0x154335(%rip), %rsi    # 0x1a54dc
callq 0x15cb30
cmpq $0x0, %rax
je 0x511c2
movq -0x18(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x8(%rbp), %rdi
leaq 0x154322(%rip), %rsi    # 0x1a54ef
callq 0x15cb30
cmpq $0x0, %rax
je 0x511e0
movq -0x18(%rbp), %rax
movb $0x1, 0xe(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x54, %edx
callq 0x15d1d0
cmpl $0x0, %eax
je 0x51201
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x51292
movq -0x8(%rbp), %rdi
leaq 0x1542e2(%rip), %rsi    # 0x1a54fb
callq 0x15cb30
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x51290
movq -0x20(%rbp), %rdi
leaq 0x14b33f(%rip), %rsi    # 0x19c573
callq 0x191a0
cmpl $0x0, %eax
jne 0x5124a
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x5128e
movq -0x20(%rbp), %rdi
leaq 0x172c83(%rip), %rsi    # 0x1c3ed8
callq 0x191a0
cmpl $0x0, %eax
jne 0x5126b
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x5128c
movq -0x20(%rbp), %rdi
leaq 0x15428d(%rip), %rsi    # 0x1a5503
callq 0x191a0
cmpl $0x0, %eax
jne 0x5128a
movq -0x18(%rbp), %rax
movl $0x2, (%rax)
jmp 0x5128c
jmp 0x5128e
jmp 0x51290
jmp 0x51292
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x51370
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x154aff(%rip), %rsi    # 0x1a5e26
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x154b30(%rip), %rsi    # 0x1a5e69
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x154b58(%rip), %rsi    # 0x1a5ea3
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x154b76(%rip), %rsi    # 0x1a5ed3
movb $0x0, %al
callq 0x15c190
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: de_run_cfb_internal
static void de_run_cfb_internal(deark *c, lctx *d)
{
	do_init_format_detection(c, d);

	if(!do_header(c, d)) {
		goto done;
	}

	read_difat(c, d);

	read_fat(c, d);

	read_minifat(c, d);

	read_directory_stream(c, d);

	do_directory(c, d);

done:
	dbuf_close(d->difat);
	dbuf_close(d->fat);
	dbuf_close(d->minifat);
	dbuf_close(d->dir);
	if(d->dir_entry) {
		i64 k;
		for(k=0; k<d->num_dir_entries; k++) {
			de_destroy_stringreaderdata(c, d->dir_entry[k].fname_srd);
			ucstring_destroy(d->dir_entry[k].path);
		}
		de_free(c, d->dir_entry);
	}
	dbuf_close(d->mini_sector_stream);
	if(d->thumbsdb_catalog) {
		i64 k;
		for(k=0; k<d->thumbsdb_catalog_num_entries; k++) {
			de_destroy_stringreaderdata(c, d->thumbsdb_catalog[k].fname_srd);
		}
		de_free(c, d->thumbsdb_catalog);
		d->thumbsdb_catalog = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51570
cmpl $0x0, %eax
jne 0x513a1
jmp 0x513e2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x519e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51ba0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51d10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51f00
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x520a0
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
je 0x514a7
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jge 0x51493
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x28(%rax), %rsi
callq 0x166830
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x78(%rax), %rdi
callq 0x171750
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x51435
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x51532
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0xa8(%rcx), %rax
jge 0x5150f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x166830
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x514cd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq $0x0, 0xb0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: read_fat
static void read_fat(deark *c, lctx *d)
{
	i64 i;
	i64 sec_id;
	i64 sec_offset;
	char buf[80];

	d->fat = dbuf_create_membuf(c, d->num_fat_sectors * d->sec_size, 1);

	de_dbg(c, "reading FAT contents (%d sectors)", (int)d->num_fat_sectors);
	de_dbg_indent(c, 1);
	for(i=0; i<d->num_fat_sectors; i++) {
		sec_id = dbuf_geti32le(d->difat, i*4);
		sec_offset = sec_id_to_offset(c, d, sec_id);
		describe_sec_id(c, d, sec_id, buf, sizeof(buf));
		de_dbg(c, "reading sector: DIFAT_idx=%d, SecID=%d (%s)",
			(int)i, (int)sec_id, buf);
		dbuf_copy(c->infile, sec_offset, d->sec_size, d->fat);
	}
	de_dbg_indent(c, -1);

	d->num_fat_entries = d->fat->len/4;
	dump_fat(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
imulq 0x20(%rax), %rsi
movl $0x1, %edx
callq 0x168020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0x153b0f(%rip), %rsi    # 0x1a5704
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jge 0x51cc4
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x165600
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x52340
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rcx
movl $0x50, %r8d
callq 0x52250
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq -0x80(%rbp), %r8
leaq 0x153a9e(%rip), %rsi    # 0x1a5726
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rcx
callq 0x166070
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x51c12
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x18(%rax), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x52390
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_directory
static void do_directory(deark *c, lctx *d)
{
	i64 i;
	int pass;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "reading directory entries");
	do_before_reading_directory_entries(c, d);
	for(i=0; i<d->num_dir_entries; i++) {
		i64 dir_entry_offs = 128*i;
		do_read_dir_entry(c, d, i, dir_entry_offs);
	}

	de_dbg(c, "decoding directory structure");
	do_analyze_dir_structure(c, d);

	de_dbg(c, "detecting format");
	do_finalize_format_detection(c, d);

	de_dbg(c, "processing directory entries");
	de_dbg_indent(c, 1);
	for(pass=1; pass<=3; pass++) {
		de_dbg2(c, "[pass %d]", pass);
		for(i=0; i<d->num_dir_entries; i++) {
			if(d->dir_entry[i].pass == pass) {
				de_dbg(c, "directory entry, StreamID=%d", (int)i);
				de_dbg_indent(c, 1);
				do_process_dir_entry(c, d, i);
				de_dbg_indent(c, -1);
			}
		}
	}

	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
leaq 0x1537df(%rip), %rsi    # 0x1a58a7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x525d0
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jge 0x52121
movq -0x18(%rbp), %rax
shlq $0x7, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x52690
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x520e4
movq -0x8(%rbp), %rdi
leaq 0x153795(%rip), %rsi    # 0x1a58c1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x52a90
movq -0x8(%rbp), %rdi
leaq 0x153793(%rip), %rsi    # 0x1a58de
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x52b40
movq -0x8(%rbp), %rdi
leaq 0x153785(%rip), %rsi    # 0x1a58ef
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movl $0x1, -0x1c(%rbp)
cmpl $0x3, -0x1c(%rbp)
jg 0x5223d
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x15376e(%rip), %rsi    # 0x1a590c
movb $0x0, %al
callq 0x15b350
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jge 0x5222d
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x5221d
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0x15372d(%rip), %rsi    # 0x1a5916
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x52c40
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
jmp 0x5221f
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x521ad
jmp 0x5222f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x52186
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x15b5a0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jl 0x522a9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x52340
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0x166b91(%rip), %rdx    # 0x1b8e2e
movb $0x0, %al
callq 0x15a980
jmp 0x52339
cmpq $-0x1, -0x18(%rbp)
jne 0x522c6
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x1533b5(%rip), %rsi    # 0x1a5674
callq 0x15aa30
jmp 0x52337
cmpq $-0x2, -0x18(%rbp)
jne 0x522e3
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x15339d(%rip), %rsi    # 0x1a5679
callq 0x15aa30
jmp 0x52335
cmpq $-0x3, -0x18(%rbp)
jne 0x52300
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x15338f(%rip), %rsi    # 0x1a5688
callq 0x15aa30
jmp 0x52333
cmpq $-0x4, -0x18(%rbp)
jne 0x5231d
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x153370(%rip), %rsi    # 0x1a5686
callq 0x15aa30
jmp 0x52331
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x165901(%rip), %rsi    # 0x1b7c2d
callq 0x15aa30
jmp 0x52333
jmp 0x52335
jmp 0x52337
jmp 0x52339
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: dump_fat
static void dump_fat(deark *c, lctx *d)
{
	i64 i;
	i64 sec_id;
	char buf[80];

	if(c->debug_level<2) return;

	de_dbg2(c, "dumping FAT contents (%d entries)", (int)d->num_fat_entries);

	de_dbg_indent(c, 1);
	for(i=0; i<d->num_fat_entries; i++) {
		sec_id = dbuf_geti32le(d->fat, i*4);
		describe_sec_id(c, d, sec_id, buf, sizeof(buf));
		de_dbg2(c, "FAT[%d]: next_SecID=%d (%s)", (int)i, (int)sec_id, buf);
	}
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jge 0x523ae
jmp 0x52463
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movl %eax, %edx
leaq 0x15338f(%rip), %rsi    # 0x1a5752
movb $0x0, %al
callq 0x15b350
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jge 0x52455
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x165600
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movl $0x50, %r8d
callq 0x52250
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq -0x70(%rbp), %r8
leaq 0x153334(%rip), %rsi    # 0x1a5774
movb $0x0, %al
callq 0x15b350
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x523e0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: get_next_sec_id
static i64 get_next_sec_id(deark *c, lctx *d, i64 cur_sec_id)
{
	i64 next_sec_id;

	if(cur_sec_id < 0) return -2;
	if(!d->fat) return -2;
	next_sec_id = dbuf_geti32le(d->fat, cur_sec_id*4);
	return next_sec_id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x52495
movq $-0x2, -0x8(%rbp)
jmp 0x524d1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x524ad
movq $-0x2, -0x8(%rbp)
jmp 0x524d1
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x20(%rbp), %rsi
shlq $0x2, %rsi
callq 0x165600
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: dump_minifat
static void dump_minifat(deark *c, lctx *d)
{
	i64 i;
	i64 sec_id;
	i64 num_minifat_entries;

	if(c->debug_level<2) return;
	if(!d->minifat) return;

	num_minifat_entries = d->minifat->len / 4;
	de_dbg2(c, "dumping MiniFAT contents (%d entries)", (int)num_minifat_entries);

	de_dbg_indent(c, 1);
	for(i=0; i<num_minifat_entries; i++) {
		sec_id = dbuf_geti32le(d->minifat, i*4);
		de_dbg2(c, "MiniFAT[%d]: next_MiniSecID=%d", (int)i, (int)sec_id);
	}
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jge 0x524fe
jmp 0x525bc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
jne 0x52511
jmp 0x525bc
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x18(%rax), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x1532b3(%rip), %rsi    # 0x1a57f2
movb $0x0, %al
callq 0x15b350
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x525ae
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x165600
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x15327f(%rip), %rsi    # 0x1a5818
movb $0x0, %al
callq 0x15b350
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x5255c
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/cfb.c
// Function: do_before_reading_directory_entries
static void do_before_reading_directory_entries(deark *c, lctx *d)
{
	i64 i;

	// Stores some extra information for each directory entry, and a copy of
	// some information for convenience.
	// (The original entry is still available at d->dir[128*n].)
	d->dir_entry = de_mallocarray(c, d->num_dir_entries, sizeof(struct dir_entry_info));

	// Set defaults for each entry
	for(i=0; i<d->num_dir_entries; i++) {
		d->dir_entry[i].child_id = -1;
		d->dir_entry[i].sibling_id[0] = -1;
		d->dir_entry[i].sibling_id[1] = -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
movl $0x88, %edx
callq 0x15c450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jge 0x5267f
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
imulq $0x88, -0x18(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, 0x6c(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x5260c
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_analyze_dir_structure
static void do_analyze_dir_structure(deark *c, lctx *d)
{
	de_dbg_indent(c, 1);

	if(d->dump_dir_structure) do_dump_dir_structure(c, d);

	if(d->num_dir_entries<1) goto done;

	// The first entry should be the root entry.
	if(d->dir_entry[0].entry_type!=OBJTYPE_ROOT_STORAGE) goto done;

	// Its child is one of the entries in the root directory. Start with it.
	do_mark_dir_entries_recursively(c, d, 0, d->dir_entry[0].child_id, 0);

	if(d->dump_dir_structure) do_dump_dir_structure(c, d);
done:
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
cmpb $0x0, 0xe(%rax)
je 0x52ac5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x533a0
movq -0x10(%rbp), %rax
cmpq $0x1, 0x70(%rax)
jge 0x52ad2
jmp 0x52b22
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
je 0x52ae8
jmp 0x52b22
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movl 0x64(%rax), %ecx
xorl %r8d, %r8d
movl %r8d, %edx
callq 0x535b0
movq -0x10(%rbp), %rax
cmpb $0x0, 0xe(%rax)
je 0x52b20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x533a0
jmp 0x52b22
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_finalize_format_detection
static void do_finalize_format_detection(deark *c, lctx *d)
{
	d->subformat_final = SUBFMT_RAW; // default

	if(d->subformat_req!=SUBFMT_AUTO) {
		d->subformat_final = d->subformat_req;
		goto done;
	}

	if(!d->could_be_thumbsdb) goto done;

	if(d->thumbsdb_old_names_found>0 && !d->thumbsdb_catalog_found)
	{
		d->could_be_thumbsdb = 0;
	}
	else if(d->thumbsdb_old_names_found + d->thumbsdb_new_names_found +
		d->thumbsdb_catalog_found < 1)
	{
		d->could_be_thumbsdb = 0;
	}

	if(d->could_be_thumbsdb) {
		d->subformat_final = SUBFMT_THUMBSDB;
	}

done:
	switch(d->subformat_final) {
	case SUBFMT_THUMBSDB:
		de_declare_fmt(c, "Thumbs.db");
		d->thumbsdb_msrgba_mode = de_get_ext_option_bool(c, "cfb:msrgbamode", 1);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x52b76
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x52bfc
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb8(%rax)
jne 0x52b85
jmp 0x52bfc
movq -0x10(%rbp), %rax
cmpl $0x0, 0xbc(%rax)
jle 0x52baf
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0x52baf
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
jmp 0x52be2
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0xc0(%rcx), %eax
movq -0x10(%rbp), %rcx
addl 0xc4(%rcx), %eax
cmpl $0x1, %eax
jge 0x52be0
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
jmp 0x52be2
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb8(%rax)
je 0x52bfa
movq -0x10(%rbp), %rax
movl $0x2, 0x4(%rax)
jmp 0x52bfc
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
jne 0x52c38
jmp 0x52c0a
movq -0x8(%rbp), %rdi
leaq 0x163e42(%rip), %rsi    # 0x1b6a57
callq 0x15e380
movq -0x8(%rbp), %rdi
leaq 0x152dca(%rip), %rsi    # 0x1a59ef
movl $0x1, %edx
callq 0x15cbc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x52ff2
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x15d580
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: do_per_dir_entry_format_detection
static void do_per_dir_entry_format_detection(deark *c, lctx *d, struct dir_entry_info *dei)
{
	size_t nlen;

	if(dei->entry_type==OBJTYPE_EMPTY) return;
	if(d->subformat_req!=SUBFMT_AUTO) return;
	if(!d->could_be_thumbsdb) return;

	if(dei->entry_type==OBJTYPE_ROOT_STORAGE) {
		if(de_memcmp(dei->clsid, EMPTY_CLSID, 16)) {
			d->could_be_thumbsdb = 0;
			return;
		}
	}

	if(dei->entry_type==OBJTYPE_STORAGE) {
		// Thumbs.db files aren't expected to have any Storage objects.
		d->could_be_thumbsdb = 0;
		return;
	}
	if(dei->entry_type!=OBJTYPE_STREAM) {
		return;
	}

	nlen = dei->fname_srd->sz_utf8_strlen;
	if(nlen<1 || nlen>21) {
		d->could_be_thumbsdb = 0;
		return;
	}

	if(dei->is_thumbsdb_catalog) {
		d->thumbsdb_catalog_found++;
		return;
	}

	if(is_thumbsdb_orig_name(c, d, dei->fname_srd->sz_utf8, nlen)) {
		d->thumbsdb_old_names_found++;
		return;
	}

	if(is_thumbsdb_new_name(c, d, dei->fname_srd->sz_utf8, nlen)) {
		d->thumbsdb_new_names_found++;
		return;
	}
}

// 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
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x53026
jmp 0x5317f
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x53034
jmp 0x5317f
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb8(%rax)
jne 0x53046
jmp 0x5317f
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x5, %eax
jne 0x5308e
movq -0x18(%rbp), %rax
addq $0x30, %rax
movups (%rax), %xmm0
xorps %xmm1, %xmm1
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x5308c
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
jmp 0x5317f
jmp 0x5308e
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x530ae
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
jmp 0x5317f
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
je 0x530c0
jmp 0x5317f
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jb 0x530de
cmpq $0x15, -0x20(%rbp)
jbe 0x530f1
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
jmp 0x5317f
movq -0x18(%rbp), %rax
cmpb $0x0, 0x80(%rax)
je 0x53113
movq -0x10(%rbp), %rax
movl 0xc4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc4(%rax)
jmp 0x5317f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rcx
callq 0x53190
cmpl $0x0, %eax
je 0x5314a
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xbc(%rax)
jmp 0x5317f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rdx
movq -0x20(%rbp), %rcx
callq 0x53220
cmpl $0x0, %eax
je 0x5317f
movq -0x10(%rbp), %rax
movl 0xc0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: is_thumbsdb_orig_name
static int is_thumbsdb_orig_name(deark *c, lctx *d, const char *name, size_t nlen)
{
	size_t i;

	if(nlen<1 || nlen>6) return 0;
	for(i=0; i<nlen; i++) {
		if(name[i]<'0' || name[i]>'9') return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x1, -0x28(%rbp)
jb 0x531b2
cmpq $0x6, -0x28(%rbp)
jbe 0x531bb
movl $0x0, -0x4(%rbp)
jmp 0x5320f
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x53208
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x531ef
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jle 0x531f8
movl $0x0, -0x4(%rbp)
jmp 0x5320f
jmp 0x531fa
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x531c3
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: is_thumbsdb_new_name
static int is_thumbsdb_new_name(deark *c, lctx *d, const char *name, size_t nlen)
{
	size_t i;
	int count1 = 0;
	int found_underscore = 0;
	int count2 = 0;

	if(nlen<4 || nlen>22) return 0;
	for(i=0; i<nlen; i++) {
		if(!found_underscore && name[i]=='_') {
			found_underscore = 1;
		}
		else if(!found_underscore) {
			// pre-underscore (pixel dimension)
			if(name[i]>='0' && name[i]<='9')
				count1++;
			else
				return 0;
		}
		else {
			// post-underscore (hash?)
			if((name[i]>='0' && name[i]<='9') ||
				(name[i]>='a' && name[i]<='f'))
			{
				count2++;
			}
			else
			{
				return 0;
			}
		}
	}
	if(!found_underscore) return 0;
	if(count1<1 || count1>5) return 0;
	if(count2<1 || count2>16) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpq $0x4, -0x28(%rbp)
jb 0x53257
cmpq $0x16, -0x28(%rbp)
jbe 0x53263
movl $0x0, -0x4(%rbp)
jmp 0x5338c
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x5334c
cmpl $0x0, -0x38(%rbp)
jne 0x5329c
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5f, %eax
jne 0x5329c
movl $0x1, -0x38(%rbp)
jmp 0x53339
cmpl $0x0, -0x38(%rbp)
jne 0x532dd
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x532cf
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jg 0x532cf
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x532db
movl $0x0, -0x4(%rbp)
jmp 0x5338c
jmp 0x53337
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x532ff
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jle 0x53321
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x61, %eax
jl 0x5332c
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x66, %eax
jg 0x5332c
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x53335
movl $0x0, -0x4(%rbp)
jmp 0x5338c
jmp 0x53337
jmp 0x53339
jmp 0x5333b
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x5326b
cmpl $0x0, -0x38(%rbp)
jne 0x5335b
movl $0x0, -0x4(%rbp)
jmp 0x5338c
cmpl $0x1, -0x34(%rbp)
jl 0x53367
cmpl $0x5, -0x34(%rbp)
jle 0x53370
movl $0x0, -0x4(%rbp)
jmp 0x5338c
cmpl $0x1, -0x3c(%rbp)
jl 0x5337c
cmpl $0x10, -0x3c(%rbp)
jle 0x53385
movl $0x0, -0x4(%rbp)
jmp 0x5338c
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: identify_clsid
static void identify_clsid(deark *c, lctx *d, const u8 *clsid, char *buf, size_t buflen)
{
	const char *name = "?";
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(known_clsids); i++) {
		u8 tmpclsid[16];
		unsigned int k;
		const struct clsid_id_struct *ci = &known_clsids[i];

		de_memcpy(tmpclsid, clsid, 16);
		for(k=0; k<16; k++) {
			if((ci->mask & (1<<(15-k)))==0) {
				tmpclsid[k] = 0x00;
			}
		}
		if(!de_memcmp(tmpclsid, ci->clsid, 16)) {
			name = ci->name;
			break;
		}
	}
	de_snprintf(buf, buflen, " (%s)", name);
}

// 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)
leaq 0x16448a(%rip), %rax    # 0x1b7c2d
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0xc, -0x38(%rbp)
jae 0x5386b
movq -0x38(%rbp), %rcx
leaq 0x1c225b(%rip), %rax    # 0x215a20
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $0x10, -0x54(%rbp)
jae 0x53824
movq -0x60(%rbp), %rax
movl 0x10(%rax), %eax
movl $0xf, %ecx
subl -0x54(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x53817
movl -0x54(%rbp), %eax
movb $0x0, -0x50(%rbp,%rax)
jmp 0x53819
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x537ea
leaq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x53858
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x5386b
jmp 0x5385a
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x537af
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq 0x16406c(%rip), %rdx    # 0x1b78ea
movb $0x0, %al
callq 0x15a980
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: read_mini_sector_stream
static void read_mini_sector_stream(deark *c, lctx *d, i64 first_sec_id, i64 stream_size)
{
	if(d->mini_sector_stream) return; // Already done

	de_dbg(c, "reading mini sector stream (%d bytes)", (int)stream_size);
	d->mini_sector_stream = dbuf_create_membuf(c, 0, 0);
	copy_normal_stream_to_dbuf(c, d, first_sec_id, 0, stream_size, d->mini_sector_stream);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x53918
jmp 0x53971
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x15217f(%rip), %rsi    # 0x1a5aa8
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x168020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %r8
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %r9
xorl %eax, %eax
movl %eax, %ecx
callq 0x54290
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
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)
cmpq $0x0, -0x28(%rbp)
jg 0x542bc
jmp 0x543c3
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x542e6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
jle 0x543c3
cmpq $0x0, -0x38(%rbp)
jge 0x54315
jmp 0x543c3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x52340
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jle 0x5434c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
subq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jle 0x5436e
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x50(%rbp), %rsi
addq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x166070
movq -0x58(%rbp), %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x52470
movq %rax, -0x38(%rbp)
jmp 0x542fe
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: copy_mini_stream_to_dbuf
static void copy_mini_stream_to_dbuf(deark *c, lctx *d, i64 first_minisec_id,
	i64 stream_startpos, i64 stream_size,
	dbuf *outf)
{
	i64 minisec_id;
	i64 bytes_left_to_copy;
	i64 bytes_left_to_skip;

	if(!d->mini_sector_stream) return;
	if(stream_size<=0 || stream_size>c->infile->len ||
		stream_size>d->mini_sector_stream->len)
	{
		return;
	}

	bytes_left_to_copy = stream_size;
	bytes_left_to_skip = stream_startpos;
	minisec_id = first_minisec_id;
	while(bytes_left_to_copy > 0) {
		i64 minisec_offs;
		i64 bytes_to_copy;
		i64 bytes_to_skip;

		if(minisec_id<0) break;
		minisec_offs = minisec_id * d->mini_sector_size;

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

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

		dbuf_copy(d->mini_sector_stream, minisec_offs + bytes_to_skip, bytes_to_copy, outf);

		bytes_left_to_copy -= bytes_to_copy;
		bytes_left_to_skip -= bytes_to_skip;
		minisec_id = get_next_minisec_id(c, d, minisec_id);
	}
}

// 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)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x54483
jmp 0x54592
cmpq $0x0, -0x28(%rbp)
jle 0x544b1
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x544b1
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xa0(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x544b6
jmp 0x54592
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
jle 0x54592
cmpq $0x0, -0x38(%rbp)
jge 0x544e5
jmp 0x54592
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
imulq 0x50(%rcx), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jle 0x54518
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
subq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jle 0x5453a
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
movq -0x50(%rbp), %rsi
addq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x166070
movq -0x58(%rbp), %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x545a0
movq %rax, -0x38(%rbp)
jmp 0x544ce
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cfb.c
// Function: get_next_minisec_id
static i64 get_next_minisec_id(deark *c, lctx *d, i64 cur_minisec_id)
{
	i64 next_minisec_id;

	if(cur_minisec_id < 0) return -2;
	if(!d->minifat) return -2;
	next_minisec_id = dbuf_geti32le(d->minifat, cur_minisec_id*4);
	return next_minisec_id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x545c5
movq $-0x2, -0x8(%rbp)
jmp 0x54601
movq -0x18(%rbp), %rax
cmpq $0x0, 0x88(%rax)
jne 0x545dd
movq $-0x2, -0x8(%rbp)
jmp 0x54601
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x20(%rbp), %rsi
shlq $0x2, %rsi
callq 0x165600
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)