// File: /workspace/github_c_makefile_star2_O3/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 0xccff
movl %eax, %ebp
leaq 0x1344b(%rip), %rsi     # 0x20132
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 0xcd38
movq %rbx, %rdi
movl $0x420003, %esi         # imm = 0x420003
callq 0x6670
testl %eax, %eax
je 0xcd62
movl %eax, %ebp
leaq 0x13404(%rip), %rsi     # 0x20132
movq %rbx, %rdi
movl $0x1b07, %edx           # imm = 0x1B07
jmp 0xccef
leaq 0x13420(%rip), %rsi     # 0x2015f
movq %rbx, %rdi
callq 0x6800
leaq 0x133e4(%rip), %rsi     # 0x20132
movq %rbx, %rdi
movl $0x1b0c, %edx           # imm = 0x1B0C
callq 0x6de0
movl $0xffffffec, %ebp       # imm = 0xFFFFFFEC
jmp 0xccf4
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xcd92
movq %rbx, %rdi
movl $0x420002, %esi         # imm = 0x420002
callq 0x6670
testl %eax, %eax
je 0xcdb8
movl %eax, %ebp
leaq 0x133ad(%rip), %rsi     # 0x20132
movq %rbx, %rdi
movl $0x1b13, %edx           # imm = 0x1B13
jmp 0xccef
cmpl $0x2, 0x18(%rbx)
ja 0xcdb8
leaq 0x13414(%rip), %rsi     # 0x201b3
movq %rbx, %rdi
callq 0x6800
leaq 0x13384(%rip), %rsi     # 0x20132
movq %rbx, %rdi
movl $0x1b1a, %edx           # imm = 0x1B1A
jmp 0xcd56
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xcde8
movl %eax, %ebp
leaq 0x13357(%rip), %rsi     # 0x20132
movq %rbx, %rdi
movl $0x1b23, %edx           # imm = 0x1B23
jmp 0xccef
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xccf4