// File: /workspace/github_c_makefile_star2_O1/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
movl $0x38, %esi
callq 0xe969b
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq $0x8, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, (%r14)
leaq 0xc8229(%rip), %rsi     # 0x121b64
movq %rbx, %rdi
movl $0x4, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x8(%r14)
leaq 0xc8218(%rip), %rsi     # 0x121b80
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq (%r14), %rax
movq %rsp, %r15
movq %rax, (%r15)
leaq 0x1c(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq (%r14), %rdx
leaq 0xc8252(%rip), %rsi     # 0x121be7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x20(%r14)
leaq 0xc8236(%rip), %rsi     # 0x121bf9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
cmpq $0xf4240, %rdi          # imm = 0xF4240
jg 0x59bc1
movq (%rsp), %r15
addq $0x4, %r15
movq %r15, (%rsp)
shlq $0x2, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0xea80b
movq %rax, 0x10(%rsp)
movl (%rsp), %edx
leaq 0xc8200(%rip), %rsi     # 0x121c09
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rsi
movl $0x8, %edx
movq %rbx, %rdi
callq 0xea259
movq %rax, 0x28(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x20(%r14)
jle 0x59a79
movq %rsp, %r12
leaq 0xc81dd(%rip), %r13     # 0x121c23
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
movq 0x28(%r14), %rcx
movl %eax, (%rcx,%rbp,8)
testl %eax, %eax
je 0x59a70
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
incq %rbp
cmpq 0x20(%r14), %rbp
jl 0x59a48
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x10(%rsp), %rax
addq %r15, %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xef34e
movq %rax, %r15
leaq 0xc818e(%rip), %rsi     # 0x121c35
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r15, 0x10(%rsp)
leaq -0x1(%r15), %rax
cmpq $0xf423f, %rax          # imm = 0xF423F
ja 0x59bc1
xorl %r12d, %r12d
movq (%rsp), %rcx
movq %rbx, %rdi
leaq 0xc8169(%rip), %rsi     # 0x121c43
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef14d
movzbl %al, %ebp
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movl $0x11, %r9d
callq 0xefe67
movq %rax, %r13
addq %rbp, 0x8(%rsp)
movq 0x18(%rax), %rdi
callq 0xf74bd
movq %rbx, %rdi
leaq 0xc8a2d(%rip), %rsi     # 0x122573
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, %r15
movq %rbx, %rdi
leaq 0xc8121(%rip), %rsi     # 0x121c8a
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%r13), %rdi
leaq 0xc80da(%rip), %rsi     # 0x121c58
callq 0x181a0
testl %eax, %eax
jne 0x59b93
movl $0x1, 0x10(%r14)
movl %r15d, 0x14(%r14)
addq $0x5, %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf00aa
addq %rbp, (%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
incq %r12
cmpq %r12, 0x10(%rsp)
jne 0x59acc
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpl $0x0, 0x10(%r14)
je 0x59ce7
movl 0x14(%r14), %r12d
movq 0x20(%r14), %r13
cmpq %r12, %r13
jle 0x59c00
movq 0x28(%r14), %rax
movl (%rax,%r12,8), %r15d
movl %r15d, %edi
andl $0x1f, %edi
callq 0xea7f2
andl $-0x20, %r15d
orq $0x4, %r15
cmpq %r12, %r13
jg 0x59c0f
movq 0x18(%rbx), %rax
movq 0x18(%rax), %r15
xorl %eax, %eax
cmpq %r12, %r13
jle 0x59cf8
movl 0x14(%r14), %edx
leaq 0xc803a(%rip), %rsi     # 0x121c5d
movq %rbx, %rdi
movl %r15d, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
leaq 0x8(%rsp), %r12
movq %r15, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
movl %eax, 0x18(%r14)
leaq 0xc8020(%rip), %rsi     # 0x121c80
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
leaq 0xc8018(%rip), %rsi     # 0x121c97
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
leaq 0xc8008(%rip), %rsi     # 0x121ca6
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
leaq 0xc8001(%rip), %rsi     # 0x121cbe
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movl 0x18(%r14), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59d52
jmp 0x59cf8
leaq 0xc7ea7(%rip), %rsi     # 0x121b95
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xe9752
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq