// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_get_request_payload
int
kmip_encode_get_request_payload(KMIP *ctx, const GetRequestPayload *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_REQUEST_PAYLOAD, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);
    
    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;
    
    if(value->unique_identifier != NULL)
    {
        result = kmip_encode_text_string(ctx, KMIP_TAG_UNIQUE_IDENTIFIER, value->unique_identifier);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->key_format_type != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_KEY_FORMAT_TYPE, value->key_format_type);
        CHECK_RESULT(ctx, result);
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(value->key_wrap_type != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_KEY_WRAP_TYPE, value->key_wrap_type);
            CHECK_RESULT(ctx, result);
        }
    }
    
    if(value->key_compression_type != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_KEY_COMPRESSION_TYPE, value->key_compression_type);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->key_wrapping_spec != NULL)
    {
        result = kmip_encode_key_wrapping_specification(ctx, value->key_wrapping_spec);
        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 $0x42007901, %esi       # imm = 0x42007901
callq 0x60a0
testl %eax, %eax
je 0xea62
movl %eax, %ebp
leaq 0x12903(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1ddc, %edx           # imm = 0x1DDC
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)
movq (%r14), %rdx
testq %rdx, %rdx
je 0xea9b
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xea9b
movl %eax, %ebp
leaq 0x128bc(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1de4, %edx           # imm = 0x1DE4
jmp 0xea52
movl 0x8(%r14), %edx
testl %edx, %edx
je 0xeac7
movq %rbx, %rdi
movl $0x420042, %esi         # imm = 0x420042
callq 0x66d0
testl %eax, %eax
je 0xeac7
movl %eax, %ebp
leaq 0x12890(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1dea, %edx           # imm = 0x1DEA
jmp 0xea52
cmpl $0x4, 0x18(%rbx)
jb 0xeafc
movl 0x18(%r14), %edx
testl %edx, %edx
je 0xeafc
movq %rbx, %rdi
movl $0x4200f8, %esi         # imm = 0x4200F8
callq 0x66d0
testl %eax, %eax
je 0xeafc
movl %eax, %ebp
leaq 0x1285e(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1df2, %edx           # imm = 0x1DF2
jmp 0xea52
movl 0xc(%r14), %edx
testl %edx, %edx
je 0xeb2b
movq %rbx, %rdi
movl $0x420041, %esi         # imm = 0x420041
callq 0x66d0
testl %eax, %eax
je 0xeb2b
movl %eax, %ebp
leaq 0x1282f(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1df9, %edx           # imm = 0x1DF9
jmp 0xea52
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xeb56
movq %rbx, %rdi
callq 0x6280
testl %eax, %eax
je 0xeb56
movl %eax, %ebp
leaq 0x12804(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1dff, %edx           # imm = 0x1DFF
jmp 0xea52
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xeb86
movl %eax, %ebp
leaq 0x127d4(%rip), %rsi     # 0x2134d
movq %rbx, %rdi
movl $0x1e06, %edx           # imm = 0x1E06
jmp 0xea52
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xea57