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

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

	pos = 8;
	d->infoblk_offs = de_getu32be_p(&pos);
	de_dbg(c, "info block offset: (%d+)%"I64_FMT, HDRSIZE, d->infoblk_offs);
	d->infoblk_offs += HDRSIZE;
	d->infoblk_size = de_getu32be_p(&pos);
	de_dbg(c, "info block size: %"I64_FMT, d->infoblk_size);

	do_info_block(c, d);

	if(!d->found_dsdb) {
		de_err(c, "DSDB block not found. This file is probably corrupted, or "
			"an unsupported version.");
		goto done;
	}
	if(!do_dsdb(c, d)) goto done;

	do_one_node(c, d, d->root_node_block_id);

done:
	if(d) {
		de_free(c, d->block_addr_table);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
pushq $0x38
popq %rsi
callq 0xdecaf
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq $0x8, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movq %rax, (%r14)
leaq 0xbe3db(%rip), %rsi     # 0x114b84
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
addq $0x4, (%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movq %rax, 0x8(%r14)
leaq 0xbe3cc(%rip), %rsi     # 0x114ba0
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq (%r14), %rax
movq %rsp, %r15
movq %rax, (%r15)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq (%r14), %rdx
leaq 0xbe406(%rip), %rsi     # 0x114c07
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movq %rax, 0x20(%r14)
leaq 0xbe3ec(%rip), %rsi     # 0x114c19
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
cmpq $0xf4240, %rdi          # imm = 0xF4240
jg 0x5691e
movq %rsp, %r15
movq (%r15), %r12
addq $0x4, %r12
movq %r12, (%r15)
shlq $0x2, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0xdfbb6
movq %rax, 0x10(%rsp)
movl (%r15), %edx
leaq 0xbe3b5(%rip), %rsi     # 0x114c29
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xdf66f
movq %rax, 0x28(%r14)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
leaq 0xbe3a0(%rip), %r13     # 0x114c43
xorl %ebp, %ebp
cmpq 0x20(%r14), %rbp
jge 0x568d8
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movq 0x28(%r14), %rcx
movl %eax, (%rcx,%rbp,8)
testl %eax, %eax
je 0x568d3
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
incq %rbp
jmp 0x568a5
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x10(%rsp), %rax
addq %r12, %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xe4071
movq %rax, %r15
leaq 0xbe351(%rip), %rsi     # 0x114c55
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0xf4240, %r15          # imm = 0xF4240
jle 0x56a5b
movl 0x18(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
cmpl $0x0, 0x10(%r14)
je 0x56a24
movl 0x14(%r14), %edx
leaq 0x8(%rsp), %rcx
movq %rsp, %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x571d8
testl %eax, %eax
je 0x56a35
movl 0x14(%r14), %edx
movq 0x8(%rsp), %r12
movl (%rsp), %r8d
leaq 0xbe315(%rip), %rsi     # 0x114c7d
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
leaq 0x18(%rsp), %r15
movq %r12, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movl %eax, 0x18(%r14)
leaq 0xbe301(%rip), %rsi     # 0x114ca0
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
leaq 0xbe2f9(%rip), %rsi     # 0x114cb7
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
leaq 0xbe2e9(%rip), %rsi     # 0x114cc6
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
leaq 0xbe2e2(%rip), %rsi     # 0x114cde
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movl 0x18(%r14), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x56b92
jmp 0x56a35
leaq 0xbe18a(%rip), %rsi     # 0x114bb5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xded32
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rcx
xorl %eax, %eax
testq %r15, %r15
cmovleq %rax, %rcx
movq %rcx, 0x10(%rsp)
xorl %ebp, %ebp
cmpq %rbp, 0x10(%rsp)
je 0x5691e
movq (%rsp), %rcx
movq %rbx, %rdi
leaq 0xbe1dc(%rip), %rsi     # 0x114c63
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xe3f2a
movzbl %al, %r12d
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
pushq $0x11
popq %r9
callq 0xe495c
movq %rax, %r13
addq %r12, 0x8(%rsp)
movq 0x18(%rax), %rdi
callq 0xeb7e4
movq %rbx, %rdi
leaq 0xbeacc(%rip), %rsi     # 0x1155bb
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4071
movq %rax, %r15
movq %rbx, %rdi
leaq 0xbe198(%rip), %rsi     # 0x114caa
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x8(%r13), %rdi
leaq 0xbe151(%rip), %rsi     # 0x114c78
callq 0x181a0
testl %eax, %eax
jne 0x56b3c
movl $0x1, 0x10(%r14)
movl %r15d, 0x14(%r14)
addq $0x5, %r12
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe4b94
addq %r12, (%rsp)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %rbp
jmp 0x56a6e