// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_get_response_payload
int
kmip_encode_get_response_payload(KMIP *ctx, const GetResponsePayload *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_RESPONSE_PAYLOAD, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);
    
    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;
    
    result = kmip_encode_enum(ctx, KMIP_TAG_OBJECT_TYPE, value->object_type);
    CHECK_RESULT(ctx, result);
    
    result = kmip_encode_text_string(ctx, KMIP_TAG_UNIQUE_IDENTIFIER, value->unique_identifier);
    CHECK_RESULT(ctx, result);
    
    switch(value->object_type)
    {
        case KMIP_OBJTYPE_SYMMETRIC_KEY:
        result = kmip_encode_symmetric_key(ctx, (const SymmetricKey*)value->object);
        CHECK_RESULT(ctx, result);
        break;
        
        case KMIP_OBJTYPE_PUBLIC_KEY:
        result = kmip_encode_public_key(ctx, (const PublicKey*)value->object);
        CHECK_RESULT(ctx, result);
        break;
        
        case KMIP_OBJTYPE_PRIVATE_KEY:
        result = kmip_encode_private_key(ctx, (const PrivateKey*)value->object);
        CHECK_RESULT(ctx, result);
        break;
        
        default:
        kmip_push_error_frame(ctx, __func__, __LINE__);
        return(KMIP_NOT_IMPLEMENTED);
        break;
    };
    
    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 $0x42007c01, %esi       # imm = 0x42007C01
callq 0x60a0
testl %eax, %eax
je 0xebc0
movl %eax, %ebp
leaq 0x127b7(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e12, %edx           # imm = 0x1E12
jmp 0xec1a
movq 0x8(%rbx), %r12
leaq 0x4(%r12), %r15
movq %r15, 0x8(%rbx)
movl (%r14), %edx
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
callq 0x66d0
testl %eax, %eax
je 0xebf4
movl %eax, %ebp
leaq 0x12783(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e18, %edx           # imm = 0x1E18
jmp 0xec1a
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xec2a
movl %eax, %ebp
leaq 0x1275b(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e1b, %edx           # imm = 0x1E1B
callq 0x6de0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl (%r14), %eax
cmpl $0x4, %eax
je 0xec86
cmpl $0x3, %eax
je 0xec63
cmpl $0x2, %eax
jne 0xecdc
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x69c0
testl %eax, %eax
je 0xecac
movl %eax, %ebp
leaq 0x12714(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e21, %edx           # imm = 0x1E21
jmp 0xec1a
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6190
testl %eax, %eax
je 0xecac
movl %eax, %ebp
leaq 0x126f1(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e26, %edx           # imm = 0x1E26
jmp 0xec1a
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x65d0
testl %eax, %eax
je 0xecac
movl %eax, %ebp
leaq 0x126ce(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e2b, %edx           # imm = 0x1E2B
jmp 0xec1a
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xecfa
movl %eax, %ebp
leaq 0x1269e(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e38, %edx           # imm = 0x1E38
jmp 0xec1a
leaq 0x1268a(%rip), %rsi     # 0x2136d
movq %rbx, %rdi
movl $0x1e2f, %edx           # imm = 0x1E2F
callq 0x6de0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xec1f
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xec1f