// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/os2ea.c
// Function: eadata_do_MVMT
static int eadata_do_MVMT(deark *c, struct eadata_ctx *d,
	i64 pos1, i64 nbytes_avail, i64 *pbytes_consumed, int nesting_level)
{
	UI codepage;
	i64 num_entries;
	i64 pos = pos1;
	int retval = 0;
	int ret;
	i64 i;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	codepage = (UI)de_getu16le_p(&pos);
	de_dbg(c, "code page: %u", codepage);

	num_entries = de_getu16le_p(&pos);
	de_dbg(c, "num entries: %d", (int)num_entries);
	for(i=0; i<num_entries; i++) {
		UI attr_dtype;
		i64 bytes_consumed2 = 0;

		if(pos > pos1+nbytes_avail) goto done;
		de_dbg(c, "entry %d at %"I64_FMT, (int)i, pos);
		de_dbg_indent(c, 1);
		attr_dtype = (UI)de_getu16le_p(&pos);
		de_dbg(c, "data type: 0x%04x (%s)", attr_dtype, eadata_get_data_type_name(attr_dtype));

		ret = eadata_do_attribute_lowlevel(c, d, attr_dtype, pos, pos1+nbytes_avail-pos,
			&bytes_consumed2, nesting_level+1);
		if(!ret) goto done;
		pos += bytes_consumed2;
		de_dbg_indent(c, -1);
	}

	*pbytes_consumed = pos - pos1;
	retval = 1;
done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %edx
leaq 0xcda7a(%rip), %rsi     # 0x1be5eb
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0xb4f7d(%rip), %rsi     # 0x1a5b1b
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0xf0ca8
movq $0x0, -0x60(%rbp)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0xf0bd9
jmp 0xf0cbe
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rcx
leaq 0xcda0b(%rip), %rsi     # 0x1be5f9
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x58(%rbp), %edi
callq 0xf09b0
movq -0x70(%rbp), %rdi
movl -0x64(%rbp), %edx
movq %rax, %rcx
leaq 0xc876a(%rip), %rsi     # 0x1b93a8
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x58(%rbp), %edx
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %r8
addq -0x20(%rbp), %r8
subq -0x40(%rbp), %r8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
leaq -0x60(%rbp), %r9
movl %eax, (%rsp)
callq 0xf0a50
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jne 0xf0c7d
jmp 0xf0cbe
movq -0x60(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xf0bad
movq -0x40(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x15b5a0
movl -0x44(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)