// File: /workspace/github_c_makefile_star2_O1/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 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0xfdb0a
movq %rax, (%r14)
movq %r14, 0x40(%rax)
movl $0x1, 0x10(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl $0xd, %edx
callq 0xeb7d1
movq (%r14), %rcx
movl %eax, 0x18(%rcx)
leaq 0xc46dd(%rip), %rsi     # 0x122e25
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl $0x7, %esi
callq 0xef0d5
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x5e781
movzbl %al, %eax
addl $-0x30, %eax
movl %eax, 0x8(%r14)
movq 0x18(%rbx), %rdi
movl $0x9, %esi
callq 0xef0d5
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x5e7a1
movzbl %al, %eax
addl $-0x30, %eax
movl %eax, 0xc(%r14)
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
leaq 0xbaa16(%rip), %rsi     # 0x1191c6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl $0x10, %esi
callq 0xef1ca
movq %rax, 0x18(%r14)
leaq 0xc4668(%rip), %rsi     # 0x122e3b
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl $0x12, %esi
callq 0xef1ca
movq (%r14), %rcx
movq %rax, 0x20(%rcx)
leaq 0xc464d(%rip), %rsi     # 0x122e49
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl $0x16, %esi
callq 0xef37e
movq %rax, 0x20(%r14)
leaq 0xc4635(%rip), %rsi     # 0x122e57
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
xorl %eax, %eax
cmpq $0x1a, 0x20(%r14)
sete %al
movl %eax, 0x10(%r14)
leaq 0xcea84(%rip), %rax     # 0x12d2d5
leaq 0xb849b(%rip), %rdx     # 0x116cf3
cmoveq %rax, %rdx
leaq 0xc45b9(%rip), %rsi     # 0x122e1c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb703
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 0xe958c
cmpq $0x100, 0x18(%r14)      # imm = 0x100
jl 0x5e8a3
movq $0xff, 0x18(%r14)
movq 0x18(%r14), %rsi
testq %rsi, %rsi
jle 0x5e9dc
movl $0x8, %edx
movq %rbx, %rdi
callq 0xea259
movq %rax, 0x40(%r14)
cmpq $0x0, 0x18(%r14)
jle 0x5e8e4
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0xf6870
movq 0x40(%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq 0x18(%r14), %r15
jl 0x5e8cb
movq 0x30(%r14), %rdx
leaq 0xc457b(%rip), %rsi     # 0x122e6a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x30(%r14), %r13
cmpq $0x0, 0x18(%r14)
jle 0x5e9d2
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r13, %rcx
jle 0x5e957
xorl %ebp, %ebp
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %r8
callq 0xf0057
testl %eax, %eax
je 0x5e959
movq 0x8(%rsp), %rdx
subq %r13, %rdx
cmpq $0x104, %rdx            # imm = 0x104
jle 0x5e96d
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x5ed53
incq %r12
cmpq 0x18(%r14), %r12
jl 0x5e91d
jmp 0x5e9d2
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 0xf01b0
leal 0x1(%r12), %ebp
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xc44d0(%rip), %rsi     # 0x122e77
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdi
movl $0x1, %esi
callq 0xfdb50
movq 0x8(%rsp), %r13
incq %r13
movb $0x1, %bpl
jmp 0x5e959
subq 0x30(%r14), %r13
movq %r13, 0x38(%r14)
jmp 0x5e9e4
movq $0x0, 0x38(%r14)
movl $0x1, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpl $0x0, 0x28(%r14)
je 0x5ea49
movq 0x38(%r14), %r12
addq 0x30(%r14), %r12
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rcx
subq %r12, %rcx
cmpq $0x2, %rcx
jl 0x5ea49
xorl %r15d, %r15d
leaq 0x8(%rsp), %r8
xorl %esi, %esi
movq %r12, %rdx
callq 0xf0057
testl %eax, %eax
je 0x5ea4c
movq 0x8(%rsp), %r13
subq %r12, %r13
leaq -0x801(%r13), %rax
cmpq $-0x800, %rax           # imm = 0xF800
jae 0x5edfb
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf6bb0
leaq 0x14(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq (%r14), %rax
cmpq $0x0, 0x20(%rax)
jle 0x5eda3
movq 0x20(%r14), %rdx
leaq 0xc4435(%rip), %rsi     # 0x122eaf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r14), %rax
movq $0x1a, 0x28(%rax)
cmpq $0x0, 0x20(%rax)
jle 0x5eda3
xorl %r15d, %r15d
leaq (%r15,%r15,2), %rbp
shlq $0x3, %rbp
addq 0x20(%r14), %rbp
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe958c
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xfda6c
movq %rax, %r12
movl $0x4, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r13
movq %rax, 0x88(%r12)
movq %rbx, %rdi
callq 0xf6870
movq %rax, 0x68(%r12)
movq %rbx, %rdi
leaq 0xc43c0(%rip), %rsi     # 0x122ec0
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
leaq 0xe46ac(%rip), %rsi     # 0x1431cd
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbp, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rbp
movq %rbp, %rsi
callq 0xef14d
movzbl %al, %edx
movl %edx, (%r13)
movq %rbx, %rdi
leaq 0xc4371(%rip), %rsi     # 0x122ed0
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movq %rbp, %rsi
callq 0xfdc7e
movq (%r14), %rdi
movq 0x50(%r12), %rsi
addq $0x18, %rsi
leaq 0xb951a(%rip), %rdx     # 0x11809e
movl $0x4, %ecx
movq %rbp, %r8
callq 0xfdc9b
movq %r12, %rdi
movq %rbp, %rsi
callq 0xfdb9b
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 0xf01b0
movq 0x68(%r12), %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xdcdf5(%rip), %rsi     # 0x13b9d4
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x68(%r12), %rbp
movq 0x10(%rbp), %rax
testq %rax, %rax
jle 0x5ec12
movq 0x8(%rbp), %rcx
xorl %edx, %edx
cmpl $0x2f, (%rcx,%rdx,4)
jne 0x5ec0a
movl $0x5f, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x5ebfd
movq %rbp, %rdi
callq 0xf6bea
testl %eax, %eax
je 0x5ec2b
movq %rbp, %rdi
movl $0x5f, %esi
callq 0xf69a2
movq 0x88(%r12), %rbp
movl (%rbp), %eax
testq %rax, %rax
je 0x5ec70
cmpq %rax, 0x18(%r14)
jl 0x5ec70
movq 0x40(%r14), %rcx
testq %rcx, %rcx
je 0x5ec70
decl %eax
movq (%rcx,%rax,8), %rdi
callq 0xf6c00
testl %eax, %eax
je 0x5ec70
movq 0x58(%r12), %rdi
movq 0x40(%r14), %rax
movl (%rbp), %ecx
decl %ecx
movq (%rax,%rcx,8), %rsi
callq 0xf6969
movq 0x58(%r12), %rdi
movq 0x68(%r12), %rsi
callq 0xf6969
orb $0x1, 0x78(%r12)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpl $0x0, 0x10(%r14)
je 0x5eca1
cmpq $0x0, 0x30(%r12)
jne 0x5ed18
movq (%r14), %rax
movq 0x28(%rax), %rdx
movq %rbx, %rdi
leaq 0xc2c7c(%rip), %rsi     # 0x12192e
xorl %eax, %eax
callq 0xe9226
movq (%r14), %rax
movq 0x28(%rax), %rcx
movq 0x30(%r12), %rdx
addq %rcx, %rdx
cmpq 0x20(%r14), %rdx
jg 0x5ed69
movq %rcx, 0x40(%r12)
movq %rdx, 0x28(%rax)
testb $0x18, 0x7c(%r12)
je 0x5ed01
movq 0x58(%r12), %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xc41fc(%rip), %rsi     # 0x122ef3
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9b27
leaq 0x1cd(%rip), %rax       # 0x5eed5
movq %rax, 0xa8(%r12)
movq %r12, %rdi
callq 0xfdec1
xorl %edi, %edi
callq 0xf6bb0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r12, %rsi
callq 0xfdab8
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
incq %r15
movq (%r14), %rax
cmpq 0x20(%rax), %r15
jl 0x5eaaa
jmp 0x5eda3
leaq 0xc412c(%rip), %rsi     # 0x122e86
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0x5e9ec
leaq 0xc416d(%rip), %rsi     # 0x122edd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
xorl %edi, %edi
callq 0xf6bb0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r12, %rsi
callq 0xfdab8
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpq $0x0, 0x40(%r14)
je 0x5edd6
cmpq $0x0, 0x18(%r14)
jle 0x5edd6
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0xf6bb0
incq %r15
cmpq 0x18(%r14), %r15
jl 0x5edc0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xfdb25
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc409e(%rip), %rsi     # 0x122ea0
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6870
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 0xf01b0
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r15, %rdi
callq 0xf7557
leaq 0xb5899(%rip), %rsi     # 0x1146f3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0x5ea4c