// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x11e69
movq %rdi, %rbx
cmpl $0x4, 0x18(%rdi)
ja 0x11cef
leaq 0xf8d8(%rip), %rsi      # 0x215b0
movq %rbx, %rdi
movl $0x2280, %edx           # imm = 0x2280
callq 0x6de0
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
jmp 0x11e69
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
cmpq $0x7, %rax
ja 0x11d1e
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x11d60
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x11d07
jmp 0x11d87
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 0x11d91
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x11ddb
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x11d42
jmp 0x11e69
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xe30f(%rip), %rsi      # 0x20080
movl $0x63, %edx
callq 0x66f0
movl $0x2281, 0x9c(%rbx,%r14) # imm = 0x2281
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x11e69
movl 0x4(%rsp), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42015f00, %ecx       # imm = 0x42015F00
jne 0x11e04
cmpb $0x1, %al
jne 0x11e50
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x64b0
testl %eax, %eax
je 0x11e7a
movl %eax, %ebp
leaq 0xf7e7(%rip), %rsi      # 0x215b0
movq %rbx, %rdi
movl $0x228c, %edx           # imm = 0x228C
callq 0x6de0
jmp 0x11e69
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xe294(%rip), %rsi      # 0x20080
movl $0x63, %edx
callq 0x66f0
movl $0x2288, 0x9c(%rbx,%r14) # imm = 0x2288
jmp 0x11e69
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x11e22
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x11e0b
jmp 0x11e49
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0xe24d(%rip), %rsi      # 0x20080
movl $0x63, %edx
callq 0x66f0
movl $0x2289, 0x9c(%rbx,%r14) # imm = 0x2289
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x11e69
leaq 0xf759(%rip), %rsi      # 0x215b0
movq %rbx, %rdi
movl $0x2289, %edx           # imm = 0x2289
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 0x11ea6
leaq 0xf71c(%rip), %rsi      # 0x215b0
movq %rbx, %rdi
movl $0x228d, %edx           # imm = 0x228D
callq 0x6de0
jmp 0x11d87
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x1203d
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
addq (%rbx), %rdx
xorl %eax, %eax
cmpq $0x3, %rdx
jb 0x11ef4
movzbl (%rcx), %eax
shll $0x10, %eax
movzbl 0x1(%rcx), %edx
shll $0x8, %edx
orl %eax, %edx
movzbl 0x2(%rcx), %eax
orl %edx, %eax
leaq 0xf6e5(%rip), %r15      # 0x215e0
leaq 0xf6ae(%rip), %r12      # 0x215b0
cmpl $0x42015e, %eax         # imm = 0x42015E
jne 0x1206f
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
testq %rax, %rax
je 0x11fb4
movq %rax, %r13
movq (%r14), %rax
testq %rax, %rax
je 0x11f61
movq 0x8(%rax), %rcx
movq %r13, 0x8(%rax)
movq $0x0, (%r13)
movq %rcx, 0x8(%r13)
incq 0x10(%rax)
testq %rcx, %rcx
je 0x11f58
movq %r13, (%rcx)
cmpq $0x0, (%rax)
jne 0x11f61
movq %r13, (%rax)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x11fd1
movq %rbx, %rdi
movl $0x42015e, %esi         # imm = 0x42015E
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
je 0x1200e
movl %eax, %r13d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x229d, %edx           # imm = 0x229D
callq 0x6de0
movl $0x42015e, %eax         # imm = 0x42015E
xorl %ecx, %ecx
movl %r13d, %ebp
jmp 0x12001
movl $0x18, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x6ba0
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2296, %edx           # imm = 0x2296
jmp 0x11ff0
movl $0x4, %esi
movq %rbx, %rdi
leaq 0xf60f(%rip), %rdx      # 0x215ef
callq 0x6ba0
movq %rbx, %rdi
movq %r12, %rsi
movl $0x229a, %edx           # imm = 0x229A
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x42015e, %eax         # imm = 0x42015E
xorl %ecx, %ecx
testb %cl, %cl
jne 0x11f02
jmp 0x11e69
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
subq %rdx, %rsi
addq (%rbx), %rsi
xorl %eax, %eax
movb $0x1, %cl
cmpq $0x3, %rsi
jb 0x12001
movzbl (%rdx), %eax
shll $0x10, %eax
movzbl 0x1(%rdx), %esi
shll $0x8, %esi
orl %eax, %esi
movzbl 0x2(%rdx), %eax
orl %esi, %eax
jmp 0x12001
leaq 0xf591(%rip), %rdx      # 0x215d5
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xf558(%rip), %rsi      # 0x215b0
movq %rbx, %rdi
movl $0x2290, %edx           # imm = 0x2290
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x11e69
xorl %ebp, %ebp
jmp 0x11e69