// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_protection_storage_masks
int
kmip_decode_protection_storage_masks(KMIP *ctx, ProtectionStorageMasks *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_PROTECTION_STORAGE_MASKS, KMIP_TYPE_STRUCTURE);

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

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

    uint32 tag = kmip_peek_tag(ctx);
    while(tag == KMIP_TAG_PROTECTION_STORAGE_MASK)
    {
        LinkedListItem *item = ctx->calloc_func(ctx->state, 1, sizeof(LinkedListItem));
        CHECK_NEW_MEMORY(ctx, item, sizeof(LinkedListItem), "LinkedListItem");
        kmip_linked_list_enqueue(value->masks, item);

        item->data = ctx->calloc_func(ctx->state, 1, sizeof(int32));
        CHECK_NEW_MEMORY(ctx, item->data, sizeof(int32), "Protection Storage Mask");

        result = kmip_decode_integer(ctx, KMIP_TAG_PROTECTION_STORAGE_MASK, (int32 *)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 0xfa56
pushq $-0x11
jmp 0xfa9e
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0xfa77
leaq 0x841a(%rip), %rsi      # 0x17e80
movq %rbx, %rdi
movl $0x2280, %edx           # imm = 0x2280
callq 0x6e80
pushq $-0xb
jmp 0xfa9e
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0xfab0
leaq 0x83f1(%rip), %rsi      # 0x17e80
movq %rbx, %rdi
movl $0x2281, %edx           # imm = 0x2281
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 0xfad4
movl %eax, %ebp
movl $0x2288, %edx           # imm = 0x2288
jmp 0xfb10
movl 0x4(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0x2289, %edx           # imm = 0x2289
cmpl $0x42015f00, %ecx       # imm = 0x42015F00
jne 0xfb09
cmpb $0x1, %al
jne 0xfb0d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x64d0
testl %eax, %eax
je 0xfb24
movl %eax, %ebp
movl $0x228c, %edx           # imm = 0x228C
jmp 0xfb10
pushq $-0x4
jmp 0xfb0f
pushq $-0x5
popq %rbp
leaq 0x8369(%rip), %rsi      # 0x17e80
movq %rbx, %rdi
callq 0x6e80
jmp 0xfa9f
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%rsp), %ecx
cmpq %rcx, %rax
jae 0xfb41
pushq $-0x2
popq %rbp
movl $0x228d, %edx           # imm = 0x228D
jmp 0xfb10
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x18
popq %rdx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0xfbe1
pushq $0x1
popq %r15
pushq $0x18
popq %r12
pushq $0x4
popq %r13
movq %rbx, %rdi
callq 0x69b0
cmpl $0x42015e, %eax         # imm = 0x42015E
jne 0xfc00
movq 0x890(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x868(%rbx)
testq %rax, %rax
je 0xfc07
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 0xfc26
movq %rbx, %rdi
movl $0x42015e, %esi         # imm = 0x42015E
movq %rax, %rdx
callq 0x60d0
movl %eax, %ebp
movl $0x229d, %edx           # imm = 0x229D
testl %eax, %eax
je 0xfb6c
jmp 0xfb10
leaq 0x82bd(%rip), %rdx      # 0x17ea5
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2290, %edx           # imm = 0x2290
jmp 0xfb10
xorl %ebp, %ebp
jmp 0xfa9f
leaq 0x82a2(%rip), %rdx      # 0x17eb0
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2296, %edx           # imm = 0x2296
jmp 0xfb10
leaq 0x8292(%rip), %rdx      # 0x17ebf
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x229a, %edx           # imm = 0x229A
jmp 0xfb10