// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/zip.c
// Function: ef_extended_timestamp
static void ef_extended_timestamp(deark *c, lctx *d, struct extra_item_info_struct *eii)
{
	i64 pos = eii->dpos;
	u8 flags;
	i64 endpos;
	int has_mtime, has_atime, has_ctime;
	struct de_timestamp timestamp_tmp;

	endpos = pos + eii->dlen;
	if(pos+1>endpos) return;
	flags = de_getbyte_p(&pos);
	de_dbg2(c, "flags: 0x%02x", (UI)flags);
	if(eii->is_central) {
		has_mtime = (eii->dlen>=5);
		has_atime = 0;
		has_ctime = 0;
	}
	else {
		eii->md->has_extts = 1;
		has_mtime = (flags & 0x01)?1:0;
		has_atime = (flags & 0x02)?1:0;
		has_ctime = (flags & 0x04)?1:0;
	}
	if(has_mtime) {
		if(pos+4>endpos) return;
		read_unix_timestamp(c, d, pos, &timestamp_tmp, "mtime");
		apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_MODIFY, &timestamp_tmp, 50);
		pos+=4;
	}
	if(has_atime) {
		if(pos+4>endpos) return;
		read_unix_timestamp(c, d, pos, &timestamp_tmp, "atime");
		apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_ACCESS, &timestamp_tmp, 50);
		eii->md->has_extts_atime = 1;
		pos+=4;
	}
	if(has_ctime) {
		if(pos+4>endpos) return;
		read_unix_timestamp(c, d, pos, &timestamp_tmp, "creation time");
		apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_CREATE, &timestamp_tmp, 50);
		eii->md->has_extts_crtime = 1;
		pos+=4;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x8(%rdx), %r15
movq %r15, (%rsp)
movq 0x10(%rdx), %r12
testq %r12, %r12
jle 0xdf7fb
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xeeb4b
movzbl %al, %ebp
leaq 0x509ca(%rip), %rsi     # 0x130076
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe87e4
cmpl $0x0, 0x30(%rbx)
je 0xdf6d0
xorl %eax, %eax
cmpq $0x5, 0x10(%rbx)
setge %al
movb $0x1, %r13b
movb $0x1, %bpl
jmp 0xdf6f0
movq 0x20(%rbx), %rax
movb $0x1, 0x1fc(%rax)
movl %ebp, %eax
andl $0x1, %eax
testb $0x2, %bpl
sete %r13b
testb $0x4, %bpl
sete %bpl
addq %r15, %r12
testl %eax, %eax
je 0xdf744
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xdf7fb
leaq 0x5c517(%rip), %rcx     # 0x13bc26
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xdfe59
cmpb $0x0, (%r15)
je 0xdf73f
movq 0x20(%rbx), %rax
cmpl $0x32, 0x58(%rax)
jg 0xdf73f
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x48(%rax)
movl $0x32, 0x58(%rax)
addq $0x4, (%rsp)
testb %r13b, %r13b
jne 0xdf7a7
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xdf7fb
leaq 0x5c66e(%rip), %rcx     # 0x13bdcf
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xdfe59
cmpb $0x0, (%r15)
movq 0x20(%rbx), %rax
je 0xdf79b
cmpl $0x32, 0x88(%rax)
jg 0xdf79b
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x78(%rax)
movl $0x32, 0x88(%rax)
movq 0x20(%rbx), %rax
movb $0x1, 0x1fd(%rax)
addq $0x4, (%rsp)
testb %bpl, %bpl
jne 0xdf7fb
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xdf7fb
leaq 0x4e87f(%rip), %rcx     # 0x12e03f
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xdfe59
cmpb $0x0, (%r15)
movq 0x20(%rbx), %rax
je 0xdf7f4
cmpl $0x32, 0x70(%rax)
jg 0xdf7f4
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x60(%rax)
movl $0x32, 0x70(%rax)
movq 0x20(%rbx), %rax
movb $0x1, 0x1fe(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq