// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/os2ea.c
// Function: eadata_do_attribute
static int eadata_do_attribute(deark *c, struct eadata_ctx *d, i64 pos1, i64 maxlen,
	de_ucstring *tmps, i64 *pbytes_consumed)
{
	i64 namelen;
	i64 attr_dpos;
	i64 attr_dlen;
	i64 tmpbc;
	UI attr_dtype;
	i64 pos = pos1;
	int retval = 0;

	pos++; // fEA
	namelen = (i64)de_getbyte_p(&pos);

	attr_dlen = (i64)de_getu16le_p(&pos);
	ucstring_empty(tmps);
	dbuf_read_to_ucstring(c->infile, pos, namelen, tmps, 0, DE_ENCODING_ASCII);
	de_dbg(c, "name: \"%s\"", ucstring_getpsz_d(tmps));
	pos += namelen + 1;
	attr_dpos = pos;
	de_dbg(c, "outer data len: %"I64_FMT, attr_dlen);
	if(attr_dpos + attr_dlen > pos1+maxlen) goto done;

	attr_dtype = (UI)de_getu16le_p(&pos);
	de_dbg(c, "data type: 0x%04x (%s)", attr_dtype, eadata_get_data_type_name(attr_dtype));

	tmpbc = 0;
	eadata_do_attribute_lowlevel(c, d, attr_dtype, attr_dpos+2, attr_dlen-2, &tmpbc, 0);

	pos = attr_dpos + attr_dlen;
	*pbytes_consumed = pos - pos1;
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x60(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x70(%rbp), %rdi
movq %rax, %rdx
leaq 0xbd91b(%rip), %rsi     # 0x1ae1d0
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rax
addq $0x1, %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0xcdcc9(%rip), %rsi     # 0x1be5ac
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0xf0904
jmp 0xf099d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x54(%rbp), %edi
callq 0xf09b0
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %edx
movq %rax, %rcx
leaq 0xc8a69(%rip), %rsi     # 0x1b93a8
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x54(%rbp), %edx
movq -0x40(%rbp), %rcx
addq $0x2, %rcx
movq -0x48(%rbp), %r8
subq $0x2, %r8
leaq -0x50(%rbp), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0xf0a50
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)