// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_attributes
int
kmip_decode_attributes(KMIP *ctx, Attributes *value)
{
    CHECK_DECODE_ARGS(ctx, value);
    CHECK_KMIP_VERSION(ctx, KMIP_2_0);
    CHECK_BUFFER_FULL(ctx, 8);

    int result = 0;
    int32 tag_type = 0;
    uint32 length = 0;

    result = kmip_decode_int32_be(ctx, &tag_type);
    CHECK_RESULT(ctx, result);
    CHECK_TAG_TYPE(ctx, tag_type, KMIP_TAG_ATTRIBUTES, KMIP_TYPE_STRUCTURE);

    result = kmip_decode_length(ctx, &length);
    CHECK_RESULT(ctx, result);
    CHECK_BUFFER_FULL(ctx, length);

    value->attribute_list = ctx->calloc_func(ctx->state, 1, sizeof(LinkedList));
    CHECK_NEW_MEMORY(ctx, value->attribute_list, sizeof(LinkedList), "LinkedList");

    uint32 tag = kmip_peek_tag(ctx);
    while(tag != 0 && kmip_is_attribute_tag(tag))
    {
        LinkedListItem *item = ctx->calloc_func(ctx->state, 1, sizeof(LinkedListItem));
        CHECK_NEW_MEMORY(ctx, item, sizeof(LinkedListItem), "LinkedListItem");
        kmip_linked_list_enqueue(value->attribute_list, item);

        item->data = ctx->calloc_func(ctx->state, 1, sizeof(Attribute));
        CHECK_NEW_MEMORY(ctx, item->data, sizeof(Attribute), "Attribute");

        result = kmip_decode_attribute(ctx, (Attribute *)item->data);
        CHECK_RESULT(ctx, result);

        tag = kmip_peek_tag(ctx);
    }

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x13f36
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0x13db9
leaq 0xcac8(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2459, %edx           # imm = 0x2459
callq 0x6de0
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x13f36
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0x13de8
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x13e2b
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x13dd1
jmp 0x13e52
movq %rsi, %r14
xorl %eax, %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x6a10
testl %eax, %eax
je 0x13e5c
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x13ea8
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x13e0d
jmp 0x13f36
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xb3e4(%rip), %rsi      # 0x1f220
movl $0x63, %edx
callq 0x66f0
movl $0x245a, 0x9c(%rbx,%r14) # imm = 0x245A
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x13f36
movl 0xc(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42012500, %ecx       # imm = 0x42012500
jne 0x13ed1
cmpb $0x1, %al
jne 0x13f1d
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x64b0
testl %eax, %eax
je 0x13f45
movl %eax, %ebp
leaq 0xc9d4(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2465, %edx           # imm = 0x2465
callq 0x6de0
jmp 0x13f36
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xb367(%rip), %rsi      # 0x1f220
movl $0x63, %edx
callq 0x66f0
movl $0x2461, 0x9c(%rbx,%r14) # imm = 0x2461
jmp 0x13f36
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x13eef
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x13ed8
jmp 0x13f16
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xb320(%rip), %rsi      # 0x1f220
movl $0x63, %edx
callq 0x66f0
movl $0x2462, 0x9c(%rbx,%r14) # imm = 0x2462
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x13f36
leaq 0xc946(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2462, %edx           # imm = 0x2462
callq 0x6de0
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl 0x8(%rsp), %ecx
cmpq %rcx, %rax
jae 0x13f72
leaq 0xc90a(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2466, %edx           # imm = 0x2466
callq 0x6de0
jmp 0x13e52
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x140bf
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x3, %rcx
jb 0x13f36
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
je 0x13f36
leaq 0xd6e3(%rip), %r12      # 0x216b0
cmpl $0x420094, %eax         # imm = 0x420094
je 0x13ffd
movq $-0x1, %rcx
cmpq $0x6, %rcx
je 0x13f36
leaq 0x1(%rcx), %rdx
cmpl %eax, 0x8(%r12,%rcx,4)
movq %rdx, %rcx
jne 0x13fdb
cmpq $0x6, %rdx
ja 0x13f36
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
testq %rax, %rax
je 0x140f1
movq %rax, %r15
movq (%r14), %rax
testq %rax, %rax
je 0x14050
movq 0x8(%rax), %rcx
movq %r15, 0x8(%rax)
movq $0x0, (%r15)
movq %rcx, 0x8(%r15)
incq 0x10(%rax)
testq %rcx, %rcx
je 0x14047
movq %r15, (%rcx)
cmpq $0x0, (%rax)
jne 0x14050
movq %r15, (%rax)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x14116
movq %rbx, %rdi
movq %rax, %rsi
callq 0x67f0
testl %eax, %eax
jne 0x1413b
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x13f36
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
jne 0x13fcd
jmp 0x13f36
leaq 0xc57f(%rip), %rdx      # 0x20645
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xc790(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2469, %edx           # imm = 0x2469
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x13f36
leaq 0xc558(%rip), %rdx      # 0x20650
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xc75e(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x246f, %edx           # imm = 0x246F
jmp 0x140e2
leaq 0xcb9a(%rip), %rdx      # 0x20cb7
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xc739(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2473, %edx           # imm = 0x2473
jmp 0x140e2
movl %eax, %r15d
leaq 0xc725(%rip), %rsi      # 0x2086a
movq %rbx, %rdi
movl $0x2476, %edx           # imm = 0x2476
callq 0x6de0
movl %r15d, %ebp
jmp 0x13f36