// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_create_request_payload
int
kmip_decode_create_request_payload(KMIP *ctx, CreateRequestPayload *value)
{
    CHECK_DECODE_ARGS(ctx, value);
    CHECK_BUFFER_FULL(ctx, 8);
    
    int result = 0;
    int32 tag_type = 0;
    uint32 length = 0;
    
    kmip_decode_int32_be(ctx, &tag_type);
    CHECK_TAG_TYPE(ctx, tag_type, KMIP_TAG_REQUEST_PAYLOAD, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    result = kmip_decode_enum(ctx, KMIP_TAG_OBJECT_TYPE, &value->object_type);
    CHECK_RESULT(ctx, result);
    CHECK_ENUM(ctx, KMIP_TAG_OBJECT_TYPE, value->object_type);

    if(ctx->version < KMIP_2_0)
    {
        value->template_attribute = ctx->calloc_func(ctx->state, 1, sizeof(TemplateAttribute));
        if(value->template_attribute == NULL)
        {
            HANDLE_FAILED_ALLOC(ctx, sizeof(TemplateAttribute), "TemplateAttribute");
        }
        result = kmip_decode_template_attribute(ctx, value->template_attribute);
        if(result != KMIP_OK)
        {
            kmip_free_template_attribute(ctx, value->template_attribute);
            ctx->free_func(ctx, value->template_attribute);
            value->template_attribute = NULL;
            HANDLE_FAILURE(ctx, result);
        }
    }
    else
    {
        value->attributes = ctx->calloc_func(ctx->state, 1, sizeof(Attributes));
        if(value->attributes == NULL)
        {
            HANDLE_FAILED_ALLOC(ctx, sizeof(Attributes), "Attributes");
        }
        result = kmip_decode_attributes(ctx, value->attributes);
        if(result != KMIP_OK)
        {
            kmip_free_attributes(ctx, value->attributes);
            ctx->free_func(ctx, value->attributes);
            value->attributes = NULL;

            HANDLE_FAILURE(ctx, result);
        }

        if(kmip_is_tag_next(ctx, KMIP_TAG_PROTECTION_STORAGE_MASKS))
        {
            value->protection_storage_masks = ctx->calloc_func(ctx->state, 1, sizeof(ProtectionStorageMasks));
            if(value->protection_storage_masks == NULL)
            {
                kmip_free_attributes(ctx, value->attributes);
                ctx->free_func(ctx, value->attributes);
                value->attributes = NULL;

                HANDLE_FAILED_ALLOC(ctx, sizeof(ProtectionStorageMasks), "ProtectionStorageMasks");
            }
            result = kmip_decode_protection_storage_masks(ctx, value->protection_storage_masks);
            if(result != KMIP_OK)
            {
                kmip_free_attributes(ctx, value->attributes);
                kmip_free_protection_storage_masks(ctx, value->protection_storage_masks);
                ctx->free_func(ctx, value->attributes);
                ctx->free_func(ctx, value->protection_storage_masks);
                value->attributes = NULL;
                value->protection_storage_masks = NULL;

                HANDLE_FAILURE(ctx, result);
            }
        }
    }
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x12d6d
pushq $-0x11
jmp 0x12d97
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x12d9a
leaq 0x57d3(%rip), %rsi      # 0x1855b
movq %rbx, %rdi
movl $0x274c, %edx           # imm = 0x274C
callq 0x6e80
pushq $-0x2
popq %rbp
jmp 0x12e15
movq %rsi, %r14
leaq 0xc(%rsp), %r15
andl $0x0, (%r15)
andl $0x0, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a80
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0x2753, %edx           # imm = 0x2753
cmpl $0x42007900, %ecx       # imm = 0x42007900
jne 0x12dff
cmpb $0x1, %al
jne 0x12e03
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64d0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%r15), %ecx
cmpq %rcx, %rax
jae 0x12e24
pushq $-0x2
popq %rbp
movl $0x2756, %edx           # imm = 0x2756
jmp 0x12e06
pushq $-0x4
jmp 0x12e05
pushq $-0x5
popq %rbp
leaq 0x574e(%rip), %rsi      # 0x1855b
movq %rbx, %rdi
callq 0x6e80
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movq %r14, %rdx
callq 0x6b70
testl %eax, %eax
je 0x12e41
movl %eax, %ebp
movl $0x2759, %edx           # imm = 0x2759
jmp 0x12e06
movl 0x18(%rbx), %eax
movl (%r14), %edx
leal -0x1(%rdx), %ecx
cmpl $0x8, %ecx
jae 0x12eb1
cmpl $0x4, %eax
ja 0x12ef1
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x20
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x12ec9
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6890
testl %eax, %eax
je 0x1301d
movl %eax, %ebp
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x6460
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
andq $0x0, 0x8(%r14)
movl $0x2769, %edx           # imm = 0x2769
jmp 0x12e06
cmpl $0xa, %edx
je 0x12ee8
cmpl $0x9, %edx
jne 0x13001
cmpl $0x1, %eax
ja 0x12e4f
jmp 0x12ffd
leaq 0x56ae(%rip), %rdx      # 0x1857e
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2761, %edx           # imm = 0x2761
jmp 0x12e06
cmpl $0x4, %eax
jbe 0x12ffd
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x12f4a
leaq 0x10(%r14), %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6b40
testl %eax, %eax
je 0x12f69
movl %eax, %ebp
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6e30
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
andq $0x0, (%r12)
movl $0x277a, %edx           # imm = 0x277A
jmp 0x12e06
leaq 0x563f(%rip), %rdx      # 0x18590
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2771, %edx           # imm = 0x2771
jmp 0x12e06
movq %rbx, %rdi
movl $0x42015f, %esi         # imm = 0x42015F
callq 0x62d0
xorl %ebp, %ebp
testl %eax, %eax
je 0x12e15
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x13024
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6ad0
testl %eax, %eax
je 0x12e15
movl %eax, %r15d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6e30
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x6b80
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movl $0x2792, %edx           # imm = 0x2792
movl %r15d, %ebp
jmp 0x12e06
pushq $-0xb
jmp 0x13003
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movl %ebp, %ecx
callq 0x6120
movl $0x275a, %edx           # imm = 0x275A
jmp 0x12e06
xorl %ebp, %ebp
jmp 0x12e15
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6e30
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
andq $0x0, (%r12)
leaq 0x5552(%rip), %rdx      # 0x1859b
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2786, %edx           # imm = 0x2786
jmp 0x12e06