// File: /workspace/github_c_makefile_star2_O1/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 0xe01f1
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xef14d
movzbl %al, %ebp
leaq 0x4fccd(%rip), %rsi     # 0x12fd6a
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe93cf
cmpl $0x0, 0x30(%rbx)
je 0xe00c1
xorl %eax, %eax
cmpq $0x5, 0x10(%rbx)
setge %al
movb $0x1, %r13b
movb $0x1, %bpl
jmp 0xe00e1
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 0xe0135
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xe01f1
leaq 0x5b7ac(%rip), %rcx     # 0x13b8ac
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xe0858
cmpb $0x0, (%r15)
je 0xe0130
movq 0x20(%rbx), %rax
cmpl $0x32, 0x58(%rax)
jg 0xe0130
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x48(%rax)
movl $0x32, 0x58(%rax)
addq $0x4, (%rsp)
testb %r13b, %r13b
jne 0xe0198
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xe01f1
leaq 0x5b903(%rip), %rcx     # 0x13ba55
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xe0858
cmpb $0x0, (%r15)
je 0xe0188
movq 0x20(%rbx), %rax
cmpl $0x32, 0x88(%rax)
jg 0xe0188
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 0xe01f1
movq (%rsp), %rsi
leaq 0x4(%rsi), %rax
cmpq %r12, %rax
jg 0xe01f1
leaq 0x4db96(%rip), %rcx     # 0x12dd47
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0xe0858
cmpb $0x0, (%r15)
je 0xe01e1
movq 0x20(%rbx), %rax
cmpl $0x32, 0x70(%rax)
jg 0xe01e1
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x60(%rax)
movl $0x32, 0x70(%rax)
movq 0x20(%rbx), %rax
movb $0x1, 0x1fe(%rax)
addq $0x4, (%rsp)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq