// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-cmpr.c
// Function: squeeze_read_nodetable
static int squeeze_read_nodetable(deark *c, struct squeeze_ctx *sqctx)
{
	i64 k;
	int retval = 0;

	if(sqctx->bitrd.curpos+2 > sqctx->bitrd.endpos) goto done;
	sqctx->nodecount = dbuf_getu16le_p(sqctx->dcmpri->f, &sqctx->bitrd.curpos);
	de_dbg(c, "node count: %d", (int)sqctx->nodecount);
	if(sqctx->nodecount > SQUEEZE_MAX_NODES) {
		de_dfilter_set_errorf(c, sqctx->dres, sqctx->modname,
			"Invalid node count");
		goto done;
	}

	de_dbg2(c, "node table nodes at %"I64_FMT, sqctx->bitrd.curpos);
	de_dbg_indent(c, 1);
	for(k=0; k<sqctx->nodecount; k++) {
		sqctx->tmpnodes[k].child[0].dval = (i16)dbuf_geti16le_p(sqctx->dcmpri->f, &sqctx->bitrd.curpos);
		sqctx->tmpnodes[k].child[1].dval = (i16)dbuf_geti16le_p(sqctx->dcmpri->f, &sqctx->bitrd.curpos);
		if(c->debug_level >= 2) {
			de_dbg2(c, "nodetable[%d]: %d %d", (int)k, (int)sqctx->tmpnodes[k].child[0].dval,
				(int)sqctx->tmpnodes[k].child[1].dval);
		}
	}
	de_dbg_indent(c, -1);
	if(sqctx->bitrd.curpos > sqctx->bitrd.endpos) goto done;

	if(!squeeze_process_nodetable(c, sqctx)) 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, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
addq $0x2, %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jle 0x179132
jmp 0x1792ec
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
addq $0x8, %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
leaq 0x5d5cb(%rip), %rsi     # 0x1d6739
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
cmpq $0x100, 0x30(%rax)      # imm = 0x100
jle 0x1791aa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x5d5aa(%rip), %rcx     # 0x1d6748
movb $0x0, %al
callq 0x177450
jmp 0x1792ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x30e2e(%rip), %rsi     # 0x1a9feb
movb $0x0, %al
callq 0x15b350
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x1792af
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
addq $0x8, %rsi
callq 0x1653f0
movw %ax, %cx
movq -0x10(%rbp), %rax
addq $0x70, %rax
imulq $0x6, -0x18(%rbp), %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
addq $0x8, %rsi
callq 0x1653f0
movw %ax, %cx
movq -0x10(%rbp), %rax
addq $0x70, %rax
imulq $0x6, -0x18(%rbp), %rdx
addq %rdx, %rax
movw %cx, 0x4(%rax)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jl 0x17929c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
addq $0x70, %rax
imulq $0x6, -0x18(%rbp), %rcx
addq %rcx, %rax
movswl 0x2(%rax), %ecx
movq -0x10(%rbp), %rax
addq $0x70, %rax
imulq $0x6, -0x18(%rbp), %rsi
addq %rsi, %rax
movswl 0x4(%rax), %r8d
leaq 0x5d4c6(%rip), %rsi     # 0x1d675b
movb $0x0, %al
callq 0x15b350
jmp 0x17929e
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1791da
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jle 0x1792d1
jmp 0x1792ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x17a670
cmpl $0x0, %eax
jne 0x1792e5
jmp 0x1792ec
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)