// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/nufx.c
// Function: decompress_thread
static int decompress_thread(deark *c,
	struct nufx_ctx *d, struct nufx_record *rec,
	struct nufx_thread *t, dbuf *outf)
{
	int retval = 0;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	de_dbg(c, "[reading thread #%u]", t->idx);
	de_dbg_indent(c, 1);

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	if(!t) goto done;
	if(t->cmpr_pos + t->cmpr_len > c->infile->len) goto done;

	dcmpri.f = c->infile;
	dcmpri.pos = t->cmpr_pos;
	dcmpri.len = t->cmpr_len;
	dcmpro.f = outf;
	dcmpro.expected_len = t->orig_len;
	dcmpro.len_known = 1;

	if(t->cmpr_meth==0 || t->orig_len==0) {
		fmtutil_decompress_uncompressed(c, &dcmpri, &dcmpro, &dres, 0);
	}
	else if(t->cmpr_meth==2) {
		decompress_lzw_1(c, d, &dcmpri, &dcmpro, &dres);
	}
	else if(t->cmpr_meth==3) {
		decompress_lzw_2(c, d, &dcmpri, &dcmpro, &dres);
	}
	else {
		de_dfilter_set_errorf(c, &dres, NULL, "Unsupported compression method");
	}

	if(dres.errcode) {
		de_err(c, "Decompression failed for record#%u thread#%u: %s",
			rec->idx, t->idx, de_dfilter_get_errmsg(c, &dres));
		goto done;
	}

