LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_read_zlib_header
static int lzh_read_zlib_header(deark *c, struct lzh_ctx *cctx)
{
	u8 h[2];
	UI meth, cinfo;
	UI fcheck, fdict, flevel;
	UI chk;
	int retval = 0;

	de_dbg(c, "zlib header at %"I64_FMT, cctx->bitrd.curpos);
	de_dbg_indent(c, 1);
	h[0] = (u8)lzh_getbits(cctx, 8);
	h[1] = (u8)lzh_getbits(cctx, 8);

	meth = (UI)(h[0]&0x0f);
	de_dbg2(c, "CM: %u", meth);
	cinfo = (UI)(h[0]>>4);
	de_dbg2(c, "CINFO: %u", cinfo);

	fcheck = (UI)(h[1]&0x1f);
	de_dbg2(c, "FCHECK: %u", fcheck);
	fdict = (UI)((h[1]>>5)&0x1);
	de_dbg2(c, "FDICT: %u", fdict);
	flevel = (UI)((h[1]>>6)&0x3);
	de_dbg2(c, "FLEVEL: %u", flevel);

	chk = (((UI)h[0])<<8) | (UI)h[1];
	if(chk%31 != 0) goto done;
	if(meth!=8) goto done;
	if(cinfo>7) goto done;
	if(fdict) goto done;
	retval = 1;

done:
	if(!retval) {
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname, "Bad or unsupported zlib parameters");
	}
	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
