// File: /workspace/github_c_makefile_star2_O2/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 0xd759
movl %eax, %ebp
leaq 0xa3de(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1ddc, %edx           # imm = 0x1DDC
callq 0x6e80
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 0xd792
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x66a0
testl %eax, %eax
je 0xd792
movl %eax, %ebp
leaq 0xa397(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1de4, %edx           # imm = 0x1DE4
jmp 0xd749
movl 0x8(%r14), %edx
testl %edx, %edx
je 0xd7be
movq %rbx, %rdi
movl $0x420042, %esi         # imm = 0x420042
callq 0x6700
testl %eax, %eax
je 0xd7be
movl %eax, %ebp
leaq 0xa36b(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1dea, %edx           # imm = 0x1DEA
jmp 0xd749
cmpl $0x4, 0x18(%rbx)
jb 0xd7f3
movl 0x18(%r14), %edx
testl %edx, %edx
je 0xd7f3
movq %rbx, %rdi
movl $0x4200f8, %esi         # imm = 0x4200F8
callq 0x6700
testl %eax, %eax
je 0xd7f3
movl %eax, %ebp
leaq 0xa339(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1df2, %edx           # imm = 0x1DF2
jmp 0xd749
movl 0xc(%r14), %edx
testl %edx, %edx
je 0xd822
movq %rbx, %rdi
movl $0x420041, %esi         # imm = 0x420041
callq 0x6700
testl %eax, %eax
je 0xd822
movl %eax, %ebp
leaq 0xa30a(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1df9, %edx           # imm = 0x1DF9
jmp 0xd749
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xd84d
movq %rbx, %rdi
callq 0x6290
testl %eax, %eax
je 0xd84d
movl %eax, %ebp
leaq 0xa2df(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1dff, %edx           # imm = 0x1DFF
jmp 0xd749
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6b10
testl %eax, %eax
je 0xd87d
movl %eax, %ebp
leaq 0xa2af(%rip), %rsi      # 0x17b1f
movq %rbx, %rdi
movl $0x1e06, %edx           # imm = 0x1E06
jmp 0xd749
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xd74e