// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pack.c
// Function: de_run_pack
static void de_run_pack(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos = 0;
	dbuf *outf = NULL;

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

	pos += 2;
	d->unc_size = de_getu32be_p(&pos);
	de_dbg(c, "uncompressed size: %"I64_FMT, d->unc_size);

	if(d->unc_size!=0) {
		d->ht = fmtutil_huffman_create_decoder(c, 257, 257);
		if(!read_tree(c, d, pos)) goto done;
		pos += d->tree_def_size;
	}

	outf = dbuf_create_output_file(c, "bin", NULL, 0);
	dbuf_enable_wbuffer(outf);

	if(d->unc_size!=0) {
		decode_file_data(c, d, pos, outf);
	}

done:
	dbuf_close(outf);
	if(d) {
		if(d->ht) {
			fmtutil_huffman_destroy_decoder(c, d->ht);
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x110, %esi            # imm = 0x110
callq 0xdecaf
movq %rax, %r14
leaq 0x18(%rsp), %rsi
movq $0x2, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xe4071
movq %rax, (%r14)
leaq 0x7935f(%rip), %rsi     # 0x12af6c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpq $0x0, (%r14)
je 0xb1de6
movl $0x101, %esi            # imm = 0x101
movl $0x101, %edx            # imm = 0x101
movq %rbx, %rdi
callq 0xf8601
movq %rax, 0x10(%r14)
movq 0x18(%rsp), %r15
leaq 0x8(%rsp), %rsi
movq %r15, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xe3f2a
movzbl %al, %edx
movl %edx, 0x48(%r14)
leaq 0x6533c(%rip), %rsi     # 0x116f9a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x48(%r14), %eax
leal -0x30(%rax), %ecx
cmpl $-0x30, %ecx
ja 0xb1c85
movq 0x8(%rsp), %rax
subq %r15, %rax
movq %rax, 0x8(%r14)
jmp 0xb1dd9
movl %ecx, 0x24(%rsp)
movq %r15, 0x10(%rsp)
leaq 0x8(%rsp), %r15
leaq 0x792e9(%rip), %r12     # 0x12af83
xorl %r13d, %r13d
movl %eax, %ecx
cmpq %rcx, %r13
jae 0xb1ce4
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f2a
movzbl %al, %ecx
movl %ecx, 0x4c(%r14,%r13,4)
movl 0x48(%r14), %eax
decl %eax
cmpq %rax, %r13
jne 0xb1ccb
addl $0x2, %ecx
movl %ecx, 0x4c(%r14,%r13,4)
incq %r13
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde9f1
movl 0x48(%r14), %eax
jmp 0xb1c9d
xorl %r15d, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
jae 0xb1d95
decl %eax
xorl %ecx, %ecx
cmpq %rax, %r15
sete %cl
movq %r14, %r13
movl 0x4c(%r14,%r15,4), %r12d
subl %ecx, %r12d
leal 0x1(%r15), %ebp
subl $0x1, %r12d
jb 0xb1d51
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3f2a
movzbl %al, %r14d
movq %rbx, %rdi
leaq 0x7926e(%rip), %rsi     # 0x12af9b
movl %r15d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xdea83
movq 0x10(%r13), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
callq 0xf82ee
jmp 0xb1d0b
movq %r13, %r14
movl 0x48(%r13), %eax
leal -0x1(%rax), %ecx
cmpq %rcx, %r15
jne 0xb1d8d
movq %rbx, %rdi
leaq 0x7923d(%rip), %rsi     # 0x12afa7
movl %r15d, %edx
xorl %eax, %eax
callq 0xdea83
movq 0x10(%r14), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
pushq $-0x1
popq %rdx
movl %ebp, %ecx
callq 0xf82ee
movl 0x48(%r14), %eax
incq %r15
jmp 0xb1ce7
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xf8362
testl %eax, %eax
jne 0xb1dc4
leaq 0x791f7(%rip), %rsi     # 0x12afb1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x8(%rsp), %rax
subq 0x10(%rsp), %rax
movq %rax, 0x8(%r14)
cmpl $-0x2f, 0x24(%rsp)
jae 0xb1de1
xorl %r15d, %r15d
jmp 0xb1f30
addq %rax, 0x18(%rsp)
leaq 0x766f0(%rip), %rsi     # 0x1284dd
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe4e62
movq %rax, %r15
movq %rax, %rdi
callq 0xe589c
cmpq $0x0, (%r14)
je 0xb1f30
movq %r15, 0x10(%rsp)
movq %r14, %r13
movq 0x18(%rsp), %r14
leaq 0x7311e(%rip), %rsi     # 0x124f40
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rax
leaq 0x18(%r13), %r12
movq %rax, 0x18(%r13)
movq %r14, 0x20(%r13)
movq 0x18(%rax), %rax
movq %rax, 0x28(%r13)
movq %r13, %rdi
addq $0x38, %rdi
movb $0x0, 0x38(%r13)
callq 0xe6a40
movq %r13, %r15
movq (%r13), %r14
leaq 0x8(%rsp), %r13
xorl %ebp, %ebp
cmpq %r14, %rbp
jg 0xb1f15
andl $0x0, 0x8(%rsp)
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xf8071
testl %eax, %eax
je 0xb1ec7
cmpl $0x3, (%rbx)
jl 0xb1ea7
movl 0x8(%rsp), %edx
movq %rbx, %rdi
leaq 0x6bcfe(%rip), %rsi     # 0x11db9e
xorl %eax, %eax
callq 0xdea83
movl 0x8(%rsp), %eax
cmpq %rbp, %r14
je 0xb1ee4
cmpl $-0x1, %eax
je 0xb1f04
movzbl %al, %esi
movq 0x10(%rsp), %rdi
callq 0xe5bc5
incq %rbp
jmp 0xb1e66
cmpq %rbp, %r14
movq %r15, %r14
movq 0x10(%rsp), %r15
je 0xb1ef1
cmpb $0x0, 0x30(%r14)
je 0xb1f1f
leaq 0x53e12(%rip), %rsi     # 0x105cf4
jmp 0xb1f26
cmpl $-0x1, %eax
movq %r15, %r14
movq 0x10(%rsp), %r15
je 0xb1f30
leaq 0x790d7(%rip), %rsi     # 0x12afcf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf05a
jmp 0xb1f30
leaq 0x7910e(%rip), %rsi     # 0x12b019
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %r15, %r14
movq 0x10(%rsp), %r15
jmp 0xb1f30
leaq 0x790de(%rip), %rsi     # 0x12b004
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %r15, %rdi
callq 0xe5591
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xb1f49
movq %rbx, %rdi
callq 0xf86b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq