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

	d = de_malloc(c, sizeof(lctx));
	d->da = de_arch_create_lctx(c);
	d->da->userdata = (void*)d;
	d->da->is_le = 1;

	d->da->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_CP437);

	if(!do_archive_header(c, d)) goto done;
	d->is_cri = (d->dir_segment_pos == CRUSH_HEADER_LEN);
	de_declare_fmtf(c, "CRUSH %s", d->is_cri ? "index" : "archive");

	d->paths_segment_pos = d->dir_segment_pos + (CRUSH_DIRENTRY_LEN * d->da->num_members);

	(void)do_read_paths(c, d);
	do_comment(c, d);
	do_read_dir_and_extract_files(c, d);

done:
	if(d) {
		if(d->paths) {
			i64 i;

			for(i=0; i<d->num_paths; i++) {
				ucstring_destroy(d->paths[i]);
			}
		}
		de_arch_destroy_lctx(c, d->da);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
pushq $0x48
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq %rbx, %rdi
callq 0xf16ce
movq %rax, (%r14)
movq %r14, 0x40(%rax)
movl $0x1, 0x10(%rax)
pushq $0xd
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe08d2
movq (%r14), %rcx
movl %eax, 0x18(%rcx)
leaq 0xbaaee(%rip), %rsi     # 0x115e52
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rdi
pushq $0x7
popq %rsi
callq 0xe3eb4
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x5b399
movzbl %al, %eax
addl $-0x30, %eax
movl %eax, 0x8(%r14)
movq 0x18(%rbx), %rdi
pushq $0x9
popq %rsi
callq 0xe3eb4
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jae 0x5b3b9
movzbl %al, %ecx
addl $-0x30, %ecx
movl %ecx, 0xc(%r14)
jmp 0x5b3bd
movl 0xc(%r14), %ecx
movl 0x8(%r14), %edx
leaq 0xb0e2e(%rip), %rsi     # 0x10c1f6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0x10
popq %rsi
callq 0xe3fa3
movq %rax, 0x18(%r14)
leaq 0xbaa7f(%rip), %rsi     # 0x115e68
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0x12
popq %rsi
callq 0xe3fa3
movq (%r14), %rcx
movq %rax, 0x20(%rcx)
leaq 0xbaa66(%rip), %rsi     # 0x115e76
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0x16
popq %rsi
callq 0xe409f
movq %rax, 0x20(%r14)
leaq 0xbaa50(%rip), %rsi     # 0x115e84
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
xorl %eax, %eax
cmpq $0x1a, 0x20(%r14)
sete %al
movl %eax, 0x10(%r14)
leaq 0xc4eec(%rip), %rax     # 0x12034d
leaq 0xae8ab(%rip), %rdx     # 0x109d13
cmoveq %rax, %rdx
leaq 0xba9d6(%rip), %rsi     # 0x115e49
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe0824
movq (%r14), %rax
imulq $0x18, 0x20(%rax), %rax
addq 0x20(%r14), %rax
movq %rax, 0x30(%r14)
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq 0x18(%r14), %rsi
cmpq $0x100, %rsi            # imm = 0x100
jl 0x5b4b6
movq $0xff, 0x18(%r14)
movl $0xff, %esi
jmp 0x5b4bf
testq %rsi, %rsi
jle 0x5b5de
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xdf66f
movq %rax, 0x40(%r14)
xorl %r15d, %r15d
cmpq 0x18(%r14), %r15
jge 0x5b4ec
movq %rbx, %rdi
callq 0xeac74
movq 0x40(%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x5b4d1
movq 0x30(%r14), %rdx
leaq 0xba9a0(%rip), %rsi     # 0x115e97
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x30(%r14), %r13
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
cmpq 0x18(%r14), %r12
jge 0x5b5d4
andq $0x0, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r13, %rcx
jle 0x5b5c1
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %r8
callq 0xe4b21
testl %eax, %eax
je 0x5b5c1
movq 0x8(%rsp), %rdx
subq %r13, %rdx
cmpq $0x104, %rdx            # imm = 0x104
jg 0x5b5c1
movq 0x18(%rbx), %rdi
movq (%r14), %rax
movq 0x40(%r14), %rcx
movq (%rcx,%r12,8), %rcx
movl 0x18(%rax), %r9d
movq %r13, %rsi
xorl %r8d, %r8d
callq 0xe4c9a
leaq 0x1(%r12), %rbp
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xba90f(%rip), %rsi     # 0x115ea4
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdi
pushq $0x1
popq %rsi
callq 0xf1712
movq 0x8(%rsp), %r13
incq %r13
movq %rbp, %r12
jmp 0x5b518
leaq 0xba8eb(%rip), %rsi     # 0x115eb3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf05a
jmp 0x5b5eb
subq 0x30(%r14), %r13
movq %r13, 0x38(%r14)
jmp 0x5b5e3
andq $0x0, 0x38(%r14)
movl $0x1, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
cmpl $0x0, 0x28(%r14)
je 0x5b648
movq 0x38(%r14), %r12
addq 0x30(%r14), %r12
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r12, %rcx
cmpq $0x2, %rcx
jl 0x5b648
xorl %r15d, %r15d
leaq 0x8(%rsp), %r8
xorl %esi, %esi
movq %r12, %rdx
callq 0xe4b21
testl %eax, %eax
je 0x5b64b
movq 0x8(%rsp), %r13
subq %r12, %r13
leaq -0x801(%r13), %rax
cmpq $-0x800, %rax           # imm = 0xF800
jae 0x5b9c8
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xeaf3c
leaq 0x14(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq (%r14), %rax
cmpq $0x0, 0x20(%rax)
jle 0x5b975
movq 0x20(%r14), %rdx
leaq 0xba863(%rip), %rsi     # 0x115edc
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq (%r14), %rax
movq $0x1a, 0x28(%rax)
xorl %ebp, %ebp
cmpq 0x20(%rax), %rbp
jge 0x5b975
imulq $0x18, %rbp, %r12
addq 0x20(%r14), %r12
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0xdebae
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf1630
movq %rax, %r15
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0xdecaf
movq %rax, %r13
movq %rax, 0x88(%r15)
movq %rbx, %rdi
callq 0xeac74
movq %rax, 0x68(%r15)
movq %rbx, %rdi
leaq 0xba7fa(%rip), %rsi     # 0x115eed
movq %rbp, 0x20(%rsp)
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0xdeba7
movq %rbx, %rdi
leaq 0xdab45(%rip), %rsi     # 0x13625d
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdeba7
movq %r12, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0xe3f2a
movzbl %al, %edx
movq %r13, 0x18(%rsp)
movl %edx, (%r13)
movq %rbx, %rdi
leaq 0xba7a5(%rip), %rsi     # 0x115efd
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
movq %r12, %rsi
callq 0xf1849
movq (%r14), %rdi
movq 0x50(%r15), %rsi
addq $0x18, %rsi
leaq 0xaf96a(%rip), %rdx     # 0x10b0e6
pushq $0x4
popq %rcx
movq %r12, %r8
callq 0xf1866
movq %r15, %rdi
movq %r12, %rsi
callq 0xf1766
movq 0x38(%r15), %rax
movq 0x68(%r15), %rcx
movq %rax, 0x30(%r15)
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq (%r14), %rax
movl 0x18(%rax), %r9d
pushq $0xc
popq %rdx
movl %ebp, %r8d
callq 0xe4c9a
movq 0x68(%r15), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xd3292(%rip), %rsi     # 0x12ea5e
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x68(%r15), %r12
movq 0x10(%r12), %rax
testq %rax, %rax
movl $0x0, %ecx
cmovleq %rcx, %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x5b809
movq 0x8(%r12), %rdx
cmpl $0x2f, (%rdx,%rcx,4)
jne 0x5b804
movl $0x5f, (%rdx,%rcx,4)
incq %rcx
jmp 0x5b7ed
movq %r12, %rdi
callq 0xeaf76
testl %eax, %eax
movq 0x20(%rsp), %rbp
je 0x5b825
movq %r12, %rdi
pushq $0x5f
popq %rsi
callq 0xeada5
movq 0x88(%r15), %r12
movl (%r12), %eax
testq %rax, %rax
je 0x5b86a
cmpq %rax, 0x18(%r14)
jl 0x5b86a
movq 0x40(%r14), %rcx
testq %rcx, %rcx
je 0x5b86a
decl %eax
movq (%rcx,%rax,8), %rdi
callq 0xeaf8a
testl %eax, %eax
je 0x5b86a
movq 0x58(%r15), %rdi
movq 0x40(%r14), %rax
movl (%r12), %ecx
decl %ecx
movq (%rax,%rcx,8), %rsi
callq 0xead71
movq 0x58(%r15), %rdi
movq 0x68(%r15), %rsi
callq 0xead71
orb $0x1, 0x78(%r15)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
cmpl $0x0, 0x10(%r14)
je 0x5b895
cmpq $0x0, 0x30(%r15)
jne 0x5b903
movq (%r14), %rax
movq 0x28(%rax), %rdx
movq %rbx, %rdi
leaq 0xb90a4(%rip), %rsi     # 0x11494a
xorl %eax, %eax
callq 0xde896
movq (%r14), %rax
movq 0x28(%rax), %rcx
movq 0x30(%r15), %rdx
addq %rcx, %rdx
cmpq 0x20(%r14), %rdx
jg 0x5b939
movq %rcx, 0x40(%r15)
movq %rdx, 0x28(%rax)
testb $0x18, 0x7c(%r15)
je 0x5b8ed
movq 0x58(%r15), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xba63d(%rip), %rsi     # 0x115f20
movq %rax, %rdx
xorl %eax, %eax
callq 0xdf05a
leaq 0x1a8(%rip), %rax       # 0x5ba9c
movq %rax, 0xa8(%r15)
movq %r15, %rdi
callq 0xf1a85
xorl %edi, %edi
callq 0xeaf3c
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xded32
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf167c
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
incq %rbp
movq (%r14), %rax
jmp 0x5b69b
leaq 0xba5ca(%rip), %rsi     # 0x115f0a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
xorl %edi, %edi
callq 0xeaf3c
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xded32
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf167c
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
cmpq $0x0, 0x40(%r14)
je 0x5b9a3
xorl %r15d, %r15d
cmpq 0x18(%r14), %r15
jge 0x5b9a3
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0xeaf3c
incq %r15
jmp 0x5b98b
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf16e7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xba4fe(%rip), %rsi     # 0x115ecd
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq (%r14), %rax
movzbl 0x18(%rax), %r9d
orl $0x300, %r9d            # imm = 0x300
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xe4c9a
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %r15, %rdi
callq 0xeb877
leaq 0xabd1e(%rip), %rsi     # 0x107743
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
jmp 0x5b64b