// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %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, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
cmpq -0x28(%rbp), %rax
jle 0x14b11f
jmp 0x14b2ea
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x30(%rbp)
jne 0x14b15d
leaq 0x84b5d(%rip), %rax     # 0x1cfcb4
movq %rax, -0x40(%rbp)
jmp 0x14b168
leaq 0x6cac9(%rip), %rax     # 0x1b7c2d
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movl %eax, %r8d
leaq 0x84b3f(%rip), %rsi     # 0x1cfcc3
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0x14b19e
jmp 0x14b2ea
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
cmpq $0x1, -0x30(%rbp)
jne 0x14b2cb
cmpq $0x18, -0x38(%rbp)
jl 0x14b2cb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq 0x7c282(%rip), %r8      # 0x1c745b
callq 0x14c6e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
xorl %ecx, %ecx
leaq -0x50(%rbp), %r8
movl $0x5a, %r9d
callq 0x14a470
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
leaq -0x60(%rbp), %rcx
leaq 0x7c3ea(%rip), %r8      # 0x1c7604
callq 0x14c6e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x2, %ecx
leaq -0x60(%rbp), %r8
movl $0x5a, %r9d
callq 0x14a470
leaq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x14c760
cmpl $0x0, %eax
je 0x14b264
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x1af(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x10, %rdx
leaq -0x60(%rbp), %rcx
leaq 0x6e8de(%rip), %r8      # 0x1b9b5d
callq 0x14c6e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x1, %ecx
leaq -0x60(%rbp), %r8
movl $0x5a, %r9d
callq 0x14a470
leaq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x14c760
cmpl $0x0, %eax
je 0x14b2c9
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x1b0(%rax)
jmp 0x14b2cb
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x38(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x14b10c
addq $0x60, %rsp
popq %rbp
retq