// File: /workspace/github_c_makefile_star2_O3/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 0xe8b2b
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq $0x8, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, (%r14)
leaq 0xc8539(%rip), %rsi     # 0x121c74
movq %rbx, %rdi
movl $0x4, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0x4, (%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x8(%r14)
leaq 0xc8528(%rip), %rsi     # 0x121c90
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%r14), %rax
movq %rsp, %r15
movq %rax, (%r15)
leaq 0x1c(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq (%r14), %rdx
leaq 0xc8562(%rip), %rsi     # 0x121cf7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x20(%r14)
leaq 0xc8546(%rip), %rsi     # 0x121d09
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
cmpq $0xf4240, %rdi          # imm = 0xF4240
jg 0x599c1
movq (%rsp), %r15
addq $0x4, %r15
movq %r15, (%rsp)
shlq $0x2, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0xe9cb4
movq %rax, 0x10(%rsp)
movl (%rsp), %edx
leaq 0xc8510(%rip), %rsi     # 0x121d19
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rsi
movl $0x8, %edx
movq %rbx, %rdi
callq 0xe96f7
movq %rax, 0x28(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpq $0x0, 0x20(%r14)
jle 0x59879
movq %rsp, %r12
leaq 0xc84ed(%rip), %r13     # 0x121d33
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeed31
movq 0x28(%r14), %rcx
movl %eax, (%rcx,%rbp,8)
testl %eax, %eax
je 0x59870
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
incq %rbp
cmpq 0x20(%r14), %rbp
jl 0x59848
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%rsp), %rax
addq %r15, %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xeed31
movq %rax, %r15
leaq 0xc849e(%rip), %rsi     # 0x121d45
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq %r15, 0x10(%rsp)
leaq -0x1(%r15), %rax
cmpq $0xf423f, %rax          # imm = 0xF423F
ja 0x599c1
xorl %r12d, %r12d
movq (%rsp), %rcx
movq %rbx, %rdi
leaq 0xc8479(%rip), %rsi     # 0x121d53
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xeeb4b
movzbl %al, %ebp
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movl $0x11, %r9d
callq 0xef87c
movq %rax, %r13
addq %rbp, 0x8(%rsp)
movq 0x18(%rax), %rdi
callq 0xf705c
movq %rbx, %rdi
leaq 0xc8e35(%rip), %rsi     # 0x12277b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, %r15
movq %rbx, %rdi
leaq 0xc8431(%rip), %rsi     # 0x121d9a
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x8(%r13), %rdi
leaq 0xc83ea(%rip), %rsi     # 0x121d68
callq 0x181a0
testl %eax, %eax
jne 0x59993
movl $0x1, 0x10(%r14)
movl %r15d, 0x14(%r14)
addq $0x5, %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0xefaca
addq %rbp, (%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
incq %r12
cmpq %r12, 0x10(%rsp)
jne 0x598cc
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
cmpl $0x0, 0x10(%r14)
je 0x59acf
movl 0x14(%r14), %eax
cmpq %rax, 0x20(%r14)
jle 0x59ae0
movq 0x28(%r14), %rcx
movl (%rcx,%rax,8), %r12d
movl %r12d, %edi
andl $0x1f, %edi
callq 0xe9c9b
andl $-0x20, %r12d
orq $0x4, %r12
movl 0x14(%r14), %edx
leaq 0xc8361(%rip), %rsi     # 0x121d6d
movq %rbx, %rdi
movl %r12d, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x8(%rsp), %r15
movq %r12, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movl %eax, 0x18(%r14)
leaq 0xc8348(%rip), %rsi     # 0x121d90
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
leaq 0xc8340(%rip), %rsi     # 0x121da7
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
leaq 0xc8330(%rip), %rsi     # 0x121db6
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
leaq 0xc8329(%rip), %rsi     # 0x121dce
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movl 0x18(%r14), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59b3a
jmp 0x59ae0
leaq 0xc81cf(%rip), %rsi     # 0x121ca5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xe8be2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq