// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_attribute_v2
int
kmip_decode_attribute_v2(KMIP *ctx, Attribute *value)
{
    CHECK_DECODE_ARGS(ctx, value);
    CHECK_KMIP_VERSION(ctx, KMIP_2_0);

    kmip_init_attribute(value);

    int result = 0;
    uint32 tag = kmip_peek_tag(ctx);
    if(tag == 0)
    {
        /* Record an error for an underfull buffer here and return. */
    }

    CHECK_RESULT(ctx, result);

    switch(tag)
    {
        case KMIP_TAG_UNIQUE_IDENTIFIER:
        {
            value->type = KMIP_ATTR_UNIQUE_IDENTIFIER;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(TextString), "UniqueIdentifier text string");

            result = kmip_decode_text_string(ctx, KMIP_TAG_UNIQUE_IDENTIFIER, (TextString *)value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_NAME:
        {
            value->type = KMIP_ATTR_NAME;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(Name));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(Name), "Name structure");

            result = kmip_decode_name(ctx, (Name *)value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_OBJECT_TYPE:
        {
            value->type = KMIP_ATTR_OBJECT_TYPE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int32));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int32), "ObjectType enumeration");

            result = kmip_decode_enum(ctx, KMIP_TAG_OBJECT_TYPE, (int32 *)value->value);
            CHECK_RESULT(ctx, result);

            CHECK_ENUM(ctx, KMIP_TAG_OBJECT_TYPE, *(int32 *)value->value);
        }
        break;

        case KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM:
        {
            value->type = KMIP_ATTR_CRYPTOGRAPHIC_ALGORITHM;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int32));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int32), "CrypographicAlgorithm enumeration");

            result = kmip_decode_enum(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM, (int32 *)value->value);
            CHECK_RESULT(ctx, result);

            CHECK_ENUM(ctx, KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM, *(int32 *)value->value);
        }
        break;

        case KMIP_TAG_CRYPTOGRAPHIC_LENGTH:
        {
            value->type = KMIP_ATTR_CRYPTOGRAPHIC_LENGTH;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int32));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int32), "CryptographicLength integer");

            result = kmip_decode_integer(ctx, KMIP_TAG_CRYPTOGRAPHIC_LENGTH, (int32 *)value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_CRYPTOGRAPHIC_USAGE_MASK:
        {
            value->type = KMIP_ATTR_CRYPTOGRAPHIC_USAGE_MASK;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int32));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int32), "CryptographicUsageMask integer");

            result = kmip_decode_integer(ctx, KMIP_TAG_CRYPTOGRAPHIC_USAGE_MASK, (int32 *)value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_STATE:
        {
            value->type = KMIP_ATTR_STATE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int32));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int32), "State enumeration");

            result = kmip_decode_enum(ctx, KMIP_TAG_STATE, (int32 *)value->value);
            CHECK_RESULT(ctx, result);

            CHECK_ENUM(ctx, KMIP_TAG_STATE, *(int32 *)value->value);
        }
        break;

        case KMIP_TAG_APPLICATION_SPECIFIC_INFORMATION:
        {
            value->type = KMIP_ATTR_APPLICATION_SPECIFIC_INFORMATION;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(ApplicationSpecificInformation));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(ApplicationSpecificInformation), "ApplicationSpecificInformation structure");

            result = kmip_decode_application_specific_information(ctx, value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_OBJECT_GROUP:
        {
            value->type = KMIP_ATTR_OBJECT_GROUP;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(TextString), "ObjectGroup text string");

            result = kmip_decode_text_string(ctx, KMIP_TAG_OBJECT_GROUP, (TextString*)value->value);
            CHECK_RESULT(ctx, result);
        }
        break;

        case KMIP_TAG_ACTIVATION_DATE:
        {
            value->type = KMIP_ATTR_ACTIVATION_DATE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int64));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int64), "ActivationDate date time");

            result = kmip_decode_date_time(ctx, KMIP_TAG_ACTIVATION_DATE, (int64*)value->value);
            CHECK_RESULT(ctx, result);
        } break;

        case KMIP_TAG_DEACTIVATION_DATE:
        {
            value->type = KMIP_ATTR_DEACTIVATION_DATE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int64));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int64), "DeactivationDate date time");

            result = kmip_decode_date_time(ctx, KMIP_TAG_DEACTIVATION_DATE, (int64*)value->value);
            CHECK_RESULT(ctx, result);
        } break;

        case KMIP_TAG_PROCESS_START_DATE:
        {
            value->type = KMIP_ATTR_PROCESS_START_DATE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int64));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int64), "ProcessStartDate date time");

            result = kmip_decode_date_time(ctx, tag, (int64*)value->value);
            CHECK_RESULT(ctx, result);
        } break;

        case KMIP_TAG_PROTECT_STOP_DATE:
        {
            value->type = KMIP_ATTR_PROTECT_STOP_DATE;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(int64));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(int64), "ProtectStopDate date time");

            result = kmip_decode_date_time(ctx, tag, (int64*)value->value);
            CHECK_RESULT(ctx, result);
        } break;

        case KMIP_TAG_CRYPTOGRAPHIC_PARAMETERS:
        {
            value->type = KMIP_ATTR_CRYPTOGRAPHIC_PARAMETERS;
            value->value = ctx->calloc_func(ctx->state, 1, sizeof(CryptographicParameters));
            CHECK_NEW_MEMORY(ctx, value->value, sizeof(CryptographicParameters), "CryptographicParameters structure");

            result = kmip_decode_cryptographic_parameters(ctx, value->value);
            CHECK_RESULT(ctx, result);
        } break;

        default:
        {
            kmip_push_error_frame(ctx, __func__, __LINE__);
            return(KMIP_ERROR_ATTR_UNSUPPORTED);
        }
        break;
    };

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffef, %ebp       # imm = 0xFFFFFFEF
jne 0x13598
movq %rdi, %rbx
cmpl $0x5, 0x18(%rdi)
jae 0x13553
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
movl $0x2391, %edx           # imm = 0x2391
jmp 0x13589
movq %rsi, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
movl $0x243d, %edx           # imm = 0x243D
cmpq $0x3, %rcx
jae 0x1359f
leaq 0xd29f(%rip), %rsi      # 0x2082f
movq %rbx, %rdi
callq 0x6de0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %esi
shll $0x8, %esi
orl %ecx, %esi
movzbl 0x2(%rax), %eax
orl %esi, %eax
cmpl $0x420052, %eax         # imm = 0x420052
jg 0x13629
leal -0x420028(%rax), %ecx
cmpl $0x7, %ecx
ja 0x13710
leaq 0xaecf(%rip), %rax      # 0x1e4a0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x3, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13b17
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
movq %rax, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x13c75
movl %eax, %ebp
movl $0x23ca, %edx           # imm = 0x23CA
jmp 0x13589
cmpl $0x420066, %eax         # imm = 0x420066
jle 0x136a0
cmpl $0x42008c, %eax         # imm = 0x42008C
jg 0x13770
cmpl $0x420067, %eax         # imm = 0x420067
je 0x13905
cmpl $0x420068, %eax         # imm = 0x420068
jne 0x13589
movl $0xd, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13ba3
movq %rbx, %rdi
movl $0x420068, %esi         # imm = 0x420068
movq %rax, %rdx
callq 0x6aa0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x242e, %edx           # imm = 0x242E
jmp 0x13589
cmpl $0x420053, %eax         # imm = 0x420053
je 0x139a3
cmpl $0x420056, %eax         # imm = 0x420056
je 0x139ed
cmpl $0x420057, %eax         # imm = 0x420057
jne 0x13589
movl $0x2, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13c0c
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movq %rax, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x13cc3
movl %eax, %ebp
movl $0x23bd, %edx           # imm = 0x23BD
jmp 0x13589
cmpl $0x420001, %eax         # imm = 0x420001
je 0x13a3c
cmpl $0x420004, %eax         # imm = 0x420004
jne 0x13589
movl $0x8, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13c2f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6710
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x23fa, %edx           # imm = 0x23FA
jmp 0x13589
cmpl $0x42008d, %eax         # imm = 0x42008D
je 0x13954
cmpl $0x420094, %eax         # imm = 0x420094
jne 0x13589
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13bc6
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x23a7, %edx           # imm = 0x23A7
jmp 0x13589
movl $0x6, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13a8b
movq %rbx, %rdi
movl $0x42002c, %esi         # imm = 0x42002C
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x23e2, %edx           # imm = 0x23E2
jmp 0x13589
movl $0x4, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13aae
movq %rbx, %rdi
movl $0x42002a, %esi         # imm = 0x42002A
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x23d7, %edx           # imm = 0x23D7
jmp 0x13589
movl $0xe, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x50, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13ad1
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6cd0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x2438, %edx           # imm = 0x2438
jmp 0x13589
movl $0xb, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13af4
movq %rbx, %rdi
movl $0x42002f, %esi         # imm = 0x42002F
movq %rax, %rdx
callq 0x6aa0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x241a, %edx           # imm = 0x241A
jmp 0x13589
movl $0xc, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13b3a
movq %rbx, %rdi
movl $0x420067, %esi         # imm = 0x420067
movq %rax, %rdx
callq 0x6aa0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x2424, %edx           # imm = 0x2424
jmp 0x13589
movl $0x7, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13b5d
movq %rbx, %rdi
movl $0x42008d, %esi         # imm = 0x42008D
movq %rax, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x13cae
movl %eax, %ebp
movl $0x23ed, %edx           # imm = 0x23ED
jmp 0x13589
movl $0x1, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13b80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6dc0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x23b2, %edx           # imm = 0x23B2
jmp 0x13589
movl $0x9, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13be9
movq %rbx, %rdi
movl $0x420056, %esi         # imm = 0x420056
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x2405, %edx           # imm = 0x2405
jmp 0x13589
movl $0xa, (%r14)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x13c52
movq %rbx, %rdi
movl $0x420001, %esi         # imm = 0x420001
movq %rax, %rdx
callq 0x6aa0
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movl $0x2410, %edx           # imm = 0x2410
jmp 0x13589
leaq 0xcceb(%rip), %rdx      # 0x2077d
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23df, %edx           # imm = 0x23DF
jmp 0x13589
leaq 0xcc8c(%rip), %rdx      # 0x20741
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23d4, %edx           # imm = 0x23D4
jmp 0x13589
leaq 0xcc0d(%rip), %rdx      # 0x206e5
movl $0x50, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x2435, %edx           # imm = 0x2435
jmp 0x13589
leaq 0xcce4(%rip), %rdx      # 0x207df
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x2417, %edx           # imm = 0x2417
jmp 0x13589
leaq 0xcd2a(%rip), %rdx      # 0x20848
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23c7, %edx           # imm = 0x23C7
jmp 0x13589
leaq 0xccb9(%rip), %rdx      # 0x207fa
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x2421, %edx           # imm = 0x2421
jmp 0x13589
leaq 0xcc38(%rip), %rdx      # 0x2079c
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23ea, %edx           # imm = 0x23EA
jmp 0x13589
leaq 0xcb4f(%rip), %rdx      # 0x206d6
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23af, %edx           # imm = 0x23AF
jmp 0x13589
leaq 0xcc6b(%rip), %rdx      # 0x20815
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x242b, %edx           # imm = 0x242B
jmp 0x13589
leaq 0xcaec(%rip), %rdx      # 0x206b9
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23a4, %edx           # imm = 0x23A4
jmp 0x13589
leaq 0xcbbe(%rip), %rdx      # 0x207ae
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x2402, %edx           # imm = 0x2402
jmp 0x13589
leaq 0xcaf4(%rip), %rdx      # 0x20707
movl $0x4, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23ba, %edx           # imm = 0x23BA
jmp 0x13589
leaq 0xca5a(%rip), %rdx      # 0x20690
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x23f7, %edx           # imm = 0x23F7
jmp 0x13589
leaq 0xcb6d(%rip), %rdx      # 0x207c6
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x240d, %edx           # imm = 0x240D
jmp 0x13589
movl 0x18(%rbx), %edi
movq 0x8(%r14), %rax
movl (%rax), %r14d
movl $0x420028, %esi         # imm = 0x420028
movl %r14d, %edx
callq 0x6350
testl %eax, %eax
je 0x13cbc
movl %eax, %ebp
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
movl %r14d, %edx
movl %eax, %ecx
callq 0x6120
movl $0x23cc, %edx           # imm = 0x23CC
jmp 0x13589
movq 0x8(%r14), %rax
movl (%rax), %edx
leal -0x1(%rdx), %eax
cmpl $0x6, %eax
jae 0x13cfb
xorl %ebp, %ebp
jmp 0x13598
movq 0x8(%r14), %rax
movl (%rax), %edx
xorl %ebp, %ebp
leal -0x1(%rdx), %eax
cmpl $0x8, %eax
jb 0x13598
movl 0x18(%rbx), %eax
cmpl $0xa, %edx
je 0x13d1c
movl $0xfffffff7, %r14d      # imm = 0xFFFFFFF7
cmpl $0x9, %edx
jne 0x13d2b
movl $0xfffffff5, %r14d      # imm = 0xFFFFFFF5
cmpl $0x1, %eax
ja 0x13598
jmp 0x13d2b
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movq %rbx, %rdi
movl $0x42008d, %esi         # imm = 0x42008D
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
callq 0x6120
movl $0x23ef, %edx           # imm = 0x23EF
jmp 0x13589
movl $0xfffffff5, %r14d      # imm = 0xFFFFFFF5
cmpl $0x4, %eax
ja 0x13598
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movl %r14d, %ecx
callq 0x6120
movl $0x23bf, %edx           # imm = 0x23BF
movl %r14d, %ebp
jmp 0x13589