// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_get_request_payload
int
kmip_encode_get_request_payload(KMIP *ctx, const GetRequestPayload *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_REQUEST_PAYLOAD, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);
    
    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;
    
    if(value->unique_identifier != NULL)
    {
        result = kmip_encode_text_string(ctx, KMIP_TAG_UNIQUE_IDENTIFIER, value->unique_identifier);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->key_format_type != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_KEY_FORMAT_TYPE, value->key_format_type);
        CHECK_RESULT(ctx, result);
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(value->key_wrap_type != 0)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_KEY_WRAP_TYPE, value->key_wrap_type);
            CHECK_RESULT(ctx, result);
        }
    }
    
    if(value->key_compression_type != 0)
    {
        result = kmip_encode_enum(ctx, KMIP_TAG_KEY_COMPRESSION_TYPE, value->key_compression_type);
        CHECK_RESULT(ctx, result);
    }
    
    if(value->key_wrapping_spec != NULL)
    {
        result = kmip_encode_key_wrapping_specification(ctx, value->key_wrapping_spec);
        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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x42007901, %esi       # imm = 0x42007901
callq 0x60b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1428e
movq -0x10(%rbp), %rdi
leaq 0x10e0a(%rip), %rsi     # 0x25083
movl $0x1ddc, %edx           # imm = 0x1DDC
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x14290
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rax
addq $0x4, %rax
movq %rax, 0x8(%rcx)
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x142fc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl $0x420094, %esi         # imm = 0x420094
callq 0x66f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x142f8
movq -0x10(%rbp), %rdi
leaq 0x10da0(%rip), %rsi     # 0x25083
movl $0x1de4, %edx           # imm = 0x1DE4
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x142fa
jmp 0x142fc
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x14348
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x420042, %esi         # imm = 0x420042
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x14344
movq -0x10(%rbp), %rdi
leaq 0x10d54(%rip), %rsi     # 0x25083
movl $0x1dea, %edx           # imm = 0x1DEA
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x14346
jmp 0x14348
movq -0x10(%rbp), %rax
cmpl $0x4, 0x18(%rax)
jb 0x143a0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x1439e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x18(%rax), %edx
movl $0x4200f8, %esi         # imm = 0x4200F8
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1439a
movq -0x10(%rbp), %rdi
leaq 0x10cfe(%rip), %rsi     # 0x25083
movl $0x1df2, %edx           # imm = 0x1DF2
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x1439c
jmp 0x1439e
jmp 0x143a0
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x143ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x420041, %esi         # imm = 0x420041
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x143e8
movq -0x10(%rbp), %rdi
leaq 0x10cb0(%rip), %rsi     # 0x25083
movl $0x1df9, %edx           # imm = 0x1DF9
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x143ea
jmp 0x143ec
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14432
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x62c0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1442e
movq -0x10(%rbp), %rdi
leaq 0x10c67(%rip), %rsi     # 0x25083
movl $0x1dff, %edx           # imm = 0x1DFF
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x14430
jmp 0x14432
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x6ba0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x14484
movq -0x10(%rbp), %rdi
leaq 0x10c11(%rip), %rsi     # 0x25083
movl $0x1e06, %edx           # imm = 0x1E06
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14499
jmp 0x14486
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)