	retval = 1;
	t->dcmpr_ok_flag = 1;
	goto done;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, 0x98(%rsp)
movq %rdi, %rbx
movl (%rcx), %edx
leaq 0x9cf06(%rip), %rsi     # 0x12f731
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x58(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
movq %rbx, %rdi
callq 0xfa1dc
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rax
leaq (%rcx,%rax), %rsi
movq 0x18(%rbx), %rdx
cmpq 0x18(%rdx), %rsi
jg 0x9328d
movq %r12, 0x80(%rsp)
movq %rdx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movq %r15, 0xc0(%rsp)
movq 0x20(%r14), %r13
movq %r13, 0xd0(%rsp)
movb $0x1, 0xc8(%rsp)
movq %r14, 0x88(%rsp)
movl 0x8(%r14), %ecx
testl %ecx, %ecx
sete %dl
testq %r13, %r13
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x928f1
leaq 0x58(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xfa510
jmp 0x93235
cmpl $0x3, %ecx
je 0x92cda
cmpl $0x2, %ecx
jne 0x930b8
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x18(%rsp)
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, %r12
movl $0x20, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x48(%rsp)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x38(%rsp)
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x30(%rsp)
movl $0x20, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x40(%rsp)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x50(%rsp)
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x20(%rsp)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
leaq 0x9cdd1(%rip), %rsi     # 0x12f781
movq %rbx, %rdi
movq %rax, 0xa0(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0x9cdc6(%rip), %rsi     # 0x12f7a1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0x9cdba(%rip), %rsi     # 0x12f7b6
movq %rbx, %rdi
movl %edx, 0x78(%rsp)
xorl %eax, %eax
callq 0xe8617
movq 0x98(%rsp), %rax
movq 0x58(%rax), %rdi
callq 0xeb7fe
testq %r13, %r13
jle 0x92c7d
movq %r12, 0x28(%rsp)
movq 0x10(%rsp), %r15
leaq 0x3(%r15), %rax
movq 0x68(%rsp), %rcx
addq 0x60(%rsp), %rcx
cmpq %rcx, %rax
jg 0x92c7d
movq %r13, 0x90(%rsp)
movq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0xeebeb
movq %rax, %rbp
xorl %r14d, %r14d
cmpq $0x1000, %rax           # imm = 0x1000
setne %r14b
movq 0x58(%rsp), %rdi
movq %r12, %rsi
callq 0xeeb4b
movzbl %al, %r12d
movq %rbx, %rdi
leaq 0x9cd46(%rip), %rsi     # 0x12f7d0
movq %r15, %rdx
movq %rbp, %rcx
movl %r12d, %r8d
movl %r14d, %r9d
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0xf145f
testb %r12b, %r12b
je 0x92b70
movq %rbx, %rdi
movq 0x48(%rsp), %r15
movq %r15, %rsi
movq 0x38(%rsp), %r12
movq %r12, %rdx
movq %r14, %r13
movq 0x30(%rsp), %r14
movq %r14, %rcx
callq 0xfa1dc
movq 0x58(%rsp), %rax
movq %rax, (%r15)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r15)
movq 0x68(%rsp), %rcx
subq %rax, %rcx
addq 0x60(%rsp), %rcx
movq %rcx, 0x10(%r15)
movq %rbx, %rdi
movq %r13, %rbx
movq %r13, (%r12)
movb $0x1, 0x8(%r12)
movq %rbp, 0x10(%r12)
leaq 0xb0(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x9, 0xac(%rsp)
movl $0xc, 0xb8(%rsp)
movq %rdi, %r13
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
leaq 0xac(%rsp), %r8
callq 0x102400
cmpl $0x0, (%r14)
jne 0x930d8
cmpb $0x0, 0x4(%r14)
je 0x930f4
movq 0x10(%rsp), %rax
addq 0x8(%r14), %rax
movq %rbx, %r14
movq %r13, %rbx
jmp 0x92b8d
movq 0x58(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0xef481
movq 0x10(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xf145f
cmpq $0x1000, %rbp           # imm = 0x1000
je 0x92c1a
movq %rbx, %rdi
movq %r14, %r13
movq 0x40(%rsp), %r14
movq %r14, %rsi
movq 0x50(%rsp), %r15
movq %r15, %rdx
movq 0x20(%rsp), %r12
movq %r12, %rcx
callq 0xfa1dc
movq %r13, (%r14)
movq $0x0, 0x8(%r14)
movq 0x18(%r13), %rax
movq %rax, 0x10(%r14)
movq 0x28(%rsp), %rax
movq %rax, (%r15)
movb $0x1, 0x8(%r15)
movq $0x1000, 0x10(%r15)     # imm = 0x1000
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl 0x78(%rsp), %r8d
callq 0x93507
cmpl $0x0, (%r12)
movq 0x28(%rsp), %r12
je 0x92c2c
jmp 0x931c0
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0xef481
movq 0x98(%rsp), %rax
movq 0x58(%rax), %rdi
movl $0x1000, %ecx           # imm = 0x1000
movq %r12, %rsi
xorl %edx, %edx
callq 0xeb944
movl $0x1000, %esi           # imm = 0x1000
movq 0x90(%rsp), %r13
movq %r13, %rdi
callq 0xe9c3b
movq %rax, %r14
movq 0xc0(%rsp), %rcx
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0xef481
subq %r14, %r13
jg 0x92a29
movq 0x98(%rsp), %rax
movq 0x58(%rax), %rdi
callq 0xeb865
movl %eax, %ebp
leaq 0x9cb68(%rip), %rsi     # 0x12f7ff
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl 0xa0(%rsp), %ebp
movq 0x18(%rsp), %r14
je 0x931df
leaq 0x9cabb(%rip), %rdx     # 0x12f777
leaq 0x9cb5e(%rip), %rcx     # 0x12f821
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfa21a
jmp 0x931df
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq $0x0, 0x18(%rsp)
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x28(%rsp)
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, %r12
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %rbp
movl $0x20, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x50(%rsp)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x78(%rsp)
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0xb0(%rsp)
movl $0xa, 0xac(%rsp)
movl $0xc, 0xb8(%rsp)
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0x9ca02(%rip), %rsi     # 0x12f7a1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0x9c9f6(%rip), %rsi     # 0x12f7b6
movq %rbx, %rdi
movl %edx, 0xa0(%rsp)
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbp, 0x20(%rsp)
movq %rbp, %rcx
callq 0xfa1dc
testq %r13, %r13
jle 0x93170
movq $0x0, 0x30(%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, 0x48(%rsp)
movq %r12, 0x38(%rsp)
movq %r13, 0x90(%rsp)
movq 0x28(%rsp), %r13
movq 0x10(%rsp), %r12
movq 0x68(%rsp), %rax
addq 0x60(%rsp), %rax
cmpq %rax, %r12
jg 0x93170
movq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %rax, %rbp
movl %ebp, %r14d
shrl $0xf, %r14d
andl $0x1fff, %ebp           # imm = 0x1FFF
movq %rbp, %r15
andb $0x1, %r14b
je 0x92e7b
movq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %rax, %r15
cmpq $0x5, %rax
movl $0x4, %eax
cmovlq %rax, %r15
addq $-0x4, %r15
xorl %eax, %eax
cmpq $0x1000, %rbp           # imm = 0x1000
setne %al
movzbl %r14b, %r14d
movl %eax, (%rsp)
movq %rbx, %rdi
leaq 0x9c9b3(%rip), %rsi     # 0x12f84b
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
movl %r14d, %r9d
xorl %eax, %eax
callq 0xe8617
movq %r13, %r12
movq %r13, %rdi
callq 0xf145f
testb %r14b, %r14b
jne 0x92efd
movq 0x58(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq 0xef481
cmpq $0x0, 0x18(%rsp)
movq 0x30(%rsp), %rcx
movzbl %cl, %ecx
movl $0x1, %eax
cmovnel %eax, %ecx
movq %rcx, 0x30(%rsp)
movq 0x90(%rsp), %r13
movq 0x48(%rsp), %r14
jmp 0x92fc0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
movq 0x90(%rsp), %r13
movq 0x48(%rsp), %r14
je 0x92f2e
cmpb $0x0, 0x30(%rsp)
je 0x92f58
movl $0x1, %esi
xorl %edx, %edx
callq 0xfa3ab
movq 0x18(%rsp), %rdi
jmp 0x92f58
movq %r12, (%r14)
movb $0x0, 0x8(%r14)
movq %rbx, %rdi
leaq 0x6f4db(%rip), %rsi     # 0x10241b
leaq 0xac(%rsp), %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r8
callq 0xfa325
movq %rax, %rdi
movq 0x58(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %rdi, %r12
callq 0xfa404
movq %r12, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xfa3ab
movq (%r14), %rdi
callq 0xf08ba
cmpb $0x0, 0x20(%r12)
je 0x92f94
movq %r12, %rdi
callq 0xfa3c8
movq %r12, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x93116
movq (%r14), %rax
movq 0x18(%rax), %r9
cmpq %rbp, %r9
jne 0x9314d
movq $0x0, 0x30(%rsp)
movq 0x38(%rsp), %r12
addq %r15, 0x10(%rsp)
movq %r12, %rdi
callq 0xf145f
cmpl $0x1000, %ebp           # imm = 0x1000
je 0x93051
movq %rbx, %rdi
movq 0x50(%rsp), %r15
movq %r15, %rsi
movq 0x78(%rsp), %rbp
movq %rbp, %rdx
movq 0x40(%rsp), %r12
movq %r12, %rcx
callq 0xfa1dc
movq 0x28(%rsp), %rax
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movq 0x18(%rax), %rax
movq %rax, 0x10(%r15)
movq 0x38(%rsp), %rax
movq %rax, (%rbp)
movb $0x1, 0x8(%rbp)
movq $0x1000, 0x10(%rbp)     # imm = 0x1000
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r12, %rcx
movl 0xa0(%rsp), %r8d
callq 0x93507
cmpl $0x0, (%r12)
movq 0x38(%rsp), %r12
je 0x93065
jmp 0x9312f
movl $0x1000, %edx           # imm = 0x1000
movq 0x28(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0xef481
movq 0x98(%rsp), %rax
movq 0x58(%rax), %rdi
movl $0x1000, %ecx           # imm = 0x1000
movq %r12, %rsi
xorl %edx, %edx
callq 0xeb944
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdi
callq 0xe9c3b
movq %rax, %r14
movq 0xc0(%rsp), %rcx
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0xef481
subq %r14, %r13
movq 0x48(%rsp), %r14
jg 0x92e0b
jmp 0x93170
leaq 0x8da45(%rip), %rcx     # 0x120b04
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xfa21a
jmp 0x93235
leaq 0x9c698(%rip), %rcx     # 0x12f777
leaq 0xd8(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0xfb0d9
jmp 0x9310b
leaq 0x9c67c(%rip), %rdx     # 0x12f777
leaq 0xd8(%rsp), %rsi
movq %r13, %rdi
callq 0xfa311
movq %rbx, %r14
movq %r13, %rbx
jmp 0x931df
leaq 0x9c724(%rip), %rcx     # 0x12f841
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
jmp 0x93146
leaq 0x9c70b(%rip), %rcx     # 0x12f841
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0xfb0d9
jmp 0x93170
leaq 0x9c6ed(%rip), %rdx     # 0x12f841
leaq 0x9c72d(%rip), %rcx     # 0x12f888
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdi
movq %rbp, %r8
xorl %eax, %eax
callq 0xfa21a
movq 0x18(%rsp), %rdi
callq 0xfa3d4
movq 0x28(%rsp), %rdi
callq 0xf052b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
jmp 0x93230
leaq 0x9c5b0(%rip), %rcx     # 0x12f777
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0xfb0d9
movq %r13, %r14
movq %r14, %rdi
callq 0xf052b
movq %rbx, %rdi
movq 0x48(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0xe8be2
movq 0x88(%rsp), %rax
movq 0x80(%rsp), %rcx
cmpl $0x0, 0xd8(%rsp)
je 0x93284
movl 0x8(%rcx), %r14d
movl (%rax), %r15d
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0x9c4d9(%rip), %rsi     # 0x12f746
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r14d, %edx
movl %r15d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9295
jmp 0x9328d
movb $0x1, 0x48(%rax)
movl $0x1, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq