// File: /workspace/github_c_makefile_star2_O1/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 0xcf57
movl %eax, %ebp
leaq 0x14183(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1aff, %edx           # imm = 0x1AFF
callq 0x6de0
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 0xcf90
movq %rbx, %rdi
movl $0x420003, %esi         # imm = 0x420003
callq 0x6670
testl %eax, %eax
je 0xcfba
movl %eax, %ebp
leaq 0x1413c(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1b07, %edx           # imm = 0x1B07
jmp 0xcf47
leaq 0x14158(%rip), %rsi     # 0x210ef
movq %rbx, %rdi
callq 0x6800
leaq 0x1411c(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1b0c, %edx           # imm = 0x1B0C
callq 0x6de0
movl $0xffffffec, %ebp       # imm = 0xFFFFFFEC
jmp 0xcf4c
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xcfea
movq %rbx, %rdi
movl $0x420002, %esi         # imm = 0x420002
callq 0x6670
testl %eax, %eax
je 0xd010
movl %eax, %ebp
leaq 0x140e5(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1b13, %edx           # imm = 0x1B13
jmp 0xcf47
cmpl $0x2, 0x18(%rbx)
ja 0xd010
leaq 0x1414c(%rip), %rsi     # 0x21143
movq %rbx, %rdi
callq 0x6800
leaq 0x140bc(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1b1a, %edx           # imm = 0x1B1A
jmp 0xcfae
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xd040
movl %eax, %ebp
leaq 0x1408f(%rip), %rsi     # 0x210c2
movq %rbx, %rdi
movl $0x1b23, %edx           # imm = 0x1B23
jmp 0xcf47
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xcf4c