// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/zip.c
// Function: de_run_zip_normally
static void de_run_zip_normally(deark *c, lctx *d)
{
	int eocd_found;

	if(c->detection_data && c->detection_data->zip_eocd_looked_for) {
		eocd_found = (int)c->detection_data->zip_eocd_found;
		d->eocd_pos = c->detection_data->zip_eocd_pos;
	}
	else {
		eocd_found = fmtutil_find_zip_eocd(c, c->infile, 0, &d->eocd_pos);
	}
	if(!eocd_found) {
		if(c->module_disposition==DE_MODDISP_AUTODETECT ||
			c->module_disposition==DE_MODDISP_EXPLICIT)
		{
			u32 bof_sig;

			bof_sig = (u32)de_getu32be(0);
			if(bof_sig==CODE_PK78) {
				de_err(c, "This looks like the first segment of a multi-segment ZIP archive.");
				print_multisegment_note(c, d);
				goto done;
			}
			if(bof_sig==CODE_PK34) {
				de_err(c, "ZIP central directory not found. "
					"You could try \"-opt zip:scanmode\".");
				goto done;
			}
		}
		de_err(c, "Not a valid ZIP file");
		goto done;
	}

	de_dbg(c, "end-of-central-dir record found at %"I64_FMT,
		d->eocd_pos);

	do_zip64_eocd_locator(c, d);

	if(d->is_zip64) {
		if(!do_zip64_eocd(c, d)) goto done;
	}

	check_for_resof_fmt(c, d);

	if(d->is_zip64)
		de_declare_fmt(c, "ZIP-Zip64");
	else if(d->is_resof)
		de_declare_fmt(c, "SOF/RESOF");
	else
		de_declare_fmt(c, "ZIP");

	if(!do_end_of_central_dir(c, d)) {
		goto done;
	}

	if(!do_central_dir(c, d)) {
		goto done;
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
je 0xdc0fb
cmpb $0x0, 0x6(%rcx)
je 0xdc0fb
movzbl 0x7(%rcx), %eax
movq 0x8(%rcx), %rcx
movq %rcx, 0x88(%r14)
jmp 0xdc110
movq 0x18(%rbx), %rsi
leaq 0x88(%r14), %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf8ed5
testl %eax, %eax
je 0xdc247
movq 0x88(%r14), %rdx
leaq 0x6749e(%rip), %rsi     # 0x1435c4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x88(%r14), %r12
leaq -0x14(%r12), %r15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed0d
cmpl $0x504b0607, %eax       # imm = 0x504B0607
jne 0xdc208
leaq 0x6845e(%rip), %rsi     # 0x1445b8
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
addq $-0x10, %r12
leaq 0x10(%rsp), %r15
movq %r12, (%r15)
movb $0x1, 0xac(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, 0x98(%r14)
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xeef09
leaq 0x90(%r14), %r12
movq %rax, 0x90(%r14)
addq $0x8, (%r15)
movl 0x98(%r14), %ecx
leaq 0x68411(%rip), %rsi     # 0x1445d8
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xebad2
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
leaq 0x68410(%rip), %rsi     # 0x1445ff
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
cmpb $0x0, 0xac(%r14)
je 0xdc398
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
cmpq $0x0, 0x98(%r14)
je 0xdc2cb
leaq 0x683e4(%rip), %rsi     # 0x14461c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
jmp 0xdc37a
movl 0x24(%rbx), %eax
decl %eax
cmpl $0x1, %eax
ja 0xdc2ac
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xeed0d
cmpl $0x504b0304, %eax       # imm = 0x504B0304
je 0xdc858
cmpl $0x504b0708, %eax       # imm = 0x504B0708
jne 0xdc2ac
leaq 0x6824a(%rip), %rsi     # 0x1444bf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
cmpb $0x0, 0xac(%r14)
jne 0xdc849
leaq 0x682da(%rip), %rsi     # 0x14456e
movq %rbx, %rdi
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9393
leaq 0x68292(%rip), %rsi     # 0x144545
movq %rbx, %rdi
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9295
movq 0x90(%r14), %r15
movq %r15, 0x10(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed0d
cmpl $0x504b0606, %eax       # imm = 0x504B0606
jne 0xdc366
leaq 0x683af(%rip), %rsi     # 0x1446a0
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
leaq 0x4(%r15), %r12
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeef09
addq $0xc, %r15
leaq 0x10(%rsp), %r12
movq %r15, (%r12)
leaq 0x68398(%rip), %rsi     # 0x1446c7
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeebeb
movzbl %ah, %edx
leaq 0xb1b9e(%rip), %r15     # 0x18def0
cmpl $0x13, %edx
ja 0xdc864
movl %edx, %ecx
movq (%r15,%rcx,8), %rcx
jmp 0xdc879
leaq 0x682f3(%rip), %rsi     # 0x144660
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8faa
movb $0x0, 0xac(%r14)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
cmpb $0x0, 0xac(%r14)
jne 0xdc3e8
cmpl $0x3, 0x24(%rbx)
je 0xdc3de
movq 0x88(%r14), %rsi
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
addq $-0x16, %rax
cmpq %rax, %rsi
jne 0xdc3de
addq $0xf, %rsi
callq 0xeead3
testb %al, %al
jns 0xdc3de
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xeed0d
cmpq $0x504b0306, %rax       # imm = 0x504B0306
jne 0xdc3de
movb $0x1, 0xad(%r14)
cmpb $0x0, 0xac(%r14)
je 0xdc3f1
leaq 0x6816b(%rip), %rsi     # 0x14455a
jmp 0xdc40b
cmpb $0x0, 0xad(%r14)
leaq 0x49e8f(%rip), %rax     # 0x12628f
leaq 0x6815d(%rip), %rsi     # 0x144564
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xeb125
movq 0x88(%r14), %r15
leaq 0x68285(%rip), %rsi     # 0x1446a6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq 0x4(%r15), %rsi
callq 0xeebc8
movq %rax, 0x8(%r14)
leaq 0x66f66(%rip), %rsi     # 0x1433b9
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x6(%r15), %rsi
callq 0xeebc8
movq %rax, 0x10(%r14)
leaq 0x682c9(%rip), %rsi     # 0x144741
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x8(%r15), %rsi
callq 0xeebc8
movq %rax, 0x18(%r14)
movl 0xac(%r14), %edi
leaq 0x10(%rsp), %r12
movl $0xffff, %edx           # imm = 0xFFFF
movq %rax, %rsi
movq %r12, %rcx
callq 0xde7b5
leaq 0x682b0(%rip), %rsi     # 0x144769
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0xac(%r14)
je 0xdc4e2
cmpq $0xffff, 0x18(%r14)     # imm = 0xFFFF
jne 0xdc4e2
movq 0x58(%r14), %rax
movq %rax, 0x18(%r14)
movq 0x18(%rbx), %rdi
leaq 0xa(%r15), %rsi
callq 0xeebc8
movq %rax, 0x20(%r14)
leaq 0xc(%r15), %rsi
cmpb $0x0, 0xad(%r14)
movq 0x18(%rbx), %rdi
je 0xdc50f
callq 0xeedfa
negq %rax
jmp 0xdc514
callq 0xeed61
movq %rax, 0x28(%r14)
movq 0x18(%rbx), %rdi
leaq 0x10(%r15), %rsi
callq 0xeed61
movq %rax, 0x30(%r14)
movq 0x20(%r14), %rsi
movl 0xac(%r14), %edi
leaq 0x10(%rsp), %r12
movl $0xffff, %edx           # imm = 0xFFFF
movq %r12, %rcx
callq 0xde7b5
leaq 0x68248(%rip), %rsi     # 0x144795
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0xac(%r14)
je 0xdc576
cmpq $0xffff, 0x20(%r14)     # imm = 0xFFFF
jne 0xdc576
movq 0x60(%r14), %rax
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rdx
leaq 0x66e98(%rip), %rsi     # 0x143419
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movb 0xac(%r14), %al
testb %al, %al
je 0xdc5a9
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, 0x28(%r14)
jne 0xdc5a9
movq 0x68(%r14), %rcx
movq %rcx, 0x28(%r14)
movq 0x30(%r14), %rsi
movzbl %al, %edi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r12, %rcx
callq 0xde7b5
movq 0x10(%r14), %rcx
leaq 0x681de(%rip), %rsi     # 0x1447b1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0xac(%r14)
je 0xdc5f8
cmpq %r13, 0x30(%r14)
jne 0xdc5f8
movq 0x70(%r14), %rax
movq %rax, 0x30(%r14)
movq 0x18(%rbx), %rdi
leaq 0x14(%r15), %rsi
callq 0xeebc8
movq %rax, 0x38(%r14)
leaq 0x5ad1f(%rip), %rsi     # 0x13732f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x8(%r14), %rax
movq 0x10(%r14), %rdx
cmpq %rax, %rdx
jne 0xdc650
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq 0x88(%r14), %rcx
jle 0xdc650
leaq 0x68195(%rip), %rsi     # 0x1447d6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0xdc83c
movq 0x38(%r14), %rcx
testq %rcx, %rcx
jle 0xdc688
addq $0x16, %r15
leaq 0x3becf(%rip), %rax     # 0x118533
movq %rax, (%rsp)
leaq 0x6819a(%rip), %r9      # 0x144809
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xde5f9
movq 0x8(%r14), %rax
movq 0x10(%r14), %rdx
cmpq %rax, %rdx
jne 0xdc810
cmpb $0x0, 0xac(%r14)
je 0xdc6a8
cmpq %rax, 0x98(%r14)
jne 0xdc810
testq %rax, %rax
je 0xdc6d9
leaq 0x6819b(%rip), %rsi     # 0x14484f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
cmpb $0x0, 0xac(%r14)
jne 0xdc6d9
leaq 0x67e9f(%rip), %rsi     # 0x14456e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9393
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
cmpq %rcx, %rdx
je 0xdc6f7
leaq 0x6819a(%rip), %rsi     # 0x144887
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
xorl %eax, %eax
cmpb $0x0, 0xac(%r14)
setne %al
movq 0x88(%r14,%rax,8), %r15
subq 0x28(%r14), %r15
js 0xdc768
movq 0x30(%r14), %rdx
cmpq %rdx, %r15
je 0xdc768
leaq 0x681d0(%rip), %rsi     # 0x1448f2
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8faa
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed0d
cmpl $0x504b0102, %eax       # imm = 0x504B0102
jne 0xdc768
movq %r15, %rax
subq 0x30(%r14), %rax
movq %rax, 0xa0(%r14)
leaq 0x68208(%rip), %rsi     # 0x14495f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r15, 0x30(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x30(%r14), %r15
leaq 0x681ff(%rip), %rsi     # 0x14497f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x78, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r12
movq %r14, 0x8(%rax)
leaq 0x3717(%rip), %rax      # 0xdfecc
movq %rax, (%r12)
movq 0x20(%r14), %rax
movq %rax, 0x30(%r12)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r12)
movq %r15, 0x20(%r12)
addq 0x28(%r14), %r15
movq %r15, 0x28(%r12)
movb $0x1, 0x14(%r12)
movb 0xad(%r14), %al
movb %al, 0x16(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xdcd15
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe8be2
jmp 0xdc849
leaq 0x68003(%rip), %rsi     # 0x14481a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
cmpb $0x0, 0xac(%r14)
jne 0xdc83c
leaq 0x67d3c(%rip), %rsi     # 0x14456e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9393
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67ca2(%rip), %rsi     # 0x144501
jmp 0xdc2b3
cmpl $0x1e, %edx
leaq 0x671d0(%rip), %rsi     # 0x143a3e
leaq 0x4f8dc(%rip), %rcx     # 0x12c151
cmoveq %rsi, %rcx
movl $0xff, %ebp
movl %eax, %esi
andl %ebp, %esi
imull $0xcd, %esi, %r8d
shrl $0xb, %r8d
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subb %sil, %al
movzbl %al, %r9d
leaq 0x66f47(%rip), %rsi     # 0x1437e9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movl %eax, %edx
shrl $0x8, %edx
andl %ebp, %edx
cmpl $0x13, %edx
ja 0xdc8ce
movl %edx, %ecx
movq (%r15,%rcx,8), %rcx
jmp 0xdc8e3
cmpl $0x1e, %edx
leaq 0x67166(%rip), %rsi     # 0x143a3e
leaq 0x4f872(%rip), %rcx     # 0x12c151
cmoveq %rsi, %rcx
movzbl %al, %esi
imull $0xcd, %esi, %r8d
shrl $0xb, %r8d
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subb %sil, %al
movzbl %al, %r9d
leaq 0x67de5(%rip), %rsi     # 0x1446eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xeed83
leaq 0x66a91(%rip), %rsi     # 0x1433b9
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, 0x50(%r14)
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xeef09
leaq 0x58(%r14), %r12
movq %rax, 0x58(%r14)
addq $0x8, (%r15)
leaq 0x66a6b(%rip), %rsi     # 0x1433cf
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xebad2
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xeef09
movq %rax, 0x60(%r14)
addq $0x8, (%r15)
leaq 0x66a68(%rip), %rsi     # 0x1433fc
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xebad2
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xeef09
leaq 0x68(%r14), %r12
movq %rax, 0x68(%r14)
addq $0x8, (%r15)
leaq 0x66a51(%rip), %rsi     # 0x143419
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xebad2
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xeef09
leaq 0x70(%r14), %r12
movq %rax, 0x70(%r14)
addq $0x8, (%r15)
movl 0x50(%r14), %ecx
leaq 0x67d1c(%rip), %rsi     # 0x14471c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xebad2
jmp 0xdc382