// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_application_specific_information
int
kmip_encode_application_specific_information(KMIP *ctx, const ApplicationSpecificInformation *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_APPLICATION_SPECIFIC_INFORMATION, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);

    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;

    if(value->application_namespace != NULL)
    {
        result = kmip_encode_text_string(ctx, KMIP_TAG_APPLICATION_NAMESPACE, value->application_namespace);
        CHECK_RESULT(ctx, result);
    }
    else
    {
        kmip_set_error_message(ctx, "The ApplicationSpecificInformation structure is missing the application name field.");
        kmip_push_error_frame(ctx, __func__, __LINE__);
        return(KMIP_INVALID_FIELD);
    }

    if(value->application_data != NULL)
    {
        result = kmip_encode_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 structure is missing the application data field.");
            kmip_push_error_frame(ctx, __func__, __LINE__);
            return(KMIP_INVALID_FIELD);
        }
    }

    uint8 *curr_index = ctx->index;
    ctx->index = length_index;

    result = kmip_encode_length(ctx, curr_index - value_index);
    CHECK_RESULT(ctx, result);

    ctx->index = curr_index;

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x42000401, %esi       # imm = 0x42000401
callq 0x60a0
testl %eax, %eax
je 0xbfdb
movl %eax, %ebp
leaq 0xb8d1(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1aff, %edx           # imm = 0x1AFF
callq 0x6e80
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %r12
leaq 0x4(%r12), %r15
movq %r15, 0x8(%rbx)
movq (%r14), %rdx
testq %rdx, %rdx
je 0xc014
movq %rbx, %rdi
movl $0x420003, %esi         # imm = 0x420003
callq 0x66a0
testl %eax, %eax
je 0xc03c
movl %eax, %ebp
leaq 0xb88a(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1b07, %edx           # imm = 0x1B07
jmp 0xbfcb
leaq 0xb8a6(%rip), %rsi      # 0x178c1
movq %rbx, %rdi
callq 0x6840
leaq 0xb86a(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1b0c, %edx           # imm = 0x1B0C
callq 0x6e80
pushq $-0x14
popq %rbp
jmp 0xbfd0
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xc06c
movq %rbx, %rdi
movl $0x420002, %esi         # imm = 0x420002
callq 0x66a0
testl %eax, %eax
je 0xc092
movl %eax, %ebp
leaq 0xb835(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1b13, %edx           # imm = 0x1B13
jmp 0xbfcb
cmpl $0x2, 0x18(%rbx)
ja 0xc092
leaq 0xb89c(%rip), %rsi      # 0x17915
movq %rbx, %rdi
callq 0x6840
leaq 0xb80c(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1b1a, %edx           # imm = 0x1B1A
jmp 0xc032
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6b10
testl %eax, %eax
je 0xc0c2
movl %eax, %ebp
leaq 0xb7df(%rip), %rsi      # 0x17894
movq %rbx, %rdi
movl $0x1b23, %edx           # imm = 0x1B23
jmp 0xbfcb
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xbfd0