// File: /workspace/github_c_makefile_star2_O3/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 0x16f1e
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x16da7
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x16e2b
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x16d89
jmp 0x16e52
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 0x16e5c
cmpb $0x1, %al
jne 0x16ea8
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 0x16ef4
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x16f2d
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x16e10
jmp 0x16e52
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x88f8(%rip), %rsi      # 0x1f734
movl $0x63, %edx
callq 0x66f0
movl $0x274c, 0x9c(%rbx,%r14) # imm = 0x274C
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x16f1e
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x16e7a
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x16e63
jmp 0x16ea1
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x88a9(%rip), %rsi      # 0x1f734
movl $0x63, %edx
callq 0x66f0
movl $0x2753, 0x9c(%rbx,%r14) # imm = 0x2753
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x16f1e
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x16ec6
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x16eaf
jmp 0x16eed
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x885d(%rip), %rsi      # 0x1f734
movl $0x63, %edx
callq 0x66f0
movl $0x2753, 0x9c(%rbx,%r14) # imm = 0x2753
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
jmp 0x16f1e
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movq %r14, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x16f59
movl %eax, %ebp
leaq 0x9d7b(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2759, %edx           # imm = 0x2759
callq 0x6de0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x87f6(%rip), %rsi      # 0x1f734
movl $0x63, %edx
callq 0x66f0
movl $0x2756, 0x9c(%rbx,%r14) # imm = 0x2756
jmp 0x16e52
movl 0x18(%rbx), %eax
movl (%r14), %edx
leal -0x1(%rdx), %ecx
cmpl $0x8, %ecx
jae 0x16fda
cmpl $0x4, %eax
ja 0x17032
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x20, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x17000
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6850
testl %eax, %eax
je 0x171bb
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 0x9cbf(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2769, %edx           # imm = 0x2769
jmp 0x16f19
cmpl $0xa, %edx
je 0x17028
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
cmpl $0x9, %edx
jne 0x170a0
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
cmpl $0x1, %eax
ja 0x16f67
jmp 0x170a0
leaq 0x9ca8(%rip), %rdx      # 0x20caf
movl $0x20, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x9c71(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2761, %edx           # imm = 0x2761
jmp 0x170e6
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
cmpl $0x4, %eax
jbe 0x170a0
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x170c3
leaq 0x10(%r14), %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6ab0
testl %eax, %eax
je 0x170f5
movl %eax, %ebp
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6d90
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq $0x0, (%r12)
leaq 0x9bf9(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x277a, %edx           # imm = 0x277A
jmp 0x16f19
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movl %ebp, %ecx
callq 0x6120
leaq 0x9bd6(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x275a, %edx           # imm = 0x275A
jmp 0x16f19
leaq 0x9bf7(%rip), %rdx      # 0x20cc1
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x9bae(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2771, %edx           # imm = 0x2771
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x16f1e
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x3, %rcx
jb 0x16f1e
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 0x16f1e
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x171c2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6a50
testl %eax, %eax
je 0x16f1e
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 0x9ae6(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2792, %edx           # imm = 0x2792
callq 0x6de0
movl %r15d, %ebp
jmp 0x16f1e
xorl %ebp, %ebp
jmp 0x16f1e
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x6d90
movq (%r12), %rsi
movq %rbx, %rdi
callq *0x878(%rbx)
movq $0x0, (%r12)
leaq 0x9ae2(%rip), %rdx      # 0x20ccc
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x9a8e(%rip), %rsi      # 0x20c8c
movq %rbx, %rdi
movl $0x2786, %edx           # imm = 0x2786
jmp 0x170e6