// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_attribute_v2
int
kmip_encode_attribute_v2(KMIP *ctx, const Attribute *value)
{
    CHECK_ENCODE_ARGS(ctx, value);

    int result = 0;

    switch(value->type)
    {
        case KMIP_ATTR_APPLICATION_SPECIFIC_INFORMATION:
        {
            result = kmip_encode_application_specific_information(
                ctx,
                (ApplicationSpecificInformation*)value->value
            );
        }
        break;

        case KMIP_ATTR_UNIQUE_IDENTIFIER:
        {
            result = kmip_encode_text_string(
                ctx,
                KMIP_TAG_UNIQUE_IDENTIFIER,
                (TextString*)value->value
            );
        }
        break;

        case KMIP_ATTR_NAME:
        {
            result = kmip_encode_name(ctx, (Name*)value->value);
        }
        break;

        case KMIP_ATTR_OBJECT_TYPE:
        {
            result = kmip_encode_enum(
                ctx,
                KMIP_TAG_OBJECT_TYPE,
                *(int32 *)value->value
            );
        }
        break;

        case KMIP_ATTR_CRYPTOGRAPHIC_ALGORITHM:
        {
            result = kmip_encode_enum(
                ctx,
                KMIP_TAG_CRYPTOGRAPHIC_ALGORITHM,
                *(int32 *)value->value
            );
        }
        break;

        case KMIP_ATTR_CRYPTOGRAPHIC_LENGTH:
        {
            result = kmip_encode_integer(
                ctx,
                KMIP_TAG_CRYPTOGRAPHIC_LENGTH,
                *(int32 *)value->value
            );
        }
        break;

        case KMIP_ATTR_OPERATION_POLICY_NAME:
        {
            result = kmip_encode_text_string(
                ctx,
                KMIP_TAG_OPERATION_POLICY_NAME,
                (TextString*)value->value
            );
        }
        break;

        case KMIP_ATTR_CRYPTOGRAPHIC_USAGE_MASK:
        {
            result = kmip_encode_integer(
                ctx,
                KMIP_TAG_CRYPTOGRAPHIC_USAGE_MASK,
                *(int32 *)value->value)
            ;
        }
        break;

        case KMIP_ATTR_STATE:
        {
            result = kmip_encode_enum(
                ctx,
                KMIP_TAG_STATE,
                *(int32 *)value->value
            );
        }
        break;

        case KMIP_ATTR_OBJECT_GROUP:
        {
            result = kmip_encode_text_string(
                ctx,
                KMIP_TAG_OBJECT_GROUP,
                (TextString*)value->value
            );
        }
        break;

        case KMIP_ATTR_ACTIVATION_DATE:
        {
            result = kmip_encode_date_time(
                ctx,
                KMIP_TAG_ACTIVATION_DATE,
                *(int64 *)value->value
            );
        } break;

        case KMIP_ATTR_DEACTIVATION_DATE:
        {
            result = kmip_encode_date_time(
                ctx,
                KMIP_TAG_DEACTIVATION_DATE,
                *(int64 *)value->value
            );
        } break;

        case KMIP_ATTR_PROCESS_START_DATE:
        {
            result = kmip_encode_date_time(
                ctx,
                KMIP_TAG_PROCESS_START_DATE,
                *(int64 *)value->value
            );
        } break;

        case KMIP_ATTR_PROTECT_STOP_DATE:
        {
            result = kmip_encode_date_time(
                ctx,
                KMIP_TAG_PROTECT_STOP_DATE,
                *(int64 *)value->value
            );
        } break;

        case KMIP_ATTR_CRYPTOGRAPHIC_PARAMETERS:
        {
            result = kmip_encode_cryptographic_parameters(
                ctx,
                (CryptographicParameters*)value->value
            );
        } break;

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

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x12253
movl $0xffffffef, -0x4(%rbp) # imm = 0xFFFFFFEF
jmp 0x124a0
cmpq $0x0, -0x18(%rbp)
jne 0x12266
movl $0x0, -0x4(%rbp)
jmp 0x124a0
jmp 0x12268
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x28(%rbp)
subq $0xe, %rax
ja 0x12454
movq -0x28(%rbp), %rax
leaq 0x125ea(%rip), %rcx     # 0x24878
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x6310
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x420094, %esi         # imm = 0x420094
callq 0x66f0
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x61a0
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %edx
movl $0x420057, %esi         # imm = 0x420057
callq 0x6770
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %edx
movl $0x420028, %esi         # imm = 0x420028
callq 0x6770
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %edx
movl $0x42002a, %esi         # imm = 0x42002A
callq 0x6420
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x42005d, %esi         # imm = 0x42005D
callq 0x66f0
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %edx
movl $0x42002c, %esi         # imm = 0x42002C
callq 0x6420
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %edx
movl $0x42008d, %esi         # imm = 0x42008D
callq 0x6770
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x420056, %esi         # imm = 0x420056
callq 0x66f0
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movl $0x420001, %esi         # imm = 0x420001
callq 0x6250
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movl $0x42002f, %esi         # imm = 0x42002F
callq 0x6250
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movl $0x420067, %esi         # imm = 0x420067
callq 0x6250
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
movl $0x420068, %esi         # imm = 0x420068
callq 0x6250
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x6d50
movl %eax, -0x1c(%rbp)
jmp 0x12472
movq -0x10(%rbp), %rdi
leaq 0x1292d(%rip), %rsi     # 0x24d8c
movl $0x1a7f, %edx           # imm = 0x1A7F
callq 0x6f20
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x124a0
jmp 0x12474
cmpl $0x0, -0x1c(%rbp)
je 0x12497
movq -0x10(%rbp), %rdi
leaq 0x12907(%rip), %rsi     # 0x24d8c
movl $0x1a84, %edx           # imm = 0x1A84
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x124a0
jmp 0x12499
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)