leaq 0x54ab6(%rip), %rsi     # 0x1d6f20
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x181a10
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x181a10
movb %al, -0x11(%rbp)
movzbl -0x12(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x54a7a(%rip), %rsi     # 0x1d6f33
movb $0x0, %al
callq 0x15b350
movzbl -0x12(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x54a62(%rip), %rsi     # 0x1d6f3a
movb $0x0, %al
callq 0x15b350
movzbl -0x11(%rbp), %eax
andl $0x1f, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %edx
leaq 0x54a4d(%rip), %rsi     # 0x1d6f44
movb $0x0, %al
callq 0x15b350
movzbl -0x11(%rbp), %eax
sarl $0x5, %eax
andl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x54a36(%rip), %rsi     # 0x1d6f4f
movb $0x0, %al
callq 0x15b350
movzbl -0x11(%rbp), %eax
sarl $0x6, %eax
andl $0x3, %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq 0x54a1e(%rip), %rsi     # 0x1d6f59
movb $0x0, %al
callq 0x15b350
movzbl -0x12(%rbp), %eax
shll $0x8, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1f, %ecx
xorl %edx, %edx
divl %ecx
cmpl $0x0, %edx
je 0x182565
jmp 0x182584
cmpl $0x8, -0x18(%rbp)
je 0x18256d
jmp 0x182584
cmpl $0x7, -0x1c(%rbp)
jbe 0x182575
jmp 0x182584
cmpl $0x0, -0x24(%rbp)
je 0x18257d
jmp 0x182584
movl $0x1, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x1825ac
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x549bf(%rip), %rcx     # 0x1d6f64
movb $0x0, %al
callq 0x177450
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x30(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: decompress_deflate_internal
static void decompress_deflate_internal(struct lzh_ctx *cctx)
{
	deark *c = cctx->c;

	while(1) {
		int ret;

		if(cctx->bitrd.eof_flag || cctx->err_flag) break;
		if(lzh_have_enough_output(cctx)) break;

		ret = lzh_do_deflate_block(c, cctx);
		if(!ret) break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
jne 0x1825fe
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x182600
jmp 0x18262a
movq -0x8(%rbp), %rdi
callq 0x181570
cmpl $0x0, %eax
je 0x182610
jmp 0x18262a
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x182740
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x182628
jmp 0x18262a
jmp 0x1825e7
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_read_zlib_trailer
static int lzh_read_zlib_trailer(deark *c, struct lzh_ctx *cctx)
{
	u32 cs_reported;
	u32 cs_calc;
	int retval = 0;

	de_bitreader_skip_to_byte_boundary(&cctx->bitrd);
	de_dbg(c, "zlib trailer at %"I64_FMT, cctx->bitrd.curpos);
	de_dbg_indent(c, 1);
	if(cctx->bitrd.curpos + 4 > cctx->bitrd.endpos) goto done;
	cs_reported = (u32)dbuf_getu32be_p(cctx->bitrd.f, &cctx->bitrd.curpos);
	de_dbg2(c, "checksum (reported): 0x%08x", (UI)cs_reported);
	cs_calc = de_crcobj_getval(cctx->crco);
	de_dbg2(c, "checksum (calculated): 0x%08x", (UI)cs_calc);
	if(cs_calc != cs_reported) goto done;
	retval = 1;

done:
	if(!retval) {
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname, "Bad zlib trailer");
	}
	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x16a460
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
leaq 0x54b75(%rip), %rsi     # 0x1d71dc
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x4, %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jle 0x182694
jmp 0x1826fe
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x38, %rsi
addq $0x8, %rsi
callq 0x1654b0
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x2beb2(%rip), %rsi     # 0x1ae570
movb $0x0, %al
callq 0x15b350
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
callq 0x15f340
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x2bfa2(%rip), %rsi     # 0x1ae688
movb $0x0, %al
callq 0x15b350
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x1826f7
jmp 0x1826fe
movl $0x1, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x182726
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x54ad1(%rip), %rcx     # 0x1d71f0
movb $0x0, %al
callq 0x177450
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_do_deflate_block
static int lzh_do_deflate_block(deark *c, struct lzh_ctx *cctx)
{
	UI is_last;
	UI blktype;
	int blkret;
	char pos_descr[32];
	int retval = 0;

	lzh_destroy_trees(cctx);

	de_bitreader_describe_curpos(&cctx->bitrd, pos_descr, sizeof(pos_descr));
	is_last = (UI)lzh_getbits(cctx, 1);
	blktype = (UI)lzh_getbits(cctx, 2);
	de_dbg(c, "block at %s, type=%u, last=%u", pos_descr, blktype, is_last);
	de_dbg_indent(c, 1);

	switch(blktype) {
	case 0:
		blkret = lzh_do_deflate_block_type0(c, cctx);
		break;
	case 1:
	case 2:
		blkret = lzh_do_deflate_block_type1_2(c, cctx, blktype);
		break;
	default:
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname, "Unsupported block type: %u",
			blktype);
		blkret = 0;
	}

	if(blkret && !is_last) {
		retval = 1;
	}

	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x10(%rbp), %rdi
callq 0x181bd0
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
leaq -0x40(%rbp), %rsi
movq %rsi, -0x58(%rbp)
movl $0x20, %edx
callq 0x16a540
movq -0x10(%rbp), %rdi
movl $0x1, %esi
movl %esi, -0x4c(%rbp)
callq 0x181a10
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x181a10
movq -0x58(%rbp), %rdx
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %ecx
movl -0x14(%rbp), %r8d
leaq 0x547d2(%rip), %rsi     # 0x1d6f87
xorl %eax, %eax
callq 0x15b0d0
movl -0x4c(%rbp), %esi
movq -0x8(%rbp), %rdi
callq 0x15b560
movl -0x18(%rbp), %eax
movl %eax, -0x48(%rbp)
testl %eax, %eax
je 0x1827e0
jmp 0x1827d4
movl -0x48(%rbp), %eax
decl %eax
subl $0x2, %eax
jb 0x1827f2
jmp 0x182807
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x182860
movl %eax, -0x1c(%rbp)
jmp 0x182834
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %edx
callq 0x182930
movl %eax, -0x1c(%rbp)
jmp 0x182834
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
movl -0x18(%rbp), %r8d
leaq 0x5477f(%rip), %rcx     # 0x1d6fa5
movb $0x0, %al
callq 0x177450
movl $0x0, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x182847
cmpl $0x0, -0x14(%rbp)
jne 0x182847
movl $0x1, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x44(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_do_deflate_block_type0
static int lzh_do_deflate_block_type0(deark *c, struct lzh_ctx *cctx)
{
	int retval = 0;
	UI blk_dlen;
	UI blk_check, blk_check_expected;

	// Go to the next byte boundary
	de_bitreader_skip_to_byte_boundary(&cctx->bitrd);

	// Next, two 16-bit fields
	blk_dlen = (UI)lzh_getbits(cctx, 16);
	de_dbg2(c, "non-compressed block dlen: %u", blk_dlen);
	blk_check_expected = blk_dlen ^ 0xffff;
	blk_check = (UI)lzh_getbits(cctx, 16);
	de_dbg2(c, "consistency check: 0x%04x", blk_check);
	if(blk_check != blk_check_expected) {
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname,
			"Non-compressed block failed consistency check");
		goto done;
	}

	// Then the literal bytes
	if(!lzh_copy_aligned_bytes(c, cctx, (i64)blk_dlen)) goto done;
	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x16a460
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x181a10
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x5471d(%rip), %rsi     # 0x1d6fc0
movb $0x0, %al
callq 0x15b350
movl -0x18(%rbp), %eax
xorl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x181a10
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x5470a(%rip), %rsi     # 0x1d6fde
movb $0x0, %al
callq 0x15b350
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x182907
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x546fa(%rip), %rcx     # 0x1d6ff8
movb $0x0, %al
callq 0x177450
jmp 0x182927
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %eax
movl %eax, %edx
callq 0x182af0
cmpl $0x0, %eax
jne 0x182920
jmp 0x182927
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_copy_aligned_bytes
static int lzh_copy_aligned_bytes(deark *c, struct lzh_ctx *cctx, i64 nbytes_to_copy1)
{
	i64 nbytes_left_to_copy = nbytes_to_copy1;

	de_bitreader_skip_to_byte_boundary(&cctx->bitrd);
	while(nbytes_left_to_copy>0) {
		u8 b;

		if(cctx->bitrd.curpos >= cctx->bitrd.endpos) {
			cctx->bitrd.eof_flag = 1;
			goto done;
		}
		b = dbuf_getbyte_p(cctx->bitrd.f, &cctx->bitrd.curpos);
		de_lz77buffer_add_literal_byte(cctx->ringbuf, b);
		nbytes_left_to_copy--;
	}

done:
	if(nbytes_left_to_copy!=0) {
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x16a460
cmpq $0x0, -0x28(%rbp)
jle 0x182b77
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jl 0x182b3c
movq -0x18(%rbp), %rax
movb $0x1, 0x50(%rax)
jmp 0x182b79
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x38, %rsi
addq $0x8, %rsi
callq 0x165170
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rdi
movzbl -0x29(%rbp), %esi
callq 0x178880
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x182b19
jmp 0x182b79
cmpq $0x0, -0x28(%rbp)
je 0x182b89
movl $0x0, -0x4(%rbp)
jmp 0x182b90
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: deflate_block_type1_make_fixed_trees
static int deflate_block_type1_make_fixed_trees(deark *c, struct lzh_ctx *cctx)
{
	int retval = 0;

	cctx->literals_tree.ht =  fmtutil_huffman_create_decoder(c, 288, 288);
	huffman_record_len_for_range(c, cctx->literals_tree.ht, 0, 144, 8); // 0..143
	huffman_record_len_for_range(c, cctx->literals_tree.ht, 144, 112, 9); // 144..255
	huffman_record_len_for_range(c, cctx->literals_tree.ht, 256, 24, 7); // 256..279
	huffman_record_len_for_range(c, cctx->literals_tree.ht, 280, 8, 8); // 280..287
	if(!fmtutil_huffman_make_canonical_code(c, cctx->literals_tree.ht->bk,
		cctx->literals_tree.ht->builder, 0, "lit/len codebook"))
	{
		goto done;
	}

	// This is a trivial Huffman tree -- We could do without it and just read
	// 5 bits directly, though we'd have to reverse the order of the bits.
	cctx->offsets_tree.ht =  fmtutil_huffman_create_decoder(c, 32, 32);
	huffman_record_len_for_range(c, cctx->offsets_tree.ht, 0, 32, 5);
	if(!fmtutil_huffman_make_canonical_code(c, cctx->offsets_tree.ht->bk,
		cctx->offsets_tree.ht->builder, 0, "offsets codebook"))
	{
		goto done;
	}

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x120, %edx            # imm = 0x120
movq %rdx, %rsi
callq 0x188560
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
xorl %edx, %edx
movl $0x90, %ecx
movl $0x8, %r8d
callq 0x183540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
movl $0x90, %edx
movl $0x70, %ecx
movl $0x9, %r8d
callq 0x183540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
movl $0x18, %ecx
movl $0x7, %r8d
callq 0x183540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
movl $0x118, %edx            # imm = 0x118
movl $0x8, %ecx
movl $0x8, %r8d
callq 0x183540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x10(%rax), %rdx
xorl %ecx, %ecx
leaq 0x54502(%rip), %r8      # 0x1d7190
callq 0x188020
cmpl $0x0, %eax
jne 0x182c9a
jmp 0x182d18
movq -0x8(%rbp), %rdi
movl $0x20, %edx
movq %rdx, %rsi
callq 0x188560
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rsi
xorl %edx, %edx
movl $0x20, %ecx
movl $0x5, %r8d
callq 0x183540
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq 0x10(%rax), %rdx
xorl %ecx, %ecx
leaq 0x544a4(%rip), %r8      # 0x1d71a9
callq 0x188020
cmpl $0x0, %eax
jne 0x182d11
jmp 0x182d18
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: deflate_decode_length
static UI deflate_decode_length(deark *c, struct lzh_ctx *cctx, UI code)
{
	UI length = 0;
	UI more_bits_count = 0;

	if(code<=264) {
		length = code - 254;
		more_bits_count = 0;
	}
	else if(code>=265 && code<=284) {
		more_bits_count = (code-261)/4;
		length = ((4 + (code+3)%4) << more_bits_count) + 3;
	}
	else if(code==285) {
		if(cctx->is_deflate64) {
			length = 3;
			more_bits_count = 16;
		}
		else {
			length = 258;
			more_bits_count = 0;
		}
	}
	else {
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname, "Bad length code");
		cctx->err_flag = 1;
		goto done;
	}

	if(more_bits_count>0) {
		UI more_bits_val;

		more_bits_val = (UI)lzh_getbits(cctx, more_bits_count);
		length += more_bits_val;
	}

done:
	return length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x108, -0x14(%rbp)     # imm = 0x108
ja 0x183391
movl -0x14(%rbp), %eax
subl $0xfe, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
jmp 0x183430
cmpl $0x109, -0x14(%rbp)     # imm = 0x109
jb 0x1833ca
cmpl $0x11c, -0x14(%rbp)     # imm = 0x11C
ja 0x1833ca
movl -0x14(%rbp), %eax
subl $0x105, %eax            # imm = 0x105
shrl $0x2, %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x3, %eax
andl $0x3, %eax
addl $0x4, %eax
movl -0x1c(%rbp), %ecx
shll %cl, %eax
addl $0x3, %eax
movl %eax, -0x18(%rbp)
jmp 0x18342e
cmpl $0x11d, -0x14(%rbp)     # imm = 0x11D
jne 0x1833fd
movq -0x10(%rbp), %rax
cmpb $0x0, 0x7c(%rax)
je 0x1833ed
movl $0x3, -0x18(%rbp)
movl $0x10, -0x1c(%rbp)
jmp 0x1833fb
movl $0x102, -0x18(%rbp)     # imm = 0x102
movl $0x0, -0x1c(%rbp)
jmp 0x18342c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x53da2(%rip), %rcx     # 0x1d71ba
movb $0x0, %al
callq 0x177450
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0x183450
jmp 0x18342e
jmp 0x183430
cmpl $0x0, -0x1c(%rbp)
jbe 0x18344e
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x181a10
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x183450
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: deflate_read_and_decode_distance
static UI deflate_read_and_decode_distance(deark *c, struct lzh_ctx *cctx)
{
	UI dist_code;
	UI dist = 0;
	UI more_bits_count;
	UI more_bits_val;

	dist_code = read_next_code_using_tree(cctx, &cctx->offsets_tree);
	if(dist_code<=3) {
		dist = dist_code;
		more_bits_count = 0;
	}
	else if(dist_code<=29 || (cctx->is_deflate64 && dist_code<=31)) {
		more_bits_count = (dist_code/2)-1;
		dist = (2 + dist_code%2) << more_bits_count;
	}
	else {
		de_dfilter_set_errorf(c, cctx->dres, cctx->modname, "Bad distance code");
		cctx->err_flag = 1;
		goto done;
	}

	if(more_bits_count > 0) {
		more_bits_val = (UI)lzh_getbits(cctx, more_bits_count);
		dist += more_bits_val;
	}

done:
	return dist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xa0, %rsi
callq 0x181ae0
movl %eax, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
ja 0x1834a3
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
jmp 0x18350b
cmpl $0x1d, -0x14(%rbp)
jbe 0x1834bc
movq -0x10(%rbp), %rax
movzbl 0x7c(%rax), %eax
cmpl $0x0, %eax
je 0x1834da
cmpl $0x1f, -0x14(%rbp)
ja 0x1834da
movl -0x14(%rbp), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
addl $0x2, %eax
movl -0x1c(%rbp), %ecx
shll %cl, %eax
movl %eax, -0x18(%rbp)
jmp 0x183509
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x53cd5(%rip), %rcx     # 0x1d71ca
movb $0x0, %al
callq 0x177450
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0x18352b
jmp 0x18350b
cmpl $0x0, -0x1c(%rbp)
jbe 0x183529
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x181a10
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x18352b
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: huffman_record_len_for_range
static int huffman_record_len_for_range(deark *c, struct fmtutil_huffman_decoder *ht,
	fmtutil_huffman_valtype range_start, i64 count, UI codelen)
{
	i64 i;

	for(i=0; i<count; i++) {
		int ret = fmtutil_huffman_record_a_code_length(c, ht->builder,
			range_start+(fmtutil_huffman_valtype)i, codelen);
		if(!ret) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x1835ac
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
movq -0x38(%rbp), %rax
addl %eax, %edx
movl -0x2c(%rbp), %ecx
callq 0x187f20
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x18359c
movl $0x0, -0x4(%rbp)
jmp 0x1835b3
jmp 0x18359e
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x183563
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: implode_read_trees
static int implode_read_trees(struct lzh_ctx *cctx)
{
	int retval = 0;

	if(cctx->implode_3_trees) {
		cctx->literals_tree.ht = fmtutil_huffman_create_decoder(cctx->c, 256, 256);
		if(!implode_read_a_tree(cctx, &cctx->literals_tree, 256, "literals")) {
			goto done;
		}
	}

	cctx->matchlengths_tree.ht = fmtutil_huffman_create_decoder(cctx->c, 64, 256);
	if(!implode_read_a_tree(cctx, &cctx->matchlengths_tree, 64, "match-lengths")) {
		goto done;
	}

	cctx->offsets_tree.ht = fmtutil_huffman_create_decoder(cctx->c, 64, 256);
	if(!implode_read_a_tree(cctx, &cctx->offsets_tree, 64, "offsets")) {
		goto done;
	}

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xb1(%rax)
je 0x18362e
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rdx, %rsi
callq 0x188560
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x98, %rsi
movl $0x100, %edx            # imm = 0x100
leaq 0x53c01(%rip), %rcx     # 0x1d721e
callq 0x1836e0
cmpl $0x0, %eax
jne 0x18362c
jmp 0x1836cb
jmp 0x18362e
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x40, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x188560
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa8, %rsi
movl $0x40, %edx
leaq 0x53bba(%rip), %rcx     # 0x1d7227
callq 0x1836e0
cmpl $0x0, %eax
jne 0x183679
jmp 0x1836cb
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x40, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x188560
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa0, %rsi
movl $0x40, %edx
leaq 0x31079(%rip), %rcx     # 0x1b4731
callq 0x1836e0
cmpl $0x0, %eax
jne 0x1836c4
jmp 0x1836cb
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: make_dclimplode_tree
static void make_dclimplode_tree(deark *c, struct lzh_ctx *cctx, struct lzh_tree_wrapper *tree,
	i64 num_codes, const u8 *codelengths)
{
	i64 i;

	tree->ht = fmtutil_huffman_create_decoder(c, num_codes, num_codes);

	for(i=0; i<num_codes; i++) {
		fmtutil_huffman_record_a_code_length(c, tree->ht->builder, (fmtutil_huffman_valtype)i,
			dclimplode_getcodelenfromarray(codelengths, (UI)i));
	}

	fmtutil_huffman_make_canonical_code(c, tree->ht->bk, tree->ht->builder,
		FMTUTIL_MCTFLAG_LEFT_ALIGN_BRANCHES | FMTUTIL_MCTFLAG_LAST_CODE_FIRST, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x188560
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x183966
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %esi
callq 0x1839a0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movl %eax, %ecx
callq 0x187f20
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x18390f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
movl $0x3, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x188020
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: distilled_interpret_node_pair
static void distilled_interpret_node_pair(struct distilled_nodetable_decoder *ntd,
	UI nodenum, u64 currcode, UI currcode_nbits)
{
	if(ntd->err_flag) return;
	if(currcode_nbits >= FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
		ntd->err_flag = 1;
		return;
	}
	if(nodenum > ntd->nodecount-2) {
		ntd->err_flag = 1;
		return;
	}

	if(ntd->node[nodenum].in_use || ntd->node[nodenum+1].in_use) {
		ntd->err_flag = 1;
		return;
	}

	ntd->node[nodenum].in_use = 1;
	ntd->node[nodenum+1].in_use = 1;
	distilled_interpret_dval(ntd, ntd->node[nodenum].dval, currcode<<1, currcode_nbits+1);
	distilled_interpret_dval(ntd, ntd->node[nodenum+1].dval, (currcode<<1) | 1, currcode_nbits+1);
	ntd->node[nodenum].in_use = 0;
	ntd->node[nodenum+1].in_use = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x183a55
jmp 0x183b41
cmpl $0x30, -0x1c(%rbp)
jb 0x183a68
movq -0x8(%rbp), %rax
movb $0x1, 0xc(%rax)
jmp 0x183b41
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jbe 0x183a86
movq -0x8(%rbp), %rax
movb $0x1, 0xc(%rax)
jmp 0x183b41
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl 0x18(%rax,%rcx,4), %eax
cmpl $0x0, %eax
jne 0x183aad
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl 0x18(%rax,%rcx,4), %eax
cmpl $0x0, %eax
je 0x183aba
movq -0x8(%rbp), %rax
movb $0x1, 0xc(%rax)
jmp 0x183b41
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movb $0x1, 0x18(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, 0x18(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzwl 0x1a(%rax,%rcx,4), %esi
movq -0x18(%rbp), %rdx
shlq %rdx
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
callq 0x183b50
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzwl 0x1a(%rax,%rcx,4), %esi
movq -0x18(%rbp), %rdx
shlq %rdx
orq $0x1, %rdx
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
callq 0x183b50
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movb $0x0, 0x18(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb $0x0, 0x18(%rax,%rcx,4)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: distilled_interpret_dval
static void distilled_interpret_dval(struct distilled_nodetable_decoder *ntd,
	UI dval, u64 currcode, UI currcode_nbits)
{
	if(ntd->err_flag) return;
	if(currcode_nbits>=FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
		ntd->err_flag = 1;
		return;
	}

	if(dval < ntd->nodecount) {
		distilled_interpret_node_pair(ntd, dval, currcode, currcode_nbits);
	}
	else { // a leaf node
		fmtutil_huffman_valtype adj_value;

		adj_value = (fmtutil_huffman_valtype)(dval - ntd->nodecount);
		if(ntd->c->debug_level>=3) {
			de_dbg3(ntd->c, "code: \"%s\" = %d",
				de_print_base2_fixed(ntd->b2buf, sizeof(ntd->b2buf), currcode, currcode_nbits),
				(int)adj_value);
		}
		fmtutil_huffman_add_code(ntd->c, ntd->ht->bk, currcode, currcode_nbits, adj_value);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xc(%rax)
je 0x183b75
jmp 0x183c24
cmpl $0x30, -0x1c(%rbp)
jb 0x183b88
movq -0x8(%rbp), %rax
movb $0x1, 0xc(%rax)
jmp 0x183c24
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x183ba9
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x183a30
jmp 0x183c24
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
subl 0x8(%rcx), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x3, (%rax)
jl 0x183c01
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x9e8, %rdi            # imm = 0x9E8
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl $0x48, %esi
callq 0x15cf60
movq -0x28(%rbp), %rdi
movq %rax, %rdx
movl -0x20(%rbp), %ecx
leaq 0x2641a(%rip), %rsi     # 0x1aa014
movb $0x0, %al
callq 0x15b400
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x187720
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: get_lzhuf_p_len
static UI get_lzhuf_p_len(UI n)
{
	UI p_len;

	if(n==0) p_len = 3;
	else if(n<4) p_len = 4;
	else if(n<12) p_len = 5;
	else if(n<24) p_len = 6;
	else if(n<48) p_len = 7;
	else p_len = 8;
	return p_len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x183c46
movl $0x3, -0x8(%rbp)
jmp 0x183c91
cmpl $0x4, -0x4(%rbp)
jae 0x183c55
movl $0x4, -0x8(%rbp)
jmp 0x183c8f
cmpl $0xc, -0x4(%rbp)
jae 0x183c64
movl $0x5, -0x8(%rbp)
jmp 0x183c8d
cmpl $0x18, -0x4(%rbp)
jae 0x183c73
movl $0x6, -0x8(%rbp)
jmp 0x183c8b
cmpl $0x30, -0x4(%rbp)
jae 0x183c82
movl $0x7, -0x8(%rbp)
jmp 0x183c89
movl $0x8, -0x8(%rbp)
jmp 0x183c8b
jmp 0x183c8d
jmp 0x183c8f
jmp 0x183c91
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: distilled_get_num_extra_bits
static UI distilled_get_num_extra_bits(struct lzh_ctx *cctx)
{
	UI x;
	i64 n = cctx->nbytes_written + 60;

	for(x=12; x>=6; x--) {
		if(n >= ((i64)1 << x)) return x-5;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x3c, %rax
movq %rax, -0x20(%rbp)
movl $0xc, -0x14(%rbp)
cmpl $0x6, -0x14(%rbp)
jb 0x183cf4
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
jl 0x183ce7
movl -0x14(%rbp), %eax
subl $0x5, %eax
movl %eax, -0x4(%rbp)
jmp 0x183cfb
jmp 0x183ce9
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x183cbf
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_read_run_of_1_bits
static UI mash_read_run_of_1_bits(struct lzh_ctx *cctx, UI max1bits)
{
	UI count_of_1s = 0;

	while(1) {
		u8 b;

		if(count_of_1s>=max1bits) break;
		b = mash_getbit(cctx);
		if(b==0) break;
		count_of_1s++;
	}

	return count_of_1s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x183d20
jmp 0x183d42
movq -0x8(%rbp), %rdi
callq 0x183db0
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x183d37
jmp 0x183d42
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x183d16
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_getbits
static UI mash_getbits(struct lzh_ctx *cctx, UI nbits)
{
	UI i;
	UI n = 0;

	for(i=0; i<nbits; i++) {
		n <<= 1;
		n |= (UI)mash_getbit(cctx);
	}

	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x183d9a
movl -0x14(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x183db0
movzbl %al, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x183d6d
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_getbit
static u8 mash_getbit(struct lzh_ctx *cctx)
{
	u8 v;

	if(cctx->err_flag) return 0;

	if(cctx->bitrd.bbll.nbits_in_bitbuf==0) {
		mash_fill_bitbuf(cctx);
	}

	v = (u8)de_bitbuf_lowlevel_get_bits(&cctx->bitrd.bbll, 1);

	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x183dcc
movb $0x0, -0x1(%rbp)
jmp 0x183dfe
movq -0x10(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
jne 0x183ddf
movq -0x10(%rbp), %rdi
callq 0x183e90
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
addq $0x20, %rdi
movl $0x1, %esi
callq 0x16a2a0
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_read_offset
static UI mash_read_offset(struct lzh_ctx *cctx)
{
	UI ocode;
	UI offset;
	static const u8 numextrabits[8] = {5, 7, 9, 10, 11, 12, 13, 14};

	ocode = mash_getbits(cctx, 3);
	offset = mash_getbits(cctx, numextrabits[ocode]);
	if(ocode==1) {
		offset += 32;
	}
	else if(ocode>=2) {
		offset += (1<<numextrabits[ocode]) - 352;
	}
	return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x183d50
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x536f3(%rip), %rax     # 0x1d7530
movzbl (%rax,%rcx), %esi
callq 0x183d50
movl %eax, -0x10(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x183e5a
movl -0x10(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x10(%rbp)
jmp 0x183e84
cmpl $0x2, -0xc(%rbp)
jb 0x183e82
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x536c4(%rip), %rax     # 0x1d7530
movzbl (%rax,%rcx), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x160, %eax            # imm = 0x160
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x183e84
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_fill_bitbuf
static void mash_fill_bitbuf(struct lzh_ctx *cctx)
{
	u8 b;

	if(cctx->err_flag) return;
	if(cctx->bitrd.curpos >= cctx->bitrd.endpos) {
		cctx->err_flag = 1;
		return;
	}

	b = dbuf_getbyte_p(cctx->dcmpri->f, &cctx->bitrd.curpos);
	de_bitbuf_lowlevel_add_byte(&cctx->bitrd.bbll, b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x183ea8
jmp 0x183efb
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jl 0x183ec7
movq -0x8(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0x183efb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x38, %rsi
addq $0x8, %rsi
callq 0x165170
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
addq $0x20, %rdi
movzbl -0x9(%rbp), %esi
callq 0x16a230
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: make_ic1_trees
static void make_ic1_trees(deark *c, struct lzh_ctx *cctx)
{
#define ICL_NUM_ML_CODES 14
	static const u8 codes[ICL_NUM_ML_CODES] = {
		0,1,4,0xa,0xb,0x18,0x19,0x34,0x35,0x36,0x37,0x0e,0x1e,0x1f };
	static const u8 lengths[ICL_NUM_ML_CODES] = {
		2,2,3,4,  4,  5,   5,   6,   6,   6,   6,   4,   5,   5 };
	static const u8 vals[ICL_NUM_ML_CODES] = {
		0,1,2,3,  4,  5,   6,   7,   8,   9,   10,  103, 104, 105 };
	size_t k;

	cctx->matchlengths_tree.ht = fmtutil_huffman_create_decoder(c, ICL_NUM_ML_CODES, 0);

	for(k=0; k<ICL_NUM_ML_CODES; k++) {
		fmtutil_huffman_add_code(c, cctx->matchlengths_tree.ht->bk,
			codes[k], lengths[k], vals[k]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x188560
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq $0x0, -0x18(%rbp)
cmpq $0xe, -0x18(%rbp)
jae 0x183fa5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq 0x535cb(%rip), %rax     # 0x1d7538
movzbl (%rax,%rcx), %eax
movl %eax, %edx
movq -0x18(%rbp), %rcx
leaq 0x535c8(%rip), %rax     # 0x1d7546
movzbl (%rax,%rcx), %ecx
movq -0x18(%rbp), %r8
leaq 0x535c7(%rip), %rax     # 0x1d7554
movzbl (%rax,%r8), %r8d
callq 0x187720
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x183f48
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: ic1_read_matchlencode
static UI ic1_read_matchlencode(struct lzh_ctx *cctx)
{
	fmtutil_huffman_valtype n = 0;
	UI v = 0;
	UI num_extra_bits = 0;

	n = read_next_code_using_tree(cctx, &cctx->matchlengths_tree);

	if(n<100) {
		v = (UI)n;
	}
	else if(n==103) {
		v = 11;
		num_extra_bits = 3;
	}
	else if(n==104) {
		v = 19;
		num_extra_bits = 3;
	}
	else { // 105
		UI count_of_1s;

		// Note that we've already read 5 1s.
		count_of_1s = (UI)read_run_of_1_bits(cctx, 5);
		count_of_1s += 5;
		num_extra_bits = count_of_1s;
		v = (1U<<count_of_1s) - 5;
	}

	if(num_extra_bits>0) {
		UI x;

		x = (UI)lzh_getbits(cctx, num_extra_bits);
		v += x;
	}

	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa8, %rsi
callq 0x181ae0
movl %eax, -0xc(%rbp)
cmpl $0x64, -0xc(%rbp)
jge 0x183ff6
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x184056
cmpl $0x67, -0xc(%rbp)
jne 0x18400c
movl $0xb, -0x10(%rbp)
movl $0x3, -0x14(%rbp)
jmp 0x184054
cmpl $0x68, -0xc(%rbp)
jne 0x184022
movl $0x13, -0x10(%rbp)
movl $0x3, -0x14(%rbp)
jmp 0x184052
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x184360
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x5, %eax
movl %eax, -0x10(%rbp)
jmp 0x184054
jmp 0x184056
cmpl $0x0, -0x14(%rbp)
jbe 0x184074
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x181a10
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: ic1_read_litlen
static UI ic1_read_litlen(struct lzh_ctx *cctx)
{
	UI n1;
	UI x;
	UI v = 0;

	n1 = read_run_of_1_bits(cctx, 5);
	v = 1<<n1;
	x = (UI)lzh_getbits(cctx, n1);
	v = v | x;
	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x184360
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x181a10
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
orl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzh.c
// Function: read_run_of_1_bits
static UI read_run_of_1_bits(struct lzh_ctx *cctx, UI max1bits)
{
	UI count_of_1s = 0;

	while(1) {
		u8 b;

		if(count_of_1s>=max1bits) break;
		b = (u8)lzh_getbits(cctx, 1);
		if(b==0) break;
		count_of_1s++;
	}

	return count_of_1s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x184380
jmp 0x1843a7
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x181a10
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x18439c
jmp 0x1843a7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x184376
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: dfilter_lzw_codec
void dfilter_lzw_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	delzwctx *dc = NULL;
	struct de_lzw_params *delzwp = (struct de_lzw_params*)codec_private_params;

	dc = de_malloc(dfctx->c, sizeof(delzwctx));
	dc->c = dfctx->c;
	dc->dfctx = dfctx;
	dc->debug_level = dc->c->debug_level;

	dfctx->codec_private = (void*)dc;
	dfctx->codec_finish_fn = my_lzw_codec_finish;
	dfctx->codec_destroy_fn = my_lzw_codec_destroy;
	dfctx->codec_addbuf_fn = my_lzw_codec_addbuf;
	dfctx->codec_command_fn = my_lzw_codec_command;

	dc->output_len_known = dfctx->dcmpro->len_known;
	dc->output_expected_len = dfctx->dcmpro->expected_len;

	dc->delzwp_copy = *delzwp; // struct copy
	dc->fmt = delzwp->fmt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x148, %esi            # imm = 0x148
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
leaq 0x8a(%rip), %rcx        # 0x184500
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
leaq 0x11b(%rip), %rcx       # 0x1845a0
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
leaq 0x1ac(%rip), %rcx       # 0x184640
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
leaq 0x1fd(%rip), %rcx       # 0x1846a0
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movb 0x8(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x31(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x20(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_finish
static void my_lzw_codec_finish(struct de_dfilter_ctx *dfctx)
{
	const char *modname = "delzw";
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(!dc) return;
	delzw_finish(dc);

	dfctx->dres->bytes_consumed = dc->total_nbytes_processed;
	dfctx->dres->bytes_consumed_valid = 1;

	if(dc->errcode) {
		de_dfilter_set_errorf(dfctx->c, dfctx->dres, modname, "%s", dc->errmsg);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x5308d(%rip), %rax     # 0x1d75a0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x18452c
jmp 0x18458b
movq -0x18(%rbp), %rdi
callq 0x184820
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x1, 0x4(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x60(%rax)
je 0x18458b
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %r8
addq $0xf8, %r8
leaq 0x1c5ab(%rip), %rcx     # 0x1a0b2f
movb $0x0, %al
callq 0x177450
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_destroy
static void my_lzw_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	deark *c = dfctx->c;
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(!dc) return;

	de_free(c, dc->ct);
	if(dc->ct2) de_free(c, dc->ct2);
	de_free(c, dc->valbuf);

	de_free(c, dc);
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1845cc
jmp 0x18462f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rsi
callq 0x15b820
movq -0x18(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0x184602
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xf0(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_addbuf
static void my_lzw_codec_addbuf(struct de_dfilter_ctx *dfctx,
	const u8 *buf, i64 buf_len)
{
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(!dc) return;
	delzw_addbuf(dc, buf, buf_len);
	if(dc->state == DELZW_STATE_FINISHED) {
		dfctx->finished_flag = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x184669
jmp 0x18468c
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1849c0
movq -0x20(%rbp), %rax
cmpl $0x3, 0x64(%rax)
jne 0x18468c
movq -0x8(%rbp), %rax
movb $0x1, 0x20(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_command
static void my_lzw_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags)
{
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(dc->fmt==DE_LZWFMT_SHRINKIT2) {
		if(cmd==DE_DFILTER_COMMAND_FINISH_BLOCK) {
			dc->total_nbytes_processed -= (i64)(dc->bbll.nbits_in_bitbuf/8);
			de_bitbuf_lowlevel_empty(&dc->bbll);
		}
		else if(cmd==DE_DFILTER_COMMAND_SOFTRESET) {
			delzw_clear(dc);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x14(%rax)
jne 0x184713
cmpl $0x3, -0xc(%rbp)
jne 0x184700
movq -0x18(%rbp), %rax
movl 0xbc(%rax), %eax
shrl $0x3, %eax
movl %eax, %eax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rdi
addq $0xb8, %rdi
callq 0x16a360
jmp 0x184711
cmpl $0x1, -0xc(%rbp)
jne 0x18470f
movq -0x18(%rbp), %rdi
callq 0x1861f0
jmp 0x184711
jmp 0x184713
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)