// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x17dce
cmpq $0x0, -0x18(%rbp)
jne 0x17dda
movl $0xffffffef, -0x4(%rbp) # imm = 0xFFFFFFEF
jmp 0x18143
jmp 0x17ddc
jmp 0x17dde
movq -0x10(%rbp), %rax
cmpl $0x5, 0x18(%rax)
jae 0x17e09
movq -0x10(%rbp), %rdi
leaq 0xd5f1(%rip), %rsi      # 0x253e4
movl $0x2280, %edx           # imm = 0x2280
callq 0x6f20
movl $0xfffffff5, -0x4(%rbp) # imm = 0xFFFFFFF5
jmp 0x18143
jmp 0x17e0b
jmp 0x17e0d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
cmpq $0x8, %rax
jae 0x17e51
movq -0x10(%rbp), %rdi
leaq 0xd5a9(%rip), %rsi      # 0x253e4
movl $0x2281, %edx           # imm = 0x2281
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x18143
jmp 0x17e53
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6b10
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x17e9e
movq -0x10(%rbp), %rdi
leaq 0xd55b(%rip), %rsi      # 0x253e4
movl $0x2288, %edx           # imm = 0x2288
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x18143
jmp 0x17ea0
jmp 0x17ea2
movl -0x20(%rbp), %eax
sarl $0x8, %eax
cmpl $0x42015f, %eax         # imm = 0x42015F
je 0x17ed0
movq -0x10(%rbp), %rdi
leaq 0xd52a(%rip), %rsi      # 0x253e4
movl $0x2289, %edx           # imm = 0x2289
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x18143
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x17efe
movq -0x10(%rbp), %rdi
leaq 0xd4fc(%rip), %rsi      # 0x253e4
movl $0x2289, %edx           # imm = 0x2289
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x18143
jmp 0x17f00
jmp 0x17f02
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x6520
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x17f38
movq -0x10(%rbp), %rdi
leaq 0xd4c1(%rip), %rsi      # 0x253e4
movl $0x228c, %edx           # imm = 0x228C
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x18143
jmp 0x17f3a
jmp 0x17f3c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jae 0x17f82
movq -0x10(%rbp), %rdi
leaq 0xd478(%rip), %rsi      # 0x253e4
movl $0x228d, %edx           # imm = 0x228D
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x18143
jmp 0x17f84
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x17ff0
movq -0x10(%rbp), %rdi
movl $0x18, %esi
leaq 0xd43f(%rip), %rdx      # 0x25409
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0xd40a(%rip), %rsi      # 0x253e4
movl $0x2290, %edx           # imm = 0x2290
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x18143
jmp 0x17ff2
movq -0x10(%rbp), %rdi
callq 0x6a40
movl %eax, -0x28(%rbp)
cmpl $0x42015e, -0x28(%rbp)  # imm = 0x42015E
jne 0x1813c
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *%rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1806e
movq -0x10(%rbp), %rdi
movl $0x18, %esi
leaq 0xd3cc(%rip), %rdx      # 0x25414
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0xd38c(%rip), %rsi      # 0x253e4
movl $0x2296, %edx           # imm = 0x2296
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x18143
jmp 0x18070
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x67e0
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *%rax
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x180eb
movq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq 0xd35b(%rip), %rdx      # 0x25423
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0xd30c(%rip), %rsi      # 0x253e4
movl $0x229a, %edx           # imm = 0x229A
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x18143
jmp 0x180ed
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x42015e, %esi         # imm = 0x42015E
callq 0x60e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x18129
movq -0x10(%rbp), %rdi
leaq 0xd2cd(%rip), %rsi      # 0x253e4
movl $0x229d, %edx           # imm = 0x229D
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x18143
jmp 0x1812b
movq -0x10(%rbp), %rdi
callq 0x6a40
movl %eax, -0x28(%rbp)
jmp 0x17ffe
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)