// File: /workspace/github_c_makefile_star2_O2/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
je 0x10de8
pushq $-0x11
popq %rbp
jmp 0x10e08
movq %rdi, %rbx
cmpl $0x5, 0x18(%rdi)
jae 0x10e0f
pushq $-0xb
popq %rbp
movl $0x2391, %edx           # imm = 0x2391
leaq 0x728f(%rip), %rsi      # 0x1808f
movq %rbx, %rdi
callq 0x6e80
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rsi, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, %rdi
callq 0x69b0
pushq $-0x3
popq %rbp
movl $0x243d, %edx           # imm = 0x243D
leal -0x420028(%rax), %ecx
cmpl $0x7, %ecx
jbe 0x10eea
cmpl $0x420001, %eax         # imm = 0x420001
je 0x110f8
cmpl $0x420004, %eax         # imm = 0x420004
je 0x1106c
cmpl $0x420053, %eax         # imm = 0x420053
je 0x110b2
cmpl $0x420056, %eax         # imm = 0x420056
je 0x1126f
cmpl $0x420057, %eax         # imm = 0x420057
je 0x111d9
cmpl $0x420067, %eax         # imm = 0x420067
je 0x1118e
cmpl $0x420068, %eax         # imm = 0x420068
je 0x11143
cmpl $0x42008d, %eax         # imm = 0x42008D
je 0x11224
cmpl $0x420094, %eax         # imm = 0x420094
jne 0x10df9
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x113f0
movq %rbx, %rdi
movl $0x420094, %esi         # imm = 0x420094
movq %rax, %rdx
callq 0x6560
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x23a7, %edx           # imm = 0x23A7
jmp 0x10df9
leaq 0x660b(%rip), %rax      # 0x174fc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x3, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x112d9
movq %rbx, %rdi
movl $0x420028, %esi         # imm = 0x420028
movq %rax, %rdx
callq 0x6b70
testl %eax, %eax
je 0x1146c
movl %eax, %ebp
movl $0x23ca, %edx           # imm = 0x23CA
jmp 0x10df9
movl $0xb, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x112ba
movq %rbx, %rdi
movl $0x42002f, %esi         # imm = 0x42002F
movq %rax, %rdx
callq 0x6b30
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x241a, %edx           # imm = 0x241A
jmp 0x10df9
movl $0x4, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x112f8
movq %rbx, %rdi
movl $0x42002a, %esi         # imm = 0x42002A
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x23d7, %edx           # imm = 0x23D7
jmp 0x10df9
movl $0xe, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x50
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x11317
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6d70
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x2438, %edx           # imm = 0x2438
jmp 0x10df9
movl $0x6, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x11336
movq %rbx, %rdi
movl $0x42002c, %esi         # imm = 0x42002C
movq %rax, %rdx
callq 0x60d0
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x23e2, %edx           # imm = 0x23E2
jmp 0x10df9
movl $0x8, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x11355
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6740
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x23fa, %edx           # imm = 0x23FA
jmp 0x10df9
movl $0x1, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x11374
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6e60
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x23b2, %edx           # imm = 0x23B2
jmp 0x10df9
movl $0xa, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x11393
movq %rbx, %rdi
movl $0x420001, %esi         # imm = 0x420001
movq %rax, %rdx
callq 0x6b30
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x2410, %edx           # imm = 0x2410
jmp 0x10df9
movl $0xd, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x113b2
movq %rbx, %rdi
movl $0x420068, %esi         # imm = 0x420068
movq %rax, %rdx
callq 0x6b30
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x242e, %edx           # imm = 0x242E
jmp 0x10df9
movl $0xc, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x113d1
movq %rbx, %rdi
movl $0x420067, %esi         # imm = 0x420067
movq %rax, %rdx
callq 0x6b30
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x2424, %edx           # imm = 0x2424
jmp 0x10df9
movl $0x2, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x1140f
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movq %rax, %rdx
callq 0x6b70
testl %eax, %eax
je 0x114a5
movl %eax, %ebp
movl $0x23bd, %edx           # imm = 0x23BD
jmp 0x10df9
movl $0x7, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x1142e
movq %rbx, %rdi
movl $0x42008d, %esi         # imm = 0x42008D
movq %rax, %rdx
callq 0x6b70
testl %eax, %eax
je 0x114d1
movl %eax, %ebp
movl $0x23ed, %edx           # imm = 0x23ED
jmp 0x10df9
movl $0x9, (%r14)
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x1144d
movq %rbx, %rdi
movl $0x420056, %esi         # imm = 0x420056
movq %rax, %rdx
callq 0x6560
testl %eax, %eax
je 0x114df
movl %eax, %ebp
movl $0x2405, %edx           # imm = 0x2405
jmp 0x10df9
leaq 0x6d7e(%rip), %rdx      # 0x1803f
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2417, %edx           # imm = 0x2417
jmp 0x10df9
leaq 0x6dc8(%rip), %rdx      # 0x180a8
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23c7, %edx           # imm = 0x23C7
jmp 0x10df9
leaq 0x6ca2(%rip), %rdx      # 0x17fa1
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23d4, %edx           # imm = 0x23D4
jmp 0x10df9
leaq 0x6c27(%rip), %rdx      # 0x17f45
pushq $0x50
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2435, %edx           # imm = 0x2435
jmp 0x10df9
leaq 0x6ca0(%rip), %rdx      # 0x17fdd
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23df, %edx           # imm = 0x23DF
jmp 0x10df9
leaq 0x6b94(%rip), %rdx      # 0x17ef0
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23f7, %edx           # imm = 0x23F7
jmp 0x10df9
leaq 0x6bbb(%rip), %rdx      # 0x17f36
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23af, %edx           # imm = 0x23AF
jmp 0x10df9
leaq 0x6c8c(%rip), %rdx      # 0x18026
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x240d, %edx           # imm = 0x240D
jmp 0x10df9
leaq 0x6cbc(%rip), %rdx      # 0x18075
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x242b, %edx           # imm = 0x242B
jmp 0x10df9
leaq 0x6c82(%rip), %rdx      # 0x1805a
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2421, %edx           # imm = 0x2421
jmp 0x10df9
leaq 0x6b22(%rip), %rdx      # 0x17f19
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23a4, %edx           # imm = 0x23A4
jmp 0x10df9
leaq 0x6b51(%rip), %rdx      # 0x17f67
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23ba, %edx           # imm = 0x23BA
jmp 0x10df9
leaq 0x6bc7(%rip), %rdx      # 0x17ffc
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x23ea, %edx           # imm = 0x23EA
jmp 0x10df9
leaq 0x6bba(%rip), %rdx      # 0x1800e
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2402, %edx           # imm = 0x2402
jmp 0x10df9
movl 0x18(%rbx), %edi
movq 0x8(%r14), %rax
movl (%rax), %r14d
movl $0x420028, %esi         # imm = 0x420028
movl %r14d, %edx
callq 0x6370
testl %eax, %eax
je 0x114df
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 0x10df9
movq 0x8(%r14), %rax
movl (%rax), %edx
xorl %ebp, %ebp
leal -0x1(%rdx), %eax
cmpl $0x8, %eax
jb 0x10e08
movl 0x18(%rbx), %eax
cmpl $0xa, %edx
je 0x11502
cmpl $0x9, %edx
jne 0x1150f
cmpl $0x1, %eax
ja 0x10e08
jmp 0x1150b
movq 0x8(%r14), %rax
movl (%rax), %edx
leal -0x1(%rdx), %eax
cmpl $0x6, %eax
jae 0x114e6
xorl %ebp, %ebp
jmp 0x10e08
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x42008d, %esi         # imm = 0x42008D
movl %ebp, %ecx
callq 0x6120
movl $0x23ef, %edx           # imm = 0x23EF
jmp 0x10df9
cmpl $0x4, %eax
ja 0x10e08
pushq $-0xb
jmp 0x11511
pushq $-0x9
popq %rbp
movq %rbx, %rdi
movl $0x420057, %esi         # imm = 0x420057
movl %ebp, %ecx
callq 0x6120
movl $0x23bf, %edx           # imm = 0x23BF
jmp 0x10df9