// File: /workspace/github_c_makefile_star2_O1/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 0xe8ad
movq %rsi, %r14
xorl %ebp, %ebp
testq %rsi, %rsi
je 0xea1a
movq %rdi, %rbx
movl $0x42007c01, %esi       # imm = 0x42007C01
callq 0x60a0
testl %eax, %eax
je 0xe8b7
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe8fb
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe893
jmp 0xea1a
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jmp 0xea1a
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 0xe927
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe95f
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe8e1
jmp 0xea1a
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x11134(%rip), %rsi     # 0x1fa40
movl $0x63, %edx
callq 0x66f0
movl $0x1db8, 0x9c(%rbx,%r14) # imm = 0x1DB8
jmp 0xea1a
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
callq 0x6670
testl %eax, %eax
je 0xe98b
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0xe9b9
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0xe945
jmp 0xea1a
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x110d0(%rip), %rsi     # 0x1fa40
movl $0x63, %edx
callq 0x66f0
movl $0x1dbe, 0x9c(%rbx,%r14) # imm = 0x1DBE
jmp 0xea1a
cmpl $0x4, 0x18(%rbx)
ja 0xe9e2
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xe9e2
movq %rbx, %rdi
callq 0x6c90
testl %eax, %eax
je 0xe9e2
movl %eax, %ebp
leaq 0x1297a(%rip), %rsi     # 0x21329
movq %rbx, %rdi
movl $0x1dc8, %edx           # imm = 0x1DC8
jmp 0xea0d
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x11076(%rip), %rsi     # 0x1fa40
movl $0x63, %edx
callq 0x66f0
movl $0x1dc1, 0x9c(%rbx,%r14) # imm = 0x1DC1
jmp 0xea1a
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xea14
movl %eax, %ebp
leaq 0x12924(%rip), %rsi     # 0x21329
movq %rbx, %rdi
movl $0x1dd0, %edx           # imm = 0x1DD0
callq 0x6de0
jmp 0xea1a
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq