// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x1156d
pushq $-0x11
jmp 0x115b5
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0x1158e
leaq 0x6b4d(%rip), %rsi      # 0x180ca
movq %rbx, %rdi
movl $0x2459, %edx           # imm = 0x2459
callq 0x6e80
pushq $-0xb
jmp 0x115b5
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0x115c7
leaq 0x6b24(%rip), %rsi      # 0x180ca
movq %rbx, %rdi
movl $0x245a, %edx           # imm = 0x245A
callq 0x6e80
pushq $-0x2
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
andl $0x0, (%rsp)
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0x115eb
movl %eax, %ebp
movl $0x2461, %edx           # imm = 0x2461
jmp 0x11627
movl 0x4(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0x2462, %edx           # imm = 0x2462
cmpl $0x42012500, %ecx       # imm = 0x42012500
jne 0x11620
cmpb $0x1, %al
jne 0x11624
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x64d0
testl %eax, %eax
je 0x1163b
movl %eax, %ebp
movl $0x2465, %edx           # imm = 0x2465
jmp 0x11627
pushq $-0x4
jmp 0x11626
pushq $-0x5
popq %rbp
leaq 0x6a9c(%rip), %rsi      # 0x180ca
movq %rbx, %rdi
callq 0x6e80
jmp 0x115b6
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%rsp), %ecx
cmpq %rcx, %rax
jae 0x11658
pushq $-0x2
popq %rbp
movl $0x2466, %edx           # imm = 0x2466
jmp 0x11627
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x18
popq %rdx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x11701
pushq $0x1
popq %r15
pushq $0x18
popq %r12
pushq $0x10
popq %r13
movq %rbx, %rdi
callq 0x69b0
xorl %ebp, %ebp
testl %eax, %eax
je 0x115b6
movl %eax, %edi
callq 0x6c00
testl %eax, %eax
je 0x115b6
movq 0x890(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x868(%rbx)
testq %rax, %rax
je 0x11720
movq %rax, %rbp
movq (%r14), %rdi
movq %rax, %rsi
callq 0x6770
movq 0x890(%rbx), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x868(%rbx)
movq %rax, 0x10(%rbp)
testq %rax, %rax
je 0x1173f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6830
movl %eax, %ebp
movl $0x2476, %edx           # imm = 0x2476
testl %eax, %eax
je 0x11683
jmp 0x11627
leaq 0x679d(%rip), %rdx      # 0x17ea5
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2469, %edx           # imm = 0x2469
jmp 0x11627
leaq 0x6789(%rip), %rdx      # 0x17eb0
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x246f, %edx           # imm = 0x246F
jmp 0x11627
leaq 0x6e40(%rip), %rdx      # 0x18586
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2473, %edx           # imm = 0x2473
jmp 0x11627