LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: dmsmediumlz77_codec
static void dmsmediumlz77_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct medium_ctx *mctx = NULL;

	mctx = de_malloc(dfctx->c, sizeof(struct medium_ctx));
	mctx->c = dfctx->c;
	mctx->modname = "dmsmedium_lz77";
	mctx->dcmpro = dfctx->dcmpro;
	mctx->dres = dfctx->dres;

	dfctx->codec_private = (void*)mctx;
	dfctx->codec_addbuf_fn = mediumlz77_codec_addbuf;
	dfctx->codec_command_fn = mediumlz77_codec_command;
	dfctx->codec_destroy_fn = mediumlz77_codec_destroy;

	mctx->ringbuf = de_lz77buffer_create(dfctx->c, 16*1024);
	// The set_curpos isn't needed, but could help with debugging. It makes our
	// internal state the same as most other DMS software.
	de_lz77buffer_set_curpos(mctx->ringbuf, 0x3fbe);

	mctx->ringbuf->userdata = (void*)mctx;
	mctx->ringbuf->writebyte_cb = medium_lz77buf_writebytecb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
pushq $0x78
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq (%rbx), %rdi
movq %rdi, (%rax)
leaq 0xc9ad8(%rip), %rax     # 0x1110a0
movq %rax, 0x8(%r14)
movdqu 0x8(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%r14)
movq %r14, 0x28(%rbx)
leaq 0x22a(%rip), %rax       # 0x47811
movq %rax, 0x30(%rbx)
leaq 0x3db(%rip), %rax       # 0x479cd
movq %rax, 0x38(%rbx)
leaq 0x196(%rip), %rax       # 0x47793
movq %rax, 0x48(%rbx)
movl $0x4000, %esi           # imm = 0x4000
callq 0xef27c
movq %rax, 0x30(%r14)
movq %rax, %rdi
movl $0x3fbe, %esi           # imm = 0x3FBE
callq 0xef6f0
movq 0x30(%r14), %rax
movq %r14, (%rax)
leaq 0x19d(%rip), %rcx       # 0x477c7
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: quicklz77_codec_command
static void quicklz77_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags)
{
	struct medium_ctx *mctx = (struct medium_ctx*)dfctx->codec_private;

	if(cmd==DE_DFILTER_COMMAND_FINISH_BLOCK) {
		de_bitbuf_lowlevel_empty(&mctx->bbll);
		mctx->mdst.state = MEDLZST_NEUTRAL;
		de_lz77buffer_set_curpos(mctx->ringbuf, mctx->ringbuf->curpos + 5);
	}
	else if(cmd==DE_DFILTER_COMMAND_RESET_COUNTERS) {
		mctx->nbytes_written = 0;
		mctx->errflag = 0;
		dfctx->finished_flag = 0;
	}
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rbx
cmpl $0x4, %esi
je 0x47784
cmpl $0x3, %esi
jne 0x47791
leaq 0x38(%rbx), %rdi
callq 0xe6a40
andl $0x0, 0x48(%rbx)
movq 0x30(%rbx), %rdi
movl 0x10(%rdi), %esi
addl $0x5, %esi
popq %rbx
jmp 0xef6f0
andq $0x0, 0x28(%rbx)
andl $0x0, 0x20(%rbx)
movb $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: mediumlz77_codec_destroy
static void mediumlz77_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct medium_ctx *mctx = (struct medium_ctx*)dfctx->codec_private;

	if(mctx) {
		de_lz77buffer_destroy(dfctx->c, mctx->ringbuf);
		de_free(dfctx->c, mctx);
	}
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x477ba
movq (%rbx), %rdi
movq 0x30(%r14), %rsi
callq 0xef395
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xded32
andq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: medium_lz77buf_writebytecb
static void medium_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct medium_ctx *mctx = (struct medium_ctx *)rb->userdata;

	if(medium_have_enough_output(mctx)) {
		return;
	}
	dbuf_writebyte(mctx->dcmpro->f, n);
	mctx->nbytes_written++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0x477f6
testl %eax, %eax
jne 0x477ef
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movzbl %bpl, %esi
callq 0xe5bc5
incq 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: destroy_heavy_state
static void destroy_heavy_state(deark *c, struct dmsheavy_cmpr_state *hvst)
{
	if(!hvst) return;
	dmsheavy_discard_tree(c, &hvst->literals_tree);
	dmsheavy_discard_tree(c, &hvst->offsets_tree);
	de_lz77buffer_destroy(c, hvst->ringbuf);
}

// Assembly:
testq %rsi, %rsi
je 0x47de2
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
callq 0x47e12
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x47e12
movq 0x8(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xef395
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: lha5like_lz77buf_writebytecb
static void lha5like_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct lzh_ctx *cctx = (struct lzh_ctx*)rb->userdata;

	if(lzh_have_enough_output(cctx)) {
		return;
	}
	dbuf_writebyte(cctx->dcmpro->f, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0x47f7c
testl %eax, %eax
jne 0x47e0b
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movzbl %bpl, %esi
callq 0xe5bc5
incq 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: dmsheavy_read_tree
static int dmsheavy_read_tree(struct lzh_ctx *cctx, struct lzh_tree_wrapper *htw,
	UI ncodes_nbits, UI symlen_nbits)
{
	deark *c = cctx->c;
	UI ncodes;
	UI curr_idx;
	int retval = 0;

	if(htw->ht) goto done;

	ncodes = (UI)de_bitreader_getbits(&cctx->bitrd, ncodes_nbits);
	de_dbg2(c, "num codes: %u", ncodes);

	htw->ht = fmtutil_huffman_create_decoder(c, (i64)ncodes, (i64)ncodes);

	if(ncodes==0) {
		UI null_val;

		null_val = (UI)de_bitreader_getbits(&cctx->bitrd, ncodes_nbits);
		fmtutil_huffman_add_code(c, htw->ht->bk, 0, 0, (fmtutil_huffman_valtype)null_val);
		de_dbg3(c, "val0: %u", null_val);
		retval = 1;
		goto done;
	}

	curr_idx = 0;
	while(curr_idx < ncodes) {
		UI symlen;

		symlen = (UI)de_bitreader_getbits(&cctx->bitrd, symlen_nbits);
		de_dbg3(c, "len[%u] = %u", curr_idx, symlen);
		fmtutil_huffman_record_a_code_length(c, htw->ht->builder, (fmtutil_huffman_valtype)curr_idx, symlen);
		curr_idx++;
	}
	if(cctx->bitrd.eof_flag) goto done;

	if(!fmtutil_huffman_make_canonical_code(c, htw->ht->bk, htw->ht->builder, 0, NULL)) goto done;

	retval = 1;
done:
	if(!retval) {
		lzh_set_err_flag(cctx);
	}
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
cmpq $0x0, (%rsi)
je 0x47e5e
movb $0x1, 0x50(%r14)
movl $0x1, 0x30(%r14)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %ebp
movq %rsi, %r15
movq (%r14), %rbx
leaq 0x38(%r14), %r12
movq %r12, %rdi
movl %edx, 0x8(%rsp)
movl %edx, %esi
callq 0xe6a4a
movq %rax, %r13
leaq 0xc92c0(%rip), %rsi     # 0x111142
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde9f1
movl %r13d, %edx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf8601
movq %rax, (%r15)
movq %r13, 0x10(%rsp)
testl %r13d, %r13d
je 0x47f3b
movq %r15, %r13
movq %r14, 0x8(%rsp)
xorl %r14d, %r14d
cmpl %r14d, 0x10(%rsp)
je 0x47f09
movq %r12, %rdi
movl %ebp, %esi
callq 0xe6a4a
movq %r12, %r15
movl %ebp, %r12d
movq %rax, %rbp
movq %rbx, %rdi
leaq 0xc927c(%rip), %rsi     # 0x111159
movl %r14d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xdea83
movq (%r13), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %r12d, %ebp
movq %r15, %r12
callq 0xf82ee
incl %r14d
jmp 0x47eb9
movq 0x8(%rsp), %r14
cmpb $0x0, 0x50(%r14)
jne 0x47e40
movq (%r13), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xf8362
testl %eax, %eax
jne 0x47f74
jmp 0x47e40
movq %r12, %rdi
movl 0x8(%rsp), %esi
callq 0xe6a4a
movq %rax, %r14
movq (%r15), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0xf7e56
leaq 0xc91e9(%rip), %rsi     # 0x111150
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xdea83
pushq $0x1
popq %rax
jmp 0x47e4f
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dms.c
// Function: read_next_code_using_tree
static UI read_next_code_using_tree(struct lzh_ctx *cctx, struct lzh_tree_wrapper *tree)
{
	fmtutil_huffman_valtype val = 0;
	int ret;

	if(!tree->ht) goto done;

	ret = fmtutil_huffman_read_next_value(tree->ht->bk, &cctx->bitrd, &val, NULL);
	if(cctx->bitrd.eof_flag) {
		de_dfilter_set_errorf(cctx->c, cctx->dres, cctx->modname,
			"Unexpected end of compressed data");
		lzh_set_err_flag(cctx);
		val = 0;
		goto done;
	}
	else if(!ret) {
		de_dfilter_set_errorf(cctx->c, cctx->dres, cctx->modname,
			"Huffman decoding error");
		lzh_set_err_flag(cctx);
		val = 0;
		goto done;
	}

done:
	return (UI)val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andl $0x0, 0x4(%rsp)
movq (%rsi), %rax
testq %rax, %rax
je 0x47fee
movq %rdi, %rbx
movq 0x8(%rax), %rdi
leaq 0x38(%rbx), %rsi
xorl %r14d, %r14d
leaq 0x4(%rsp), %rdx
xorl %ecx, %ecx
callq 0xf8071
cmpb $0x0, 0x50(%rbx)
je 0x47ff3
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xc918c(%rip), %rcx     # 0x111166
xorl %eax, %eax
callq 0xee823
movb $0x1, 0x50(%rbx)
movl $0x1, 0x30(%rbx)
jmp 0x47ffc
xorl %r14d, %r14d
jmp 0x47ffc
testl %eax, %eax
je 0x48007
movl 0x4(%rsp), %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xc916f(%rip), %rcx     # 0x111188
xorl %r14d, %r14d
jmp 0x47fda
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/colorix.c
// Function: de_module_colorix
void de_module_colorix(deark *c, struct deark_module_info *mi)
{
	mi->id = "colorix";
	mi->desc = "ColoRIX";
	mi->run_fn = de_run_colorix;
	mi->identify_fn = de_identify_colorix;
}

// Assembly:
leaq 0xc918e(%rip), %rax     # 0x1111b5
movq %rax, (%rsi)
leaq 0xc918c(%rip), %rax     # 0x1111bd
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4804c
movq %rax, 0x18(%rsi)
leaq 0x5ff(%rip), %rax       # 0x48646
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/colorix.c
// Function: de_identify_colorix
static int de_identify_colorix(deark *c)
{
	if(c->infile->len < RIX_MIN_FILE_SIZE) return 0;

	if(is_RIX3(c->infile)) {
		return 95;
	}

	if(c->detection_data->best_confidence_so_far >= 55) return 0;

	if(de_input_file_has_ext(c, "scr")) {
		int fmt;

		fmt = detect_old_fmt(c->infile, 1);
		if(fmt==RIXFMT_OLD_U) {
			return 35;
		}
		else if(fmt==RIXFMT_OLD_C) {
			return 55;
		}
	}
	// TODO: There is supposedly also an old ".SCP" format, 640x480x16.
	// But I can't find any samples.

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0x24, 0x18(%rdi)
jl 0x486a4
callq 0x486ae
testl %eax, %eax
je 0x48668
pushq $0x5f
popq %rbx
jmp 0x486a4
movq 0x28(%r14), %rax
cmpl $0x36, (%rax)
jg 0x486a4
leaq 0xe08c0(%rip), %rsi     # 0x128f38
movq %r14, %rdi
callq 0xdfcd5
testl %eax, %eax
je 0x486a4
movq 0x18(%r14), %rdi
pushq $0x1
popq %rsi
callq 0x486cb
xorl %ecx, %ecx
cmpl $0x2, %eax
pushq $0x37
popq %rdx
cmovnel %ecx, %edx
cmpl $0x1, %eax
pushq $0x23
popq %rbx
cmovnel %edx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/colorix.c
// Function: detect_old_fmt
static int detect_old_fmt(dbuf *f, u8 strict)
{
	size_t i;
	u8 cmpr_flag = 0;
	u8 buf[16];

	if(f->len<RIX_MIN_FILE_SIZE) return 0;

	// Check the palette
	dbuf_read(f, buf, 0, 16);
	for(i=0; i<16; i++) {
		if(i==0) {
			if((buf[i] & 0x80)!=0) {
				cmpr_flag = 1;
				buf[i] -= 0x80;
			}
			else {
				if(f->len!=RIX_UNC_SCR_FILE_SIZE) return 0;
			}
		}

		if(buf[i]>0x3f) return 0;
	}
	if(!cmpr_flag) return RIXFMT_OLD_U;
	if(!strict) return RIXFMT_OLD_C;

	if(looks_like_compressed_data(f, 16)) {
		return RIXFMT_OLD_C;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpq $0x24, 0x18(%rdi)
jl 0x48730
movl %esi, %r14d
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
pushq $0x10
popq %rcx
movq %r15, %rsi
xorl %edx, %edx
callq 0xe3cb7
movb (%r15), %al
xorl %ecx, %ecx
testq %r12, %r12
je 0x4870b
cmpq $0x10, %r12
jne 0x48723
jmp 0x48741
testb %al, %al
js 0x4871b
cmpq $0x1b590, 0x18(%rbx)    # imm = 0x1B590
je 0x48723
jmp 0x48730
andb $0x7f, %al
movb %al, 0x10(%rsp)
movb $0x1, %cl
cmpb $0x3f, 0x10(%rsp,%r12)
leaq 0x1(%r12), %r12
jbe 0x486fe
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %cl, %cl
je 0x487e2
pushq $0x2
popq %rbp
testb %r14b, %r14b
je 0x48732
leaq 0x8(%rsp), %rsi
movq $0x10, (%rsi)
movq %rbx, %rdi
callq 0xe3fc4
leaq -0x202(%rax), %rcx
cmpq $-0x1ff, %rcx           # imm = 0xFE01
jb 0x48730
leaq (%rax,%rax), %r14
addq 0x8(%rsp), %r14
cmpq 0x18(%rbx), %r14
jg 0x48730
addq $-0x2, %rax
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0xdfb45
xorl %r12d, %r12d
testq %rax, %rax
cmovgq %rax, %r12
leaq 0x8(%rsp), %r15
subq $0x1, %r12
jb 0x487ea
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3fc4
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x487d6
testb $0x1, %al
jne 0x48730
andl $0xfff, %eax            # imm = 0xFFF
addq 0x8(%rsp), %rax
cmpq %r14, %rax
jl 0x487a2
jmp 0x48730
cmpl $0x10ff, %eax           # imm = 0x10FF
jbe 0x487a2
jmp 0x48730
pushq $0x1
popq %rbp
jmp 0x48732
leaq 0x8(%rsp), %r15
movq %r14, (%r15)
pushq $0x4
popq %r12
subq $0x1, %r12
jb 0x4882e
addq $0x3, %r14
cmpq 0x18(%rbx), %r14
jg 0x48730
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3fc4
cmpq $0x64, %rax
jl 0x48730
movq %rax, %r14
addq 0x8(%rsp), %r14
movq %r14, 0x8(%rsp)
jmp 0x487f6
cmpq 0x18(%rbx), %r14
jne 0x48730
jmp 0x48732
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/diet.c
// Function: de_module_diet
void de_module_diet(deark *c, struct deark_module_info *mi)
{
	mi->id = "diet";
	mi->desc = "DIET compression";
	mi->run_fn = de_run_diet;
	mi->identify_fn = de_identify_diet;
	mi->help_fn = de_help_diet;
}

// Assembly:
leaq 0xc8461(%rip), %rax     # 0x1113f0
movq %rax, (%rsi)
leaq 0xc845c(%rip), %rax     # 0x1113f5
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x48fbf
movq %rax, 0x18(%rsi)
leaq 0xfdc(%rip), %rax       # 0x49f8b
movq %rax, 0x20(%rsi)
leaq 0x1006(%rip), %rax      # 0x49fc0
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/diet.c
// Function: check_for_com2exe
static void check_for_com2exe(deark *c, struct diet_identify_data *idd,
	struct fmtutil_exe_info *ei)
{
	UI n;

	if(!ei) return;
	// This seems to work, but I'm sure there's a better way to detect that
	// the original file was in COM format.
	n = (UI)de_getu16be(ei->end_of_dos_code - 13);
	if(n==0xed55) {
		idd->com2exe_flag = 1;
	}
}

// Assembly:
testq %rdx, %rdx
je 0x4a3e7
pushq %rbx
movq %rsi, %rbx
movq 0x18(%rdi), %rdi
movq 0x48(%rdx), %rsi
addq $-0xd, %rsi
callq 0xe3f46
cmpl $0xed55, %eax           # imm = 0xED55
jne 0x4a3e6
movb $0x1, 0xb(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/diet.c
// Function: diet_getbit
static u8 diet_getbit(deark *c, lctx *d)
{
	u8 v;

	if(d->errflag) return 0;

	if(d->bbll.nbits_in_bitbuf==0) {
		fill_bitbuf(c, d);
	}

	v = (u8)de_bitbuf_lowlevel_get_bits(&d->bbll, 1);

	if(d->bbll.nbits_in_bitbuf==0) {
		fill_bitbuf(c, d);
	}

	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x28(%rsi)
je 0x4a40b
xorl %r15d, %r15d
jmp 0x4a445
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x70(%rsi), %r15
cmpl $0x0, 0x74(%rsi)
jne 0x4a426
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a44e
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0xe69f9
movq %rax, %r15
cmpl $0x0, 0x74(%rbx)
jne 0x4a445
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a44e
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/diet.c
// Function: fill_bitbuf
static void fill_bitbuf(deark *c, lctx *d)
{
	UI i;

	if(d->errflag) return;
	if(d->dcmpr_cur_ipos+2 > c->infile->len) {
		d->errflag = 1;
		d->need_errmsg = 1;
		return;
	}

	for(i=0; i<2; i++) {
		u8 b;
		b = de_getbyte_p(&d->dcmpr_cur_ipos);
		de_bitbuf_lowlevel_add_byte(&d->bbll, b);
	}
}

// Assembly:
cmpb $0x0, 0x28(%rsi)
je 0x4a455
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x68(%rsi), %rax
addq $0x2, %rax
movq 0x18(%rdi), %rcx
cmpq 0x18(%rcx), %rax
jle 0x4a485
movw $0x101, 0x28(%rbx)      # imm = 0x101
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68(%rbx), %r15
addq $0x70, %rbx
pushq $0x2
popq %rbp
subl $0x1, %ebp
jb 0x4a47a
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xe3f2a
movzbl %al, %esi
movq %rbx, %rdi
callq 0xe69c4
jmp 0x4a490
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: de_module_div_map
void de_module_div_map(deark *c, struct deark_module_info *mi)
{
	mi->id = "div_map";
	mi->desc = "DIV Games Studio .map";
	mi->run_fn = de_run_div_map;
	mi->identify_fn = de_identify_div_map;
}

// Assembly:
leaq 0xc7331(%rip), %rax     # 0x1117e8
movq %rax, (%rsi)
leaq 0xc732f(%rip), %rax     # 0x1117f0
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4a4dc
movq %rax, 0x18(%rsi)
leaq 0x129(%rip), %rax       # 0x4a600
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: de_run_div_map
static void de_run_div_map(deark *c, de_module_params *mparams)
{
	struct div_ctx *d = NULL;
	struct div_image_ctx *md = NULL;
	i64 pos;

	d = de_malloc(c, sizeof(struct div_ctx));
	d->fmt = identify_div_fmt(c);
	if(d->fmt==DIVFMT_MAP) {
		de_declare_fmt(c, "DIV MAP");
	}
	else {
		d->need_errmsg = 1;
		goto done;
	}
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_CP850);

	md = de_malloc(c, sizeof(struct div_image_ctx));
	if(de_getbyte(7) != 0) {
		d->need_errmsg = 1;
		goto done;
	}

	pos = 8;
	md->w = de_getu16le_p(&pos);
	md->h = de_getu16le_p(&pos);
	de_dbg_dimensions(c, md->w, md->h);

	pos = 16;

	// TODO: Figure out why the description is often garbage
	//div_read_descr_p(c, d, md, &pos);
	pos += 32;

	div_read_pal_p(c, d, &pos);

	div_read_cpoints_p(c, d, &pos);

	md->bitmap_pos = pos;
	div_do_bitmap(c, d, md);

done:
	div_image_destroy(c, md);
	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Bad or unsupported MAP file");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x408, %esi            # imm = 0x408
callq 0xdecaf
movq %rax, %r14
movq %rbx, %rdi
callq 0x4a95f
movb %al, 0x4(%r14)
cmpb $0x1, %al
jne 0x4a548
leaq 0xc7319(%rip), %rsi     # 0x111824
movq %rbx, %rdi
callq 0xe07f7
pushq $0xe
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe08d2
movl %eax, (%r14)
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r15
movq 0x18(%rbx), %rdi
pushq $0x7
popq %rsi
callq 0xe3eb4
testb %al, %al
je 0x4a552
movb $0x1, 0x6(%r14)
jmp 0x4a5c6
movb $0x1, 0x6(%r14)
xorl %r15d, %r15d
jmp 0x4a5c6
movq %rsp, %r12
movq $0x8, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, 0x18(%r15)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, 0x20(%r15)
movq 0x18(%r15), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xdf038
movq $0x30, (%r12)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4aa06
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4aa40
movq (%r12), %rax
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4aa66
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4ab6d
cmpb $0x0, 0x6(%r14)
je 0x4a5e9
leaq 0xc724d(%rip), %rsi     # 0x11182c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: de_module_div_fpg
void de_module_div_fpg(deark *c, struct deark_module_info *mi)
{
	mi->id = "div_fpg";
	mi->desc = "DIV Games Studio .fpg";
	mi->run_fn = de_run_div_fpg;
	mi->identify_fn = de_identify_div_fpg;
}

// Assembly:
leaq 0xc71ed(%rip), %rax     # 0x111806
movq %rax, (%rsi)
leaq 0xc71eb(%rip), %rax     # 0x11180e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4a63e
movq %rax, 0x18(%rsi)
leaq 0x314(%rip), %rax       # 0x4a94d
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: identify_div_fmt
static u8 identify_div_fmt(deark *c)
{
	u8 buf[7];

	if(de_getbyte(3) != 0x1a) return 0;
	de_read(buf, 0, sizeof(buf));
	if(de_memcmp(&buf[4], (const void*)"\x0d\x0a\0", 3)) return 0;
	if(!de_memcmp(buf, (const void*)"map", 3)) return DIVFMT_MAP;
	if(!de_memcmp(buf, (const void*)"fpg", 3)) return DIVFMT_FPG;
	if(!de_memcmp(buf, (const void*)"f16", 3)) return DIVFMT_F16;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
pushq $0x3
popq %rsi
callq 0xe3eb4
cmpb $0x1a, %al
jne 0x4a9f4
movq 0x18(%rbx), %rdi
xorl %ebx, %ebx
leaq 0x9(%rsp), %rsi
pushq $0x7
popq %rcx
xorl %edx, %edx
callq 0xe3cb7
leaq 0xd(%rsp), %rdi
leaq 0xc6f12(%rip), %rsi     # 0x1118aa
pushq $0x3
popq %rdx
callq 0x18230
testl %eax, %eax
jne 0x4a9f6
leaq 0xbee0f(%rip), %rsi     # 0x1097ba
leaq 0x9(%rsp), %rdi
pushq $0x3
popq %rdx
callq 0x18230
testl %eax, %eax
je 0x4a9fe
leaq 0xc6e5d(%rip), %rsi     # 0x111820
leaq 0x9(%rsp), %rdi
pushq $0x3
popq %rdx
callq 0x18230
testl %eax, %eax
je 0x4aa02
leaq 0xcf323(%rip), %rsi     # 0x119cfe
leaq 0x9(%rsp), %rdi
pushq $0x3
popq %rdx
callq 0x18230
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal (%rcx,%rcx,2), %ebx
jmp 0x4a9f6
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
movb $0x1, %bl
jmp 0x4a9f6
movb $0x2, %bl
jmp 0x4a9f6
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: div_read_cpoints_p
static void div_read_cpoints_p(deark *c, struct div_ctx *d, i64 *ppos)
{
	i64 n;

	// number of 4-byte "cpoints" items
	if(d->is_archive) {
		n = de_getu32le_p(ppos);
	}
	else {
		n = de_getu16le_p(ppos);
	}
	*ppos += 4*n;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
cmpb $0x0, 0x5(%rsi)
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
je 0x4aa58
callq 0xe40bf
jmp 0x4aa5d
callq 0xe3fc4
shlq $0x2, %rax
addq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: div_do_bitmap
static void div_do_bitmap(deark *c, struct div_ctx *d, struct div_image_ctx *md)
{
	de_bitmap *img = NULL;

	de_dbg(c, "bitmap at %"I64_FMT, md->bitmap_pos);
	if(!de_good_image_dimensions(c, md->w, md->h)) goto done;
	img = de_bitmap_create(c, md->w, md->h, 3);

	if(d->fmt==DIVFMT_F16) {
		div_convert_f16(c, d, md, img);
	}
	else {
		de_convert_image_paletted(c->infile, md->bitmap_pos, 8,
			md->w, d->pal, img, 0);
	}
	de_bitmap_write_to_file_finfo(img, md->fi, DE_CREATEFLAG_OPT_IMAGE);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rdx), %rdx
leaq 0xde87d(%rip), %rsi     # 0x129305
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq %r15, %rdi
callq 0xe6be1
testl %eax, %eax
je 0x4ab56
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
pushq $0x3
popq %rcx
movq %r15, %rdi
callq 0xe7437
movq %rax, %r14
cmpb $0x3, 0x4(%r12)
jne 0x4ab25
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
cmpq 0x20(%rbx), %r12
jge 0x4ab47
movq 0x18(%rbx), %rax
movq %r12, %rcx
imulq %rax, %rcx
addq %rcx, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rsp)
xorl %ebp, %ebp
cmpq %rax, %rbp
jge 0x4ab20
movq 0x18(%r15), %rdi
movq %r13, %rsi
callq 0xe3fc4
movl %eax, %edi
callq 0xe1da6
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl %eax, %ecx
callq 0xe7287
incq %rbp
movq 0x18(%rbx), %rax
jmp 0x4aaef
incq %r12
jmp 0x4aad0
movq 0x18(%r15), %rdi
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rcx
addq $0x8, %r12
andl $0x0, (%rsp)
pushq $0x8
popq %rdx
movq %r12, %r8
movq %r14, %r9
callq 0xe7cbc
movq 0x38(%rbx), %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0xe70ab
movq %r14, %rdi
callq 0xe7084
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/divgs.c
// Function: div_image_destroy
static void div_image_destroy(deark *c, struct div_image_ctx *md)
{
	if(!md) return;
	ucstring_destroy(md->descr);
	ucstring_destroy(md->fn);
	de_finfo_destroy(c, md->fi);
	de_free(c, md);
}

// Assembly:
testq %rsi, %rsi
je 0x4abac
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rsi), %rdi
callq 0xeaf3c
movq 0x30(%rbx), %rdi
callq 0xeaf3c
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0xdfd24
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: de_module_dosbackup33
void de_module_dosbackup33(deark *c, struct deark_module_info *mi)
{
	mi->id = "dosbackup33";
	mi->desc = "MS-DOS BACKUP (v3.3+)";
	mi->run_fn = de_run_dosbackup33;
	mi->identify_fn = de_identify_dosbackup33;
	mi->flags |= DE_MODFLAG_MULTIPART;
}

// Assembly:
leaq 0xc6cf7(%rip), %rax     # 0x1118ae
movq %rax, (%rsi)
leaq 0xc6cf9(%rip), %rax     # 0x1118ba
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x4abe0
movq %rax, 0x18(%rsi)
leaq 0x9a5(%rip), %rax       # 0x4b57c
movq %rax, 0x20(%rsi)
orb $0x40, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: de_module_dosbackup20
void de_module_dosbackup20(deark *c, struct deark_module_info *mi)
{
	mi->id = "dosbackup20";
	mi->desc = "MS-DOS BACKUP (v2.0-3.2)";
	mi->run_fn = de_run_dosbackup20;
	mi->identify_fn = de_identify_dosbackup20;
	mi->flags |= DE_MODFLAG_MULTIPART;
}

// Assembly:
leaq 0xc6339(%rip), %rax     # 0x1118d0
movq %rax, (%rsi)
leaq 0xc633b(%rip), %rax     # 0x1118dc
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x4b5c0
movq %rax, 0x18(%rsi)
leaq 0x53d(%rip), %rax       # 0x4baf4
movq %rax, 0x20(%rsi)
orb $0x40, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: de_identify_dosbackup20
static int de_identify_dosbackup20(deark *c)
{
	u8 b0;
	u8 b;
	u8 fnlen;
	UI seq_num;
	UI n;
	i64 nulpos;

	if(c->infile->len<128) return 0;
	b0 = de_getbyte(0);
	if(b0!=0 && b0!=0xff) return 0;

	// first letter of filename
	b = de_getbyte(5);
	if(b!='\\' && b!='/') return 0;

	seq_num = (UI)de_getu16le(1);
	if(seq_num==0 || seq_num>255) return 0;

	n = (UI)de_getu16le(3); // unknown bytes, expecting 0
	if(n!=0) return 0;

	// len seems to include the trailing NUL
	fnlen = de_getbyte(83);
	if(fnlen<3 || fnlen>78) return 0;
	nulpos = 5+(i64)fnlen-1;

	// last letter of filename
	b = de_getbyte(nulpos-1);
	if(b<33) return 0;

	// Expecting zeros from the filename trailing NUL, until the fn
	// length byte.
	if(!dbuf_is_all_zeroes(c->infile, nulpos, 83-nulpos)) return 0;

	// Expecting zeroes to fill out the 128-byte header.
	if(!dbuf_is_all_zeroes(c->infile, 84, 44)) return 0;

	return (b0==0xff && seq_num==1) ? 45 : 29;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0x80, 0x18(%rdi)
jl 0x4bbeb
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xe3eb4
movl %eax, %r14d
leal -0x1(%r14), %eax
cmpb $-0x2, %al
jb 0x4bbeb
movq 0x18(%r15), %rdi
pushq $0x5
popq %rsi
callq 0xe3eb4
cmpb $0x5c, %al
je 0x4bb4a
movzbl %al, %eax
cmpl $0x2f, %eax
jne 0x4bbeb
movq 0x18(%r15), %rdi
pushq $0x1
popq %rsi
callq 0xe3fa3
movq %rax, %r12
addl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0xffffff01, %eax       # imm = 0xFFFFFF01
jb 0x4bbeb
movq 0x18(%r15), %rdi
pushq $0x3
popq %rsi
callq 0xe3fa3
testl %eax, %eax
jne 0x4bbeb
movq 0x18(%r15), %rdi
pushq $0x53
popq %r13
movq %r13, %rsi
callq 0xe3eb4
leal -0x4f(%rax), %ecx
cmpb $-0x4c, %cl
jb 0x4bbeb
movzbl %al, %ebp
movq 0x18(%r15), %rdi
leaq 0x3(%rbp), %rsi
callq 0xe3eb4
cmpb $0x21, %al
jb 0x4bbeb
addq $0x4, %rbp
movq 0x18(%r15), %rdi
subq %rbp, %r13
movq %rbp, %rsi
movq %r13, %rdx
callq 0xe66d2
testl %eax, %eax
je 0x4bbeb
movq 0x18(%r15), %rdi
pushq $0x54
popq %rsi
pushq $0x2c
popq %rdx
callq 0xe66d2
testl %eax, %eax
je 0x4bbeb
xorl %eax, %eax
cmpl $0x1, %r12d
sete %al
shll $0x4, %eax
addl $0x1d, %eax
cmpb $-0x1, %r14b
pushq $0x1d
popq %rbx
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: dbk_destroy_lctx
static void dbk_destroy_lctx(deark *c, lctx *d)
{
	if(!d) return;

	logical_member_finish_and_free(c, d);

	if(d->need_errmsg) {
		de_err(c, "Failed to process this MS-DOS BACKUP set");
	}
	ucstring_destroy(d->v33_cur_dir_name);
	de_free(c, d->v33_control_file_xidxs);
	de_free(c, d->data_file_xidxs);
	de_free(c, d->v20_fsig_expected);
	de_free(c, d);
}

// Assembly:
testq %rsi, %rsi
je 0x4bc66
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4bccf
cmpb $0x0, 0x9(%rbx)
je 0x4bc27
leaq 0xc5ecf(%rip), %rsi     # 0x111aec
movq %r14, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x38(%rbx), %rdi
callq 0xeaf3c
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xded32
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xded32
movq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0xded32
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: v33_looks_like_control_file
static int v33_looks_like_control_file(dbuf *f)
{
	int has_sig1;
	UI sig2;

	has_sig1 = !dbuf_memcmp(f, 0, "\x8b" "BACKUP", 7);
	if(!has_sig1) return 0;

	// Found a compressed variant format where the next two bytes are
	// different, but no plans to support it.
	sig2 = (UI)dbuf_getu16be(f, 7);
	if(sig2!=0x2020) {
		return 0;
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0xc5d94(%rip), %rdx     # 0x111a09
xorl %ebx, %ebx
pushq $0x7
popq %rcx
xorl %esi, %esi
callq 0xe4d48
testl %eax, %eax
jne 0x4bc9a
pushq $0x7
popq %rsi
movq %r14, %rdi
callq 0xe3f46
xorl %ebx, %ebx
cmpl $0x2020, %eax           # imm = 0x2020
sete %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: logical_member_finish_and_free
static void logical_member_finish_and_free(deark *c, lctx *d)
{
	if(!d->clm) return;

	if(d->fmtver==DOSBK_VER_DOS33 && d->clm->nbytes_written!=d->clm->v33_nbytes_expected) {
		de_err(c, "%s: Expected %"I64_FMT" bytes, got %"I64_FMT,
			ucstring_getpsz_d(d->clm->fullfn), d->clm->v33_nbytes_expected,
			d->clm->nbytes_written);
	}
	dbuf_close(d->clm->outf);
	ucstring_destroy(d->clm->fullfn);
	de_free(c, d->clm);
	d->clm = NULL;
}

// Assembly:
movq 0x30(%rsi), %rax
testq %rax, %rax
je 0x4bd4c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x3, 0x4(%rsi)
jne 0x4bd1f
movq 0x8(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x4bd1f
movq 0x18(%rax), %rdi
callq 0xeb877
movq 0x30(%rbx), %rcx
movq 0x8(%rcx), %r8
movq 0x10(%rcx), %rcx
leaq 0xc5dbe(%rip), %rsi     # 0x111acc
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf2a5
movq 0x30(%rbx), %rax
movq (%rax), %rdi
callq 0xe5591
movq 0x30(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0xeaf3c
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0xded32
andq $0x0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/flif.c
// Function: de_module_flif
void de_module_flif(deark *c, struct deark_module_info *mi)
{
	mi->id = "flif";
	mi->desc = "FLIF image format";
	mi->run_fn = de_run_flif;
	mi->identify_fn = de_identify_flif;
	mi->flags |= DE_MODFLAG_NONWORKING;
}

// Assembly:
leaq 0xc5e81(%rip), %rax     # 0x111bd8
movq %rax, (%rsi)
leaq 0xc5e7c(%rip), %rax     # 0x111bdd
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x4bd80
movq %rax, 0x18(%rsi)
leaq 0x301(%rip), %rax       # 0x4c078
movq %rax, 0x20(%rsi)
orb $0x2, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/flif.c
// Function: read_varint
static int read_varint(deark *c, i64 pos1, i64 *result, i64 *bytes_consumed)
{
	i64 val = 0;
	u8 b;
	i64 pos = pos1;
	int retval = 0;

	*result = 0;

	while(1) {
		b = de_getbyte(pos++);
		val = (val<<7)|(b&0x7f);
		if((b&0x80)==0) break;
		if(pos - pos1 >= 8) {
			// We allow varints up to 8 bytes (8*7=56 bits).
			// If we've read 8 bytes without finding the terminating byte,
			// give up.
			// (Note that if we were to allow 63 bits, we could have int64
			// overflow when we convert from a physical value to a logical
			// value.)
			de_err(c, "Excessively large varint at %d", (int)pos1);
			goto done;
		}
	}

	*result = val;
	retval = 1;
done:
	*bytes_consumed = pos - pos1;
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
andq $0x0, (%rdx)
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
leaq (%r14,%r13), %rsi
movq 0x18(%r15), %rdi
callq 0xe3eb4
movq %rbp, %rcx
shlq $0x7, %rcx
movl %eax, %edx
andb $0x7f, %dl
movzbl %dl, %ebp
orq %rcx, %rbp
testb %al, %al
jns 0x4c0fe
incq %r13
cmpq $0x8, %r13
jb 0x4c0ba
leaq 0xc5b80(%rip), %rsi     # 0x111c6d
xorl %ebp, %ebp
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x4c108
movq %rbp, (%r12)
incq %r13
pushq $0x1
popq %rbp
movq %r13, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/fnt.c
// Function: de_module_fnt
void de_module_fnt(deark *c, struct deark_module_info *mi)
{
	mi->id = "fnt";
	mi->desc = "Windows FNT font";
	mi->run_fn = de_run_fnt;
	mi->identify_fn = de_identify_fnt;
}

// Assembly:
leaq 0xc41ba(%rip), %rax     # 0x1102dd
movq %rax, (%rsi)
leaq 0xc5bd5(%rip), %rax     # 0x111d02
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4c148
movq %rax, 0x18(%rsi)
leaq 0xa79(%rip), %rax       # 0x4cbbc
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gemfont.c
// Function: de_module_gemfont
void de_module_gemfont(deark *c, struct deark_module_info *mi)
{
	mi->id = "gemfont";
	mi->desc = "GEM bitmap font";
	mi->run_fn = de_run_gemfont;
	mi->identify_fn = de_identify_gemfont;
}

// Assembly:
leaq 0xc538d(%rip), %rax     # 0x111f94
movq %rax, (%rsi)
leaq 0xc538b(%rip), %rax     # 0x111f9c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4cc2c
movq %rax, 0x18(%rsi)
leaq 0x60d(%rip), %rax       # 0x4d234
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gemfont.c
// Function: de_identify_gemfont
static int de_identify_gemfont(deark *c)
{
	int has_usual_lm;
	i64 fdoffs, fwidth, fheight, eofd;

	if(!de_input_file_has_ext(c, "fnt") &&
		!de_input_file_has_ext(c, "gft"))
	{
		return 0;
	}

	has_usual_lm = !dbuf_memcmp(c->infile, 62, "UUUU", 4);
	fdoffs = de_getu32le(76);
	if(fdoffs<88) return 0;
	fwidth = de_getu16le(80);
	fheight = de_getu16le(82);
	if(fwidth<1 || fheight<1) return 0;
	eofd = fdoffs + fwidth*fheight; // end of font data
	if(eofd > c->infile->len) return 0;
	if(eofd==c->infile->len && has_usual_lm) return 100;
	if(eofd==c->infile->len) return 70;
	if(has_usual_lm) return 25;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xc3097(%rip), %rsi     # 0x1102dd
callq 0xdfcd5
testl %eax, %eax
jne 0x4d266
leaq 0xc4ee9(%rip), %rsi     # 0x11213f
movq %rbx, %rdi
callq 0xdfcd5
testl %eax, %eax
je 0x4d2ec
movq 0x18(%rbx), %rdi
leaq 0xc4ed2(%rip), %rdx     # 0x112143
pushq $0x3e
popq %rsi
pushq $0x4
popq %rcx
callq 0xe4d48
movl %eax, %ebp
movq 0x18(%rbx), %rdi
pushq $0x4c
popq %rsi
callq 0xe409f
xorl %r14d, %r14d
cmpq $0x58, %rax
jl 0x4d306
movq %rax, %r15
movq 0x18(%rbx), %rdi
pushq $0x50
popq %rsi
callq 0xe3fa3
movq %rax, %r12
movq 0x18(%rbx), %rdi
pushq $0x52
popq %rsi
callq 0xe3fa3
testq %r12, %r12
setle %cl
testq %rax, %rax
setle %dl
orb %cl, %dl
jne 0x4d306
imulq %r12, %rax
addq %r15, %rax
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jg 0x4d306
testl %ebp, %ebp
sete %dl
cmpq %rcx, %rax
sete %sil
testb %dl, %sil
je 0x4d2f1
pushq $0x64
popq %r14
jmp 0x4d306
xorl %r14d, %r14d
jmp 0x4d306
xorl %edx, %edx
testl %ebp, %ebp
pushq $0x19
popq %rsi
cmovnel %edx, %esi
cmpq %rcx, %rax
pushq $0x46
popq %r14
cmovnel %esi, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gemmeta.c
// Function: de_module_gemmeta
void de_module_gemmeta(deark *c, struct deark_module_info *mi)
{
	mi->id = "gemmeta";
	mi->desc = "GEM VDI Metafile";
	mi->run_fn = de_run_gemmeta;
	mi->identify_fn = de_identify_gemmeta;
}

// Assembly:
leaq 0xc4e2d(%rip), %rax     # 0x112148
movq %rax, (%rsi)
leaq 0xc4e2b(%rip), %rax     # 0x112150
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4d340
movq %rax, 0x18(%rsi)
leaq 0x1fb(%rip), %rax       # 0x4d536
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gemmeta.c
// Function: do_opcode_5
static void do_opcode_5(deark *c, lctx *d, struct opcode_data *op)
{
	i64 sub_opcode_id;
	const char *name;

	if(op->func_id!=99) return;
	if(op->intin_count<1) return;
	sub_opcode_id = de_getu16le(op->intin_pos);

	switch(sub_opcode_id) {
	case 10: name="Start Group"; break;
	case 11: name="End Group"; break;
	case 49: name="Set No Line Style"; break;
	case 50: name="Set Attribute Shadow On"; break;
	case 51: name="Set Attribute Shadow Off"; break;
	case 80: name="Start Draw Area Type Primitive"; break;
	case 81: name="End Draw Area Type Primitive"; break;
	default:
		if(sub_opcode_id>100) {
			name="for developer use";
		}
		else {
			name="?";
		}
	}

	de_dbg(c, "sub-opcode id: %d (%s)", (int)sub_opcode_id, name);
}

// Assembly:
cmpq $0x63, 0x20(%rdx)
jne 0x4d5aa
cmpq $0x0, 0x30(%rdx)
jle 0x4d5aa
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x10(%rdx), %rsi
callq 0xe3fa3
cmpq $0xa, %rax
je 0x4d5c6
cmpq $0x51, %rax
je 0x4d5f0
cmpq $0x31, %rax
je 0x4d5e7
cmpq $0x32, %rax
je 0x4d5ab
cmpq $0x33, %rax
je 0x4d5bd
cmpq $0x50, %rax
je 0x4d5b4
cmpq $0xb, %rax
jne 0x4d5cf
leaq 0xc4e22(%rip), %rcx     # 0x1123ca
jmp 0x4d5f7
retq
leaq 0xc4e34(%rip), %rcx     # 0x1123e6
jmp 0x4d5f7
leaq 0xc4e5c(%rip), %rcx     # 0x112417
jmp 0x4d5f7
leaq 0xc4e3a(%rip), %rcx     # 0x1123fe
jmp 0x4d5f7
leaq 0xc4df1(%rip), %rcx     # 0x1123be
jmp 0x4d5f7
cmpq $0x65, %rax
leaq 0xc4e79(%rip), %rdx     # 0x112453
leaq 0xd1900(%rip), %rcx     # 0x11eee1
cmovgeq %rdx, %rcx
jmp 0x4d5f7
leaq 0xc4de6(%rip), %rcx     # 0x1123d4
jmp 0x4d5f7
leaq 0xc4e3f(%rip), %rcx     # 0x112436
leaq 0xc4e67(%rip), %rsi     # 0x112465
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
jmp 0xde896
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gemras.c
// Function: de_module_gemraster
void de_module_gemraster(deark *c, struct deark_module_info *mi)
{
	mi->id = "gemraster";
	mi->id_alias[0] = "gemras";
	mi->desc = "GEM VDI Bit Image, a.k.a. GEM Raster";
	mi->run_fn = de_run_gemraster;
	mi->identify_fn = de_identify_gemraster;
	mi->help_fn = de_help_gemraster;
}

// Assembly:
leaq 0xc4f09(%rip), %rax     # 0x112550
movq %rax, (%rsi)
leaq 0xc4f09(%rip), %rax     # 0x11255a
movq %rax, 0x38(%rsi)
leaq 0xc4f05(%rip), %rax     # 0x112561
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x4d682
movq %rax, 0x18(%rsi)
leaq 0x5e6(%rip), %rax       # 0x4dc58
movq %rax, 0x20(%rsi)
leaq 0x7bf(%rip), %rax       # 0x4de3c
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: de_module_gif
void de_module_gif(deark *c, struct deark_module_info *mi)
{
	mi->id = "gif";
	mi->desc = "GIF image";
	mi->run_fn = de_run_gif;
	mi->identify_fn = de_identify_gif;
	mi->help_fn = de_help_gif;
}

// Assembly:
leaq 0xc4449(%rip), %rax     # 0x112a4c
movq %rax, (%rsi)
leaq 0xc4443(%rip), %rax     # 0x112a50
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x4e633
movq %rax, 0x18(%rsi)
leaq 0x166d(%rip), %rax      # 0x4fc90
movq %rax, 0x20(%rsi)
leaq 0x16ca(%rip), %rax      # 0x4fcf8
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: de_identify_gif
static int de_identify_gif(deark *c)
{
	u8 buf[6];

	de_read(buf, 0, 6);
	if(!de_memcmp(buf, "GIF87a", 6)) return 100;
	if(!de_memcmp(buf, "GIF89a", 6)) return 100;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xa(%rsp), %r14
pushq $0x6
popq %r15
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0xe3cb7
leaq 0xc33c8(%rip), %rsi     # 0x113084
movq %r14, %rdi
movq %r15, %rdx
callq 0x18230
testl %eax, %eax
je 0x4fce9
leaq 0xc33b9(%rip), %rsi     # 0x11308b
leaq 0xa(%rsp), %rdi
pushq $0x6
popq %rdx
callq 0x18230
testl %eax, %eax
pushq $0x64
popq %rax
cmovel %eax, %ebx
jmp 0x4fcec
pushq $0x64
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: do_read_subblocks_p
static void do_read_subblocks_p(deark *c, lctx *d, dbuf *inf,
	subblock_callback_fn_type cbfn, void *userdata, i64 *ppos)
{
	struct subblock_reader_data sbrd;
	int eof_flag = 0;

	de_zeromem(&sbrd, sizeof(struct subblock_reader_data));
	sbrd.userdata = userdata;
	sbrd.inf = inf;

	while(1) {
		sbrd.subblkpos = *ppos;

		if(*ppos >= inf->len) {
			on_unexpected_eof(c, d);
			*ppos = inf->len;
			return;
		}
		sbrd.reported_dlen = (i64)de_getbyte_p(ppos);

		sbrd.dpos = *ppos;

		if(sbrd.dpos + sbrd.reported_dlen > inf->len) {
			eof_flag = 1;
			sbrd.dlen = inf->len - sbrd.dpos;
		}
		else {
			sbrd.dlen = sbrd.reported_dlen;
		}

		*ppos += sbrd.dlen;

		if(sbrd.dlen>0 || !eof_flag) {
			cbfn(c, d, &sbrd);
		}

		if(eof_flag) {
			on_unexpected_eof(c, d);
			*ppos = inf->len;
			return;
		}

		if(sbrd.reported_dlen==0) break;
		sbrd.subblock_idx++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x18(%rax)
movq %r8, (%rax)
movq %rdx, 0x10(%rax)
movq (%rbx), %rax
movq %rax, 0x28(%rsp)
cmpq 0x18(%r14), %rax
jge 0x4fe7f
movq 0x18(%r12), %rdi
movq %rbx, %rsi
callq 0xe3f2a
movzbl %al, %eax
movq %rax, 0x30(%rsp)
movq (%rbx), %rbp
movq %rbp, 0x38(%rsp)
movq 0x18(%r14), %r13
movq %r13, %rcx
subq %rbp, %rcx
addq %rax, %rbp
cmpq %r13, %rbp
setg %dl
cmovleq %rax, %rcx
movq %r13, %rax
cmovlq %rbp, %rax
movq %rcx, 0x40(%rsp)
movq %rax, (%rbx)
testq %rcx, %rcx
setle %al
testb %al, %dl
jne 0x4fe6b
movq %r12, %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
callq *0x8(%rsp)
cmpq %r13, %rbp
jg 0x4fe7f
cmpq $0x0, 0x30(%rsp)
je 0x4fe91
incq 0x18(%rsp)
jmp 0x4fe01
movq %r12, %rdi
movq %r15, %rsi
callq 0x4fd2d
movq 0x18(%r14), %rax
movq %rax, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: decode_text_color
static void decode_text_color(deark *c, lctx *d, const char *name, u8 clr_idx,
	de_color *pclr)
{
	de_color clr;
	const char *alphastr;
	char csamp[32];

	clr = d->global_ct[(unsigned int)clr_idx];
	*pclr = clr;

	if(d->gce && d->gce->trns_color_idx_valid && d->gce->trns_color_idx==clr_idx) {
		alphastr = ",A=0";
		*pclr = DE_SET_ALPHA(*pclr, 0);
	}
	else {
		alphastr = "";
	}
	de_get_colorsample_code(c, clr, csamp, sizeof(csamp));
	de_dbg(c, "%s color: idx=%3u (%3u,%3u,%3u%s)%s", name,
		(unsigned int)clr_idx, (unsigned int)DE_COLOR_R(clr),
		(unsigned int)DE_COLOR_G(clr), (unsigned int)DE_COLOR_B(clr),
		alphastr, csamp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %r15
movl %ecx, %eax
movl 0x38(%rsi,%rax,4), %ebx
movl %ebx, (%r8)
movq 0x440(%rsi), %rax
leaq 0xe790f(%rip), %r13     # 0x137c60
testq %rax, %rax
je 0x50372
cmpb $0x0, 0x1(%rax)
je 0x50372
cmpb %cl, 0x2(%rax)
jne 0x50372
movl %ebx, %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, (%r8)
leaq 0xc290b(%rip), %r13     # 0x112c7d
movzbl %cl, %ebp
movq %rsp, %r12
pushq $0x20
popq %rcx
movq %r15, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0xdf0eb
movl %ebx, %r8d
shrl $0x10, %r8d
movl $0xff, %eax
andl %eax, %r8d
movl %ebx, %r9d
shrl $0x8, %r9d
andl %eax, %r9d
andl %eax, %ebx
subq $0x8, %rsp
leaq 0xc28d4(%rip), %rsi     # 0x112c82
movq %r15, %rdi
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
pushq %r12
pushq %r13
pushq %rbx
callq 0xde896
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: callback_for_comment_ext
static void callback_for_comment_ext(deark *c, lctx *d, struct subblock_reader_data *sbrd)
{
	struct comment_ext_ctx *ctx = (struct comment_ext_ctx*)sbrd->userdata;

	if(sbrd->dlen<1) return;

	if(ctx->outf) {
		// GIF comments are supposed to be 7-bit ASCII, so just copy them as-is.
		dbuf_copy(sbrd->inf, sbrd->dpos, sbrd->dlen, ctx->outf);
	}

	if(ctx->s->len<DE_DBG_MAX_STRLEN) {
		dbuf_read_to_ucstring(sbrd->inf, sbrd->dpos, sbrd->dlen, ctx->s, 0, DE_ENCODING_ASCII);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x30(%rdx), %rdx
testq %rdx, %rdx
jle 0x50426
movq (%rbx), %r14
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x503fa
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0xe45f4
movq (%r14), %rcx
cmpq $0x1f3, 0x10(%rcx)      # imm = 0x1F3
jg 0x50426
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
pushq $0x1
popq %r9
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe4c9a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: do_copy_subblocks_to_dbuf
static void do_copy_subblocks_to_dbuf(deark *c, lctx *d, dbuf *outf,
	i64 pos1, int has_max, i64 maxlen)
{
	i64 pos = pos1;
	struct copy_subblocks_ctx ctx;

	ctx.outf = outf;
	ctx.has_max = has_max;
	ctx.maxlen = maxlen;
	ctx.nbytes_copied = 0;
	do_read_subblocks_p(c, d, c->infile, callback_for_copy_subblocks, (void*)&ctx, &pos);
}

// Assembly:
subq $0x28, %rsp
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x8(%rsp), %r10
movq %rdx, (%r10)
movl %r8d, 0x8(%r10)
movq %r9, 0x10(%r10)
andq $0x0, 0x18(%r10)
movq 0x18(%rdi), %rdx
leaq 0x10(%rip), %rcx        # 0x50468
movq %r10, %r8
movq %rax, %r9
callq 0x4fdc7
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/gif.c
// Function: callback_for_copy_subblocks
static void callback_for_copy_subblocks(deark *c, lctx *d, struct subblock_reader_data *sbrd)
{
	struct copy_subblocks_ctx *ctx = (struct copy_subblocks_ctx*)sbrd->userdata;
	i64 nbytes_to_copy;

	if(ctx->has_max && (ctx->nbytes_copied >= ctx->maxlen)) return;
	if(sbrd->dlen<1) return;

	nbytes_to_copy = sbrd->dlen;
	if(ctx->has_max) {
		if(ctx->nbytes_copied + nbytes_to_copy > ctx->maxlen) {
			nbytes_to_copy = ctx->maxlen - ctx->nbytes_copied;
		}
	}
	dbuf_copy(sbrd->inf, sbrd->dpos, nbytes_to_copy, ctx->outf);
	ctx->nbytes_copied += nbytes_to_copy;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdx), %r14
cmpl $0x0, 0x8(%r14)
je 0x5049b
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq %rax, %rbx
subq %rcx, %rbx
jle 0x504bb
movq 0x30(%rdx), %rsi
testq %rsi, %rsi
jle 0x504bb
addq %rsi, %rcx
cmpq %rax, %rcx
cmovleq %rsi, %rbx
jmp 0x504a4
movq 0x30(%rdx), %rbx
testq %rbx, %rbx
jle 0x504bb
movq 0x10(%rdx), %rdi
movq 0x28(%rdx), %rsi
movq (%r14), %rcx
movq %rbx, %rdx
callq 0xe45f4
addq %rbx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq