// File: /workspace/github_c_makefile_star2_O1/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 0xd088
movl %eax, %ebp
leaq 0x14127(%rip), %rsi     # 0x21197
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 0xd0c0
movq %rbx, %rdi
movl $0x420011, %esi         # imm = 0x420011
callq 0x66d0
testl %eax, %eax
je 0xd0c0
movl %eax, %ebp
leaq 0x140e1(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b37, %edx           # imm = 0x1B37
jmp 0xd078
movl 0x4(%r14), %edx
testl %edx, %edx
je 0xd0ec
movq %rbx, %rdi
movl $0x42005f, %esi         # imm = 0x42005F
callq 0x66d0
testl %eax, %eax
je 0xd0ec
movl %eax, %ebp
leaq 0x140b5(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b3d, %edx           # imm = 0x1B3D
jmp 0xd078
movl 0x8(%r14), %edx
testl %edx, %edx
je 0xd11b
movq %rbx, %rdi
movl $0x420038, %esi         # imm = 0x420038
callq 0x66d0
testl %eax, %eax
je 0xd11b
movl %eax, %ebp
leaq 0x14089(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b43, %edx           # imm = 0x1B43
jmp 0xd078
movl 0xc(%r14), %edx
testl %edx, %edx
je 0xd14a
movq %rbx, %rdi
movl $0x420083, %esi         # imm = 0x420083
callq 0x66d0
testl %eax, %eax
je 0xd14a
movl %eax, %ebp
leaq 0x1405a(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b49, %edx           # imm = 0x1B49
jmp 0xd078
cmpl $0x2, 0x18(%rbx)
jb 0xd302
movl 0x10(%r14), %edx
testl %edx, %edx
je 0xd183
movq %rbx, %rdi
movl $0x4200ae, %esi         # imm = 0x4200AE
callq 0x66d0
testl %eax, %eax
je 0xd183
movl %eax, %ebp
leaq 0x14021(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b51, %edx           # imm = 0x1B51
jmp 0xd078
movl 0x14(%r14), %edx
testl %edx, %edx
je 0xd1b2
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
callq 0x66d0
testl %eax, %eax
je 0xd1b2
movl %eax, %ebp
leaq 0x13ff2(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b57, %edx           # imm = 0x1B57
jmp 0xd078
movl 0x18(%r14), %edx
cmpl $-0x1, %edx
je 0xd1e2
movq %rbx, %rdi
movl $0x4200c5, %esi         # imm = 0x4200C5
callq 0x6570
testl %eax, %eax
je 0xd1e2
movl %eax, %ebp
leaq 0x13fc2(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b5d, %edx           # imm = 0x1B5D
jmp 0xd078
movl 0x1c(%r14), %edx
cmpl $-0x1, %edx
je 0xd212
movq %rbx, %rdi
movl $0x4200cd, %esi         # imm = 0x4200CD
callq 0x63d0
testl %eax, %eax
je 0xd212
movl %eax, %ebp
leaq 0x13f92(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b63, %edx           # imm = 0x1B63
jmp 0xd078
movl 0x20(%r14), %edx
cmpl $-0x1, %edx
je 0xd242
movq %rbx, %rdi
movl $0x4200ce, %esi         # imm = 0x4200CE
callq 0x63d0
testl %eax, %eax
je 0xd242
movl %eax, %ebp
leaq 0x13f62(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b69, %edx           # imm = 0x1B69
jmp 0xd078
movl 0x24(%r14), %edx
cmpl $-0x1, %edx
je 0xd272
movq %rbx, %rdi
movl $0x4200cf, %esi         # imm = 0x4200CF
callq 0x63d0
testl %eax, %eax
je 0xd272
movl %eax, %ebp
leaq 0x13f32(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b6f, %edx           # imm = 0x1B6F
jmp 0xd078
movl 0x28(%r14), %edx
cmpl $-0x1, %edx
je 0xd2a2
movq %rbx, %rdi
movl $0x4200d2, %esi         # imm = 0x4200D2
callq 0x63d0
testl %eax, %eax
je 0xd2a2
movl %eax, %ebp
leaq 0x13f02(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b75, %edx           # imm = 0x1B75
jmp 0xd078
movl 0x2c(%r14), %edx
cmpl $-0x1, %edx
je 0xd2d2
movq %rbx, %rdi
movl $0x4200d0, %esi         # imm = 0x4200D0
callq 0x63d0
testl %eax, %eax
je 0xd2d2
movl %eax, %ebp
leaq 0x13ed2(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b7b, %edx           # imm = 0x1B7B
jmp 0xd078
movl 0x30(%r14), %edx
cmpl $-0x1, %edx
je 0xd302
movq %rbx, %rdi
movl $0x4200d1, %esi         # imm = 0x4200D1
callq 0x63d0
testl %eax, %eax
je 0xd302
movl %eax, %ebp
leaq 0x13ea2(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b81, %edx           # imm = 0x1B81
jmp 0xd078
cmpl $0x4, 0x18(%rbx)
jb 0xd3fa
movl 0x34(%r14), %edx
cmpl $-0x1, %edx
je 0xd33c
movq %rbx, %rdi
movl $0x420100, %esi         # imm = 0x420100
callq 0x63d0
testl %eax, %eax
je 0xd33c
movl %eax, %ebp
leaq 0x13e68(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b8a, %edx           # imm = 0x1B8A
jmp 0xd078
movl 0x38(%r14), %edx
testl %edx, %edx
je 0xd36b
movq %rbx, %rdi
movl $0x420101, %esi         # imm = 0x420101
callq 0x66d0
testl %eax, %eax
je 0xd36b
movl %eax, %ebp
leaq 0x13e39(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b90, %edx           # imm = 0x1B90
jmp 0xd078
movl 0x3c(%r14), %edx
testl %edx, %edx
je 0xd39a
movq %rbx, %rdi
movl $0x420102, %esi         # imm = 0x420102
callq 0x66d0
testl %eax, %eax
je 0xd39a
movl %eax, %ebp
leaq 0x13e0a(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b96, %edx           # imm = 0x1B96
jmp 0xd078
movq 0x40(%r14), %rdx
testq %rdx, %rdx
je 0xd3ca
movq %rbx, %rdi
movl $0x420103, %esi         # imm = 0x420103
callq 0x6c10
testl %eax, %eax
je 0xd3ca
movl %eax, %ebp
leaq 0x13dda(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1b9c, %edx           # imm = 0x1B9C
jmp 0xd078
movl 0x48(%r14), %edx
cmpl $-0x1, %edx
je 0xd3fa
movq %rbx, %rdi
movl $0x420104, %esi         # imm = 0x420104
callq 0x63d0
testl %eax, %eax
je 0xd3fa
movl %eax, %ebp
leaq 0x13daa(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1ba2, %edx           # imm = 0x1BA2
jmp 0xd078
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xd42a
movl %eax, %ebp
leaq 0x13d7a(%rip), %rsi     # 0x21197
movq %rbx, %rdi
movl $0x1baa, %edx           # imm = 0x1BAA
jmp 0xd078
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xd07d