// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rdi, %rbx
movl $0x48, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rbx, %rdi
callq 0xfd4b2
movq %rax, (%r14)
movq %r14, 0x40(%rax)
movl $0x1, 0x10(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl $0xd, %edx
callq 0xeb220
movq (%r14), %rcx
movl %eax, 0x18(%rcx)
leaq 0xc49be(%rip), %rsi     # 0x123012
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl $0x7, %esi
callq 0xeead3
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x5e68d
movzbl %al, %eax
addl $-0x30, %eax
movl %eax, 0x8(%r14)
movq 0x18(%rbx), %rdi
movl $0x9, %esi
callq 0xeead3
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jae 0x5e6af
movzbl %al, %ecx
addl $-0x30, %ecx
movl %ecx, 0xc(%r14)
jmp 0x5e6b3
movl 0xc(%r14), %ecx
movl 0x8(%r14), %edx
leaq 0xbac28(%rip), %rsi     # 0x1192e6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl $0x10, %esi
callq 0xeebc8
movq %rax, 0x18(%r14)
leaq 0xc4947(%rip), %rsi     # 0x123028
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl $0x12, %esi
callq 0xeebc8
movq (%r14), %rcx
movq %rax, 0x20(%rcx)
leaq 0xc492c(%rip), %rsi     # 0x123036
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl $0x16, %esi
callq 0xeed61
movq %rax, 0x20(%r14)
leaq 0xc4914(%rip), %rsi     # 0x123044
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
xorl %eax, %eax
cmpq $0x1a, 0x20(%r14)
sete %al
movl %eax, 0x10(%r14)
leaq 0xcee5e(%rip), %rax     # 0x12d5bd
leaq 0xb863d(%rip), %rdx     # 0x116da3
cmoveq %rax, %rdx
leaq 0xc4898(%rip), %rsi     # 0x123009
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb152
movq (%r14), %rax
movq 0x20(%rax), %rax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x20(%r14), %rax
movq %rax, 0x30(%r14)
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq 0x18(%r14), %rsi
cmpq $0x100, %rsi            # imm = 0x100
jl 0x5e7bb
movq $0xff, 0x18(%r14)
movl $0xff, %esi
jmp 0x5e7c4
testq %rsi, %rsi
jle 0x5e902
movl $0x8, %edx
movq %rbx, %rdi
callq 0xe96f7
movq %rax, 0x40(%r14)
cmpq $0x0, 0x18(%r14)
jle 0x5e7f8
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0xf6410
movq 0x40(%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq 0x18(%r14), %r15
jl 0x5e7df
movq 0x30(%r14), %rdx
leaq 0xc4854(%rip), %rsi     # 0x123057
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x30(%r14), %r13
cmpq $0x0, 0x18(%r14)
jle 0x5e8f6
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r13, %rcx
jle 0x5e8e3
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %r8
callq 0xefa77
testl %eax, %eax
je 0x5e8e3
movq 0x8(%rsp), %rdx
subq %r13, %rdx
cmpq $0x104, %rdx            # imm = 0x104
jg 0x5e8e3
movq 0x18(%rbx), %rdi
movq (%r14), %rax
movq 0x40(%r14), %rcx
movq (%rcx,%rbp,8), %rcx
movl 0x18(%rax), %r9d
movq %r13, %rsi
xorl %r8d, %r8d
callq 0xefbd7
leaq 0x1(%rbp), %r12
movq 0x40(%r14), %rax
movq (%rax,%rbp,8), %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xc47bb(%rip), %rsi     # 0x123064
movl %r12d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x40(%r14), %rax
movq (%rax,%rbp,8), %rdi
movl $0x1, %esi
callq 0xfd4f8
movq 0x8(%rsp), %r13
incq %r13
movq %r12, %rbp
cmpq 0x18(%r14), %r12
jl 0x5e830
movq 0x30(%r14), %rax
jmp 0x5e8f9
leaq 0xc4789(%rip), %rsi     # 0x123073
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
jmp 0x5e912
movq %r13, %rax
subq %rax, %r13
movq %r13, 0x38(%r14)
jmp 0x5e90a
movq $0x0, 0x38(%r14)
movl $0x1, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
cmpl $0x0, 0x28(%r14)
je 0x5e96f
movq 0x38(%r14), %r12
addq 0x30(%r14), %r12
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r12, %rcx
cmpq $0x2, %rcx
jl 0x5e96f
xorl %r15d, %r15d
leaq 0x8(%rsp), %r8
xorl %esi, %esi
movq %r12, %rdx
callq 0xefa77
testl %eax, %eax
je 0x5e972
movq 0x8(%rsp), %r13
subq %r12, %r13
leaq -0x801(%r13), %rax
cmpq $-0x800, %rax           # imm = 0xF800
jae 0x5ed0b
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf6753
leaq 0x14(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq (%r14), %rax
cmpq $0x0, 0x20(%rax)
jle 0x5ecb3
movq 0x20(%r14), %rdx
leaq 0xc46fc(%rip), %rsi     # 0x12309c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq (%r14), %rax
movq $0x1a, 0x28(%rax)
cmpq $0x0, 0x20(%rax)
jle 0x5ecb3
xorl %r15d, %r15d
leaq (%r15,%r15,2), %rbp
shlq $0x3, %rbp
addq 0x20(%r14), %rbp
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe8a1c
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xfd414
movq %rax, %r12
movl $0x4, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r13
movq %rax, 0x88(%r12)
movq %rbx, %rdi
callq 0xf6410
movq %rax, 0x68(%r12)
movq %rbx, %rdi
leaq 0xc4687(%rip), %rsi     # 0x1230ad
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbx, %rdi
leaq 0xe4c66(%rip), %rsi     # 0x1436ad
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbp, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rbp
movq %rbp, %rsi
callq 0xeeb4b
movzbl %al, %edx
movl %edx, (%r13)
movq %rbx, %rdi
leaq 0xc4638(%rip), %rsi     # 0x1230bd
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
movq %rbp, %rsi
callq 0xfd61b
movq (%r14), %rdi
movq 0x50(%r12), %rsi
addq $0x18, %rsi
leaq 0xb972c(%rip), %rdx     # 0x1181d6
movl $0x4, %ecx
movq %rbp, %r8
callq 0xfd638
movq %r12, %rdi
movq %rbp, %rsi
callq 0xfd538
movq 0x38(%r12), %rax
movq 0x68(%r12), %rcx
movq %rax, 0x30(%r12)
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq (%r14), %rax
movl 0x18(%rax), %r9d
movl $0xc, %edx
movl $0x1, %r8d
callq 0xefbd7
movq 0x68(%r12), %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xdd249(%rip), %rsi     # 0x13bd4e
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x68(%r12), %rbp
movq 0x10(%rbp), %rax
testq %rax, %rax
jle 0x5eb38
movq 0x8(%rbp), %rcx
xorl %edx, %edx
cmpl $0x2f, (%rcx,%rdx,4)
jne 0x5eb30
movl $0x5f, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x5eb23
movq %rbp, %rdi
callq 0xf678d
testl %eax, %eax
je 0x5eb51
movq %rbp, %rdi
movl $0x5f, %esi
callq 0xf6542
movq 0x88(%r12), %rbp
movl (%rbp), %eax
testq %rax, %rax
je 0x5eb96
cmpq %rax, 0x18(%r14)
jl 0x5eb96
movq 0x40(%r14), %rcx
testq %rcx, %rcx
je 0x5eb96
decl %eax
movq (%rcx,%rax,8), %rdi
callq 0xf67a3
testl %eax, %eax
je 0x5eb96
movq 0x58(%r12), %rdi
movq 0x40(%r14), %rax
movl (%rbp), %ecx
decl %ecx
movq (%rax,%rcx,8), %rsi
callq 0xf6509
movq 0x58(%r12), %rdi
movq 0x68(%r12), %rsi
callq 0xf6509
orb $0x1, 0x78(%r12)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
cmpl $0x0, 0x10(%r14)
je 0x5ebc7
cmpq $0x0, 0x30(%r12)
jne 0x5ec3e
movq (%r14), %rax
movq 0x28(%rax), %rdx
movq %rbx, %rdi
leaq 0xc2e62(%rip), %rsi     # 0x121a3a
xorl %eax, %eax
callq 0xe8617
movq (%r14), %rax
movq 0x28(%rax), %rcx
movq 0x30(%r12), %rdx
addq %rcx, %rdx
cmpq 0x20(%r14), %rdx
jg 0x5ec79
movq %rcx, 0x40(%r12)
movq %rdx, 0x28(%rax)
testb $0x18, 0x7c(%r12)
je 0x5ec27
movq 0x58(%r12), %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xc44c3(%rip), %rsi     # 0x1230e0
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8faa
leaq 0x1b7(%rip), %rax       # 0x5ede5
movq %rax, 0xa8(%r12)
movq %r12, %rdi
callq 0xfd85e
xorl %edi, %edi
callq 0xf6753
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe8be2
movq %rbx, %rdi
movq %r12, %rsi
callq 0xfd460
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
incq %r15
movq (%r14), %rax
cmpq 0x20(%rax), %r15
jl 0x5e9d0
jmp 0x5ecb3
leaq 0xc444a(%rip), %rsi     # 0x1230ca
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
xorl %edi, %edi
callq 0xf6753
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe8be2
movq %rbx, %rdi
movq %r12, %rsi
callq 0xfd460
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
cmpq $0x0, 0x40(%r14)
je 0x5ece6
cmpq $0x0, 0x18(%r14)
jle 0x5ece6
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0xf6753
incq %r15
cmpq 0x18(%r14), %r15
jl 0x5ecd0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xfd4cd
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc437b(%rip), %rsi     # 0x12308d
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
callq 0xf6410
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 0xefbd7
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r15, %rdi
callq 0xf70f6
leaq 0xb5a64(%rip), %rsi     # 0x1147ce
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0x5e972