// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x11998
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0x1181e
leaq 0xee19(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x2280, %edx           # imm = 0x2280
callq 0x6de0
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x11998
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0x1184d
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1188f
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x11836
jmp 0x118b6
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 0x118c0
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1190a
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x11871
jmp 0x11998
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xd854(%rip), %rsi      # 0x1f0f4
movl $0x63, %edx
callq 0x66f0
movl $0x2281, 0x9c(%rbx,%r14) # imm = 0x2281
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x11998
movl 0x4(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42015f00, %ecx       # imm = 0x42015F00
jne 0x11933
cmpb $0x1, %al
jne 0x1197f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x64b0
testl %eax, %eax
je 0x119a5
movl %eax, %ebp
leaq 0xed28(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x228c, %edx           # imm = 0x228C
callq 0x6de0
jmp 0x11998
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xd7d9(%rip), %rsi      # 0x1f0f4
movl $0x63, %edx
callq 0x66f0
movl $0x2288, 0x9c(%rbx,%r14) # imm = 0x2288
jmp 0x11998
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x11951
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1193a
jmp 0x11978
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xd792(%rip), %rsi      # 0x1f0f4
movl $0x63, %edx
callq 0x66f0
movl $0x2289, 0x9c(%rbx,%r14) # imm = 0x2289
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x11998
leaq 0xec9a(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x2289, %edx           # imm = 0x2289
callq 0x6de0
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
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 0x119d1
leaq 0xec61(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x228d, %edx           # imm = 0x228D
callq 0x6de0
jmp 0x118b6
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x11acc
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x3, %rcx
jb 0x11998
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x42015e, %eax         # imm = 0x42015E
jne 0x11998
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
testq %rax, %rax
je 0x11afe
movq %rax, %r15
movq (%r14), %rax
testq %rax, %rax
je 0x11a7d
movq 0x8(%rax), %rcx
movq %r15, 0x8(%rax)
movq $0x0, (%r15)
movq %rcx, 0x8(%r15)
incq 0x10(%rax)
testq %rcx, %rcx
je 0x11a74
movq %r15, (%rcx)
cmpq $0x0, (%rax)
jne 0x11a7d
movq %r15, (%rax)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x11b23
movq %rbx, %rdi
movl $0x42015e, %esi         # imm = 0x42015E
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
jne 0x11b48
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
jmp 0x11a04
leaq 0xeb72(%rip), %rdx      # 0x20645
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xeb39(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x2290, %edx           # imm = 0x2290
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x11998
leaq 0xeb4b(%rip), %rdx      # 0x20650
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xeb07(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x2296, %edx           # imm = 0x2296
jmp 0x11aef
leaq 0xeb35(%rip), %rdx      # 0x2065f
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xeae2(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x229a, %edx           # imm = 0x229A
jmp 0x11aef
movl %eax, %r15d
leaq 0xeace(%rip), %rsi      # 0x20620
movq %rbx, %rdi
movl $0x229d, %edx           # imm = 0x229D
callq 0x6de0
movl %r15d, %ebp
jmp 0x11998