// File: /workspace/github_c_makefile_star2_O3/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 0xe84f
movl %eax, %ebp
leaq 0x11b98(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e12, %edx           # imm = 0x1E12
jmp 0xe8a9
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 0xe883
movl %eax, %ebp
leaq 0x11b64(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e18, %edx           # imm = 0x1E18
jmp 0xe8a9
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xe8b9
movl %eax, %ebp
leaq 0x11b3c(%rip), %rsi     # 0x203dd
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 0xe915
cmpl $0x3, %eax
je 0xe8f2
cmpl $0x2, %eax
jne 0xe96b
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x69c0
testl %eax, %eax
je 0xe93b
movl %eax, %ebp
leaq 0x11af5(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e21, %edx           # imm = 0x1E21
jmp 0xe8a9
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6190
testl %eax, %eax
je 0xe93b
movl %eax, %ebp
leaq 0x11ad2(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e26, %edx           # imm = 0x1E26
jmp 0xe8a9
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x65d0
testl %eax, %eax
je 0xe93b
movl %eax, %ebp
leaq 0x11aaf(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e2b, %edx           # imm = 0x1E2B
jmp 0xe8a9
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xe989
movl %eax, %ebp
leaq 0x11a7f(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e38, %edx           # imm = 0x1E38
jmp 0xe8a9
leaq 0x11a6b(%rip), %rsi     # 0x203dd
movq %rbx, %rdi
movl $0x1e2f, %edx           # imm = 0x1E2F
callq 0x6de0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xe8ae
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xe8ae