// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x42002b01, %esi       # imm = 0x42002B01
callq 0x60b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11c1e
movq -0x10(%rbp), %rdi
leaq 0x132c4(%rip), %rsi     # 0x24ecd
movl $0x1b2f, %edx           # imm = 0x1B2F
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11c20
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rax
addq $0x4, %rax
movq %rax, 0x8(%rcx)
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x11c8a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x420011, %esi         # imm = 0x420011
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11c86
movq -0x10(%rbp), %rdi
leaq 0x1325c(%rip), %rsi     # 0x24ecd
movl $0x1b37, %edx           # imm = 0x1B37
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11c88
jmp 0x11c8a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x11cd6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x42005f, %esi         # imm = 0x42005F
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11cd2
movq -0x10(%rbp), %rdi
leaq 0x13210(%rip), %rsi     # 0x24ecd
movl $0x1b3d, %edx           # imm = 0x1B3D
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11cd4
jmp 0x11cd6
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x11d22
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x420038, %esi         # imm = 0x420038
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11d1e
movq -0x10(%rbp), %rdi
leaq 0x131c4(%rip), %rsi     # 0x24ecd
movl $0x1b43, %edx           # imm = 0x1B43
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11d20
jmp 0x11d22
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x11d6e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x420083, %esi         # imm = 0x420083
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11d6a
movq -0x10(%rbp), %rdi
leaq 0x13178(%rip), %rsi     # 0x24ecd
movl $0x1b49, %edx           # imm = 0x1B49
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11d6c
jmp 0x11d6e
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jb 0x1202a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x11dc8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
movl $0x4200ae, %esi         # imm = 0x4200AE
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11dc4
movq -0x10(%rbp), %rdi
leaq 0x1311e(%rip), %rsi     # 0x24ecd
movl $0x1b51, %edx           # imm = 0x1B51
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11dc6
jmp 0x11dc8
movq -0x18(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x11e14
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x14(%rax), %edx
movl $0x420028, %esi         # imm = 0x420028
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11e10
movq -0x10(%rbp), %rdi
leaq 0x130d2(%rip), %rsi     # 0x24ecd
movl $0x1b57, %edx           # imm = 0x1B57
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11e12
jmp 0x11e14
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x18(%rax)
je 0x11e60
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x18(%rax), %edx
movl $0x4200c5, %esi         # imm = 0x4200C5
callq 0x65e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11e5c
movq -0x10(%rbp), %rdi
leaq 0x13086(%rip), %rsi     # 0x24ecd
movl $0x1b5d, %edx           # imm = 0x1B5D
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11e5e
jmp 0x11e60
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x1c(%rax)
je 0x11eac
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %edx
movl $0x4200cd, %esi         # imm = 0x4200CD
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11ea8
movq -0x10(%rbp), %rdi
leaq 0x1303a(%rip), %rsi     # 0x24ecd
movl $0x1b63, %edx           # imm = 0x1B63
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11eaa
jmp 0x11eac
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x20(%rax)
je 0x11ef8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x20(%rax), %edx
movl $0x4200ce, %esi         # imm = 0x4200CE
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11ef4
movq -0x10(%rbp), %rdi
leaq 0x12fee(%rip), %rsi     # 0x24ecd
movl $0x1b69, %edx           # imm = 0x1B69
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11ef6
jmp 0x11ef8
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x24(%rax)
je 0x11f44
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x24(%rax), %edx
movl $0x4200cf, %esi         # imm = 0x4200CF
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11f40
movq -0x10(%rbp), %rdi
leaq 0x12fa2(%rip), %rsi     # 0x24ecd
movl $0x1b6f, %edx           # imm = 0x1B6F
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11f42
jmp 0x11f44
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
je 0x11f90
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edx
movl $0x4200d2, %esi         # imm = 0x4200D2
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11f8c
movq -0x10(%rbp), %rdi
leaq 0x12f56(%rip), %rsi     # 0x24ecd
movl $0x1b75, %edx           # imm = 0x1B75
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11f8e
jmp 0x11f90
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
je 0x11fdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edx
movl $0x4200d0, %esi         # imm = 0x4200D0
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11fd8
movq -0x10(%rbp), %rdi
leaq 0x12f0a(%rip), %rsi     # 0x24ecd
movl $0x1b7b, %edx           # imm = 0x1B7B
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x11fda
jmp 0x11fdc
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0x12028
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x30(%rax), %edx
movl $0x4200d1, %esi         # imm = 0x4200D1
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12024
movq -0x10(%rbp), %rdi
leaq 0x12ebe(%rip), %rsi     # 0x24ecd
movl $0x1b81, %edx           # imm = 0x1B81
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x12026
jmp 0x12028
jmp 0x1202a
movq -0x10(%rbp), %rax
cmpl $0x4, 0x18(%rax)
jb 0x121b5
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x34(%rax)
je 0x12084
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x34(%rax), %edx
movl $0x420100, %esi         # imm = 0x420100
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12080
movq -0x10(%rbp), %rdi
leaq 0x12e62(%rip), %rsi     # 0x24ecd
movl $0x1b8a, %edx           # imm = 0x1B8A
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x12082
jmp 0x12084
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x120d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edx
movl $0x420101, %esi         # imm = 0x420101
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x120cc
movq -0x10(%rbp), %rdi
leaq 0x12e16(%rip), %rsi     # 0x24ecd
movl $0x1b90, %edx           # imm = 0x1B90
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x120ce
jmp 0x120d0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x1211c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edx
movl $0x420102, %esi         # imm = 0x420102
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12118
movq -0x10(%rbp), %rdi
leaq 0x12dca(%rip), %rsi     # 0x24ecd
movl $0x1b96, %edx           # imm = 0x1B96
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x1211a
jmp 0x1211c
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x1216a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
movl $0x420103, %esi         # imm = 0x420103
callq 0x6d40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12166
movq -0x10(%rbp), %rdi
leaq 0x12d7c(%rip), %rsi     # 0x24ecd
movl $0x1b9c, %edx           # imm = 0x1B9C
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x12168
jmp 0x1216a
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x48(%rax)
je 0x121b3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x48(%rax), %edx
movl $0x420104, %esi         # imm = 0x420104
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x121af
movq -0x10(%rbp), %rdi
leaq 0x12d30(%rip), %rsi     # 0x24ecd
movl $0x1ba2, %edx           # imm = 0x1BA2
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x121b1
jmp 0x121b3
jmp 0x121b5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x6ba0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12207
movq -0x10(%rbp), %rdi
leaq 0x12cd8(%rip), %rsi     # 0x24ecd
movl $0x1baa, %edx           # imm = 0x1BAA
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1221c
jmp 0x12209
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)