// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
cmpq -0x30(%rbp), %rax
jle 0x14bdb3
jmp 0x14bfa6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165170
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x21(%rbp), %edx
leaq 0x6fd43(%rip), %rsi     # 0x1bbb19
movb $0x0, %al
callq 0x15b350
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x14be0b
movq -0x18(%rbp), %rax
cmpq $0x5, 0x10(%rax)
setge %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
jmp 0x14be5f
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x1ac(%rax)
movzbl -0x21(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
movzbl -0x21(%rbp), %edx
andl $0x2, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x38(%rbp)
movzbl -0x21(%rbp), %edx
andl $0x4, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x14bec1
movq -0x20(%rbp), %rax
addq $0x4, %rax
cmpq -0x30(%rbp), %rax
jle 0x14be78
jmp 0x14bfa6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq 0x7b5cc(%rip), %r8      # 0x1c745b
callq 0x14c830
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
xorl %ecx, %ecx
leaq -0x50(%rbp), %r8
movl $0x32, %r9d
callq 0x14a470
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x14bf35
movq -0x20(%rbp), %rax
addq $0x4, %rax
cmpq -0x30(%rbp), %rax
jle 0x14beda
jmp 0x14bfa6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq 0x7b713(%rip), %r8      # 0x1c7604
callq 0x14c830
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x2, %ecx
leaq -0x50(%rbp), %r8
movl $0x32, %r9d
callq 0x14a470
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x1ad(%rax)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x14bfa6
movq -0x20(%rbp), %rax
addq $0x4, %rax
cmpq -0x30(%rbp), %rax
jle 0x14bf4b
jmp 0x14bfa6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq 0x6dbfb(%rip), %r8      # 0x1b9b5d
callq 0x14c830
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x1, %ecx
leaq -0x50(%rbp), %r8
movl $0x32, %r9d
callq 0x14a470
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x1ae(%rax)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)