// File: /workspace/github_c_makefile_star2_O2/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 0xd8b7
movl %eax, %ebp
leaq 0xa292(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e12, %edx           # imm = 0x1E12
jmp 0xd911
movq 0x8(%rbx), %r12
leaq 0x4(%r12), %r15
movq %r15, 0x8(%rbx)
movl (%r14), %edx
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
callq 0x6700
testl %eax, %eax
je 0xd8eb
movl %eax, %ebp
leaq 0xa25e(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e18, %edx           # imm = 0x1E18
jmp 0xd911
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x66a0
testl %eax, %eax
je 0xd921
movl %eax, %ebp
leaq 0xa236(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e1b, %edx           # imm = 0x1E1B
callq 0x6e80
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl (%r14), %eax
cmpl $0x4, %eax
je 0xd97d
cmpl $0x3, %eax
je 0xd95a
cmpl $0x2, %eax
jne 0xd9d3
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6a30
testl %eax, %eax
je 0xd9a3
movl %eax, %ebp
leaq 0xa1ef(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e21, %edx           # imm = 0x1E21
jmp 0xd911
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6190
testl %eax, %eax
je 0xd9a3
movl %eax, %ebp
leaq 0xa1cc(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e26, %edx           # imm = 0x1E26
jmp 0xd911
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6600
testl %eax, %eax
je 0xd9a3
movl %eax, %ebp
leaq 0xa1a9(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e2b, %edx           # imm = 0x1E2B
jmp 0xd911
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6b10
testl %eax, %eax
je 0xd9ef
movl %eax, %ebp
leaq 0xa179(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e38, %edx           # imm = 0x1E38
jmp 0xd911
leaq 0xa165(%rip), %rsi      # 0x17b3f
movq %rbx, %rdi
movl $0x1e2f, %edx           # imm = 0x1E2F
callq 0x6e80
pushq $-0x1
popq %rbp
jmp 0xd916
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xd916