// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/zip.c
// Function: ef_ntfs
static void ef_ntfs(deark *c, lctx *d, struct extra_item_info_struct *eii)
{
	i64 pos = eii->dpos;
	i64 endpos;
	i64 attr_tag;
	i64 attr_size;
	const char *name;
	struct de_timestamp timestamp_tmp_m;
	struct de_timestamp timestamp_tmp;

	endpos = pos+eii->dlen;
	pos += 4; // skip reserved field

	while(1) {
		if(pos+4>endpos) break;
		attr_tag = de_getu16le_p(&pos);
		attr_size = de_getu16le_p(&pos);
		if(attr_tag==0x0001) name="NTFS filetimes";
		else name="?";
		de_dbg(c, "tag: 0x%04x (%s), dlen: %d", (UI)attr_tag, name,
			(int)attr_size);
		if(pos+attr_size>endpos) break;

		de_dbg_indent(c, 1);
		if(attr_tag==0x0001 && attr_size>=24) {
			read_FILETIME(c, d, pos, &timestamp_tmp_m, "mtime");
			apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_MODIFY, &timestamp_tmp_m, 90);

			read_FILETIME(c, d, pos+8, &timestamp_tmp, "atime");
			apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_ACCESS, &timestamp_tmp, 90);
			if(timestamps_are_valid_and_equal(&timestamp_tmp, &timestamp_tmp_m)) {
				eii->md->questionable_atime = 1;
			}

			read_FILETIME(c, d, pos+16, &timestamp_tmp, "creation time");
			apply_timestamp(c, d, eii->md, DE_TIMESTAMPIDX_CREATE, &timestamp_tmp, 90);
			if(timestamps_are_valid_and_equal(&timestamp_tmp, &timestamp_tmp_m)) {
				eii->md->questionable_crtime = 1;
			}
		}
		de_dbg_indent(c, -1);

		pos += attr_size;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%rdx), %rax
movq %rax, (%rsp)
movq 0x10(%rdx), %rbp
leaq 0x4(%rax), %rcx
movq %rcx, (%rsp)
cmpq $0x8, %rbp
jl 0xdf892
movq %rdx, %rbx
movq %rdi, %r14
addq %rax, %rbp
movq %rsp, %r15
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xef1ed
movq %rax, %r12
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xef1ed
movq %rax, %r13
cmpq $0x1, %r12
leaq 0x4c756(%rip), %rcx     # 0x12be69
leaq 0x64587(%rip), %rax     # 0x143ca1
cmoveq %rax, %rcx
movq %r14, %rdi
leaq 0x64588(%rip), %rsi     # 0x143cb0
movl %r12d, %edx
movl %r13d, %r8d
xorl %eax, %eax
callq 0xe9226
movq (%rsp), %rax
addq %r13, %rax
cmpq %rbp, %rax
jg 0xdf892
cmpq $0x1, %r12
setne %r12b
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x18, %r13
setl %al
orb %r12b, %al
jne 0xdf869
movq (%rsp), %rsi
movq %r14, %rdi
leaq 0x18(%rsp), %rdx
leaq 0x5c12f(%rip), %rcx     # 0x13b8ac
callq 0xe0776
cmpb $0x0, 0x18(%rsp)
je 0xdf7a3
movq 0x20(%rbx), %rax
cmpl $0x5a, 0x58(%rax)
jg 0xdf7a3
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x48(%rax)
movl $0x5a, 0x58(%rax)
movq (%rsp), %rsi
addq $0x8, %rsi
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
leaq 0x5c29b(%rip), %rcx     # 0x13ba55
callq 0xe0776
movb 0x8(%rsp), %al
testb %al, %al
je 0xdf809
movq 0x20(%rbx), %rcx
cmpl $0x5a, 0x88(%rcx)
jg 0xdf7e7
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x78(%rcx)
movl $0x5a, 0x88(%rcx)
testb %al, %al
je 0xdf809
cmpb $0x0, 0x18(%rsp)
je 0xdf809
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0xdf809
movq 0x20(%rbx), %rax
movb $0x1, 0x1ff(%rax)
movq (%rsp), %rsi
addq $0x10, %rsi
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
leaq 0x4e527(%rip), %rcx     # 0x12dd47
callq 0xe0776
movb 0x8(%rsp), %al
testb %al, %al
je 0xdf869
movq 0x20(%rbx), %rcx
cmpl $0x5a, 0x70(%rcx)
jg 0xdf847
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x60(%rcx)
movl $0x5a, 0x70(%rcx)
testb %al, %al
je 0xdf869
cmpb $0x0, 0x18(%rsp)
je 0xdf869
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0xdf869
movq 0x20(%rbx), %rax
movb $0x1, 0x200(%rax)
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq (%rsp), %rax
leaq (%rax,%r13), %rcx
movq %rcx, (%rsp)
addq %r13, %rax
addq $0x4, %rax
cmpq %rbp, %rax
jle 0xdf6ea
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq