// File: /workspace/github_c_makefile_star2_O3/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 0xe6f1
movl %eax, %ebp
leaq 0x11ce4(%rip), %rsi     # 0x203bd
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 0xe72a
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xe72a
movl %eax, %ebp
leaq 0x11c9d(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1de4, %edx           # imm = 0x1DE4
jmp 0xe6e1
movl 0x8(%r14), %edx
testl %edx, %edx
je 0xe756
movq %rbx, %rdi
movl $0x420042, %esi         # imm = 0x420042
callq 0x66d0
testl %eax, %eax
je 0xe756
movl %eax, %ebp
leaq 0x11c71(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1dea, %edx           # imm = 0x1DEA
jmp 0xe6e1
cmpl $0x4, 0x18(%rbx)
jb 0xe78b
movl 0x18(%r14), %edx
testl %edx, %edx
je 0xe78b
movq %rbx, %rdi
movl $0x4200f8, %esi         # imm = 0x4200F8
callq 0x66d0
testl %eax, %eax
je 0xe78b
movl %eax, %ebp
leaq 0x11c3f(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1df2, %edx           # imm = 0x1DF2
jmp 0xe6e1
movl 0xc(%r14), %edx
testl %edx, %edx
je 0xe7ba
movq %rbx, %rdi
movl $0x420041, %esi         # imm = 0x420041
callq 0x66d0
testl %eax, %eax
je 0xe7ba
movl %eax, %ebp
leaq 0x11c10(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1df9, %edx           # imm = 0x1DF9
jmp 0xe6e1
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xe7e5
movq %rbx, %rdi
callq 0x6280
testl %eax, %eax
je 0xe7e5
movl %eax, %ebp
leaq 0x11be5(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1dff, %edx           # imm = 0x1DFF
jmp 0xe6e1
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xe815
movl %eax, %ebp
leaq 0x11bb5(%rip), %rsi     # 0x203bd
movq %rbx, %rdi
movl $0x1e06, %edx           # imm = 0x1E06
jmp 0xe6e1
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xe6e6