// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_create_response_payload
int
kmip_encode_create_response_payload(KMIP *ctx, const CreateResponsePayload *value)
{
    CHECK_ENCODE_ARGS(ctx, 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);

    if(ctx->version < KMIP_2_0)
    {
        if(value->template_attribute != NULL)
        {
            result = kmip_encode_template_attribute(ctx, value->template_attribute);
            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
testq %rdi, %rdi
je 0xe53c
movq %rsi, %r14
xorl %ebp, %ebp
testq %rsi, %rsi
je 0xe6a9
movq %rdi, %rbx
movl $0x42007c01, %esi       # imm = 0x42007C01
callq 0x60a0
testl %eax, %eax
je 0xe546
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe58a
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe522
jmp 0xe6a9
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jmp 0xe6a9
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 0xe5b6
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe5ee
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe570
jmp 0xe6a9
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x10519(%rip), %rsi     # 0x1eab4
movl $0x63, %edx
callq 0x66f0
movl $0x1db8, 0x9c(%rbx,%r14) # imm = 0x1DB8
jmp 0xe6a9
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xe61a
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe648
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe5d4
jmp 0xe6a9
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x104b5(%rip), %rsi     # 0x1eab4
movl $0x63, %edx
callq 0x66f0
movl $0x1dbe, 0x9c(%rbx,%r14) # imm = 0x1DBE
jmp 0xe6a9
cmpl $0x4, 0x18(%rbx)
ja 0xe671
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xe671
movq %rbx, %rdi
callq 0x6c90
testl %eax, %eax
je 0xe671
movl %eax, %ebp
leaq 0x11d5b(%rip), %rsi     # 0x20399
movq %rbx, %rdi
movl $0x1dc8, %edx           # imm = 0x1DC8
jmp 0xe69c
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x1045b(%rip), %rsi     # 0x1eab4
movl $0x63, %edx
callq 0x66f0
movl $0x1dc1, 0x9c(%rbx,%r14) # imm = 0x1DC1
jmp 0xe6a9
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xe6a3
movl %eax, %ebp
leaq 0x11d05(%rip), %rsi     # 0x20399
movq %rbx, %rdi
movl $0x1dd0, %edx           # imm = 0x1DD0
callq 0x6de0
jmp 0xe6a9
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq