// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_cryptographic_parameters
int
kmip_encode_cryptographic_parameters(KMIP *ctx, const CryptographicParameters *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_CRYPTOGRAPHIC_PARAMETERS, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);
    
    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;
    
    if(value->block_cipher_mode != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_BLOCK_CIPHER_MODE, value->block_cipher_mode);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->padding_method != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_PADDING_METHOD, value->padding_method);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->hashing_algorithm != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_HASHING_ALGORITHM, value->hashing_algorithm);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->key_role_type != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_KEY_ROLE_TYPE, value->key_role_type);
        CHECK_RESULT(ctx, result);
    }
    
    if(ctx->version >= KMIP_1_2)
    {
        if(value->digital_signature_algorithm != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_DIGITAL_SIGNATURE_ALGORITHM, value->digital_signature_algorithm);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->cryptographic_algorithm != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM, value->cryptographic_algorithm);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->random_iv != KMIP_UNSET)
        {
            result = kmip_encode_bool(ctx, KMIP_TAG_RANDOM_IV, value->random_iv);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->iv_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_IV_LENGTH, value->iv_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->tag_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_TAG_LENGTH, value->tag_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->fixed_field_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_FIXED_FIELD_LENGTH, value->fixed_field_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->invocation_field_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_INVOCATION_FIELD_LENGTH, value->invocation_field_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->counter_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_COUNTER_LENGTH, value->counter_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->initial_counter_value != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_INITIAL_COUNTER_VALUE, value->initial_counter_value);
            CHECK_RESULT(ctx, result);
        }
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(value->salt_length != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_SALT_LENGTH, value->salt_length);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->mask_generator != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_MASK_GENERATOR, value->mask_generator);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->mask_generator_hashing_algorithm != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_MASK_GENERATOR_HASHING_ALGORITHM, value->mask_generator_hashing_algorithm);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->p_source != NULL)
        {
            result = kmip_encode_byte_string(ctx, KMIP_TAG_P_SOURCE, value->p_source);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->trailer_field != KMIP_UNSET)
        {
            result = kmip_encode_integer(ctx, KMIP_TAG_TRAILER_FIELD, value->trailer_field);
            CHECK_RESULT(ctx, result);
        }
    }
    
    uint8 *curr_index = ctx->index;
    ctx->index = length_index;
    
    result = kmip_encode_length(ctx, curr_index - value_index);
    CHECK_RESULT(ctx, result);

    ctx->index = curr_index;
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x42002b01, %esi       # imm = 0x42002B01
callq 0x60a0
testl %eax, %eax
je 0xce30
movl %eax, %ebp
leaq 0x133ef(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b2f, %edx           # imm = 0x1B2F
callq 0x6de0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %r12
leaq 0x4(%r12), %r15
movq %r15, 0x8(%rbx)
movl (%r14), %edx
testl %edx, %edx
je 0xce68
movq %rbx, %rdi
movl $0x420011, %esi         # imm = 0x420011
callq 0x66d0
testl %eax, %eax
je 0xce68
movl %eax, %ebp
leaq 0x133a9(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b37, %edx           # imm = 0x1B37
jmp 0xce20
movl 0x4(%r14), %edx
testl %edx, %edx
je 0xce94
movq %rbx, %rdi
movl $0x42005f, %esi         # imm = 0x42005F
callq 0x66d0
testl %eax, %eax
je 0xce94
movl %eax, %ebp
leaq 0x1337d(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b3d, %edx           # imm = 0x1B3D
jmp 0xce20
movl 0x8(%r14), %edx
testl %edx, %edx
je 0xcec3
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
callq 0x66d0
testl %eax, %eax
je 0xcec3
movl %eax, %ebp
leaq 0x13351(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b43, %edx           # imm = 0x1B43
jmp 0xce20
movl 0xc(%r14), %edx
testl %edx, %edx
je 0xcef2
movq %rbx, %rdi
movl $0x420083, %esi         # imm = 0x420083
callq 0x66d0
testl %eax, %eax
je 0xcef2
movl %eax, %ebp
leaq 0x13322(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b49, %edx           # imm = 0x1B49
jmp 0xce20
cmpl $0x2, 0x18(%rbx)
jb 0xd1a2
movl 0x10(%r14), %edx
testl %edx, %edx
je 0xcf2b
movq %rbx, %rdi
movl $0x4200ae, %esi         # imm = 0x4200AE
callq 0x66d0
testl %eax, %eax
je 0xcf2b
movl %eax, %ebp
leaq 0x132e9(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b51, %edx           # imm = 0x1B51
jmp 0xce20
movl 0x14(%r14), %edx
testl %edx, %edx
je 0xcf5a
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
callq 0x66d0
testl %eax, %eax
je 0xcf5a
movl %eax, %ebp
leaq 0x132ba(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b57, %edx           # imm = 0x1B57
jmp 0xce20
movl 0x18(%r14), %edx
cmpl $-0x1, %edx
je 0xcf8a
movq %rbx, %rdi
movl $0x4200c5, %esi         # imm = 0x4200C5
callq 0x6570
testl %eax, %eax
je 0xcf8a
movl %eax, %ebp
leaq 0x1328a(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b5d, %edx           # imm = 0x1B5D
jmp 0xce20
movl 0x1c(%r14), %edx
cmpl $-0x1, %edx
je 0xcfba
movq %rbx, %rdi
movl $0x4200cd, %esi         # imm = 0x4200CD
callq 0x63d0
testl %eax, %eax
je 0xcfba
movl %eax, %ebp
leaq 0x1325a(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b63, %edx           # imm = 0x1B63
jmp 0xce20
movl 0x20(%r14), %edx
cmpl $-0x1, %edx
je 0xcfea
movq %rbx, %rdi
movl $0x4200ce, %esi         # imm = 0x4200CE
callq 0x63d0
testl %eax, %eax
je 0xcfea
movl %eax, %ebp
leaq 0x1322a(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b69, %edx           # imm = 0x1B69
jmp 0xce20
movl 0x24(%r14), %edx
cmpl $-0x1, %edx
je 0xd01a
movq %rbx, %rdi
movl $0x4200cf, %esi         # imm = 0x4200CF
callq 0x63d0
testl %eax, %eax
je 0xd01a
movl %eax, %ebp
leaq 0x131fa(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b6f, %edx           # imm = 0x1B6F
jmp 0xce20
movl 0x28(%r14), %edx
cmpl $-0x1, %edx
je 0xd04a
movq %rbx, %rdi
movl $0x4200d2, %esi         # imm = 0x4200D2
callq 0x63d0
testl %eax, %eax
je 0xd04a
movl %eax, %ebp
leaq 0x131ca(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b75, %edx           # imm = 0x1B75
jmp 0xce20
movl 0x2c(%r14), %edx
cmpl $-0x1, %edx
je 0xd07a
movq %rbx, %rdi
movl $0x4200d0, %esi         # imm = 0x4200D0
callq 0x63d0
testl %eax, %eax
je 0xd07a
movl %eax, %ebp
leaq 0x1319a(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b7b, %edx           # imm = 0x1B7B
jmp 0xce20
movl 0x30(%r14), %edx
cmpl $-0x1, %edx
je 0xd0aa
movq %rbx, %rdi
movl $0x4200d1, %esi         # imm = 0x4200D1
callq 0x63d0
testl %eax, %eax
je 0xd0aa
movl %eax, %ebp
leaq 0x1316a(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b81, %edx           # imm = 0x1B81
jmp 0xce20
cmpl $0x4, 0x18(%rbx)
jb 0xd1a2
movl 0x34(%r14), %edx
cmpl $-0x1, %edx
je 0xd0e4
movq %rbx, %rdi
movl $0x420100, %esi         # imm = 0x420100
callq 0x63d0
testl %eax, %eax
je 0xd0e4
movl %eax, %ebp
leaq 0x13130(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b8a, %edx           # imm = 0x1B8A
jmp 0xce20
movl 0x38(%r14), %edx
testl %edx, %edx
je 0xd113
movq %rbx, %rdi
movl $0x420101, %esi         # imm = 0x420101
callq 0x66d0
testl %eax, %eax
je 0xd113
movl %eax, %ebp
leaq 0x13101(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b90, %edx           # imm = 0x1B90
jmp 0xce20
movl 0x3c(%r14), %edx
testl %edx, %edx
je 0xd142
movq %rbx, %rdi
movl $0x420102, %esi         # imm = 0x420102
callq 0x66d0
testl %eax, %eax
je 0xd142
movl %eax, %ebp
leaq 0x130d2(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b96, %edx           # imm = 0x1B96
jmp 0xce20
movq 0x40(%r14), %rdx
testq %rdx, %rdx
je 0xd172
movq %rbx, %rdi
movl $0x420103, %esi         # imm = 0x420103
callq 0x6c10
testl %eax, %eax
je 0xd172
movl %eax, %ebp
leaq 0x130a2(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1b9c, %edx           # imm = 0x1B9C
jmp 0xce20
movl 0x48(%r14), %edx
cmpl $-0x1, %edx
je 0xd1a2
movq %rbx, %rdi
movl $0x420104, %esi         # imm = 0x420104
callq 0x63d0
testl %eax, %eax
je 0xd1a2
movl %eax, %ebp
leaq 0x13072(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1ba2, %edx           # imm = 0x1BA2
jmp 0xce20
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xd1d2
movl %eax, %ebp
leaq 0x13042(%rip), %rsi     # 0x20207
movq %rbx, %rdi
movl $0x1baa, %edx           # imm = 0x1BAA
jmp 0xce20
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xce25