// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/os2ea.c
// Function: eadata_do_attribute_lowlevel
static int eadata_do_attribute_lowlevel(deark *c, struct eadata_ctx *d,
	UI attr_dtype, i64 pos1, i64 nbytes_avail, i64 *pbytes_consumed, int nesting_level)
{
	int retval = 0;

	*pbytes_consumed = 0;

	// I don't know if multi-val attributes are allowed to contain other multi-val attributes.
	if(nesting_level>5) goto done;

	switch(attr_dtype) {
	case 0xffdf:
		if(!eadata_do_MVMT(c, d, pos1, nbytes_avail, pbytes_consumed, nesting_level)) goto done;
		break;
	case 0xffde: // MVST (TODO)
	case 0xffdd: // ASN1
		goto done;
	default:
		if(!eadata_do_attribute_lowlevel_singleval(c, d, attr_dtype, pos1, nbytes_avail,
			pbytes_consumed))
		{
			goto done;
		}
		break;
	}

	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
andq $0x0, (%r9)
movl 0x80(%rsp), %r15d
xorl %ebp, %ebp
cmpl $0x5, %r15d
jg 0x9d60b
movl %edx, %r14d
leal -0xffdd(%r14), %eax
cmpl $0x2, %eax
jb 0x9d60b
movq %r8, %r13
movq %rcx, %r12
movq %rdi, %rbx
movq %r9, 0x28(%rsp)
movq %rsi, 0x10(%rsp)
cmpl $0xffdf, %r14d          # imm = 0xFFDF
jne 0x9d4a8
leaq 0x18(%rsp), %r14
movq %r12, (%r14)
leaq 0x24(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3fc4
leaq 0x88518(%rip), %rsi     # 0x1258bf
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3fc4
movq %rax, %r14
leaq 0x6f9ee(%rip), %rsi     # 0x10cdb7
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %r12, 0x38(%rsp)
addq %r12, %r13
incl %r15d
testq %r14, %r14
movl $0x0, %r12d
movq %r14, 0x40(%rsp)
cmovgq %r14, %r12
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x9d56b
andq $0x0, 0x30(%rsp)
movq 0x18(%rsp), %rcx
cmpq %r13, %rcx
jg 0x9d57d
movq %rbx, %rdi
leaq 0x884b0(%rip), %rsi     # 0x1258cd
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3fc4
movq %rax, %rbp
movl %ebp, %edi
callq 0x9d2ce
movq %rbx, %rdi
leaq 0x83188(%rip), %rsi     # 0x1205dc
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rsp), %rcx
movq %r13, %r8
subq %rcx, %r8
movl %r15d, (%rsp)
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movl %ebp, %edx
leaq 0x30(%rsp), %r9
callq 0x9d326
testl %eax, %eax
je 0x9d57d
movq 0x30(%rsp), %rax
addq %rax, 0x18(%rsp)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %r14
jmp 0x9d3f6
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fa3
movq %rax, %r15
leaq 0x8841f(%rip), %rsi     # 0x1258dd
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpq $0x2, %r15
setl %al
cmpq %r13, %r15
setg %cl
orb %al, %cl
movq 0x28(%rsp), %rcx
jne 0x9d60b
movq %r15, %rax
addq $0x2, %rax
movq %rax, (%rcx)
addq $0x2, %r12
cmpl $0xfffd, %r14d          # imm = 0xFFFD
je 0x9d594
cmpl $0xfff9, %r14d          # imm = 0xFFF9
jne 0x9d5e6
movq %rbx, %rdi
callq 0xdfd1a
movq 0x10(%rsp), %rcx
movq %rax, %r14
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0x9d61c
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xdfd55
movq 0x10(%rsp), %rcx
movq 0x18(%rbx), %rdi
movl 0x4(%rcx), %r9d
leaq 0x730e3(%rip), %rcx     # 0x110630
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %r8
callq 0xe4e0b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdfd24
jmp 0x9d608
movq 0x18(%rsp), %rax
subq 0x38(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
xorl %ebp, %ebp
cmpq 0x40(%rsp), %r14
jge 0x9d608
jmp 0x9d60b
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x1, (%rsp)
movl $0x800, %ecx            # imm = 0x800
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r14, %rdi
callq 0xeb877
leaq 0x907e5(%rip), %rsi     # 0x12ddb4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
callq 0xeaf3c
jmp 0x9d608
movq 0x18(%rbx), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xded3a
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x9d53e
movq 0x8(%rax), %rdi
callq 0xeaf8a
movq 0x10(%rsp), %rcx
testl %eax, %eax
je 0x9d53e
movq 0x18(%rcx), %rax
movq 0x8(%rax), %rdx
jmp 0x9d52c