// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_cryptographic_parameters
int
kmip_decode_cryptographic_parameters(KMIP *ctx, CryptographicParameters *value)
{
    CHECK_BUFFER_FULL(ctx, 8);
    
    kmip_init_cryptographic_parameters(value);
    
    int result = 0;
    int32 tag_type = 0;
    uint32 length = 0;
    
    kmip_decode_int32_be(ctx, &tag_type);
    CHECK_TAG_TYPE(ctx, tag_type, KMIP_TAG_CRYPTOGRAPHIC_PARAMETERS, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_BLOCK_CIPHER_MODE))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_BLOCK_CIPHER_MODE, &value->block_cipher_mode);
        CHECK_RESULT(ctx, result);
        CHECK_ENUM(ctx, KMIP_TAG_BLOCK_CIPHER_MODE, value->block_cipher_mode);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_PADDING_METHOD))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_PADDING_METHOD, &value->padding_method);
        CHECK_RESULT(ctx, result);
        CHECK_ENUM(ctx, KMIP_TAG_PADDING_METHOD, value->padding_method);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_HASHING_ALGORITHM))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_HASHING_ALGORITHM, &value->hashing_algorithm);
        CHECK_RESULT(ctx, result);
        CHECK_ENUM(ctx, KMIP_TAG_HASHING_ALGORITHM, value->hashing_algorithm);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_KEY_ROLE_TYPE))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_KEY_ROLE_TYPE, &value->key_role_type);
        CHECK_RESULT(ctx, result);
        CHECK_ENUM(ctx, KMIP_TAG_KEY_ROLE_TYPE, value->key_role_type);
    }
    
    if(ctx->version >= KMIP_1_2)
    {
        if(kmip_is_tag_next(ctx, KMIP_TAG_DIGITAL_SIGNATURE_ALGORITHM))
        {
            result = kmip_decode_enum(ctx, KMIP_TAG_DIGITAL_SIGNATURE_ALGORITHM, &value->digital_signature_algorithm);
            CHECK_RESULT(ctx, result);
            CHECK_ENUM(ctx, KMIP_TAG_DIGITAL_SIGNATURE_ALGORITHM, value->digital_signature_algorithm);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM))
        {
            result = kmip_decode_enum(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM, &value->cryptographic_algorithm);
            CHECK_RESULT(ctx, result);
            CHECK_ENUM(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM, value->cryptographic_algorithm);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_RANDOM_IV))
        {
            result = kmip_decode_bool(ctx, KMIP_TAG_RANDOM_IV, &value->random_iv);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_IV_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_IV_LENGTH, &value->iv_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_TAG_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_TAG_LENGTH, &value->tag_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_FIXED_FIELD_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_FIXED_FIELD_LENGTH, &value->fixed_field_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_INVOCATION_FIELD_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_INVOCATION_FIELD_LENGTH, &value->invocation_field_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_COUNTER_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_COUNTER_LENGTH, &value->counter_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_INITIAL_COUNTER_VALUE))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_INITIAL_COUNTER_VALUE, &value->initial_counter_value);
            CHECK_RESULT(ctx, result);
        }
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(kmip_is_tag_next(ctx, KMIP_TAG_SALT_LENGTH))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_SALT_LENGTH, &value->salt_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_MASK_GENERATOR))
        {
            result = kmip_decode_enum(ctx, KMIP_TAG_MASK_GENERATOR, &value->mask_generator);
            CHECK_RESULT(ctx, result);
            CHECK_ENUM(ctx, KMIP_TAG_MASK_GENERATOR, value->mask_generator);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_MASK_GENERATOR_HASHING_ALGORITHM))
        {
            result = kmip_decode_enum(ctx, KMIP_TAG_MASK_GENERATOR_HASHING_ALGORITHM, &value->mask_generator_hashing_algorithm);
            CHECK_RESULT(ctx, result);
            CHECK_ENUM(ctx, KMIP_TAG_HASHING_ALGORITHM, value->mask_generator_hashing_algorithm);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_P_SOURCE))
        {
            value->p_source = ctx->calloc_func(ctx->state, 1, sizeof(ByteString));
            CHECK_NEW_MEMORY(ctx, value->p_source, sizeof(ByteString), "P Source byte string");
            
            result = kmip_decode_byte_string(ctx, KMIP_TAG_P_SOURCE, value->p_source);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_TRAILER_FIELD))
        {
            result = kmip_decode_integer(ctx, KMIP_TAG_TRAILER_FIELD, &value->trailer_field);
            CHECK_RESULT(ctx, result);
        }
    }
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x10701
leaq 0x7c1f(%rip), %rsi      # 0x1830b
movq %rbx, %rdi
movl $0x256c, %edx           # imm = 0x256C
callq 0x6e80
pushq $-0x2
popq %rbp
jmp 0x107a7
movq %rsi, %r14
testq %rsi, %rsi
je 0x1072f
xorps %xmm0, %xmm0
andq $0x0, 0x10(%r14)
movups %xmm0, (%r14)
pcmpeqd %xmm1, %xmm1
movdqu %xmm1, 0x18(%r14)
movdqu %xmm1, 0x28(%r14)
movups %xmm0, 0x38(%r14)
orl $-0x1, 0x48(%r14)
leaq 0xc(%rsp), %r15
andl $0x0, (%r15)
andl $0x0, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a80
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0x2575, %edx           # imm = 0x2575
cmpl $0x42002b00, %ecx       # imm = 0x42002B00
jne 0x10791
cmpb $0x1, %al
jne 0x10795
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64d0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%r15), %ecx
cmpq %rcx, %rax
jae 0x107b6
pushq $-0x2
popq %rbp
movl $0x2578, %edx           # imm = 0x2578
jmp 0x10798
pushq $-0x4
jmp 0x10797
pushq $-0x5
popq %rbp
leaq 0x7b6c(%rip), %rsi      # 0x1830b
movq %rbx, %rdi
callq 0x6e80
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl $0x420011, %esi         # imm = 0x420011
callq 0x62d0
testl %eax, %eax
je 0x107f3
movq %rbx, %rdi
movl $0x420011, %esi         # imm = 0x420011
movq %r14, %rdx
callq 0x6b70
testl %eax, %eax
je 0x107e4
movl %eax, %ebp
movl $0x257d, %edx           # imm = 0x257D
jmp 0x10798
movl (%r14), %edx
leal -0x1(%rdx), %eax
cmpl $0x11, %eax
jae 0x10928
movq %rbx, %rdi
movl $0x42005f, %esi         # imm = 0x42005F
callq 0x62d0
testl %eax, %eax
je 0x10833
leaq 0x4(%r14), %r15
movq %rbx, %rdi
movl $0x42005f, %esi         # imm = 0x42005F
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10828
movl %eax, %ebp
movl $0x2584, %edx           # imm = 0x2584
jmp 0x10798
movl (%r15), %edx
leal -0x1(%rdx), %eax
cmpl $0xa, %eax
jae 0x10868
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
callq 0x62d0
testl %eax, %eax
je 0x108a1
leaq 0x8(%r14), %r15
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10884
movl %eax, %ebp
movl $0x258b, %edx           # imm = 0x258B
jmp 0x10798
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x42005f, %esi         # imm = 0x42005F
movl %ebp, %ecx
callq 0x6120
movl $0x2585, %edx           # imm = 0x2585
jmp 0x10798
movl (%r15), %edx
pushq $-0x9
popq %rbp
cmpl $0x11, %edx
ja 0x109d9
movl $0xffe, %eax            # imm = 0xFFE
btl %edx, %eax
jae 0x1093b
movq %rbx, %rdi
movl $0x420083, %esi         # imm = 0x420083
callq 0x62d0
testl %eax, %eax
je 0x108e5
leaq 0xc(%r14), %r15
movq %rbx, %rdi
movl $0x420083, %esi         # imm = 0x420083
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x108d6
movl %eax, %ebp
movl $0x2592, %edx           # imm = 0x2592
jmp 0x10798
movl (%r15), %edx
leal -0x1(%rdx), %eax
cmpl $0x15, %eax
jae 0x109f2
xorl %ebp, %ebp
cmpl $0x2, 0x18(%rbx)
jb 0x107a7
movq %rbx, %rdi
movl $0x4200ae, %esi         # imm = 0x4200AE
callq 0x62d0
testl %eax, %eax
je 0x1098c
leaq 0x10(%r14), %r15
movq %rbx, %rdi
movl $0x4200ae, %esi         # imm = 0x4200AE
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10972
movl $0x259b, %edx           # imm = 0x259B
jmp 0x10d41
cmpl $0x12, %edx
jne 0x10956
cmpl $0x3, 0x18(%rbx)
ja 0x107f3
pushq $-0xb
jmp 0x10958
movl 0x18(%rbx), %eax
movl $0x3c000, %ecx          # imm = 0x3C000
btl %edx, %ecx
jae 0x109c3
cmpl $0x3, %eax
ja 0x108a1
jmp 0x109d6
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x420011, %esi         # imm = 0x420011
movl %ebp, %ecx
callq 0x6120
movl $0x257e, %edx           # imm = 0x257E
jmp 0x10798
movl 0x18(%rbx), %eax
movl (%r15), %edx
leal -0x1(%rdx), %ecx
cmpl $0x10, %ecx
jae 0x10b08
testl %eax, %eax
je 0x10b1d
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
callq 0x62d0
testl %eax, %eax
je 0x10a48
leaq 0x14(%r14), %r15
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10a0f
movl $0x25a2, %edx           # imm = 0x25A2
jmp 0x10d41
movl $0x3000, %ecx           # imm = 0x3000
btl %edx, %ecx
jae 0x109d9
cmpl $0x1, %eax
ja 0x108a1
pushq $-0xb
popq %rbp
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
movl %ebp, %ecx
callq 0x6120
movl $0x258c, %edx           # imm = 0x258C
jmp 0x10798
leal -0x16(%rdx), %eax
cmpl $0x2, %eax
ja 0x10b69
cmpl $0x3, 0x18(%rbx)
ja 0x108e5
pushq $-0xb
jmp 0x10b6b
movl 0x18(%rbx), %edi
movl (%r15), %r15d
movl $0x420028, %esi         # imm = 0x420028
movl %r15d, %edx
callq 0x6370
testl %eax, %eax
je 0x10a48
movl %eax, %r12d
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
movl %r15d, %edx
movl %eax, %ecx
callq 0x6120
movl $0x25a3, %edx           # imm = 0x25A3
movl %r12d, %ebp
jmp 0x10798
movq %rbx, %rdi
movl $0x4200c5, %esi         # imm = 0x4200C5
callq 0x62d0
testl %eax, %eax
je 0x10a78
leaq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x4200c5, %esi         # imm = 0x4200C5
callq 0x6dc0
testl %eax, %eax
je 0x10a78
movl $0x25a9, %edx           # imm = 0x25A9
jmp 0x10d41
movq %rbx, %rdi
movl $0x4200cd, %esi         # imm = 0x4200CD
callq 0x62d0
testl %eax, %eax
je 0x10aa8
leaq 0x1c(%r14), %rdx
movq %rbx, %rdi
movl $0x4200cd, %esi         # imm = 0x4200CD
callq 0x60d0
testl %eax, %eax
je 0x10aa8
movl $0x25af, %edx           # imm = 0x25AF
jmp 0x10d41
movq %rbx, %rdi
movl $0x4200ce, %esi         # imm = 0x4200CE
callq 0x62d0
testl %eax, %eax
je 0x10ad8
leaq 0x20(%r14), %rdx
movq %rbx, %rdi
movl $0x4200ce, %esi         # imm = 0x4200CE
callq 0x60d0
testl %eax, %eax
je 0x10ad8
movl $0x25b5, %edx           # imm = 0x25B5
jmp 0x10d41
movq %rbx, %rdi
movl $0x4200cf, %esi         # imm = 0x4200CF
callq 0x62d0
testl %eax, %eax
je 0x10b39
leaq 0x24(%r14), %rdx
movq %rbx, %rdi
movl $0x4200cf, %esi         # imm = 0x4200CF
callq 0x60d0
testl %eax, %eax
je 0x10b39
movl $0x25bb, %edx           # imm = 0x25BB
jmp 0x10d41
leal -0x11(%rdx), %ecx
cmpl $0x3, %ecx
jae 0x10be5
cmpl $0x3, %eax
ja 0x1098c
pushq $-0xb
popq %rbp
movq %rbx, %rdi
movl $0x4200ae, %esi         # imm = 0x4200AE
movl %ebp, %ecx
callq 0x6120
movl $0x259c, %edx           # imm = 0x259C
jmp 0x10798
movq %rbx, %rdi
movl $0x4200d2, %esi         # imm = 0x4200D2
callq 0x62d0
testl %eax, %eax
je 0x10b85
leaq 0x28(%r14), %rdx
movq %rbx, %rdi
movl $0x4200d2, %esi         # imm = 0x4200D2
callq 0x60d0
testl %eax, %eax
je 0x10b85
movl $0x25c1, %edx           # imm = 0x25C1
jmp 0x10d41
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x420083, %esi         # imm = 0x420083
movl %ebp, %ecx
callq 0x6120
movl $0x2593, %edx           # imm = 0x2593
jmp 0x10798
movq %rbx, %rdi
movl $0x4200d0, %esi         # imm = 0x4200D0
callq 0x62d0
testl %eax, %eax
je 0x10bb5
leaq 0x2c(%r14), %rdx
movq %rbx, %rdi
movl $0x4200d0, %esi         # imm = 0x4200D0
callq 0x60d0
testl %eax, %eax
je 0x10bb5
movl $0x25c7, %edx           # imm = 0x25C7
jmp 0x10d41
movq %rbx, %rdi
movl $0x4200d1, %esi         # imm = 0x4200D1
callq 0x62d0
testl %eax, %eax
je 0x10bec
leaq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x4200d1, %esi         # imm = 0x4200D1
callq 0x60d0
testl %eax, %eax
je 0x10bec
movl $0x25cd, %edx           # imm = 0x25CD
jmp 0x10d41
pushq $-0x9
jmp 0x10b1f
cmpl $0x4, 0x18(%rbx)
jb 0x107a7
movq %rbx, %rdi
movl $0x420100, %esi         # imm = 0x420100
callq 0x62d0
testl %eax, %eax
je 0x10c26
leaq 0x34(%r14), %rdx
movq %rbx, %rdi
movl $0x420100, %esi         # imm = 0x420100
callq 0x60d0
testl %eax, %eax
je 0x10c26
movl $0x25d6, %edx           # imm = 0x25D6
jmp 0x10d41
movq %rbx, %rdi
movl $0x420101, %esi         # imm = 0x420101
callq 0x62d0
testl %eax, %eax
je 0x10c6b
leaq 0x38(%r14), %r15
movq %rbx, %rdi
movl $0x420101, %esi         # imm = 0x420101
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10c59
movl $0x25dc, %edx           # imm = 0x25DC
jmp 0x10d41
movl (%r15), %edx
cmpl $0x1, %edx
jne 0x10c9e
cmpl $0x3, 0x18(%rbx)
jbe 0x10d48
movq %rbx, %rdi
movl $0x420102, %esi         # imm = 0x420102
callq 0x62d0
testl %eax, %eax
je 0x10cc3
leaq 0x3c(%r14), %r15
movq %rbx, %rdi
movl $0x420102, %esi         # imm = 0x420102
movq %r15, %rdx
callq 0x6b70
testl %eax, %eax
je 0x10ca5
movl $0x25e3, %edx           # imm = 0x25E3
jmp 0x10d41
pushq $-0x9
jmp 0x10d4a
movl (%r15), %edx
pushq $-0x9
popq %r15
cmpl $0x11, %edx
ja 0x10db2
movl $0xffe, %eax            # imm = 0xFFE
btl %edx, %eax
jae 0x10d83
movq %rbx, %rdi
movl $0x420103, %esi         # imm = 0x420103
callq 0x62d0
testl %eax, %eax
je 0x10d0b
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x10d64
movq %rbx, %rdi
movl $0x420103, %esi         # imm = 0x420103
movq %rax, %rdx
callq 0x6d60
testl %eax, %eax
je 0x10d0b
movl $0x25ed, %edx           # imm = 0x25ED
jmp 0x10d41
movq %rbx, %rdi
movl $0x420104, %esi         # imm = 0x420104
callq 0x62d0
testl %eax, %eax
je 0x107a7
addq $0x48, %r14
movq %rbx, %rdi
movl $0x420104, %esi         # imm = 0x420104
movq %r14, %rdx
callq 0x60d0
testl %eax, %eax
je 0x107a7
movl $0x25f3, %edx           # imm = 0x25F3
movl %eax, %ebp
jmp 0x10798
pushq $-0xb
popq %rbp
movq %rbx, %rdi
movl $0x420101, %esi         # imm = 0x420101
movl %ebp, %ecx
callq 0x6120
movl $0x25dd, %edx           # imm = 0x25DD
jmp 0x10798
leaq 0x75c5(%rip), %rdx      # 0x18330
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x25ea, %edx           # imm = 0x25EA
jmp 0x10798
movl 0x18(%rbx), %eax
movl $0x3c000, %ecx          # imm = 0x3C000
btl %edx, %ecx
jae 0x10d9b
cmpl $0x3, %eax
ja 0x10cc3
jmp 0x10dae
movl $0x3000, %ecx           # imm = 0x3000
btl %edx, %ecx
jae 0x10db2
cmpl $0x1, %eax
ja 0x10cc3
pushq $-0xb
popq %r15
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
movl %r15d, %ecx
callq 0x6120
movl $0x25e4, %edx           # imm = 0x25E4
movl %r15d, %ebp
jmp 0x10798