// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x17989
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x17784
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x17808
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x17766
jmp 0x1782f
movq %rsi, %r14
xorl %eax, %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a10
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42007900, %ecx       # imm = 0x42007900
jne 0x17839
cmpb $0x1, %al
jne 0x17888
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64b0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%r15), %ecx
cmpq %rcx, %rax
jae 0x178d7
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x17901
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x177ed
jmp 0x1782f
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x8ea7(%rip), %rsi      # 0x206c0
movl $0x63, %edx
callq 0x66f0
movl $0x274c, 0x9c(%rbx,%r14) # imm = 0x274C
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x17989
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x17857
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x17840
jmp 0x1787e
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x8e58(%rip), %rsi      # 0x206c0
movl $0x63, %edx
callq 0x66f0
movl $0x2753, 0x9c(%rbx,%r14) # imm = 0x2753
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x17989
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x178a6
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1788f
jmp 0x178cd
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x8e09(%rip), %rsi      # 0x206c0
movl $0x63, %edx
callq 0x66f0
movl $0x2753, 0x9c(%rbx,%r14) # imm = 0x2753
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
jmp 0x17989
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movq %r14, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x1792d
movl %eax, %ebp
leaq 0xa328(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2759, %edx           # imm = 0x2759
jmp 0x17984
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x8dae(%rip), %rsi      # 0x206c0
movl $0x63, %edx
callq 0x66f0
movl $0x2756, 0x9c(%rbx,%r14) # imm = 0x2756
jmp 0x1782f
movl 0x18(%rbx), %eax
movl (%r14), %edx
xorl %ebp, %ebp
leal -0x1(%rdx), %ecx
cmpl $0x8, %ecx
jb 0x17962
cmpl $0xa, %edx
je 0x1794e
cmpl $0x9, %edx
jne 0x1795d
xorl %ecx, %ecx
cmpl $0x2, %eax
jmp 0x17953
xorl %ecx, %ecx
cmpl $0x5, %eax
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
cmovael %ecx, %ebp
jmp 0x17962
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
testl %ebp, %ebp
je 0x17998
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movl %ebp, %ecx
callq 0x6120
leaq 0xa2a0(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x275a, %edx           # imm = 0x275A
callq 0x6de0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x868(%rbx), %rcx
movq 0x890(%rbx), %rdi
movl $0x1, %esi
cmpl $0x4, %eax
ja 0x17a0e
movl $0x20, %edx
callq *%rcx
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x17a6c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6850
testl %eax, %eax
je 0x17ac3
movl %eax, %ebp
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x6440
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq $0x0, 0x8(%r14)
leaq 0xa21b(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2769, %edx           # imm = 0x2769
jmp 0x17984
movl $0x8, %edx
callq *%rcx
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x17a91
leaq 0x10(%r14), %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6ab0
testl %eax, %eax
je 0x17aca
movl %eax, %ebp
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6d90
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq $0x0, (%r12)
leaq 0xa1bd(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x277a, %edx           # imm = 0x277A
jmp 0x17984
leaq 0xa1cc(%rip), %rdx      # 0x21c3f
movl $0x20, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xa195(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2761, %edx           # imm = 0x2761
jmp 0x17ab4
leaq 0xa1b9(%rip), %rdx      # 0x21c51
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xa170(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2771, %edx           # imm = 0x2771
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x17989
xorl %ebp, %ebp
jmp 0x17989
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x3, %rcx
jb 0x17989
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x42015f, %eax         # imm = 0x42015F
jne 0x17989
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x17b90
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6a50
testl %eax, %eax
je 0x17989
movl %eax, %r15d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x6d90
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x6af0
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)
leaq 0xa0a1(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2792, %edx           # imm = 0x2792
callq 0x6de0
movl %r15d, %ebp
jmp 0x17989
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6d90
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq $0x0, (%r12)
leaq 0xa0a4(%rip), %rdx      # 0x21c5c
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0xa050(%rip), %rsi      # 0x21c1c
movq %rbx, %rdi
movl $0x2786, %edx           # imm = 0x2786
jmp 0x17ab4