// File: /workspace/github_c_makefile_star2_O3/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 0x10(%rdx), %rbp
leaq 0x4(%rax), %rcx
movq %rcx, (%rsp)
cmpq $0x8, %rbp
jl 0xdee8a
movq %rdx, %rbx
movq %rdi, %r14
addq %rax, %rbp
movq %rsp, %r15
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, %r12
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, %r13
cmpq $0x1, %r12
leaq 0x4d446(%rip), %rcx     # 0x12c151
leaq 0x6546f(%rip), %rax     # 0x144181
cmoveq %rax, %rcx
movq %r14, %rdi
leaq 0x65470(%rip), %rsi     # 0x144190
movl %r12d, %edx
movl %r13d, %r8d
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rax
addq %r13, %rax
cmpq %rbp, %rax
jg 0xdee8a
cmpq $0x1, %r12
setne %r12b
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpq $0x18, %r13
setl %al
orb %r12b, %al
jne 0xdee61
movq (%rsp), %rsi
movq %r14, %rdi
leaq 0x18(%rsp), %rdx
leaq 0x5ceb1(%rip), %rcx     # 0x13bc26
callq 0xdfd77
cmpb $0x0, 0x18(%rsp)
je 0xded9b
movq 0x20(%rbx), %rax
cmpl $0x5a, 0x58(%rax)
jg 0xded9b
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 0x5d01d(%rip), %rcx     # 0x13bdcf
callq 0xdfd77
movb 0x8(%rsp), %al
testb %al, %al
je 0xdeddf
movq 0x20(%rbx), %rcx
cmpl $0x5a, 0x88(%rcx)
jg 0xdeddf
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x78(%rcx)
movl $0x5a, 0x88(%rcx)
testb %al, %al
je 0xdee01
cmpb $0x0, 0x18(%rsp)
je 0xdee01
movq 0x20(%rsp), %rax
cmpq %rax, 0x10(%rsp)
jne 0xdee01
movq 0x20(%rbx), %rax
movb $0x1, 0x1ff(%rax)
movq (%rsp), %rsi
addq $0x10, %rsi
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
leaq 0x4f227(%rip), %rcx     # 0x12e03f
callq 0xdfd77
movb 0x8(%rsp), %al
testb %al, %al
je 0xdee3f
movq 0x20(%rbx), %rcx
cmpl $0x5a, 0x70(%rcx)
jg 0xdee3f
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x60(%rcx)
movl $0x5a, 0x70(%rcx)
testb %al, %al
je 0xdee61
cmpb $0x0, 0x18(%rsp)
je 0xdee61
movq 0x20(%rsp), %rax
cmpq %rax, 0x10(%rsp)
jne 0xdee61
movq 0x20(%rbx), %rax
movb $0x1, 0x200(%rax)
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq (%rsp), %rax
leaq (%rax,%r13), %rcx
movq %rcx, (%rsp)
addq %r13, %rax
addq $0x4, %rax
cmpq %rbp, %rax
jle 0xdece2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq