// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
je 0xdcab1
cmpb $0x0, 0x6(%rcx)
je 0xdcab1
movzbl 0x7(%rcx), %eax
movq 0x8(%rcx), %rcx
movq %rcx, 0x88(%r14)
jmp 0xdcac6
movq 0x18(%rbx), %rsi
leaq 0x88(%r14), %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf93ef
testl %eax, %eax
je 0xdcbfb
movq 0x88(%r14), %rdx
leaq 0x66608(%rip), %rsi     # 0x1430e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x88(%r14), %rsi
addq $-0x14, %rsi
movq %rsi, 0x10(%rsp)
movq 0x18(%rbx), %rdi
callq 0xef32a
cmpl $0x504b0607, %eax       # imm = 0x504B0607
jne 0xdcbbc
leaq 0x10(%rsp), %r15
movq (%r15), %rdx
leaq 0x675bf(%rip), %rsi     # 0x1440d8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%r15)
movb $0x1, 0xac(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, 0x98(%r14)
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
leaq 0x90(%r14), %r12
movq %rax, 0x90(%r14)
addq $0x8, (%r15)
movl 0x98(%r14), %ecx
leaq 0x6757d(%rip), %rsi     # 0x1440f8
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xec0d1
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
leaq 0x6757c(%rip), %rsi     # 0x14411f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpb $0x0, 0xac(%r14)
je 0xdcd47
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
cmpq $0x0, 0x98(%r14)
je 0xdcc7d
leaq 0x67550(%rip), %rsi     # 0x14413c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0xdcd33
movl 0x24(%rbx), %eax
decl %eax
cmpl $0x1, %eax
ja 0xdcc5f
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xef32a
cmpl $0x504b0304, %eax       # imm = 0x504B0304
je 0xdd201
cmpl $0x504b0708, %eax       # imm = 0x504B0708
jne 0xdcc5f
leaq 0x673b6(%rip), %rsi     # 0x143fdf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
cmpb $0x0, 0xac(%r14)
jne 0xdd1f3
leaq 0x67446(%rip), %rsi     # 0x14408e
movq %rbx, %rdi
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9ef5
leaq 0x673ff(%rip), %rsi     # 0x144065
movq %rbx, %rdi
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9df7
movq 0x90(%r14), %rsi
movq %rsi, 0x10(%rsp)
movq 0x18(%rbx), %rdi
callq 0xef32a
movq 0x10(%rsp), %rdx
cmpl $0x504b0606, %eax       # imm = 0x504B0606
jne 0xdcd22
leaq 0x67517(%rip), %rsi     # 0x1441c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
leaq 0x10(%rsp), %r15
addq $0x4, (%r15)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
addq $0x8, (%r15)
leaq 0x67507(%rip), %rsi     # 0x1441e7
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef1ed
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
andl %ecx, %eax
leaq 0xb11e2(%rip), %r15     # 0x18def0
cmpl $0x13, %edx
ja 0xdd20d
movl %edx, %ecx
movq (%r15,%rcx,8), %rcx
jmp 0xdd222
leaq 0x67457(%rip), %rsi     # 0x144180
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
movb $0x0, 0xac(%r14)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpb $0x0, 0xac(%r14)
jne 0xdcd97
cmpl $0x3, 0x24(%rbx)
je 0xdcd97
movq 0x88(%r14), %rsi
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
addq $-0x16, %rax
cmpq %rax, %rsi
jne 0xdcd97
addq $0xf, %rsi
callq 0xef0d5
testb %al, %al
jns 0xdcd97
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xef32a
cmpq $0x504b0306, %rax       # imm = 0x504B0306
jne 0xdcd97
movb $0x1, 0xad(%r14)
cmpb $0x0, 0xac(%r14)
je 0xdcdaa
leaq 0x672d2(%rip), %rsi     # 0x14407a
jmp 0xdcdc4
cmpb $0x0, 0xad(%r14)
leaq 0x492a6(%rip), %rax     # 0x12605f
leaq 0x672c4(%rip), %rsi     # 0x144084
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xeb6d6
movq 0x88(%r14), %r15
leaq 0x673ec(%rip), %rsi     # 0x1441c6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
leaq 0x4(%r15), %rsi
callq 0xef1ca
movq %rax, 0x8(%r14)
leaq 0x660cd(%rip), %rsi     # 0x142ed9
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x6(%r15), %rsi
callq 0xef1ca
movq %rax, 0x10(%r14)
leaq 0x67430(%rip), %rsi     # 0x144261
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x8(%r15), %rsi
callq 0xef1ca
movq %rax, 0x18(%r14)
leaq 0x10(%rsp), %r12
movl $0xffff, %edx           # imm = 0xFFFF
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rcx
callq 0xdf1a1
leaq 0x6741b(%rip), %rsi     # 0x144289
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0xac(%r14)
je 0xdce97
cmpq $0xffff, 0x18(%r14)     # imm = 0xFFFF
jne 0xdce97
movq 0x58(%r14), %rax
movq %rax, 0x18(%r14)
movq 0x18(%rbx), %rdi
leaq 0xa(%r15), %rsi
callq 0xef1ca
movq %rax, 0x20(%r14)
leaq 0xc(%r15), %rsi
cmpb $0x0, 0xad(%r14)
movq 0x18(%rbx), %rdi
je 0xdcec4
callq 0xef417
negq %rax
jmp 0xdcec9
callq 0xef37e
movq %rax, 0x28(%r14)
movq 0x18(%rbx), %rdi
leaq 0x10(%r15), %rsi
callq 0xef37e
movq %rax, 0x30(%r14)
movq 0x20(%r14), %rsi
leaq 0x10(%rsp), %r12
movl $0xffff, %edx           # imm = 0xFFFF
movq %r14, %rdi
movq %r12, %rcx
callq 0xdf1a1
leaq 0x673b7(%rip), %rsi     # 0x1442b5
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0xac(%r14)
je 0xdcf27
cmpq $0xffff, 0x20(%r14)     # imm = 0xFFFF
jne 0xdcf27
movq 0x60(%r14), %rax
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rdx
leaq 0x66007(%rip), %rsi     # 0x142f39
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0xac(%r14)
je 0xdcf59
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, 0x28(%r14)
jne 0xdcf59
movq 0x68(%r14), %rax
movq %rax, 0x28(%r14)
movq 0x30(%r14), %rsi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movq %r12, %rcx
callq 0xdf1a1
movq 0x10(%r14), %rcx
leaq 0x6734e(%rip), %rsi     # 0x1442d1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0xac(%r14)
je 0xdcfa8
cmpq %r13, 0x30(%r14)
jne 0xdcfa8
movq 0x70(%r14), %rax
movq %rax, 0x30(%r14)
movq 0x18(%rbx), %rdi
leaq 0x14(%r15), %rsi
callq 0xef1ca
movq %rax, 0x38(%r14)
leaq 0x59fe3(%rip), %rsi     # 0x136fa3
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rax
jne 0xdcffd
movq 0x28(%r14), %rax
addq 0x30(%r14), %rax
cmpq 0x88(%r14), %rax
jle 0xdcffd
leaq 0x67308(%rip), %rsi     # 0x1442f6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xdd1e6
movq 0x38(%r14), %rcx
testq %rcx, %rcx
jle 0xdd02d
addq $0x16, %r15
leaq 0x3b3ea(%rip), %rax     # 0x1183fb
movq %rax, (%rsp)
leaq 0x6730d(%rip), %r9      # 0x144329
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xdefe1
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
jne 0xdd1ba
cmpb $0x0, 0xac(%r14)
je 0xdd052
cmpq %rax, 0x98(%r14)
jne 0xdd1ba
testq %rax, %rax
je 0xdd083
leaq 0x67311(%rip), %rsi     # 0x14436f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
cmpb $0x0, 0xac(%r14)
jne 0xdd083
leaq 0x67015(%rip), %rsi     # 0x14408e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9ef5
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
cmpq %rcx, %rdx
je 0xdd0a1
leaq 0x67310(%rip), %rsi     # 0x1443a7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
xorl %eax, %eax
cmpb $0x0, 0xac(%r14)
setne %al
movq 0x88(%r14,%rax,8), %r15
subq 0x28(%r14), %r15
js 0xdd112
movq 0x30(%r14), %rdx
cmpq %rdx, %r15
je 0xdd112
leaq 0x67346(%rip), %rsi     # 0x144412
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9b27
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef32a
cmpl $0x504b0102, %eax       # imm = 0x504B0102
jne 0xdd112
movq %r15, %rax
subq 0x30(%r14), %rax
movq %rax, 0xa0(%r14)
leaq 0x6737e(%rip), %rsi     # 0x14447f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r15, 0x30(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x30(%r14), %r15
leaq 0x67375(%rip), %rsi     # 0x14449f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x78, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r12
movq %r14, 0x8(%rax)
leaq 0x376c(%rip), %rax      # 0xe08cb
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 0xdd6b9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe9752
jmp 0xdd1f3
leaq 0x67179(%rip), %rsi     # 0x14433a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
cmpb $0x0, 0xac(%r14)
jne 0xdd1e6
leaq 0x66eb2(%rip), %rsi     # 0x14408e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9ef5
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x66e19(%rip), %rsi     # 0x144021
jmp 0xdcc66
cmpl $0x1e, %edx
leaq 0x66347(%rip), %rsi     # 0x14355e
leaq 0x4ec4b(%rip), %rcx     # 0x12be69
cmoveq %rsi, %rcx
movl %eax, %esi
imulq $0x1999999a, %rsi, %r8  # imm = 0x1999999A
shrq $0x20, %r8
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subl %esi, %eax
leaq 0x660ca(%rip), %rsi     # 0x143309
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xef1ed
movl %eax, %edx
shrl $0x8, %edx
movl $0xff, %ecx
andl %ecx, %edx
andl %ecx, %eax
cmpl $0x13, %edx
ja 0xdd275
movl %edx, %ecx
movq (%r15,%rcx,8), %rcx
jmp 0xdd28a
cmpl $0x1e, %edx
leaq 0x662df(%rip), %rsi     # 0x14355e
leaq 0x4ebe3(%rip), %rcx     # 0x12be69
cmoveq %rsi, %rcx
movl %eax, %esi
imulq $0x1999999a, %rsi, %r8  # imm = 0x1999999A
shrq $0x20, %r8
leal (%r8,%r8), %esi
leal (%rsi,%rsi,4), %esi
subl %esi, %eax
leaq 0x66f64(%rip), %rsi     # 0x14420b
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xef3a0
leaq 0x65c0d(%rip), %rsi     # 0x142ed9
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, 0x50(%r14)
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
leaq 0x58(%r14), %r12
movq %rax, 0x58(%r14)
addq $0x8, (%r15)
leaq 0x65be7(%rip), %rsi     # 0x142eef
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xec0d1
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
movq %rax, 0x60(%r14)
addq $0x8, (%r15)
leaq 0x65be4(%rip), %rsi     # 0x142f1c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xec0d1
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
leaq 0x68(%r14), %r12
movq %rax, 0x68(%r14)
addq $0x8, (%r15)
leaq 0x65bcd(%rip), %rsi     # 0x142f39
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xec0d1
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
callq 0xef536
leaq 0x70(%r14), %r12
movq %rax, 0x70(%r14)
addq $0x8, (%r15)
movl 0x50(%r14), %ecx
leaq 0x66e98(%rip), %rsi     # 0x14423c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xec0d1
jmp 0xdcd3b