// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: LoadAllowableOutsideList(char const*)
void            LoadAllowableOutsideList(const char* const filename)
{
    char*           fname;
    int             i, x, y;
    char*           pData;
    char*           pszData;

    if (!filename)
    {
        return;
    }
    else
    {
        unsigned        len = strlen(filename) + 5;

        fname = (char*)Alloc(len);
        safe_snprintf(fname, len, "%s", filename);
    }

    if (q_exists(fname))
    {
        if ((i = LoadFile(fname, &pData)))
        {
            Log("Reading allowable void entities from file '%s'\n", fname);
            g_nAllowableOutside = 0;
            for (pszData = pData, y = 0, x = 0; x < i; x++)
            {
                if ((pData[x] == '\n') || (pData[x] == '\r'))
                {
                    pData[x] = 0;
                    if (strlen(pszData))
                    {
                        if (g_nAllowableOutside == g_maxAllowableOutside)
                        {
                            g_maxAllowableOutside += MAX_ALLOWABLE_OUTSIDE_GROWTH_SIZE;
                            g_strAllowableOutsideList =

                                (char**)realloc(g_strAllowableOutsideList, sizeof(char*) * g_maxAllowableOutside);
                        }

                        g_strAllowableOutsideList[y++] = pszData;
                        g_nAllowableOutside++;

                        Verbose("Adding entity '%s' to the allowable void list\n", pszData);
                    }
                    pszData = pData + x + 1;
                }
            }
        }
    }
}

// Assembly:
testq %rdi, %rdi
je 0x12e63
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x4140
leal 0x5(%rax), %r15d
movq %r15, %rdi
callq 0x48b4
movq %rax, %rbx
leaq 0xa463(%rip), %rdx      # 0x1d1b5
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x877f
movq %rbx, %rdi
callq 0x96d3
testb %al, %al
je 0x12e57
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x97e4
testl %eax, %eax
je 0x12e57
movl %eax, %ebp
leaq 0xe0e0(%rip), %rdi      # 0x20e70
movq %rbx, %rsi
xorl %eax, %eax
callq 0x9bae
movl $0x0, 0x20bbb24(%rip)   # 0x20ce8c8
testl %ebp, %ebp
jle 0x12e57
movq 0x8(%rsp), %rax
movl %ebp, %r15d
negq %r15
movl $0x1, %r12d
leaq 0xe0dc(%rip), %rbx      # 0x20ea0
movq %rax, %r14
xorl %ebp, %ebp
movzbl -0x1(%rax,%r12), %ecx
cmpl $0xd, %ecx
je 0x12dd9
cmpl $0xa, %ecx
jne 0x12e43
movb $0x0, -0x1(%rax,%r12)
cmpb $0x0, (%r14)
je 0x12e3a
movl 0x20bbadd(%rip), %esi   # 0x20ce8c8
movq 0x20bbade(%rip), %rax   # 0x20ce8d0
cmpl 0x20bbad4(%rip), %esi   # 0x20ce8cc
jne 0x12e1c
addl $0x40, %esi
movl %esi, 0x20bbac9(%rip)   # 0x20ce8cc
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x4520
movq %rax, 0x20bbaba(%rip)   # 0x20ce8d0
movl 0x20bbaac(%rip), %esi   # 0x20ce8c8
movslq %ebp, %rcx
incl %ebp
movq %r14, (%rax,%rcx,8)
incl %esi
movl %esi, 0x20bba9b(%rip)   # 0x20ce8c8
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xa2ef
movq 0x8(%rsp), %rax
leaq (%rax,%r12), %r14
leaq (%r15,%r12), %rcx
incq %rcx
incq %r12
cmpq $0x1, %rcx
jne 0x12dc9
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq