// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x10(%rsp), %r15
movq $0x0, (%r15)
movl $0x110, %esi            # imm = 0x110
callq 0xe969b
movq %rax, %r14
addq $0x2, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, (%r14)
leaq 0x7e4cc(%rip), %rsi     # 0x137ee0
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
cmpq $0x0, (%r14)
je 0xb9c19
movl $0x101, %esi            # imm = 0x101
movl $0x101, %edx            # imm = 0x101
movq %rbx, %rdi
callq 0x105165
movq %rax, 0x10(%r14)
movq 0x10(%rsp), %r15
movq %rsp, %rsi
movq %r15, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xef14d
movzbl %al, %edx
movl %edx, 0x48(%r14)
leaq 0x6a517(%rip), %rsi     # 0x123f7a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x48(%r14), %eax
leal -0x30(%rax), %ebp
cmpl $-0x2f, %ebp
jb 0xb9bfc
movq %r15, 0x20(%rsp)
testl %eax, %eax
je 0xb9adb
movq %rsp, %r15
leaq 0x7e467(%rip), %r12     # 0x137ef7
xorl %r13d, %r13d
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef14d
movzbl %al, %eax
movl %eax, 0x4c(%r14,%r13,4)
movl 0x48(%r14), %ecx
decl %ecx
cmpq %rcx, %r13
jne 0xb9aba
addl $0x2, %eax
movl %eax, 0x4c(%r14,%r13,4)
movl 0x4c(%r14,%r13,4), %ecx
incq %r13
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe93cf
movl 0x48(%r14), %eax
cmpq %rax, %r13
jb 0xb9a93
movl %ebp, 0x1c(%rsp)
movl 0x48(%r14), %eax
testl %eax, %eax
je 0xb9bc2
movq $0x0, 0x8(%rsp)
decl %eax
xorl %ecx, %ecx
movq 0x8(%rsp), %rdx
cmpq %rax, %rdx
sete %cl
movl 0x4c(%r14,%rdx,4), %r12d
subl %ecx, %r12d
movq %r14, %r13
movq %rbx, %rbp
leaq 0x7e3f7(%rip), %rbx     # 0x137f0f
je 0xb9b63
movq 0x8(%rsp), %rax
leal 0x1(%rax), %r15d
movq 0x18(%rbp), %rdi
movq %rsp, %rsi
callq 0xef14d
movzbl %al, %r14d
movq %rbp, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe9461
movq 0x10(%r13), %rax
movq 0x10(%rax), %rsi
movq %rbp, %rdi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x104de7
decl %r12d
jne 0xb9b23
movl 0x48(%r13), %eax
decl %eax
cmpq %rax, 0x8(%rsp)
movq %r13, %r14
movq %rbp, %rbx
jne 0xb9ba8
movq %rbx, %rdi
leaq 0x7e39b(%rip), %rsi     # 0x137f1b
movq 0x8(%rsp), %r15
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9461
movq 0x10(%r14), %rax
movq 0x10(%rax), %rsi
leal 0x1(%r15), %ecx
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x104de7
movq 0x8(%rsp), %rdx
incq %rdx
movl 0x48(%r14), %eax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
jb 0xb9af4
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x104e5d
testl %eax, %eax
movq 0x20(%rsp), %r15
movl 0x1c(%rsp), %ebp
jne 0xb9bfc
leaq 0x7e333(%rip), %rsi     # 0x137f25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq (%rsp), %rax
subq %r15, %rax
movq %rax, 0x8(%r14)
cmpl $-0x2f, %ebp
jae 0xb9c14
xorl %r15d, %r15d
jmp 0xb9d4d
addq %rax, 0x10(%rsp)
leaq 0x7b811(%rip), %rsi     # 0x135431
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r15
movq %rax, %rdi
callq 0xf0e3f
cmpq $0x0, (%r14)
je 0xb9d4d
movq %r14, %r12
movq 0x10(%rsp), %r14
leaq 0x78258(%rip), %rsi     # 0x131ea8
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r12)
movq %r14, 0x20(%r12)
movq 0x18(%rax), %rax
movq %rax, 0x28(%r12)
leaq 0x38(%r12), %rdi
movb $0x0, 0x38(%r12)
callq 0xf2261
movq (%r12), %r14
testq %r14, %r14
js 0xb9cee
movq %r12, %r13
addq $0x18, %r12
movl $0x0, (%rsp)
movq 0x10(%r13), %rax
movq 0x8(%rax), %rdi
movq %r12, %rsi
movq %rsp, %rdx
xorl %ecx, %ecx
callq 0x104b4d
movl %eax, %ebp
testl %eax, %eax
je 0xb9ccf
cmpl $0x3, (%rbx)
jl 0xb9ccf
movl (%rsp), %edx
movq %rbx, %rdi
leaq 0x70e76(%rip), %rsi     # 0x12ab3e
xorl %eax, %eax
callq 0xe9461
subq $0x1, %r14
jb 0xb9cf3
testl %ebp, %ebp
je 0xb9d13
movl (%rsp), %eax
cmpl $-0x1, %eax
je 0xb9d26
movzbl %al, %esi
movq %r15, %rdi
callq 0xf11be
jmp 0xb9c94
movq %r12, %r14
jmp 0xb9d4d
testl %ebp, %ebp
movq %r13, %r14
je 0xb9d00
cmpl $-0x1, (%rsp)
je 0xb9d4d
leaq 0x7e23c(%rip), %rsi     # 0x137f43
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0xb9d4d
movq %r13, %r14
cmpb $0x0, 0x30(%r13)
je 0xb9d3c
leaq 0x58fe0(%rip), %rsi     # 0x112d04
jmp 0xb9d43
leaq 0x7e260(%rip), %rsi     # 0x137f8d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %r13, %r14
jmp 0xb9d4d
leaq 0x7e235(%rip), %rsi     # 0x137f78
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %r15, %rdi
callq 0xf0b13
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xb9d66
movq %rbx, %rdi
callq 0x10521e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq