// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x42000401, %esi       # imm = 0x42000401
callq 0x60b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11a2e
movq -0x10(%rbp), %rdi
leaq 0x133df(%rip), %rsi     # 0x24df8
movl $0x1aff, %edx           # imm = 0x1AFF
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11bbc
jmp 0x11a30
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rax
addq $0x4, %rax
movq %rax, 0x8(%rcx)
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x11a9c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl $0x420003, %esi         # imm = 0x420003
callq 0x66f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11a98
movq -0x10(%rbp), %rdi
leaq 0x13375(%rip), %rsi     # 0x24df8
movl $0x1b07, %edx           # imm = 0x1B07
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11bbc
jmp 0x11a9a
jmp 0x11acd
movq -0x10(%rbp), %rdi
leaq 0x1337e(%rip), %rsi     # 0x24e25
callq 0x68b0
movq -0x10(%rbp), %rdi
leaq 0x13341(%rip), %rsi     # 0x24df8
movl $0x1b0c, %edx           # imm = 0x1B0C
callq 0x6f20
movl $0xffffffec, -0x4(%rbp) # imm = 0xFFFFFFEC
jmp 0x11bbc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x11b1b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x420002, %esi         # imm = 0x420002
callq 0x66f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11b17
movq -0x10(%rbp), %rdi
leaq 0x132f6(%rip), %rsi     # 0x24df8
movl $0x1b13, %edx           # imm = 0x1B13
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11bbc
jmp 0x11b19
jmp 0x11b55
movq -0x10(%rbp), %rax
cmpl $0x3, 0x18(%rax)
jae 0x11b53
movq -0x10(%rbp), %rdi
leaq 0x13349(%rip), %rsi     # 0x24e79
callq 0x68b0
movq -0x10(%rbp), %rdi
leaq 0x132b8(%rip), %rsi     # 0x24df8
movl $0x1b1a, %edx           # imm = 0x1B1A
callq 0x6f20
movl $0xffffffec, -0x4(%rbp) # imm = 0xFFFFFFEC
jmp 0x11bbc
jmp 0x11b55
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x6ba0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x11ba7
movq -0x10(%rbp), %rdi
leaq 0x13263(%rip), %rsi     # 0x24df8
movl $0x1b23, %edx           # imm = 0x1B23
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11bbc
jmp 0x11ba9
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)