LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %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
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165280
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x499f6
cmpq $0x0, -0x38(%rbp)
jne 0x499f6
leaq -0x80(%rbp), %rdi
movl $0x40, %esi
leaq 0x1741b6(%rip), %rdx    # 0x1bdba3
movb $0x0, %al
callq 0x15a980
jmp 0x49a6d
movq -0x18(%rbp), %rax
cmpb $0x0, 0x10(%rax)
je 0x49a3e
movq -0x38(%rbp), %rax
shlq $0x10, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x15d530
movq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
jmp 0x49a6b
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x15d750
movq -0x28(%rbp), %rax
movb $0x2, 0x1(%rax)
movq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
jmp 0x49a6d
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x80(%rbp), %rcx
leaq 0x15a7c3(%rip), %rsi    # 0x1a4243
movb $0x0, %al
callq 0x15b0d0
addq $0x90, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: fixup_path
static void fixup_path(de_ucstring *s)
{
	i64 i;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x49ae3
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpl $0x5c, (%rax,%rcx,4)
jne 0x49ad3
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl $0x2f, (%rax,%rcx,4)
jmp 0x49ad5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x49aa0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: handle_comment
static void handle_comment(deark *c, lctx *d, struct member_data *md, i64 pos,
	i64 nbytes_avail)
{
	de_ucstring *s = NULL;
	dbuf *outf = NULL;

	if(nbytes_avail<2) goto done;
	s = ucstring_create(c);
	// The header containing the comment is limited to about 2.5KB, so we don't have
	// to check sizes here.
	dbuf_read_to_ucstring(d->inf, pos, nbytes_avail, s, DE_CONVFLAG_STOP_AT_NUL,
		DE_EXTENC_MAKE(md->input_encoding, DE_ENCSUBTYPE_HYBRID));
	if(s->len<1) goto done;
	de_dbg(c, "comment: \"%s\"", ucstring_getpsz_d(s));

	if(c->extract_level>=2) {
		const char *token;

		if(md->objtype==ARJ_OBJTYPE_MAINHDR) token = "comment.txt";
		else token = "fcomment.txt";

		outf = dbuf_create_output_file(c, token, NULL, DE_CREATEFLAG_IS_AUX);
		ucstring_write_as_utf8(c, s, outf, 1);
	}

done:
	dbuf_close(outf);
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x2, -0x28(%rbp)
jge 0x49b28
jmp 0x49bff
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movl (%rax), %r9d
andl $0xff, %r9d
orl $0x300, %r9d            # imm = 0x300
movl $0x1, %r8d
callq 0x1669f0
movq -0x30(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jge 0x49b78
jmp 0x49bff
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x156ab5(%rip), %rsi    # 0x1a064c
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
cmpl $0x2, 0x90(%rax)
jl 0x49bfd
movq -0x18(%rbp), %rax
cmpl $0x64, 0x8(%rax)
jne 0x49bc2
leaq 0x15a694(%rip), %rax    # 0x1a4250
movq %rax, -0x40(%rbp)
jmp 0x49bcd
leaq 0x15a686(%rip), %rax    # 0x1a424f
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x166c60
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl $0x1, %ecx
callq 0x172150
jmp 0x49bff
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: acquire_logical_member
static void acquire_logical_member(deark *c, lctx *d, struct member_data *md)
{
	u8 need_incomplete_wflag = 0;

	if(d->clm) {
		u8 use_current_item = 1;

		// We already have a logical member. Try to figure out if it's
		// the right one.
		// TODO?: We're not doing much validation of this, but the format
		// doesn't offer a nice way to do it. Maybe we should do more,
		// such as checking the filename.

		if(!md->cont_from_prev_vol) {
			use_current_item = 0;
		}

		if(use_current_item) {
			if(md->extfile_pos != d->clm->total_orig_len) {
				use_current_item = 0;
			}
		}

		if(!use_current_item) {
			arj_logical_member_finish_and_free(c, d, 1);
		}
	}
	else {
		if(md->cont_from_prev_vol) {
			// Non-initial fragment, but no previous fragment
			if(d->mp_opt_used) {
				de_err(c, "%s: Missing initial part of fragmented file",
					ucstring_getpsz_d(md->name_srd->str));
				md->errflag = 1;
			}
			else {
				de_warn(c, "%s: Incomplete file; use \"-mp\" for multi-volume support",
					ucstring_getpsz_d(md->name_srd->str));
				need_incomplete_wflag = 1;
			}
		}
	}

	if(!d->clm) {
		arj_logical_member_create(c, d);
		ucstring_append_ucstring(d->clm->filename, md->name_srd->str);
	}
	if(need_incomplete_wflag) {
		d->clm->warned_incomplete = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x4a484
movb $0x1, -0x1a(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x1b(%rax)
jne 0x4a445
movb $0x0, -0x1a(%rbp)
cmpb $0x0, -0x1a(%rbp)
je 0x4a467
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq 0x18(%rcx), %rax
je 0x4a465
movb $0x0, -0x1a(%rbp)
jmp 0x4a467
cmpb $0x0, -0x1a(%rbp)
jne 0x4a47f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x47e00
jmp 0x4a50c
movq -0x18(%rbp), %rax
cmpb $0x0, 0x1b(%rax)
je 0x4a50a
movq -0x10(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0x4a4d3
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x159ebe(%rip), %rsi    # 0x1a4380
movb $0x0, %al
callq 0x15bfb0
movq -0x18(%rbp), %rax
movb $0x1, 0xc(%rax)
jmp 0x4a508
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x159eaf(%rip), %rsi    # 0x1a43ac
movb $0x0, %al
callq 0x15bc10
movb $0x1, -0x19(%rbp)
jmp 0x4a50a
jmp 0x4a50c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x4a544
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4a850
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x171460
cmpb $0x0, -0x19(%rbp)
je 0x4a556
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movb $0x1, 0x10(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x18(%rbp), %rax
movzbl 0xe(%rax), %eax
cmpl $0x33, %eax
jne 0x4a5a6
movl $0x7, -0x40(%rbp)
jmp 0x4a5ad
movl $0x6, -0x40(%rbp)
movb $0x0, -0x3a(%rbp)
movb $0x3, -0x3c(%rbp)
movb $0x1, -0x3b(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x17ecb0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x159e03(%rip), %rsi    # 0x1a43e4
movb $0x0, %al
callq 0x15b400
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x4a63f
cmpq $0x6800, -0x38(%rbp)    # imm = 0x6800
jle 0x4a63d
movq -0x18(%rbp), %rax
movzbl 0xe(%rax), %eax
cmpl $0xb, %eax
jg 0x4a63d
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0x48(%rbp), %rdi
movq %rax, %rdx
movq -0x38(%rbp), %rcx
leaq 0x159dbc(%rip), %rsi    # 0x1a43f2
movb $0x0, %al
callq 0x15bc10
jmp 0x4a63f
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x4a8d9
jmp 0x4a92d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0x8(%rax)
je 0x4a90b
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jl 0x4a909
movq -0x18(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0x4a92d
jmp 0x4a90b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movzbl -0x9(%rbp), %esi
callq 0x168380
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: method4_read_a_length_code
static UI method4_read_a_length_code(struct method4_ctx *cctx)
{
	UI onescount = 0;
	UI n;

	// Read up to 7 bits, counting the number of 1 bits, stopping after the first 0.
	while(1) {
		n = (UI)de_bitreader_getbits(&cctx->bitrd, 1);
		if(n==0) break;
		onescount++;
		if(onescount>=7) {
			if(cctx->old_format) {
				// A small hack for ARJ v0.13-0.14.
				// Seems to work, but not extensively tested.
				// This extra bit is presumed to be 0. I don't know what
				// happens if it's 1.
				(void)de_bitreader_getbits(&cctx->bitrd, 1);
			}
			break;
		}
	}
	// However many ones there were, read that number of bits.
	if(onescount==0) return 0;
	n = (UI)de_bitreader_getbits(&cctx->bitrd, onescount);
	return (1U<<onescount)-1 + n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %esi
callq 0x16a390
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x4a970
jmp 0x4a99f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x7, -0x14(%rbp)
jb 0x4a99d
movq -0x10(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x4a99b
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %esi
callq 0x16a390
jmp 0x4a99f
jmp 0x4a953
cmpl $0x0, -0x14(%rbp)
jne 0x4a9ae
movl $0x0, -0x4(%rbp)
jmp 0x4a9d4
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x14(%rbp), %esi
callq 0x16a390
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: method4_read_an_offset
static UI method4_read_an_offset(struct method4_ctx *cctx)
{
	UI onescount = 0;
	UI n;

	// Read up to 4 bits, counting the number of 1 bits, stopping after the first 0.
	while(1) {
		n = (UI)de_bitreader_getbits(&cctx->bitrd, 1);
		if(n==0) break;
		onescount++;
		if(onescount>=4) {
			if(cctx->old_format) {
				(void)de_bitreader_getbits(&cctx->bitrd, 1);
			}
			break;
		}
	}

	// Read {9 + the number of 1 bits} more bits.
	n = (UI)de_bitreader_getbits(&cctx->bitrd, 9+onescount);
	return (1U<<(9+onescount))-512 + n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %esi
callq 0x16a390
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x4aa10
jmp 0x4aa3f
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jb 0x4aa3d
movq -0x8(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x4aa3b
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %esi
callq 0x16a390
jmp 0x4aa3f
jmp 0x4a9f3
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movl -0xc(%rbp), %esi
addl $0x9, %esi
callq 0x16a390
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %ecx
addl $0x9, %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x200, %eax            # imm = 0x200
addl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/arj.c
// Function: report_extra_bytes
static void report_extra_bytes(deark *c, lctx *d, i64 main_endpos)
{
	i64 num_extra_bytes;
	i64 max_pos;

	if(d->cv->arjprot_flag) {
		return; // This check is not implemented in this situation.
	}

	max_pos = main_endpos;
	if(d->cv->security_envelope_len>0) {
		max_pos = de_max_int(max_pos, d->cv->security_envelope_pos+d->cv->security_envelope_len);
	}

	num_extra_bytes = d->inf->len - max_pos;
	if(num_extra_bytes>1) {
		de_dbg(c, "[%"I64_FMT" extra bytes at EOF, starting at %"I64_FMT"]", num_extra_bytes, max_pos);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpb $0x0, 0x1b(%rax)
je 0x4aa94
jmp 0x4ab04
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x28(%rax)
jle 0x4aad0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq 0x28(%rax), %rsi
callq 0x15cd20
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jle 0x4ab04
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x15995f(%rip), %rsi    # 0x1a445c
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x159b24(%rip), %rcx    # 0x1a464b
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x159a23(%rip), %rcx    # 0x1a4558
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x156695(%rip), %rcx    # 0x1a11d9
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
leaq 0x1d(%rip), %rcx        # 0x4ab70
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x5e(%rip), %rcx        # 0x4abc0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bpg.c
// Function: de_run_bpg
static void de_run_bpg(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));

	do_hevc_file(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 $0x38, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4ac10
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x165060
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x5, -0x24(%rbp)
jg 0x4af3c
movq -0x20(%rbp), %rax
shlq $0x7, %rax
movzbl -0x11(%rbp), %ecx
andl $0x7f, %ecx
movslq %ecx, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x80, %eax
jge 0x4af49
jmp 0x4af4b
jmp 0x4aeef
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bpg.c
// Function: do_extensions
static void do_extensions(deark *c, lctx *d, i64 pos)
{
	i64 endpos;
	i64 tag;
	i64 payload_len;

	endpos = pos + d->extension_data_len;

	while(pos < endpos) {
		tag = get_ue7(c, &pos);
		payload_len = get_ue7(c, &pos);
		if(pos+payload_len>endpos) break;

		switch(tag) {
		case 1: // Exif
			do_exif(c, d, pos, payload_len);
			break;
		case 2: // ICC profile
			dbuf_create_file_from_slice(c->infile, pos, payload_len, "icc", NULL, DE_CREATEFLAG_IS_AUX);
			break;
		case 3: // XMP
			dbuf_create_file_from_slice(c->infile, pos, payload_len, "xmp", NULL, DE_CREATEFLAG_IS_AUX);
			break;
		case 4: // Thumbnail
			dbuf_create_file_from_slice(c->infile, pos, payload_len, "thumb.bpg", NULL, DE_CREATEFLAG_IS_AUX);
			break;
		default:
			de_dbg(c, "unrecognized extension type: %d", (int)tag);
		}

		pos += payload_len;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x30(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x4b0ae
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4aed0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4aed0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jle 0x4afc7
jmp 0x4b0ae
movq -0x28(%rbp), %rax
decq %rax
movq %rax, -0x38(%rbp)
subq $0x3, %rax
ja 0x4b085
movq -0x38(%rbp), %rax
leaq 0x159561(%rip), %rcx    # 0x1a4548
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x4b0c0
jmp 0x4b09d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x1569c4(%rip), %rcx    # 0x1a19e5
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
jmp 0x4b09d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x17837c(%rip), %rcx    # 0x1c33c6
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
jmp 0x4b09d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x1595d2(%rip), %rcx    # 0x1a4645
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
jmp 0x4b09d
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x1595b9(%rip), %rsi    # 0x1a464f
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x4af84
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bpg.c
// Function: do_exif
static void do_exif(deark *c, lctx *d, i64 pos1, i64 len1)
{
	u8 buf[3];
	i64 pos = pos1;
	i64 len = len1;

	if(len1<8) return;
	de_read(buf, pos1, 3);
	if(buf[0]==0 && (buf[1]=='M' || buf[1]=='I') && buf[2]==buf[1]) {
		de_warn(c, "Ignoring initial NUL byte in Exif data (libbpg bug?)");
		pos++;
		len--;
	}
	fmtutil_handle_exif(c, pos, len);
}

// 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 -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x8, -0x20(%rbp)
jge 0x4b0f1
jmp 0x4b16d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x23(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x3, %ecx
callq 0x164d10
movzbl -0x23(%rbp), %eax
cmpl $0x0, %eax
jne 0x4b15c
movzbl -0x22(%rbp), %eax
cmpl $0x4d, %eax
je 0x4b126
movzbl -0x22(%rbp), %eax
cmpl $0x49, %eax
jne 0x4b15c
movzbl -0x21(%rbp), %eax
movzbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4b15c
movq -0x8(%rbp), %rdi
leaq 0x159532(%rip), %rsi    # 0x1a466f
movb $0x0, %al
callq 0x15bc10
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x1736c0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x159512(%rip), %rcx    # 0x1a46a9
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x15950a(%rip), %rcx    # 0x1a46af
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x4b1e0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x33d(%rip), %rcx       # 0x4b500
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x38e(%rip), %rcx       # 0x4b560
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: de_identify_bsave
static int de_identify_bsave(deark *c)
{
	struct bsave_id_info idi;

	// Note - Make sure XZ has higher confidence.
	// Note - Make sure BLD has higher confidence.
	// Note - See also bsave_cmpr module.
	identify_bsave_internal(c, &idi);
	if(!idi.might_be_bsave) return 0;
	if(idi.probably_not_bsave) return 0;

	if(idi.pcpaint_sig_found) {
		return 91;
	}
	return 10;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4b5f0
cmpb $0x0, -0x20(%rbp)
jne 0x4b528
movl $0x0, -0x4(%rbp)
jmp 0x4b54d
cmpb $0x0, -0x1f(%rbp)
je 0x4b537
movl $0x0, -0x4(%rbp)
jmp 0x4b54d
cmpb $0x0, -0x1e(%rbp)
je 0x4b546
movl $0x5b, -0x4(%rbp)
jmp 0x4b54d
movl $0xa, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x1595cf(%rip), %rsi    # 0x1a4b46
movb $0x0, %al
callq 0x15c190
movq $0x0, -0x10(%rbp)
cmpq $0xd, -0x10(%rbp)
jae 0x4b5e6
movq -0x10(%rbp), %rcx
leaq 0x1ca2e8(%rip), %rax    # 0x215880
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x4b5b6
jmp 0x4b5d8
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0x159588(%rip), %rsi    # 0x1a4b59
movb $0x0, %al
callq 0x15c190
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x4b586
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0xc, 0x18(%rax)
jge 0x4b624
jmp 0x4b71d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0xfd, %eax
je 0x4b644
jmp 0x4b71d
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x1, %esi
callq 0x165280
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x5, %esi
callq 0x165280
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x4b695
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x4b71d
cmpq $0x0, -0x20(%rbp)
jne 0x4b6a6
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x4b71d
cmpl $0xb800, -0x14(%rbp)    # imm = 0xB800
jne 0x4b703
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x1f55, 0x18(%rax)     # imm = 0x1F55
jl 0x4b703
movq $0x1f47, -0x28(%rbp)    # imm = 0x1F47
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq 0x1d9f14(%rip), %rdx    # 0x2255f0
movl $0xb, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x4b701
movq -0x10(%rbp), %rax
movb $0x1, 0x2(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x4b71d
jmp 0x4b703
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x4b71d
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: bsave_fmt_name_to_id
static UI bsave_fmt_name_to_id(const char *name)
{
	size_t k;

	if(!name) return FMT_UNKNOWN;

	for(k=0; k<DE_ARRAYCOUNT(bsave_fmt_arr); k++) {
		const struct bsave_fmt_arr_item *item;

		item = &bsave_fmt_arr[k];
		if(!de_strcmp(name, item->name)) {
			return item->fmt_id;
		}
	}
	return FMT_UNKNOWN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4b74c
movl $0x0, -0x4(%rbp)
jmp 0x4b7a9
movq $0x0, -0x18(%rbp)
cmpq $0xd, -0x18(%rbp)
jae 0x4b7a2
movq -0x18(%rbp), %rcx
leaq 0x1ca11a(%rip), %rax    # 0x215880
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x191a0
cmpl $0x0, %eax
jne 0x4b792
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x4b7a9
jmp 0x4b794
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x4b754
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: collect_metrics
static void collect_metrics(deark *c, lctx *d)
{
	int eof_present = 0;

	d->metrics.nbytes_after_data = c->infile->len - (BSAVE_HDRSIZE + d->data_size);
	d->metrics.maybe_bitsperrow = de_getu16le(7);
	d->metrics.maybe_nrows = de_getu16le(9);
	d->metrics.maybe_bytesperrow = (d->metrics.maybe_bitsperrow+7)/8;

	if(d->metrics.nbytes_after_data>=0) {
		eof_present = (de_getbyte(BSAVE_HDRSIZE+d->data_size) == 0x1a);
	}

	if(eof_present) {
		int eof_is_last_byte;
		u8 byte_before_eof;

		eof_is_last_byte = (c->infile->len == BSAVE_HDRSIZE+d->data_size+1);
		byte_before_eof = de_getbyte(BSAVE_HDRSIZE+d->data_size-1);

		if(eof_is_last_byte && byte_before_eof!=0x1a) {
			d->metrics.eof_marker_quality = 4;
		}
		else if(eof_is_last_byte) {
			d->metrics.eof_marker_quality = 3;
		}
		else if(byte_before_eof!=0x1a) {
			d->metrics.eof_marker_quality = 2;
		}
		else {
			d->metrics.eof_marker_quality = 1;
		}
	}

	de_dbg2(c, "file/data size discrepancy: %"I64_FMT, d->metrics.nbytes_after_data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x7, %rax
subq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x458(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x7, %esi
callq 0x165280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x440(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x9, %esi
callq 0x165280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x448(%rax)
movq -0x10(%rbp), %rax
movq 0x440(%rax), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x450(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x458(%rax)
jl 0x4b89c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x7, %rsi
callq 0x165060
movzbl %al, %eax
cmpl $0x1a, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4b952
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
addq $0x7, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x7, %rsi
subq $0x1, %rsi
callq 0x165060
movb %al, -0x19(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x4b90f
movzbl -0x19(%rbp), %eax
cmpl $0x1a, %eax
je 0x4b90f
movq -0x10(%rbp), %rax
movl $0x4, 0x460(%rax)
jmp 0x4b950
cmpl $0x0, -0x18(%rbp)
je 0x4b925
movq -0x10(%rbp), %rax
movl $0x3, 0x460(%rax)
jmp 0x4b94e
movzbl -0x19(%rbp), %eax
cmpl $0x1a, %eax
je 0x4b93e
movq -0x10(%rbp), %rax
movl $0x2, 0x460(%rax)
jmp 0x4b94c
movq -0x10(%rbp), %rax
movl $0x1, 0x460(%rax)
jmp 0x4b94e
jmp 0x4b950
jmp 0x4b952
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x458(%rax), %rdx
leaq 0x159101(%rip), %rsi    # 0x1a4a69
movb $0x0, %al
callq 0x15b350
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: read_pcpaint_palinfo
static void read_pcpaint_palinfo(deark *c, lctx *d, struct bsave_id_info *idi)
{
	i64 pos;

	if(!idi->pcpaint_sig_found) return;
	pos = idi->pcpaint_sig_pos;
	d->have_pcpaint_palinfo = 1;
	de_dbg(c, "PCPaint settings found at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	pos += 12;
	d->pcpaint_pal_num = de_getbyte_p(&pos);
	de_dbg(c, "palette: %u", (UI)d->pcpaint_pal_num);
	d->pcpaint_border_col = de_getbyte_p(&pos);
	de_dbg(c, "border color: %u", (UI)d->pcpaint_border_col);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x2(%rax)
jne 0x4b9a3
jmp 0x4ba60
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x1590c0(%rip), %rsi    # 0x1a4a89
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x20(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1c(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x1c(%rax), %edx
leaq 0x157510(%rip), %rsi    # 0x1a2f27
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1d(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x1d(%rax), %edx
leaq 0x15905c(%rip), %rsi    # 0x1a4aa7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x4ba8b
jmp 0x4bb05
movl -0x14(%rbp), %edi
callq 0x4cef0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x4bb05
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x4(%rax), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2d(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x4(%rax), %edx
andl $0x2, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: do_read_palette_file
static int do_read_palette_file(deark *c, lctx *d, const char *palfn)
{
	dbuf *f = NULL;
	int retval = 0;
	i64 i;
	u8 buf[3];

	de_dbg(c, "reading palette file %s", palfn);

	f = dbuf_open_input_file(c, palfn);
	if(!f) {
		de_err(c, "Cannot read palette file %s", palfn);
		goto done;
	}

	for(i=0; i<256; i++) {
		dbuf_read(f, buf, BSAVE_HDRSIZE + 3*i, 3);
		d->pal[i] = DE_MAKE_RGB(de_scale_63_to_255(buf[0]),
			de_scale_63_to_255(buf[1]),
			de_scale_63_to_255(buf[2]));
	}
	d->pal_valid = 1;

	retval = 1;
done:
	dbuf_close(f);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x158e00(%rip), %rsi    # 0x1a4b12
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x168de0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4bd4c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x158dea(%rip), %rsi    # 0x1a4b2a
movb $0x0, %al
callq 0x15bfb0
jmp 0x4bde6
movq $0x0, -0x30(%rbp)
cmpq $0x100, -0x30(%rbp)     # imm = 0x100
jge 0x4bdd4
movq -0x20(%rbp), %rdi
leaq -0x33(%rbp), %rsi
imulq $0x3, -0x30(%rbp), %rdx
addq $0x7, %rdx
movl $0x3, %ecx
callq 0x164d10
movzbl -0x33(%rbp), %edi
callq 0x161710
movzbl %al, %eax
shll $0x10, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
movl %eax, -0x3c(%rbp)
movzbl -0x32(%rbp), %edi
callq 0x161710
movb %al, %cl
movl -0x3c(%rbp), %eax
movzbl %cl, %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x38(%rbp)
movzbl -0x31(%rbp), %edi
callq 0x161710
movl -0x38(%rbp), %edx
movzbl %al, %eax
orl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movl %edx, 0x3c(%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4bd54
movq -0x10(%rbp), %rax
movl $0x1, 0x38(%rax)
movl $0x1, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1676a0
movl -0x24(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x7, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2d(%rax)
je 0x4c826
movq -0x10(%rbp), %rax
movq 0x450(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x448(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x4c863
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x140, %edx            # imm = 0x140
callq 0x4cc30
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cqto
idivq -0x18(%rbp)
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4cca0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x15bba0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x4c8a0
movq -0x10(%rbp), %rcx
addq $0x3c, %rcx
movl $0x28, %edi
xorl %r9d, %r9d
xorl %eax, %eax
movl %eax, %edx
movl $0x100, %r8d            # imm = 0x100
movl %r9d, %esi
callq 0x161320
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x4c8b8
jmp 0x4c910
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x3, %ecx
callq 0x16b750
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %r8
addq $0x3c, %r8
movq -0x30(%rbp), %r9
movl $0x8, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x16afd0
movq -0x30(%rbp), %rdi
callq 0x16af60
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x7, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x440(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x448(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x15bba0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x4c996
jmp 0x4ca39
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x3, %ecx
callq 0x16b750
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rcx
addq $0x3c, %rcx
movl $0x14, %edi
xorl %r9d, %r9d
xorl %eax, %eax
movl %eax, %edx
movl $0x10, %r8d
movl %r9d, %esi
callq 0x161320
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x10(%rbp), %r9
addq $0x3c, %r9
movq -0x18(%rbp), %rax
movl $0x4, %edx
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x16c690
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x16afd0
movq -0x18(%rbp), %rdi
callq 0x16af60
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x140, -0x20(%rbp)     # imm = 0x140
movq -0x20(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x2, %rax
cqto
idivq -0x50(%rbp)
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x15bba0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x4cacc
jmp 0x4cc0e
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x3, %ecx
callq 0x16b750
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x4cbff
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x50(%rbp), %rax
jge 0x4cbec
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
imulq -0x40(%rbp), %rax
addq $0x7, %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x68(%rbp), %rax
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq -0x60(%rbp), %rax
addq %rdx, %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rdx, %rcx
movq -0x58(%rbp), %rdx
movl $0x2, %esi
callq 0x16b8d0
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
shlq %rsi
movq -0x38(%rbp), %rdx
movslq -0x14(%rbp), %rcx
leaq 0x157fd3(%rip), %rax    # 0x1a4b80
movl (%rax,%rcx,4), %ecx
callq 0x16b310
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
shlq %rsi
addq $0x1, %rsi
movq -0x38(%rbp), %rdx
movslq -0x14(%rbp), %rcx
leaq 0x157fbd(%rip), %rax    # 0x1a4b90
movl (%rax,%rcx,4), %ecx
callq 0x16b310
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4cb04
jmp 0x4cbee
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4caee
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x16afd0
movq -0x48(%rbp), %rdi
callq 0x16af60
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bsave.c
// Function: get_width
static i64 get_width(deark *c, lctx *d, i64 default_width)
{
	const char *s;
	s = de_get_ext_option(c, "bsave:width");
	if(!s) s = de_get_ext_option(c, "width");
	if(s) return de_atoi64(s);
	return default_width;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x157d80(%rip), %rsi    # 0x1a49cf
callq 0x15cb30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4cc73
movq -0x10(%rbp), %rdi
leaq 0x16408d(%rip), %rsi    # 0x1b0cf7
callq 0x15cb30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4cc89
movq -0x28(%rbp), %rdi
callq 0x15ccc0
movq %rax, -0x8(%rbp)
jmp 0x4cc91
movq -0x20(%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/bsave.c
// Function: get_height
static i64 get_height(deark *c, lctx *d, i64 default_height)
{
	const char *s;
	s = de_get_ext_option(c, "bsave:height");
	if(!s) s = de_get_ext_option(c, "height");
	if(s) return de_atoi64(s);
	return default_height;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x157d1c(%rip), %rsi    # 0x1a49db
callq 0x15cb30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4cce3
movq -0x10(%rbp), %rdi
leaq 0x164041(%rip), %rsi    # 0x1b0d1b
callq 0x15cb30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4ccf9
movq -0x28(%rbp), %rdi
callq 0x15ccc0
movq %rax, -0x8(%rbp)
jmp 0x4cd01
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)