// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_application_specific_information
int
kmip_decode_application_specific_information(KMIP *ctx, ApplicationSpecificInformation *value)
{
    CHECK_BUFFER_FULL(ctx, 8);

    kmip_init_application_specific_information(value);

    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_APPLICATION_SPECIFIC_INFORMATION, KMIP_TYPE_STRUCTURE);

    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);

    if(kmip_is_tag_next(ctx, KMIP_TAG_APPLICATION_NAMESPACE))
    {
        value->application_namespace = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->application_namespace, sizeof(TextString), "Application Namespace text string");

        result = kmip_decode_text_string(ctx, KMIP_TAG_APPLICATION_NAMESPACE, value->application_namespace);
        CHECK_RESULT(ctx, result);
    }
    else
    {
        kmip_set_error_message(ctx, "The ApplicationSpecificInformation encoding is missing the application name field.");
        kmip_push_error_frame(ctx, __func__, __LINE__);
        return(KMIP_INVALID_ENCODING);
    }

    if(kmip_is_tag_next(ctx, KMIP_TAG_APPLICATION_DATA))
    {
        value->application_data = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->application_data, sizeof(TextString), "Application Data text string");

        result = kmip_decode_text_string(ctx, KMIP_TAG_APPLICATION_DATA, value->application_data);
        CHECK_RESULT(ctx, result);
    }
    else
    {
        if(ctx->version < KMIP_1_3)
        {
            kmip_set_error_message(ctx, "The ApplicationSpecificInformation encoding is missing the application data field.");
            kmip_push_error_frame(ctx, __func__, __LINE__);
            return(KMIP_INVALID_ENCODING);
        }
    }

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x1051e
leaq 0x7cf0(%rip), %rsi      # 0x181f9
movq %rbx, %rdi
movl $0x2537, %edx           # imm = 0x2537
callq 0x6e80
pushq $-0x2
popq %rbp
jmp 0x105a2
movq %rsi, %r14
testq %rsi, %rsi
je 0x1052d
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
andl $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a80
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl $0x2540, %edx           # imm = 0x2540
cmpl $0x42000400, %ecx       # imm = 0x42000400
jne 0x1058c
cmpb $0x1, %al
jne 0x10590
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64d0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%r15), %ecx
cmpq %rcx, %rax
jae 0x105af
pushq $-0x2
popq %rbp
movl $0x2543, %edx           # imm = 0x2543
jmp 0x10593
pushq $-0x4
jmp 0x10592
pushq $-0x5
popq %rbp
leaq 0x7c5f(%rip), %rsi      # 0x181f9
movq %rbx, %rdi
callq 0x6e80
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl $0x420003, %esi         # imm = 0x420003
callq 0x62d0
testl %eax, %eax
je 0x105f8
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x10611
movq %rbx, %rdi
movl $0x420003, %esi         # imm = 0x420003
movq %rax, %rdx
callq 0x6560
testl %eax, %eax
je 0x10630
movl %eax, %ebp
movl $0x254b, %edx           # imm = 0x254B
jmp 0x10593
leaq 0x7c49(%rip), %rsi      # 0x18248
movq %rbx, %rdi
callq 0x6840
pushq $-0x13
popq %rbp
movl $0x2550, %edx           # imm = 0x2550
jmp 0x10593
leaq 0x7c0e(%rip), %rdx      # 0x18226
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2548, %edx           # imm = 0x2548
jmp 0x10593
movq %rbx, %rdi
movl $0x420002, %esi         # imm = 0x420002
callq 0x62d0
testl %eax, %eax
je 0x1067d
movq 0x890(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x106a6
movq %rbx, %rdi
movl $0x420002, %esi         # imm = 0x420002
movq %rax, %rdx
callq 0x6560
testl %eax, %eax
je 0x1069f
movl %eax, %ebp
movl $0x255a, %edx           # imm = 0x255A
jmp 0x10593
cmpl $0x2, 0x18(%rbx)
ja 0x1069f
leaq 0x7c2e(%rip), %rsi      # 0x182b8
movq %rbx, %rdi
callq 0x6840
pushq $-0x13
popq %rbp
movl $0x2561, %edx           # imm = 0x2561
jmp 0x10593
xorl %ebp, %ebp
jmp 0x105a2
leaq 0x7bee(%rip), %rdx      # 0x1829b
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6c40
pushq $-0xc
popq %rbp
movl $0x2557, %edx           # imm = 0x2557
jmp 0x10593