// File: /workspace/github_c_makefile_star2_O2/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 0xd608d
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xe3f2a
movzbl %al, %ebp
leaq 0x4cea8(%rip), %rsi     # 0x122de6
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde9f1
cmpl $0x0, 0x30(%rbx)
je 0xd5f62
xorl %eax, %eax
cmpq $0x5, 0x10(%rbx)
setge %al
movb $0x1, %r13b
movb $0x1, %bpl
jmp 0xd5f82
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 0xd5fd6
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xd608d
leaq 0x58995(%rip), %rcx     # 0x12e936
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xd667f
cmpb $0x0, (%r15)
je 0xd5fd1
movq 0x20(%rbx), %rax
cmpl $0x32, 0x58(%rax)
jg 0xd5fd1
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x48(%rax)
movl $0x32, 0x58(%rax)
addq $0x4, (%rsp)
testb %r13b, %r13b
jne 0xd6039
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xd608d
leaq 0x58aec(%rip), %rcx     # 0x12eadf
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xd667f
cmpb $0x0, (%r15)
movq 0x20(%rbx), %rax
je 0xd602d
cmpl $0x32, 0x88(%rax)
jg 0xd602d
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 0xd608d
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xd608d
leaq 0x4ad7d(%rip), %rcx     # 0x120dcf
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xd667f
cmpb $0x0, (%r15)
movq 0x20(%rbx), %rax
je 0xd6086
cmpl $0x32, 0x70(%rax)
jg 0xd6086
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