LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: de_dfilter_decompress_oneshot
void de_dfilter_decompress_oneshot(deark *c,
	dfilter_codec_type codec_init_fn, void *codec_private_params,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres)
{
	struct de_dfilter_ctx *dfctx = NULL;

	dfctx = de_dfilter_create(c, codec_init_fn, codec_private_params,
		dcmpro, dres);
	dfctx->input_file_offset = dcmpri->pos;
	de_dfilter_addslice(dfctx, dcmpri->f, dcmpri->pos, dcmpri->len);
	de_dfilter_finish(dfctx);
	de_dfilter_destroy(dfctx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r12
movl $0x50, %esi
callq 0xe8b2b
movq %rax, %rbx
movq %r12, (%rax)
movq %r13, 0x8(%rax)
movq %rbp, 0x10(%rax)
testq %r15, %r15
je 0xfa4b4
movq %rbx, %rdi
movq (%rsp), %rsi
callq *%r15
movq 0x8(%r14), %rsi
movq %rsi, 0x18(%rbx)
cmpb $0x0, 0x20(%rbx)
jne 0xfa4d8
movq (%r14), %rdi
movq 0x10(%r14), %rdx
leaq -0xaa(%rip), %rcx       # 0xfa426
movq %rbx, %r8
callq 0xef5e4
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0xfa4e6
movq %rbx, %rdi
callq *%rax
movq (%rbx), %r14
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0xfa4f7
movq %rbx, %rdi
callq *%rax
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe8be2
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: dfilter_packbits_codec
void dfilter_packbits_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct packbitsctx *rctx = NULL;
	struct de_packbits_params *pbparams = (struct de_packbits_params*)codec_private_params;

	rctx = de_malloc(dfctx->c, sizeof(struct packbitsctx));
	rctx->modname = "packbits";

	dfctx->codec_private = (void*)rctx;
	dfctx->codec_addbuf_fn = my_packbits_codec_addbuf;
	dfctx->codec_finish_fn = my_packbits_codec_finish;
	dfctx->codec_command_fn = my_packbits_codec_command;
	dfctx->codec_destroy_fn = my_packbits_codec_destroy;

	rctx->nbytes_per_unit = 1;
	if(pbparams) {
		if(pbparams->nbytes_per_unit>DE_PACKBITS_MAX_NBYTES_PER_UNIT) {
			de_dfilter_set_generic_error(dfctx->c, dfctx->dres, rctx->modname);
		}
		else if(pbparams->nbytes_per_unit>1) {
			rctx->nbytes_per_unit = pbparams->nbytes_per_unit;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x48, %esi
callq 0xe8b2b
leaq 0x50551(%rip), %rcx     # 0x14aaeb
movq %rcx, 0x40(%rax)
movq %rax, 0x28(%rbx)
leaq 0x6f(%rip), %rcx        # 0xfa618
movq %rcx, 0x30(%rbx)
leaq 0x1e8(%rip), %rcx       # 0xfa79c
movq %rcx, 0x40(%rbx)
leaq 0x1f7(%rip), %rcx       # 0xfa7b6
movq %rcx, 0x38(%rbx)
leaq 0x218(%rip), %rcx       # 0xfa7e2
movq %rcx, 0x48(%rbx)
movq $0x1, (%rax)
testq %r14, %r14
je 0xfa610
movl (%r14), %ecx
cmpq $0x9, %rcx
jb 0xfa608
movq 0x8(%rbx), %rsi
cmpl $0x0, (%rsi)
jne 0xfa610
leaq 0x504f8(%rip), %rdx     # 0x14aaeb
leaq 0x504df(%rip), %rcx     # 0x14aad9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfa21a
cmpl $0x2, %ecx
jb 0xfa610
movq %rcx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: my_packbits_codec_finish
static void my_packbits_codec_finish(struct de_dfilter_ctx *dfctx)
{
	struct packbitsctx *rctx = (struct packbitsctx*)dfctx->codec_private;

	if(!rctx) return;
	dfctx->dres->bytes_consumed = rctx->total_nbytes_processed;
	dfctx->dres->bytes_consumed_valid = 1;
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0xfa7b5
movq 0x18(%rax), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movb $0x1, 0x4(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: my_packbits_codec_destroy
static void my_packbits_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct packbitsctx *rctx = (struct packbitsctx*)dfctx->codec_private;

	if(rctx) {
		de_free(dfctx->c, rctx);
	}
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0xfa7f7
movq (%rbx), %rdi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: fmtutil_decompress_packbits
int fmtutil_decompress_packbits(dbuf *f, i64 pos1, i64 len,
	dbuf *unc_pixels, i64 *cmpr_bytes_consumed)
{
	struct de_dfilter_results dres;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;

	if(cmpr_bytes_consumed) *cmpr_bytes_consumed = 0;
	de_dfilter_init_objects(f->c, &dcmpri, &dcmpro, &dres);

	dcmpri.f = f;
	dcmpri.pos = pos1;
	dcmpri.len = len;
	dcmpro.f = unc_pixels;
	if(unc_pixels->has_len_limit) {
		dcmpro.len_known = 1;
		dbuf_flush(unc_pixels);
		dcmpro.expected_len = unc_pixels->len_limit - unc_pixels->len;
	}

	de_dfilter_decompress_oneshot(f->c, dfilter_packbits_codec, NULL,
		&dcmpri, &dcmpro, &dres);

	if(cmpr_bytes_consumed && dres.bytes_consumed_valid) {
		*cmpr_bytes_consumed = dres.bytes_consumed;
	}
	if(dres.errcode != 0) return 0;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdi, %r14
testq %r8, %r8
je 0xfa83d
movq $0x0, (%rbx)
xorl %eax, %eax
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl $0x0, 0x40(%rsp)
movb %al, 0x44(%rsp)
movq %rax, 0x48(%rsp)
movb %al, 0x50(%rsp)
movq %r14, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %r15, 0x8(%rsp)
cmpl $0x0, 0x30(%r15)
je 0xfa896
movb $0x1, 0x10(%rsp)
movq %r15, %rdi
callq 0xf08ba
movq 0x28(%r15), %rax
subq 0x18(%r15), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rdi
leaq -0x325(%rip), %rsi      # 0xfa57c
leaq 0x20(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0x40(%rsp), %r9
xorl %edx, %edx
callq 0xfa46f
testq %rbx, %rbx
je 0xfa8cb
cmpb $0x0, 0x44(%rsp)
je 0xfa8cb
movq 0x48(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
cmpl $0x0, 0x40(%rsp)
sete %al
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: dfilter_rle90_codec
void dfilter_rle90_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct rle90ctx *rctx = NULL;

	rctx = de_malloc(dfctx->c, sizeof(struct rle90ctx));
	dfctx->codec_private = (void*)rctx;
	dfctx->codec_addbuf_fn = my_rle90_codec_addbuf;
	dfctx->codec_finish_fn = my_rle90_codec_finish;
	dfctx->codec_destroy_fn = my_rle90_codec_destroy;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x18, %esi
callq 0xe8b2b
movq %rax, 0x28(%rbx)
leaq 0x1c(%rip), %rax        # 0xfa931
movq %rax, 0x30(%rbx)
leaq 0x11a(%rip), %rax       # 0xfaa3a
movq %rax, 0x40(%rbx)
leaq 0x128(%rip), %rax       # 0xfaa53
movq %rax, 0x48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: my_rle90_codec_addbuf
static void my_rle90_codec_addbuf(struct de_dfilter_ctx *dfctx,
	const u8 *buf, i64 buf_len)
{
	int i;
	u8 b;
	struct rle90ctx *rctx = (struct rle90ctx*)dfctx->codec_private;

	if(!rctx) return;

	for(i=0; i<buf_len; i++) {
		if(dfctx->dcmpro->len_known &&
			(rctx->nbytes_written >= dfctx->dcmpro->expected_len))
		{
			dfctx->finished_flag = 1;
			break;
		}

		b = buf[i];
		rctx->total_nbytes_processed++;

		if(rctx->countcode_pending && b==0) {
			// Not RLE, just an escaped 0x90 byte.
			dbuf_writebyte(dfctx->dcmpro->f, 0x90);
			rctx->nbytes_written++;
			rctx->last_output_byte = 0x90;
			rctx->countcode_pending = 0;
		}
		else if(rctx->countcode_pending) {
			i64 count;

			// RLE. We already emitted one byte (because the byte to repeat
			// comes before the repeat count), so write countcode-1 bytes.
			count = (i64)(b-1);
			if(dfctx->dcmpro->len_known &&
				(rctx->nbytes_written+count > dfctx->dcmpro->expected_len))
			{
				count = dfctx->dcmpro->expected_len - rctx->nbytes_written;
			}
			dbuf_write_run(dfctx->dcmpro->f, rctx->last_output_byte, count);
			rctx->nbytes_written += count;

			rctx->countcode_pending = 0;
		}
		else if(b==0x90) {
			rctx->countcode_pending = 1;
		}
		else {
			dbuf_writebyte(dfctx->dcmpro->f, b);
			rctx->nbytes_written++;
			rctx->last_output_byte = b;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r13
testq %r13, %r13
sete %al
testq %rdx, %rdx
setle %cl
orb %al, %cl
jne 0xfaa2b
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %ebp, %ebp
movq 0x10(%r14), %rax
movb 0x8(%rax), %cl
testb %cl, %cl
je 0xfa978
movq 0x8(%r13), %rdx
cmpq 0x10(%rax), %rdx
jge 0xfaa26
movb (%r15,%rbp), %dl
incq (%r13)
movl 0x14(%r13), %esi
testl %esi, %esi
setne %dil
testb %dl, %dl
sete %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0xfa9b1
movq (%rax), %rdi
movl $0x90, %esi
callq 0xf0bd6
incq 0x8(%r13)
movb $-0x70, 0x10(%r13)
jmp 0xfa9ec
movzbl %dl, %r12d
testl %esi, %esi
je 0xfaa02
decq %r12
testb %cl, %cl
je 0xfa9d8
movq 0x8(%r13), %rcx
movq 0x10(%rax), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
addq %r12, %rcx
cmpq %rdx, %rcx
cmovgq %rsi, %r12
movq (%rax), %rdi
movzbl 0x10(%r13), %esi
movq %r12, %rdx
callq 0xf0eba
addq %r12, 0x8(%r13)
movl $0x0, 0x14(%r13)
incq %rbp
cmpq %rbp, %rbx
jne 0xfa95f
jmp 0xfaa2b
cmpb $-0x70, %dl
jne 0xfaa11
movl $0x1, 0x14(%r13)
jmp 0xfa9f4
movq (%rax), %rdi
movl %r12d, %esi
callq 0xf0bd6
incq 0x8(%r13)
movb %r12b, 0x10(%r13)
jmp 0xfa9f4
movb $0x1, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: my_rle90_codec_finish
static void my_rle90_codec_finish(struct de_dfilter_ctx *dfctx)
{
	struct rle90ctx *rctx = (struct rle90ctx*)dfctx->codec_private;

	if(!rctx) return;
	dfctx->dres->bytes_consumed = rctx->total_nbytes_processed;
	dfctx->dres->bytes_consumed_valid = 1;
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0xfaa52
movq (%rax), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movb $0x1, 0x4(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: my_rle90_codec_destroy
static void my_rle90_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct rle90ctx *rctx = (struct rle90ctx*)dfctx->codec_private;

	if(rctx) {
		de_free(dfctx->c, rctx);
	}
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0xfaa68
movq (%rbx), %rdi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: de_lz77buffer_create
struct de_lz77buffer *de_lz77buffer_create(deark *c, UI bufsize)
{
	struct de_lz77buffer *rb;

	rb = de_malloc(c, sizeof(struct de_lz77buffer));
	rb->buf = de_malloc(c, (i64)bufsize);
	rb->bufsize = bufsize;
	rb->mask = bufsize - 1;
	return rb;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x28, %esi
callq 0xe8b2b
movq %rax, %r15
movl %ebx, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, 0x20(%r15)
movl %ebx, 0x18(%r15)
decl %ebx
movl %ebx, 0x14(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: lzss_lz77buf_writebytecb
static void lzss_lz77buf_writebytecb(struct de_lz77buffer *rb, const u8 n)
{
	struct lzss_ctx *sctx = (struct lzss_ctx*)rb->userdata;

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

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

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpl $0x0, 0x8(%rbx)
jne 0xfadfc
movq 0x18(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0xfade4
movq (%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0xfadf5
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf0bd6
incq (%rbx)
jmp 0xfadfc
movl $0x1, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: lzss_fill_bitbuf
static void lzss_fill_bitbuf(deark *c, struct lzss_ctx *sctx)
{
	u8 b;

	if(sctx->cur_ipos+1 > sctx->endpos) {
		sctx->stop_flag = 1;
		return;
	}
	b = dbuf_getbyte_p(sctx->dcmpri->f, &sctx->cur_ipos);
	de_bitbuf_lowlevel_add_byte(&sctx->bbll, b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpq 0x30(%rdi), %rax
jge 0xfae45
leaq 0x28(%rbx), %rsi
movq 0x10(%rbx), %rax
movq (%rax), %rdi
callq 0xeeb4b
addq $0x38, %rbx
movzbl %al, %esi
movq %rbx, %rdi
popq %rbx
jmp 0xf1b5e
movl $0x1, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: de_lz77buffer_copy_from_hist
void de_lz77buffer_copy_from_hist(struct de_lz77buffer *rb,
	UI startpos, UI count)
{
	UI frompos;
	UI i;

	frompos = startpos & rb->mask;
	for(i=0; i<count; i++) {
		de_lz77buffer_add_literal_byte(rb, rb->buf[frompos]);
		frompos = (frompos+1) & rb->mask;
	}
}

// Assembly:
testl %edx, %edx
je 0xfaed3
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
andl 0x14(%rdi), %ebp
movq 0x20(%r14), %rax
movl %ebp, %ecx
movzbl (%rax,%rcx), %r15d
movq %r14, %rdi
movl %r15d, %esi
callq *0x8(%r14)
movq 0x20(%r14), %rax
movl 0x10(%r14), %ecx
movb %r15b, (%rax,%rcx)
movl 0x10(%r14), %eax
movl 0x14(%r14), %ecx
incl %eax
andl %ecx, %eax
movl %eax, 0x10(%r14)
incl %ebp
andl %ecx, %ebp
decl %ebx
jne 0xfae90
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: sit_huff_read_tree
static void sit_huff_read_tree(struct sit_huffctx *hctx, u64 curr_code, UI curr_code_nbits)
{
	u8 x;

	if(curr_code_nbits>FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
		hctx->errflag = 1;
	}
	if(hctx->bitrd.eof_flag || hctx->errflag) return;

	x = (u8)de_bitreader_getbits(&hctx->bitrd, 1);
	if(hctx->bitrd.eof_flag) return;

	if(x==0) {
		sit_huff_read_tree(hctx, curr_code<<1, curr_code_nbits+1);
		if(hctx->bitrd.eof_flag || hctx->errflag) return;
		sit_huff_read_tree(hctx, (curr_code<<1) | 1, curr_code_nbits+1);
	}
	else {
		int ret;
		fmtutil_huffman_valtype val;

		val = (fmtutil_huffman_valtype)de_bitreader_getbits(&hctx->bitrd, 8);
		if(hctx->c->debug_level>=2) {
			char b2buf[72];

			de_dbg(hctx->c, "code: \"%s\" = %d",
				de_print_base2_fixed(b2buf, sizeof(b2buf), curr_code, curr_code_nbits),
				(int)val);
		}
		ret = fmtutil_huffman_add_code(hctx->c, hctx->ht->bk, curr_code, curr_code_nbits, val);
		if(!ret) {
			hctx->errflag = 1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
cmpl $0x31, %ebp
jb 0xfb841
movl $0x1, 0x30(%rbx)
cmpb $0x0, 0x50(%rbx)
jne 0xfb8fd
cmpl $0x0, 0x30(%rbx)
jne 0xfb8fd
movq %r15, %rdi
movl $0x1, %esi
callq 0xf1bed
cmpb $0x0, 0x50(%rbx)
jne 0xfb8fd
testb %al, %al
jne 0xfb894
addq %r14, %r14
incl %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xfb81d
cmpb $0x0, 0x50(%rbx)
jne 0xfb8fd
orq $0x1, %r14
cmpl $0x0, 0x30(%rbx)
je 0xfb835
jmp 0xfb8fd
movq %r15, %rdi
movl $0x8, %esi
callq 0xf1bed
movq %rax, %r15
movq (%rbx), %r12
cmpl $0x2, (%r12)
jl 0xfb8da
movq %rsp, %rdi
movl $0x48, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0xe9d03
leaq 0x22b9d(%rip), %rsi     # 0x11e464
movq %r12, %rdi
movq %rax, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0xe8617
movq (%rbx), %r12
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movl %r15d, %r8d
callq 0x1044c1
testl %eax, %eax
jne 0xfb8fd
movl $0x1, 0x30(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: fmtutil_decompress_exepack_reloc_tbl
int fmtutil_decompress_exepack_reloc_tbl(deark *c, i64 pos1, i64 endpos, dbuf *outf)
{
	i64 pos = pos1;
	i64 seg = 0;
	int reloc_count = 0;
	int retval = 0;
	int saved_indent_level;
	dbuf *inf = c->infile;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "compressed reloc table: pos=%"I64_FMT", end=%"I64_FMT, pos1, endpos);
	if(endpos > inf->len) goto done;
	de_dbg_indent(c, 1);

	for(seg=0; seg<0x10000; seg+=0x1000) {
		i64 count;
		i64 i;

		if(pos>=endpos) {
			goto done;
		}
		count = dbuf_getu16le_p(inf, &pos);
		de_dbg2(c, "seg %04x count: %u", (UI)seg, (UI)count);

		de_dbg_indent(c, 1);
		for(i=0; i<count; i++) {
			i64 offs;

			if(pos>=endpos || reloc_count>=65535) goto done;
			offs = dbuf_getu16le_p(inf, &pos);
			de_dbg2(c, "reloc: %04x:%04x", (UI)seg, (UI)offs);
			dbuf_writeu16le(outf, offs);
			dbuf_writeu16le(outf, seg);
			reloc_count++;
		}
		de_dbg_indent(c, -1);
	}

	retval = 1;
	de_dbg(c, "reloc count: %d", (int)reloc_count);

done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq 0x18(%rdi), %rbp
leaq 0x14(%rsp), %rsi
callq 0xe8a1c
leaq 0x4f256(%rip), %rsi     # 0x14ab94
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
movq %r15, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
cmpq %r15, 0x18(%rbp)
jl 0xfba76
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x20(%rsp), %rax
cmpq %rax, 0x8(%rsp)
jge 0xfba73
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xeebeb
movq %rax, %r13
movq %rbx, %rdi
leaq 0x4f21a(%rip), %rsi     # 0x14abbd
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe87e4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
testq %r13, %r13
jle 0xfba33
leal (%rbp,%r13), %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq %rax, 0x8(%rsp)
jge 0xfba73
cmpl $0xfffe, %ebp           # imm = 0xFFFE
jg 0xfba73
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xeebeb
movq %rax, %r15
movq %rbx, %rdi
leaq 0x4f1cd(%rip), %rsi     # 0x14abd0
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0xe87e4
movq %r14, %rdi
movq %r15, %rsi
callq 0xf0f95
movq %r14, %rdi
movq %r12, %rsi
callq 0xf0f95
incl %ebp
decq %r13
jne 0xfb9cb
movl 0x10(%rsp), %eax
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
leaq 0x1000(%r12), %rax
cmpq $0xf000, %r12           # imm = 0xF000
movq %rax, %r12
jb 0xfb977
leaq 0x3384c(%rip), %rsi     # 0x12f2ab
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movl $0x1, %r13d
jmp 0xfba76
xorl %r13d, %r13d
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: squeeze_interpret_node
static void squeeze_interpret_node(struct squeeze_ctx *sqctx,
	i64 nodenum, u64 currcode, UI currcode_nbits)
{
	// TODO: Report errors?
	if(nodenum<0 || nodenum>=sqctx->nodecount) return;
	if(sqctx->tmpnodes[nodenum].in_use) return; // Loops are bad
	if(currcode_nbits>=FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) return;

	sqctx->tmpnodes[nodenum].in_use = 1;
	squeeze_interpret_dval(sqctx, sqctx->tmpnodes[nodenum].child[0].dval, currcode<<1, currcode_nbits+1);
	squeeze_interpret_dval(sqctx, sqctx->tmpnodes[nodenum].child[1].dval, ((currcode<<1) | 1), currcode_nbits+1);
	sqctx->tmpnodes[nodenum].in_use = 0;
}

// Assembly:
testq %rsi, %rsi
js 0xfc398
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpq %rsi, 0x30(%rdi)
jle 0xfc38d
movl %ecx, %ebx
cmpl $0x2f, %ecx
ja 0xfc38d
leaq (%rsi,%rsi,2), %rax
cmpb $0x0, 0x70(%r14,%rax,2)
jne 0xfc38d
movq %rdx, %r15
leaq (%r14,%rax,2), %r12
addq $0x70, %r12
movb $0x1, (%r12)
movswl 0x2(%r12), %esi
addq %rdx, %rdx
incl %ebx
movq %r14, %rdi
movl %ebx, %ecx
callq 0xfc399
movswl 0x4(%r12), %esi
leaq 0x1(,%r15,2), %rdx
movq %r14, %rdi
movl %ebx, %ecx
callq 0xfc399
movb $0x0, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: squeeze_interpret_dval
static void squeeze_interpret_dval(struct squeeze_ctx *sqctx,
	i16 dval, u64 currcode, UI currcode_nbits)
{
	char b2buf[72];

	if(dval>=0) { // a pointer to a node
		if((i64)dval < sqctx->nodecount) {
			squeeze_interpret_node(sqctx, (i64)dval, currcode, currcode_nbits);
		}
	}
	else if(dval>=(-257) && dval<=(-1)) {
		fmtutil_huffman_valtype adj_value;

		//  -257 => 256 (stop code)
		//  -256 => 255 (byte value)
		//  -255 => 254 (byte value)
		//  ...
		//  -1   => 0   (byte value)
		adj_value = -(((fmtutil_huffman_valtype)dval)+1);
		if(sqctx->c->debug_level>=3) {
			de_dbg3(sqctx->c, "code: \"%s\" = %d",
				de_print_base2_fixed(b2buf, sizeof(b2buf), currcode, currcode_nbits),
				(int)adj_value);
		}
		fmtutil_huffman_add_code(sqctx->c, sqctx->ht->bk, currcode, currcode_nbits, adj_value);
	}
	// TODO: Report errors?
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
testw %si, %si
js 0xfc3d4
movzwl %si, %esi
cmpq %rsi, 0x30(%r15)
jle 0xfc430
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %ecx
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xfc322
movzwl %si, %eax
cmpl $0xfeff, %eax           # imm = 0xFEFF
jb 0xfc430
notl %esi
movzwl %si, %ebp
movq (%r15), %r12
cmpl $0x3, (%r12)
jl 0xfc418
movq %rsp, %rdi
movl $0x48, %esi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xe9d03
leaq 0x2205e(%rip), %rsi     # 0x11e464
movq %r12, %rdi
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe889f
movq (%r15), %r12
movq 0x38(%r15), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %r14, %rdx
movl %ebx, %ecx
movl %ebp, %r8d
callq 0x1044c1
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: xpk_xor1_cbfn
static int xpk_xor1_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	u8 *pn = (u8*)brctx->userdata;
	i64 i;

	for(i=0; i<buf_len; i++) {
		*pn ^= buf[i];
	}
	return 1;
}

// Assembly:
testq %rdx, %rdx
jle 0xfc456
movq (%rdi), %rax
movb (%rax), %cl
xorl %edi, %edi
xorb (%rsi,%rdi), %cl
movb %cl, (%rax)
incq %rdi
cmpq %rdi, %rdx
jne 0xfc449
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: xpk_xor2_cbfn
static int xpk_xor2_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	UI *pn = (UI*)brctx->userdata;
	UI align;
	i64 i;

	align = brctx->offset & 0x1;

	for(i=0; i<buf_len; i++) {
		if(align) {
			*pn ^= buf[i];
		}
		else {
			*pn ^= ((UI)buf[i])<<8;
		}
		align = !align;
	}
	return 1;
}

// Assembly:
testq %rdx, %rdx
jle 0xfc491
movq (%rdi), %rax
movl 0x10(%rdi), %ecx
andl $0x1, %ecx
movl (%rax), %edi
xorl %r8d, %r8d
movzbl (%rsi,%r8), %r9d
movl %r9d, %r10d
shll $0x8, %r10d
testl %ecx, %ecx
cmovnel %r9d, %r10d
xorl %r10d, %edi
movl %edi, (%rax)
xorl $0x1, %ecx
incq %r8
cmpq %r8, %rdx
jne 0xfc46f
movl $0x1, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-advfile.c
// Function: de_advfile_create
struct de_advfile *de_advfile_create(deark *c)
{
	struct de_advfile *advf = NULL;

	advf = de_malloc(c, sizeof(struct de_advfile));
	advf->c = c;
	advf->filename = ucstring_create(c);
	advf->mainfork.fi = de_finfo_create(c);
	advf->rsrcfork.fi = de_finfo_create(c);
	return advf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x98, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0xf6410
movq %rax, 0x68(%r14)
movq %rbx, %rdi
callq 0xea504
movq %rax, 0x20(%r14)
movq %rbx, %rdi
callq 0xea504
movq %rax, 0x48(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-advfile.c
// Function: de_advfile_destroy
void de_advfile_destroy(struct de_advfile *advf)
{
	deark *c;

	if(!advf) return;
	c = advf->c;
	ucstring_destroy(advf->filename);
	de_finfo_destroy(c, advf->mainfork.fi);
	de_finfo_destroy(c, advf->rsrcfork.fi);
	de_free(c, advf->orig_filename);
	de_free(c, advf);
}

// Assembly:
testq %rdi, %rdi
je 0xfc52f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x68(%rdi), %rdi
callq 0xf6753
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xea50e
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0xea50e
movq 0x88(%rbx), %rsi
movq %r14, %rdi
callq 0xe8be2
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-advfile.c
// Function: de_advfile_set_orig_filename
void de_advfile_set_orig_filename(struct de_advfile *advf, const char *fn, size_t fnlen)
{
	deark *c = advf->c;

	if(advf->orig_filename) {
		de_free(c, advf->orig_filename);
		advf->orig_filename = NULL;
	}

	if(fnlen<1) return;
	advf->orig_filename_len = fnlen;
	if(advf->orig_filename_len>1024)
		advf->orig_filename_len = 1024;
	advf->orig_filename = de_malloc(c, advf->orig_filename_len);
	de_memcpy(advf->orig_filename, fn, advf->orig_filename_len);

	if(advf->orig_filename[0]<32) {
		// This is to ensure that our applesd module won't incorrectly guess that
		// this is a Pascal string.
		advf->orig_filename[0] = '_';
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x88(%rdi), %rsi
testq %rsi, %rsi
je 0xfc563
movq %r15, %rdi
callq 0xe8be2
movq $0x0, 0x88(%rbx)
testq %r12, %r12
je 0xfc5ab
movl $0x400, %esi            # imm = 0x400
cmpq %rsi, %r12
cmovbq %r12, %rsi
movq %rsi, 0x80(%rbx)
movq %r15, %rdi
callq 0xe8b2b
movq %rax, 0x88(%rbx)
movq 0x80(%rbx), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x181e0
movq 0x88(%rbx), %rax
cmpb $0x1f, (%rax)
ja 0xfc5ab
movb $0x5f, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_create_md
struct de_arch_member_data *de_arch_create_md(deark *c, de_arch_lctx *d)
{
	struct de_arch_member_data *md;

	md = de_malloc(c, sizeof(struct de_arch_member_data));
	md->c = c;
	md->d = d;
	md->filename = ucstring_create(c);
	md->name_for_msgs = ucstring_create(c);
	md->fi = de_finfo_create(c);
	return md;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0xc8, %esi
callq 0xe8b2b
movq %rax, %r15
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, %rdi
callq 0xf6410
movq %rax, 0x58(%r15)
movq %r14, %rdi
callq 0xf6410
movq %rax, 0x60(%r15)
movq %r14, %rdi
callq 0xea504
movq %rax, 0x50(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_destroy_md
void de_arch_destroy_md(deark *c, struct de_arch_member_data *md)
{
	if(!md) return;
	ucstring_destroy(md->filename);
	ucstring_destroy(md->name_for_msgs);
	ucstring_destroy(md->tmpfn_base);
	ucstring_destroy(md->tmpfn_path);
	de_finfo_destroy(c, md->fi);
	de_free(c, md);
}

// Assembly:
testq %rsi, %rsi
je 0xfd4b1
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rsi), %rdi
callq 0xf6753
movq 0x60(%rbx), %rdi
callq 0xf6753
movq 0x68(%rbx), %rdi
callq 0xf6753
movq 0x70(%rbx), %rdi
callq 0xf6753
movq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0xea50e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_create_lctx
de_arch_lctx *de_arch_create_lctx(deark *c)
{
	de_arch_lctx *d;

	d = de_malloc(c, sizeof(de_arch_lctx));
	d->c = c;
	d->inf = c->infile;
	return d;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x70, %esi
callq 0xe8b2b
movq %rbx, (%rax)
movq 0x18(%rbx), %rcx
movq %rcx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_fixup_path
void de_arch_fixup_path(de_ucstring *s, UI flags)
{
	i64 i;

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

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

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
jle 0xfd52d
movq 0x8(%rdi), %rcx
xorl %edx, %edx
cmpl $0x5c, (%rcx,%rdx,4)
jne 0xfd514
movl $0x2f, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0xfd507
testb $0x1, %sil
je 0xfd52d
movq 0x8(%rdi), %rcx
cmpl $0x2f, -0x4(%rcx,%rax,4)
jne 0xfd52e
retq
movl $0x2f, %esi
jmp 0xf6542
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_read_field_orig_len_p
void de_arch_read_field_orig_len_p(struct de_arch_member_data *md, i64 *ppos)
{
	i64 n;

	n = dbuf_getu32x(md->d->inf, *ppos, md->d->is_le);
	*ppos += 4;
	handle_field_orig_len(md, n);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rdi
movq (%rsi), %rsi
movl 0x10(%rax), %edx
callq 0xeeff3
addq $0x4, (%rbx)
movq %rax, 0x38(%r14)
movb $0x1, 0x4c(%r14)
movq (%r14), %rdi
leaq 0x1ac80(%rip), %rsi     # 0x1181ec
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_read_field_cmpr_len_p
void de_arch_read_field_cmpr_len_p(struct de_arch_member_data *md, i64 *ppos)
{
	i64 n;

	n = dbuf_getu32x(md->d->inf, *ppos, md->d->is_le);
	*ppos += 4;
	handle_field_cmpr_len(md, n);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rdi
movq (%rsi), %rsi
movl 0x10(%rax), %edx
callq 0xeeff3
addq $0x4, (%rbx)
movq %rax, 0x30(%r14)
movq (%r14), %rdi
leaq 0x20def(%rip), %rsi     # 0x11e39b
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_handle_field_dos_attr
void de_arch_handle_field_dos_attr(struct de_arch_member_data *md, UI attr)
{
	de_ucstring *descr = NULL;

	md->dos_attribs = attr;
	md->has_dos_attribs = 1;
	descr = ucstring_create(md->c);
	de_describe_dos_attribs(md->c, md->dos_attribs, descr, 0);
	de_dbg(md->c, "DOS attribs: 0x%02x (%s)", md->dos_attribs, ucstring_getpsz_d(descr));
	ucstring_destroy(descr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x7c(%rdi)
movb $0x1, 0x81(%rdi)
movq (%rdi), %rdi
callq 0xf6410
movq %rax, %r14
movq (%rbx), %rdi
movl 0x7c(%rbx), %esi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0xeaae1
movq (%rbx), %r15
movl 0x7c(%rbx), %ebx
movq %r14, %rdi
callq 0xf70f6
leaq 0x462c9(%rip), %rsi     # 0x1438c8
movq %r15, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xf6753
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: de_arch_good_cmpr_data_pos
int de_arch_good_cmpr_data_pos(struct de_arch_member_data *md)
{
	if(md->cmpr_pos<0 || md->cmpr_len<0 ||
		md->cmpr_pos+md->cmpr_len > md->d->inf->len)
	{
		ensure_name_for_msgs_is_set(md);
		de_err(md->c, "%s: Data goes beyond end of file",
			ucstring_getpsz_d(md->name_for_msgs));
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
testq %rax, %rax
js 0xfd7de
movq 0x30(%rbx), %rcx
testq %rcx, %rcx
js 0xfd7de
addq %rax, %rcx
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movl $0x1, %ebp
cmpq 0x18(%rax), %rcx
jle 0xfd808
movq %rbx, %rdi
callq 0xfd80f
movq (%rbx), %r14
movq 0x60(%rbx), %rdi
callq 0xf70f6
leaq 0x173ff(%rip), %rsi     # 0x114bf8
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-arch.c
// Function: ensure_name_for_msgs_is_set
static void ensure_name_for_msgs_is_set(struct de_arch_member_data *md)
{
	if(md->name_for_msgs_flag) return;

	if(ucstring_isnonempty(md->filename)) {
		ucstring_empty(md->name_for_msgs);
		ucstring_append_ucstring(md->name_for_msgs, md->filename);
	}
	else {
		if(ucstring_isempty(md->name_for_msgs)) {
			ucstring_append_sz(md->name_for_msgs, "(unknown filename)", DE_ENCODING_LATIN1);
		}
	}
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x4d(%rdi)
je 0xfd818
popq %rbx
retq
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
callq 0xf67a3
movq 0x60(%rbx), %rdi
testl %eax, %eax
je 0xfd83f
callq 0xf6423
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdi
popq %rbx
jmp 0xf6509
callq 0xf678d
testl %eax, %eax
je 0xfd816
movq 0x60(%rbx), %rdi
leaq 0x4d6dc(%rip), %rsi     # 0x14af2f
movl $0x5, %edx
popq %rbx
jmp 0xf65e3
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/ozunreduce.h
// Function: ozur_flush
static void ozur_flush(ozur_ctx *ozur)
{
	size_t ret;
	size_t n;

	if(ozur->error_code) return;
	n = ozur->circbuf_pos;
	if(n<1 || n>OZUR_CIRCBUF_SIZE) return;
	ret = ozur->cb_write(ozur, ozur->circbuf, n);
	if(ret != n) {
		ozur_set_error(ozur, OZUR_ERRCODE_WRITE_FAILED);
		return;
	}
	ozur->uncmpr_nbytes_written += (OZUR_OFF_T)ret;
}

// Assembly:
cmpl $0x0, 0x38(%rdi)
je 0xfdf60
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2278(%rdi), %r14
leaq -0x1001(%r14), %rax
cmpq $-0x1000, %rax          # imm = 0xF000
jb 0xfdfa5
leaq 0x2280(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq *0x28(%rbx)
cmpq %r14, %rax
jne 0xfdf98
addq %r14, 0x40(%rbx)
jmp 0xfdfa5
cmpl $0x0, 0x38(%rbx)
jne 0xfdfa5
movl $0x7, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/ozunreduce.h
// Function: ozur_bitreader_getbits
static OZUR_UINT8 ozur_bitreader_getbits(ozur_ctx *ozur, unsigned int nbits)
{
	OZUR_UINT8 n;

	if(nbits<1 || nbits>8) return 0;

	if(ozur->bitreader_nbits_in_buf < nbits) {
		OZUR_UINT8 b;

		b = ozur_nextbyte(ozur);
		if(ozur->error_code) return 0;
		ozur->bitreader_buf |= ((unsigned int)b)<<ozur->bitreader_nbits_in_buf;
		ozur->bitreader_nbits_in_buf += 8;
	}

	n = (OZUR_UINT8)(ozur->bitreader_buf & (0xff >> (8-nbits)));
	ozur->bitreader_buf >>= nbits;
	ozur->bitreader_nbits_in_buf -= nbits;
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
leal -0x9(%r14), %eax
cmpl $-0x8, %eax
jb 0xfe0c3
movq %rdi, %rbx
movl 0x64(%rdi), %edx
cmpl %r14d, %edx
jae 0xfe05a
cmpl $0x0, 0x38(%rbx)
jne 0xfe0c3
movq 0x10(%rbx), %r15
cmpq %r15, 0x48(%rbx)
jge 0xfe07b
movq 0x3280(%rbx), %rcx
xorl %eax, %eax
cmpq 0x3288(%rbx), %rcx
jb 0xfe0a1
leaq 0x3280(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
subq 0x50(%rbx), %r15
movl $0x400, %eax            # imm = 0x400
cmpq %rax, %r15
cmovgeq %rax, %r15
leaq -0x401(%r15), %rcx
xorl %ebp, %ebp
movl $0x0, %eax
cmpq $-0x400, %rcx           # imm = 0xFC00
jb 0xfe097
leaq 0x3290(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq *0x20(%rbx)
cmpq %r15, %rax
jne 0xfe084
addq %r15, 0x50(%rbx)
movq %r15, 0x3288(%rbx)
movl 0x38(%rbx), %eax
jmp 0xfe0a1
movl 0x60(%rbx), %ebp
movb $0x8, %cl
subb %r14b, %cl
movl $0xff, %eax
shrl %cl, %eax
andl %ebp, %eax
movl %r14d, %ecx
shrl %cl, %ebp
movl %ebp, 0x60(%rbx)
subl %r14d, %edx
movl %edx, 0x64(%rbx)
jmp 0xfe0c5
movl $0x8, 0x38(%rbx)
jmp 0xfe0c3
movl 0x38(%rbx), %eax
testl %eax, %eax
jne 0xfe097
movl $0x6, 0x38(%rbx)
movl $0x6, %eax
cmpq $0x0, 0x3288(%rbx)
je 0xfe0bf
movq 0x3280(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x3280(%rbx)
movzbl 0x3290(%rbx,%rcx), %ebp
incq 0x48(%rbx)
testl %eax, %eax
je 0xfe0d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x64(%rbx), %edx
movl %edx, %ecx
shll %cl, %ebp
orl 0x60(%rbx), %ebp
addl $0x8, %edx
jmp 0xfe05d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/ozunreduce.h
// Function: ozur_emit_byte
static void ozur_emit_byte(ozur_ctx *ozur, OZUR_UINT8 x)
{
	ozur->circbuf[ozur->circbuf_pos++] = x;
	if(ozur->circbuf_pos >= OZUR_CIRCBUF_SIZE) {
		ozur_flush(ozur);
		ozur->circbuf_pos = 0;
	}
	ozur->uncmpr_nbytes_emitted++;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x2278(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x2278(%rdi)
movb %sil, 0x2280(%rdi,%rax)
cmpq $0x1000, 0x2278(%rdi) # imm = 0x1000
jb 0xfe120
movq %rbx, %rdi
callq 0xfdf59
movq $0x0, 0x2278(%rbx)
incq 0x58(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-fax.c
// Function: fax34_on_eol
static void fax34_on_eol(deark *c, struct fax_ctx *fc, int is_real)
{
	i64 i;

	de_dbg3(c, "%sEOL", is_real?"":"implicit ");

	if(fc->ypos >= fc->image_height) goto done;

	// [Pack curr_row into bits (tmp_row_packed)]
	de_zeromem(fc->tmp_row_packed, (size_t)fc->rowspan_final);
	for(i=0; i<fc->image_width; i++) {
		if(fc->curr_row[i]) {
			fc->tmp_row_packed[i/8] |= 1U<<(7-i%8);
		}
	}

	// [Write tmp_row_packed to fc->dcmpro]
	dbuf_write(fc->dcmpro->f, fc->tmp_row_packed, fc->rowspan_final);
	fc->nbytes_written += fc->rowspan_final;

	if(fc->is_2d) {
		de_memcpy(fc->prev_row, fc->curr_row, (size_t)fc->image_width);
	}

	// initialize curr_row
	de_zeromem(fc->curr_row, (size_t)fc->image_width);

	fc->ypos++;
done:
	fc->a0 = -1;
	fc->a0_color = 0;
	fc->pending_run_len = 0;
	fc->f2d_h_codes_remaining = 0;
	fc->have_read_tag_bit = 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
testl %edx, %edx
leaq 0x4c7b6(%rip), %rax     # 0x14b191
leaq 0x466ce(%rip), %rdx     # 0x1450b0
cmoveq %rax, %rdx
leaq 0x4c79e(%rip), %rsi     # 0x14b18b
xorl %eax, %eax
callq 0xe889f
movq 0xa8(%rbx), %rax
cmpq 0x38(%rbx), %rax
jge 0xfeaac
movq 0x88(%rbx), %rdx
movq 0x90(%rbx), %rdi
xorl %esi, %esi
callq 0x18140
movq 0x30(%rbx), %rcx
testq %rcx, %rcx
jle 0xfea57
xorl %eax, %eax
movq 0x78(%rbx), %rdx
cmpb $0x0, (%rdx,%rax)
je 0xfea4f
movl %eax, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %dl
shlb %cl, %dl
movq 0x90(%rbx), %rcx
movq %rax, %rsi
shrq $0x3, %rsi
orb %dl, (%rcx,%rsi)
movq 0x30(%rbx), %rcx
incq %rax
cmpq %rcx, %rax
jl 0xfea25
movq 0x8(%rbx), %rax
movq 0x88(%rbx), %rdx
movq (%rax), %rdi
movq 0x90(%rbx), %rsi
callq 0xef547
movq 0x88(%rbx), %rax
addq %rax, 0x40(%rbx)
cmpb $0x0, 0x2a(%rbx)
je 0xfea96
movq 0x80(%rbx), %rdi
movq 0x30(%rbx), %rdx
movq 0x78(%rbx), %rsi
callq 0x181e0
movq 0x30(%rbx), %rdx
movq 0x78(%rbx), %rdi
xorl %esi, %esi
callq 0x18140
incq 0xa8(%rbx)
movq $-0x1, 0xb0(%rbx)
movw $0x0, 0xb8(%rbx)
movq $0x0, 0x98(%rbx)
movl $0x0, 0xa0(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-fax.c
// Function: find_b1
static void find_b1(struct fax_ctx *fc)
{
	i64 i;

	for(i=fc->a0+1; i<fc->image_width; i++) {
		if(i<0) continue;

		// first prev_row pixel to the right of a0, of opposite color to a0_color
		if(fc->prev_row[i]==fc->a0_color) continue;

		// Looking for a "changing element". I.e. if both it and the pixel to the left
		// exist, they must have different colors.
		if(i==0) {
			// Leftmost pixel is "changing" if it is black
			if(fc->prev_row[i]==0) continue;
		}
		else {
			if(fc->prev_row[i-1] == fc->prev_row[i]) continue;
		}

		fc->b1 = i;
		return;
	}
	fc->b1 = fc->image_width;
}

// Assembly:
movq 0x30(%rdi), %rax
movq 0xb0(%rdi), %rcx
incq %rcx
cmpq %rax, %rcx
jge 0xfeb24
leaq -0x1(%rcx), %rdx
cmpq $-0x1, %rdx
jl 0xfeb17
movq 0x80(%rdi), %rsi
movb (%rsi,%rcx), %dl
cmpb 0xb8(%rdi), %dl
je 0xfeb17
testq %rcx, %rcx
je 0xfeb13
cmpb %dl, -0x1(%rsi,%rcx)
je 0xfeb17
jmp 0xfeb21
testb %dl, %dl
jne 0xfeb21
incq %rcx
cmpq %rcx, %rax
jne 0xfeaea
jmp 0xfeb24
movq %rcx, %rax
movq %rax, 0xc0(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-fax.c
// Function: fax34_record_run
static void fax34_record_run(deark *c, struct fax_ctx *fc, i64 run_len,
	int respect_negative_a0)
{
	i64 i;
	u8 color = fc->a0_color;

	de_dbg3(c, "run c=%u len=%d", (UI)color, (int)run_len);

	if(fc->a0<0) {
		if(respect_negative_a0) {
			run_len += fc->a0;
		}
		fc->a0 = 0;
	}

	if(color==0) { // Pixels are initialized to 0, don't need to set them.
		fc->a0 += run_len;
	}
	else {
		for(i=0; (i<run_len) && (fc->a0 < fc->image_width); i++) {
			fc->curr_row[fc->a0++] = color;
		}
	}

	if(fc->a0 > fc->image_width) {
		fc->a0 = fc->image_width;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movb 0xb8(%rsi), %r15b
movzbl %r15b, %edx
leaq 0x4c64e(%rip), %rsi     # 0x14b19b
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe889f
movq 0xb0(%rbx), %rax
testq %rax, %rax
jns 0xfeb7b
xorl %ecx, %ecx
testl %ebp, %ebp
cmoveq %rcx, %rax
addq %rax, %r14
movq $0x0, 0xb0(%rbx)
xorl %eax, %eax
testb %r15b, %r15b
je 0xfebb3
testq %r14, %r14
jle 0xfebbd
movq 0xb0(%rbx), %rax
cmpq 0x30(%rbx), %rax
jge 0xfebbd
movq 0x78(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0xb0(%rbx)
movb %r15b, (%rcx,%rax)
decq %r14
jne 0xfeb85
movq 0xb0(%rbx), %rax
jmp 0xfebbd
addq %r14, %rax
movq %rax, 0xb0(%rbx)
movq 0x30(%rbx), %rcx
cmpq %rcx, %rax
jle 0xfebcd
movq %rcx, 0xb0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: destroy_lzh_ctx
static void destroy_lzh_ctx(struct lzh_ctx *cctx)
{
	deark *c;

	if(!cctx) return;
	c = cctx->c;
	lzh_destroy_trees(cctx);
	if(cctx->ringbuf && !cctx->ringbuf_owned_by_caller) {
		de_lz77buffer_destroy(c, cctx->ringbuf);
		cctx->ringbuf = NULL;
	}
	if(cctx->crco) de_crcobj_destroy(cctx->crco);
	de_free(c, cctx);
}

// Assembly:
testq %rdi, %rdi
je 0xff751
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
callq 0x101ec2
movq 0x70(%rbx), %rsi
testq %rsi, %rsi
je 0xff72e
cmpl $0x0, 0x78(%rbx)
jne 0xff72e
movq %r14, %rdi
callq 0xfaed4
movq $0x0, 0x70(%rbx)
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0xff73f
callq 0xeb858
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: fmtutil_deflate_codectype1
void fmtutil_deflate_codectype1(deark *c, struct de_dfilter_in_params *dcmpri,
	struct de_dfilter_out_params *dcmpro, struct de_dfilter_results *dres,
	void *codec_private_params)
{
	struct de_deflate_params *deflparams = (struct de_deflate_params*)codec_private_params;
	int must_use_miniz = 0;
	int must_use_native = 0;

	if(!deflparams) return;

	if(deflparams->ringbuf_to_use || (deflparams->flags & DE_DEFLATEFLAG_DEFLATE64)) {
		must_use_native = 1;
	}

	if(must_use_miniz && must_use_native) return;

	if(must_use_miniz) {
		fmtutil_deflate_codectype1_miniz(c, dcmpri, dcmpro, dres, codec_private_params);
		return;
	}
	if(must_use_native) {
		fmtutil_deflate_codectype1_native(c, dcmpri, dcmpro, dres, codec_private_params);
		return;
	}

	if(c->deflate_decoder_id==0) {
		const char *o;

		o = de_get_ext_option(c, "deflatecodec");
		if(o && !de_strcmp(o, "native")) {
			c->deflate_decoder_id = 2;
		}
		else {
			c->deflate_decoder_id = 1;
		}
	}

	if(c->deflate_decoder_id==2) {
		fmtutil_deflate_codectype1_native(c, dcmpri, dcmpro, dres, codec_private_params);
	}
	else {
		fmtutil_deflate_codectype1_miniz(c, dcmpri, dcmpro, dres, codec_private_params);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %r8, %r8
je 0xff7b6
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpq $0x0, 0x8(%r8)
jne 0xff7cd
testb $0x4, (%rbx)
jne 0xff7cd
movb 0x128(%r13), %al
testb %al, %al
jne 0xff7c9
leaq 0x4bb44(%rip), %rsi     # 0x14b2d6
movq %r13, %rdi
callq 0xe9b74
testq %rax, %rax
je 0xff7b2
leaq 0x4bd40(%rip), %rsi     # 0x14b4e6
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0xff7c0
movb $0x1, %al
jmp 0xff7c2
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movb $0x2, %al
movb %al, 0x128(%r13)
cmpb $0x2, %al
jne 0xff7e7
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xff804
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x10dd24
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: fmtutil_decompress_deflate
int fmtutil_decompress_deflate(dbuf *inf, i64 inputstart, i64 inputsize, dbuf *outf,
	i64 maxuncmprsize, i64 *bytes_consumed, unsigned int flags)
{
	deark *c = inf->c;
	struct de_dfilter_results dres;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_deflate_params deflparams;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	if(bytes_consumed) *bytes_consumed = 0;

	dcmpri.f = inf;
	dcmpri.pos = inputstart;
	dcmpri.len = inputsize;

	dcmpro.f = outf;
	if(flags & DE_DEFLATEFLAG_USEMAXUNCMPRSIZE) {
		dcmpro.len_known = 1;
		dcmpro.expected_len = maxuncmprsize;
		flags -= DE_DEFLATEFLAG_USEMAXUNCMPRSIZE;
	}

	de_zeromem(&deflparams, sizeof(struct de_deflate_params));
	deflparams.flags = flags;
	fmtutil_deflate_codectype1(c, &dcmpri, &dcmpro, &dres, (void*)&deflparams);

	if(bytes_consumed && dres.bytes_consumed_valid) {
		*bytes_consumed = dres.bytes_consumed;
	}

	if(dres.errcode != 0) {
		de_err(c, "%s", de_dfilter_get_errmsg(c, &dres));
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, %r14
movq %r8, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
movl 0x100(%rsp), %r12d
movq 0x8(%rdi), %rbx
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %rbx, %rdi
callq 0xfa1dc
testq %r14, %r14
je 0x1005ea
movq $0x0, (%r14)
movq %r15, 0x30(%rsp)
movq %rbp, 0x38(%rsp)
movq %r13, 0x40(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
testb $0x2, %r12b
je 0x10061c
movb $0x1, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
addl $-0x2, %r12d
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r8
movaps %xmm0, (%r8)
movl %r12d, (%r8)
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %rbx, %rdi
callq 0xff757
testq %r14, %r14
je 0x100656
cmpb $0x0, 0x6c(%rsp)
je 0x100656
movq 0x70(%rsp), %rax
movq %rax, (%r14)
cmpl $0x0, 0x68(%rsp)
je 0x100682
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0x146ee(%rip), %rsi     # 0x114d5f
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
jmp 0x100687
movl $0x1, %ebp
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_lz77buf_writebytecb
static void lzh_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);
	if(cctx->crco) lzh_update_crc(cctx, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq (%rdi), %r14
movq 0x10(%r14), %rax
cmpb $0x0, 0x8(%rax)
je 0x10124a
movq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jge 0x101276
movq (%rax), %rdi
movzbl %bl, %esi
callq 0xf0bd6
movq 0xc0(%r14), %rdi
testq %rdi, %rdi
je 0x101272
leaq 0x7(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
callq 0xeb8ad
incq 0x28(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_lz77buf_writebytecb_flagerrors
static void lzh_lz77buf_writebytecb_flagerrors(struct de_lz77buffer *rb, u8 n)
{
	struct lzh_ctx *cctx = (struct lzh_ctx*)rb->userdata;

	if(lzh_have_enough_output(cctx)) {
		cctx->err_flag = 1;
		return;
	}
	dbuf_writebyte(cctx->dcmpro->f, n);
	if(cctx->crco) lzh_update_crc(cctx, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq (%rdi), %r14
movq 0x10(%r14), %rax
cmpb $0x0, 0x8(%rax)
je 0x1015ec
movq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jge 0x10161a
movq (%rax), %rdi
movzbl %bl, %esi
callq 0xf0bd6
movq 0xc0(%r14), %rdi
testq %rdi, %rdi
je 0x101614
leaq 0x7(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
callq 0xeb8ad
incq 0x28(%r14)
jmp 0x101622
movl $0x1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq