// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x147db
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0x14661
leaq 0xd1b0(%rip), %rsi      # 0x217fa
movq %rbx, %rdi
movl $0x2459, %edx           # imm = 0x2459
callq 0x6de0
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x147db
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0x14690
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x146d2
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x14679
jmp 0x146f9
movq %rsi, %r14
xorl %eax, %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl %eax, (%rsp)
movq %rbx, %rdi
callq 0x6a10
testl %eax, %eax
je 0x14703
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1474d
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x146b4
jmp 0x147db
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xbac9(%rip), %rsi      # 0x201ac
movl $0x63, %edx
callq 0x66f0
movl $0x245a, 0x9c(%rbx,%r14) # imm = 0x245A
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x147db
movl 0x4(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42012500, %ecx       # imm = 0x42012500
jne 0x14776
cmpb $0x1, %al
jne 0x147c2
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x64b0
testl %eax, %eax
je 0x147ec
movl %eax, %ebp
leaq 0xd0bf(%rip), %rsi      # 0x217fa
movq %rbx, %rdi
movl $0x2465, %edx           # imm = 0x2465
callq 0x6de0
jmp 0x147db
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xba4e(%rip), %rsi      # 0x201ac
movl $0x63, %edx
callq 0x66f0
movl $0x2461, 0x9c(%rbx,%r14) # imm = 0x2461
jmp 0x147db
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x14794
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1477d
jmp 0x147bb
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xba07(%rip), %rsi      # 0x201ac
movl $0x63, %edx
callq 0x66f0
movl $0x2462, 0x9c(%rbx,%r14) # imm = 0x2462
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x147db
leaq 0xd031(%rip), %rsi      # 0x217fa
movq %rbx, %rdi
movl $0x2462, %edx           # imm = 0x2462
callq 0x6de0
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%rsp), %ecx
cmpq %rcx, %rax
jae 0x14818
leaq 0xcff4(%rip), %rsi      # 0x217fa
movq %rbx, %rdi
movl $0x2466, %edx           # imm = 0x2466
callq 0x6de0
jmp 0x146f9
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x149d6
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %r15d, %r15d
cmpq $0x3, %rcx
jb 0x14869
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %r15d
orl %edx, %r15d
leaq 0xddd0(%rip), %r12      # 0x22640
cmpl $0x420094, %r15d        # imm = 0x420094
je 0x148a2
testl %r15d, %r15d
je 0x14a08
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x7, %rcx
je 0x14898
leaq 0x1(%rax), %rcx
cmpl %r15d, 0x4(%r12,%rax,4)
jne 0x14884
cmpq $0x6, %rax
ja 0x14a10
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
testq %rax, %rax
je 0x14943
movq %rax, %r13
movq (%r14), %rax
testq %rax, %rax
je 0x148f6
movq 0x8(%rax), %rcx
movq %r13, 0x8(%rax)
movq $0x0, (%r13)
movq %rcx, 0x8(%r13)
incq 0x10(%rax)
testq %rcx, %rcx
je 0x148ed
movq %r13, (%rcx)
cmpq $0x0, (%rax)
jne 0x148f6
movq %r13, (%rax)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x14968
movq %rbx, %rdi
movq %rax, %rsi
callq 0x67f0
testl %eax, %eax
je 0x149a4
movl %eax, %r13d
movq %rbx, %rdi
leaq 0xcec8(%rip), %rsi      # 0x217fa
movl $0x2476, %edx           # imm = 0x2476
callq 0x6de0
xorl %eax, %eax
movl %r13d, %ebp
jmp 0x14997
movl $0x18, %esi
movq %rbx, %rdi
leaq 0xcc8e(%rip), %rdx      # 0x215e0
callq 0x6ba0
movq %rbx, %rdi
leaq 0xce99(%rip), %rsi      # 0x217fa
movl $0x246f, %edx           # imm = 0x246F
jmp 0x1498b
movl $0x10, %esi
movq %rbx, %rdi
leaq 0xd2d0(%rip), %rdx      # 0x21c47
callq 0x6ba0
movq %rbx, %rdi
leaq 0xce74(%rip), %rsi      # 0x217fa
movl $0x2473, %edx           # imm = 0x2473
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
xorl %eax, %eax
testb %al, %al
jne 0x14870
jmp 0x147db
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
addq (%rbx), %rdx
xorl %r15d, %r15d
movb $0x1, %al
cmpq $0x3, %rdx
jb 0x14997
movzbl (%rcx), %edx
shll $0x10, %edx
movzbl 0x1(%rcx), %esi
shll $0x8, %esi
orl %edx, %esi
movzbl 0x2(%rcx), %r15d
orl %esi, %r15d
jmp 0x14997
leaq 0xcbf8(%rip), %rdx      # 0x215d5
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xce09(%rip), %rsi      # 0x217fa
movq %rbx, %rdi
movl $0x2469, %edx           # imm = 0x2469
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x147db
movl %r15d, %ebp
jmp 0x147db
xorl %ebp, %ebp
jmp 0x147db