LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::FindCharReverse(char, unsigned long) const
size_t String::FindCharReverse(char c, size_t from) const
{
    if (!_meta || !c)
    {
        return -1;
    }

    from = Math::Min(from, _meta->Length - 1);
    const char *seek_ptr = _meta->CStr + from;
    while (seek_ptr >= _meta->CStr)
    {
        if (*seek_ptr == c)
        {
            return seek_ptr - _meta->CStr;
        }
        seek_ptr--;
    }
    return -1;
}

// Assembly:
movq (%rdi), %rdi
testq %rdi, %rdi
sete %cl
testb %sil, %sil
sete %r8b
movq $-0x1, %rax
orb %cl, %r8b
jne 0x15406
movq 0x10(%rdi), %rcx
decq %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
testq %rcx, %rcx
js 0x15406
movq 0x18(%rdi), %rdx
cmpb %sil, (%rdx,%rcx)
je 0x15407
leaq (%rdx,%rcx), %rdi
decq %rdi
decq %rcx
cmpq %rdx, %rdi
jae 0x153f1
retq
movq %rcx, %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::FindString(char const*, unsigned long) const
size_t String::FindString(const char *cstr, size_t from) const
{
    if (_meta && cstr && from < _meta->Length)
    {
        const char * found_cstr = strstr(_meta->CStr + from, cstr);
        return found_cstr ? found_cstr - _meta->CStr : -1;
    }
    return -1;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
sete %dil
testq %rsi, %rsi
sete %r8b
movq $-0x1, %rax
orb %dil, %r8b
jne 0x15455
cmpq %rdx, 0x10(%rcx)
jbe 0x15455
pushq %rbx
movq 0x18(%rcx), %rbx
addq %rbx, %rdx
movq %rdx, %rdi
callq 0x30e0
movq %rax, %rcx
movq %rax, %rdx
subq %rbx, %rdx
xorl %eax, %eax
cmpq $0x1, %rcx
sbbq %rax, %rax
orq %rdx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::FromFormat(char const*, ...)
String String::FromFormat(const char *fcstr, ...)
{
    fcstr = fcstr ? fcstr : "";
    String str;
    va_list argptr;
    va_start(argptr, fcstr);
    str.FormatV(fcstr, argptr);
    va_end(argptr);
    return str;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x155fe
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rsi, %rsi
leaq 0x7be0(%rip), %rax      # 0x1d1e8
cmoveq %rax, %rsi
movq %rdi, %rbx
movq $0x0, (%rdi)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x1565c
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x14d68
movq %r14, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::FormatV(char const*, __va_list_tag*)
void String::FormatV(const char *fcstr, va_list argptr)
{
    fcstr = fcstr ? fcstr : "";
    va_list argptr_cpy;
    va_copy(argptr_cpy, argptr);
    size_t length = vsnprintf(nullptr, 0u, fcstr, argptr);
    ReserveAndShift(false, Math::Surplus(length, GetLength()));
    vsprintf(_meta->CStr, fcstr, argptr_cpy);
    va_end(argptr_cpy);
    _meta->Length = length;
    _meta->CStr[_meta->Length] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rcx
movq %rdi, %rbx
testq %rsi, %rsi
leaq 0x7b71(%rip), %r14      # 0x1d1e8
cmovneq %rsi, %r14
movq 0x10(%rdx), %rax
movq %rax, 0x10(%rsp)
movups (%rdx), %xmm0
movaps %xmm0, (%rsp)
xorl %r15d, %r15d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3230
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x156a6
movq 0x10(%rcx), %r15
movslq %eax, %r12
xorl %edx, %edx
movq %r12, %rax
subq %r15, %rax
cmovaeq %rax, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x14f6a
movq (%rbx), %rax
movq 0x18(%rax), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x31b0
movq (%rbx), %rax
movq %r12, 0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::LeftSection(char, bool) const
String String::LeftSection(char separator, bool exclude_separator) const
{
    if (_meta && separator)
    {
        size_t slice_at = FindChar(separator);
        if (slice_at != -1)
        {
            slice_at = exclude_separator ? slice_at : slice_at + 1;
            return Left(slice_at);
        }
    }
    return *this;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testb %dl, %dl
je 0x1597a
cmpq $0x0, (%r14)
je 0x1597a
movl %ecx, %ebp
movsbl %dl, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x15370
cmpq $-0x1, %rax
je 0x1597a
xorb $0x1, %bpl
movzbl %bpl, %ecx
addq %rcx, %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x15856
jmp 0x1598c
movq $0x0, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c14
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::RightSection(char, bool) const
String String::RightSection(char separator, bool exclude_separator) const
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            size_t count = exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at;
            return Right(count);
        }
    }
    return *this;
}

// Assembly:
pushq %rbx
movl %edx, %eax
movq %rdi, %rbx
movq (%rsi), %rdi
testq %rdi, %rdi
sete %dl
testb %al, %al
sete %r8b
orb %dl, %r8b
jne 0x159f7
movq 0x10(%rdi), %rdx
movq %rdx, %r8
decq %r8
js 0x159f7
movq 0x18(%rdi), %r8
leaq -0x1(%r8), %r9
movq %rdx, %rdi
cmpb %al, (%r9,%rdi)
je 0x159dc
leaq (%r9,%rdi), %r10
decq %r10
decq %rdi
cmpq %r8, %r10
jae 0x159c5
jmp 0x159f7
testq %rdi, %rdi
je 0x159f7
xorb $0x1, %cl
movzbl %cl, %eax
subq %rdi, %rax
addq %rax, %rdx
movq %rbx, %rdi
callq 0x158f2
jmp 0x15a06
movq $0x0, (%rbx)
movq %rbx, %rdi
callq 0x14c14
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Section(char, unsigned long, unsigned long, bool, bool) const
String String::Section(char separator, size_t first, size_t last,
                          bool exclude_first_sep, bool exclude_last_sep) const
{
    if (!_meta || !separator)
    {
        return String();
    }

    size_t slice_from;
    size_t slice_to;
    if (FindSection(separator, first, last, exclude_first_sep, exclude_last_sep,
        slice_from, slice_to))
    {
        return Mid(slice_from, slice_to - slice_from);
    }
    return String();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testb %dl, %dl
je 0x15a74
movq %rsi, %r14
cmpq $0x0, (%rsi)
je 0x15a74
movb 0x30(%rsp), %dil
leaq 0x8(%rsp), %r10
leaq 0x10(%rsp), %r11
movsbl %dl, %esi
movzbl %r9b, %eax
movzbl %dil, %r9d
movq %r14, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movl %eax, %r8d
pushq %r10
pushq %r11
callq 0x15456
addq $0x10, %rsp
testb %al, %al
je 0x15a74
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
subq %rdx, %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x15892
jmp 0x15a7b
movq $0x0, (%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Split(char) const
std::vector<String> String::Split(char separator) const
{
    std::vector<String> result;
    if (!_meta || !separator)
        return result;
    const char *ptr = _meta->CStr;
    while (*ptr)
    {
        const char *found_cstr = strchr(ptr, separator);
        if (!found_cstr) break;
        result.push_back(String(ptr, found_cstr - ptr));
        ptr = found_cstr + 1;
    }
    if (*ptr)
        result.push_back(String(ptr));
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rsi), %rax
testq %rax, %rax
sete %cl
testb %dl, %dl
sete %sil
orb %cl, %sil
jne 0x15b52
movq 0x18(%rax), %r15
cmpb $0x0, (%r15)
je 0x15b52
movsbl %dl, %ebp
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movl %ebp, %esi
callq 0x3180
testq %rax, %rax
je 0x15b20
movq %rax, %r12
movq %rax, %rdx
subq %r15, %rdx
movq $0x0, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x14c84
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16652
movq %r14, %rdi
callq 0x14d68
movq %r12, %r15
incq %r15
cmpb $0x0, 0x1(%r12)
jne 0x15ad1
jmp 0x15b52
leaq 0x8(%rsp), %rdi
movq $0x0, (%rdi)
movq %r15, %rsi
movq $-0x1, %rdx
callq 0x14c84
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x16652
leaq 0x8(%rsp), %rdi
callq 0x14d68
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15b66
jmp 0x15b75
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x14d68
jmp 0x15b78
movq %rax, %r14
movq %rbx, %rdi
callq 0x1660a
movq %r14, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Copy(unsigned long, unsigned long)
void String::Copy(size_t max_length, size_t offset)
{
    if (!_meta)
    {
        return;
    }

    char *new_data = new char[sizeof(String::Header) + max_length + 1];
    // remember, that _meta->CStr may point to any address in buffer
    char *cstr_head = new_data + sizeof(String::Header) + offset;
    memcpy(new_data, _data, sizeof(String::Header));
    size_t copy_length = Math::Min(_meta->Length, max_length);
    memcpy(cstr_head, _meta->CStr, copy_length);
    Free();
    _data = new_data;
    _meta->RefCount = 1;
    _meta->Capacity = max_length;
    _meta->Length = copy_length;
    _meta->CStr = cstr_head;
    _meta->CStr[_meta->Length] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbp
testq %rbp, %rbp
je 0x15c74
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x21(%rsi), %rdi
callq 0x3040
movq %rax, %r12
addq %r15, %rax
movq %rax, (%rsp)
addq %r12, %r15
addq $0x20, %r15
movq 0x10(%rbp), %r13
movq 0x18(%rbp), %rsi
cmpq %rbx, %r13
cmovaeq %rbx, %r13
movq %r15, %rdi
movq %r13, %rdx
callq 0x3290
movq %r14, %rdi
callq 0x14d68
movq %r12, (%r14)
movq $0x1, (%r12)
movq %rbx, 0x8(%r12)
movq %r13, 0x10(%r12)
movq %r15, 0x18(%r12)
movq (%rsp), %rax
movb $0x0, 0x20(%r13,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipLeft(unsigned long)
void String::ClipLeft(size_t count)
{
    if (_meta && _meta->Length > 0 && count > 0)
    {
        count = Math::Min(count, _meta->Length);
        BecomeUnique();
        _meta->Length -= count;
        _meta->CStr += count;
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x15d97
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x10(%rax), %rsi
testq %rsi, %rsi
sete %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
jne 0x15d90
movq %rdi, %r14
cmpq %rbx, %rsi
cmovbq %rsi, %rbx
cmpq $0x2, (%rax)
jb 0x15d82
movq %r14, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%r14), %rax
movq 0x10(%rax), %rsi
subq %rbx, %rsi
movq %rsi, 0x10(%rax)
movq (%r14), %rax
addq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipMid(unsigned long, unsigned long)
void String::ClipMid(size_t from, size_t count)
{
    if (_meta && from < _meta->Length)
    {
        count = Math::Min(count, _meta->Length - from);
        if (count > 0)
        {
            BecomeUnique();
            if (!from)
            {
                _meta->Length -= count;
                _meta->CStr += count;
            }
            else if (from + count == _meta->Length)
            {
                _meta->Length -= count;
                _meta->CStr[_meta->Length] = 0;
            }
            else
            {
                char *cstr_mid = _meta->CStr + from;
                memmove(cstr_mid, _meta->CStr + from + count, _meta->Length - from - count + 1);
                _meta->Length -= count;
            }
        }
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x15e4d
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq 0x10(%rax), %rsi
movq %rsi, %rcx
subq %r15, %rcx
jbe 0x15e48
movq %rdx, %rbx
cmpq %rdx, %rcx
cmovbq %rcx, %rbx
testq %rbx, %rbx
je 0x15e48
movq %rdi, %r14
cmpq $0x2, (%rax)
jb 0x15df4
movq %r14, %rdi
xorl %edx, %edx
callq 0x15bf8
testq %r15, %r15
je 0x15e1e
leaq (%rbx,%r15), %rcx
movq (%r14), %rax
movq 0x10(%rax), %rdx
subq %rcx, %rdx
jne 0x15e2e
movq %r15, 0x10(%rax)
movq (%r14), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
jmp 0x15e48
movq (%r14), %rax
subq %rbx, 0x10(%rax)
movq (%r14), %rax
addq %rbx, 0x18(%rax)
jmp 0x15e48
addq 0x18(%rax), %r15
leaq (%r15,%rbx), %rsi
incq %rdx
movq %r15, %rdi
callq 0x3500
movq (%r14), %rax
subq %rbx, 0x10(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipRight(unsigned long)
void String::ClipRight(size_t count)
{
    if (_meta && count > 0)
    {
        count = Math::Min(count, GetLength());
        BecomeUnique();
        _meta->Length -= count;
        _meta->CStr[_meta->Length] = 0;
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
sete %cl
testq %rsi, %rsi
sete %dl
orb %cl, %dl
jne 0x15eaa
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rax), %rsi
cmpq %r14, %rsi
cmovbq %rsi, %r14
cmpq $0x2, (%rax)
jb 0x15e8d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%rbx), %rax
movq 0x10(%rax), %rsi
subq %r14, %rsi
movq %rsi, 0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipLeftSection(char, bool)
void String::ClipLeftSection(char separator, bool include_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindChar(separator);
        if (slice_at != -1)
        {
            ClipLeft(include_separator ? slice_at + 1 : slice_at);
        }
        else
            Empty();
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testb %sil, %sil
je 0x15eeb
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x15eeb
movl %edx, %ebp
movsbl %sil, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15370
cmpq $-0x1, %rax
je 0x15ef2
movzbl %bpl, %ecx
addq %rcx, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x15d3e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x14e6e
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipRightSection(char, bool)
void String::ClipRightSection(char separator, bool include_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            ClipRight(include_separator ? _meta->Length - slice_at : _meta->Length - slice_at - 1);
        }
        else
            Empty();
    }
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
sete %al
testb %sil, %sil
sete %r8b
orb %al, %r8b
jne 0x15f47
movq 0x10(%rcx), %rax
movq %rax, %r8
decq %r8
js 0x14e6e
movq 0x18(%rcx), %r8
leaq -0x1(%r8), %r9
movq %rax, %rcx
cmpb %sil, (%r9,%rcx)
je 0x15f48
leaq (%r9,%rcx), %r10
decq %r10
decq %rcx
cmpq %r8, %r10
jae 0x15f30
jmp 0x15f5e
retq
testq %rcx, %rcx
je 0x15f5e
movzbl %dl, %edx
subq %rcx, %rdx
addq %rdx, %rax
movq %rax, %rsi
jmp 0x15e4e
jmp 0x14e6e
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ClipSection(char, unsigned long, unsigned long, bool, bool)
void String::ClipSection(char separator, size_t first, size_t last,
                              bool include_first_sep, bool include_last_sep)
{
    if (!_meta || !separator)
    {
        return;
    }

    size_t slice_from;
    size_t slice_to;
    if (FindSection(separator, first, last, !include_first_sep, !include_last_sep,
        slice_from, slice_to))
    {
        ClipMid(slice_from, slice_to - slice_from);
    }
}

// Assembly:
testb %sil, %sil
je 0x15fbf
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x15fba
xorb $0x1, %r8b
xorb $0x1, %r9b
movq %rsp, %rax
leaq 0x8(%rsp), %r10
movsbl %sil, %esi
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movq %rbx, %rdi
pushq %rax
pushq %r10
callq 0x15456
addq $0x10, %rsp
testb %al, %al
je 0x15fba
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x15db2
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Prepend(char const*)
void String::Prepend(const char *cstr)
{
    if (cstr)
    {
        size_t length = strlen(cstr);
        if (length > 0)
        {
            ReserveAndShift(true, length);
            memcpy(_meta->CStr - length, cstr, length);
            _meta->Length += length;
            _meta->CStr -= length;
        }
    }
}

// Assembly:
testq %rsi, %rsi
je 0x1609c
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x31a0
testq %rax, %rax
je 0x16097
movq %rax, %r15
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x14f6a
movq (%rbx), %rax
movq 0x18(%rax), %rdi
subq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3290
movq (%rbx), %rax
addq %r15, 0x10(%rax)
movq (%rbx), %rax
subq %r15, 0x18(%rax)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::PrependChar(char)
void String::PrependChar(char c)
{
    if (c)
    {
        ReserveAndShift(true, 1);
        _meta->Length++;
        _meta->CStr--;
        _meta->CStr[0] = c;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
testb %bl, %bl
je 0x160d1
movq %rdi, %r14
movl $0x1, %edx
movl $0x1, %esi
callq 0x14f6a
movq (%r14), %rax
incq 0x10(%rax)
movq (%r14), %rax
decq 0x18(%rax)
movq (%r14), %rax
movq 0x18(%rax), %rax
movb %bl, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Replace(char, char)
void String::Replace(char what, char with)
{
    if (_meta && what && with && what != with)
    {
        BecomeUnique();
        char *rep_ptr = _meta->CStr;
        while (*rep_ptr)
        {
            if (*rep_ptr == what)
            {
                *rep_ptr = with;
            }
            rep_ptr++;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
cmpb %bl, %bpl
je 0x16130
testb %bl, %bl
je 0x16130
testb %bpl, %bpl
je 0x16130
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x16130
cmpq $0x2, (%rax)
jb 0x16112
movq 0x10(%rax), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%r14), %rax
movq 0x18(%rax), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x16130
incq %rax
cmpb %bpl, %cl
jne 0x16127
movb %bl, -0x1(%rax)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x1611f
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ReplaceMid(unsigned long, unsigned long, char const*)
void String::ReplaceMid(size_t from, size_t count, const char *cstr)
{
    if (!cstr)
        cstr = "";
    size_t length = strlen(cstr);
    Math::ClampLength(from, count, (size_t)0, GetLength());
    ReserveAndShift(false, Math::Surplus(length, count));
    memmove(_meta->CStr + from + length, _meta->CStr + from + count, GetLength() - (from + count) + 1);
    memcpy(_meta->CStr + from, cstr, length);
    _meta->Length += length - count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
testq %rcx, %rcx
leaq 0x7094(%rip), %r14      # 0x1d1e8
cmovneq %rcx, %r14
movq %r14, %rdi
callq 0x31a0
movq %rax, %r12
movq (%rbx), %rax
testq %rax, %rax
je 0x1617e
movq 0x10(%rax), %rbp
xorl %eax, %eax
cmpq %r15, %rbp
cmovaq %r13, %rax
cmovbq %rbp, %r15
jmp 0x16185
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r15d, %r15d
subq %r15, %rbp
cmpq %rbp, %rax
cmovbq %rax, %rbp
xorl %edx, %edx
movq %r12, %r13
subq %rbp, %r13
cmovaeq %r13, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x14f6a
movq (%rbx), %rax
movq 0x18(%rax), %rsi
addq %r15, %rsi
movq %r12, %rdi
addq %rsi, %rdi
addq %rbp, %rsi
movq 0x10(%rax), %rax
addq %r15, %rbp
negq %rbp
leaq (%rax,%rbp), %rdx
incq %rdx
callq 0x3500
movq (%rbx), %rax
addq 0x18(%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3290
movq (%rbx), %rax
addq %r13, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TrimLeft(char)
void String::TrimLeft(char c)
{
    if (!_meta || !_meta->Length)
    {
        return;
    }

    const char *trim_ptr = _meta->CStr;
    for (;;)
    {
        auto t = *trim_ptr;
        if (t == 0) { break; }
        if (c && t != c) { break; }
        if (!c && !isspace(t)) { break; }
        trim_ptr++;
    }
    size_t trimmed = trim_ptr - _meta->CStr;
    if (trimmed > 0)
    {
        BecomeUnique();
        _meta->Length -= trimmed;
        _meta->CStr += trimmed;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
testq %r15, %r15
je 0x162ec
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x162ec
movq 0x18(%r15), %r13
movb (%r13), %al
testb %al, %al
je 0x162ec
movl %esi, %ebp
movq %rdi, %rbx
xorl %r12d, %r12d
testb %bpl, %bpl
je 0x1629a
cmpb %bpl, %al
jne 0x162b9
testb %bpl, %bpl
jne 0x162ab
movsbl %al, %edi
callq 0x3090
testl %eax, %eax
je 0x162b9
movb 0x1(%r13,%r12), %al
incq %r12
testb %al, %al
jne 0x16290
jmp 0x162be
testq %r12, %r12
je 0x162ec
addq %r13, %r12
subq %r13, %r12
cmpq $0x2, (%r15)
jb 0x162de
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x15bf8
movq (%rbx), %r15
movq 0x10(%r15), %r14
subq %r12, %r14
movq %r14, 0x10(%r15)
movq (%rbx), %rax
addq %r12, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TrimRight(char)
void String::TrimRight(char c)
{
    if (!_meta || !_meta->Length)
    {
        return;
    }

    const char *trim_ptr = _meta->CStr + _meta->Length - 1;
    for (;;) 
    {
        if (trim_ptr < _meta->CStr) { break; }
        auto t = *trim_ptr;
        if (c && t != c) { break; }
        if (!c && !isspace(t)) { break; }
        trim_ptr--;
    }
    size_t trimmed = (_meta->CStr + _meta->Length - 1) - trim_ptr;
    if (trimmed > 0)
    {
        BecomeUnique();
        _meta->Length -= trimmed;
        _meta->CStr[_meta->Length] = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
movq (%rdi), %r15
testq %r15, %r15
je 0x163b8
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x163b8
movq 0x18(%r15), %r13
leaq (%r14,%r13), %rax
decq %rax
cmpq %r13, %rax
jb 0x163b8
movl %esi, %ebp
leaq (%r14,%r13), %rbx
movq $-0x1, %r12
movb (%rbx,%r12), %al
testb %bpl, %bpl
je 0x16353
cmpb %bpl, %al
jne 0x16375
testb %bpl, %bpl
jne 0x16364
movsbl %al, %edi
callq 0x3090
testl %eax, %eax
je 0x16375
leaq (%rbx,%r12), %rax
decq %rax
decq %r12
cmpq %r13, %rax
jae 0x16345
jmp 0x1637b
cmpq $-0x1, %r12
je 0x163b8
incq %r12
cmpq $0x2, (%r15)
jb 0x1639e
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x15bf8
movq (%rbx), %r15
movq 0x10(%r15), %r14
jmp 0x163a2
movq (%rsp), %rbx
addq %r14, %r12
movq %r12, 0x10(%r15)
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToLeft(unsigned long)
void String::TruncateToLeft(size_t count)
{
    if (_meta)
    {
        count = Math::Min(count, _meta->Length);
        if (count < _meta->Length)
        {
            BecomeUnique();
            _meta->Length = count;
            _meta->CStr[_meta->Length] = 0;
        }
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x16410
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x10(%rax), %rsi
cmpq %r14, %rsi
jbe 0x16409
movq %rdi, %rbx
cmpq $0x2, (%rax)
jb 0x163f6
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%rbx), %rax
movq %r14, 0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToMid(unsigned long, unsigned long)
void String::TruncateToMid(size_t from, size_t count)
{
    if (_meta)
    {
        Math::ClampLength(from, count, (size_t)0, _meta->Length);
        if (from > 0 || count < _meta->Length)
        {
            BecomeUnique();
            _meta->Length = count;
            _meta->CStr += from;
            _meta->CStr[_meta->Length] = 0;
        }
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x16485
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq 0x10(%rax), %rsi
xorl %ecx, %ecx
cmpq %rbx, %rsi
cmovaq %rdx, %rcx
cmovbq %rsi, %rbx
movq %rsi, %r15
subq %rbx, %r15
cmpq %r15, %rcx
cmovbq %rcx, %r15
testq %rbx, %rbx
sete %cl
cmpq %rsi, %r15
setae %dl
testb %dl, %cl
jne 0x16480
movq %rdi, %r14
cmpq $0x2, (%rax)
jb 0x16466
movq %r14, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%r14), %rax
movq %r15, 0x10(%rax)
movq (%r14), %rax
addq %rbx, 0x18(%rax)
movq (%r14), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToRight(unsigned long)
void String::TruncateToRight(size_t count)
{
    if (_meta)
    {
        count = Math::Min(count, GetLength());
        if (count < _meta->Length)
        {
            BecomeUnique();
            _meta->CStr += _meta->Length - count;
            _meta->Length = count;
        }
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x164d1
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x10(%rax), %rsi
cmpq %rbx, %rsi
cmovbq %rsi, %rbx
jbe 0x164ca
movq %rdi, %r14
cmpq $0x2, (%rax)
jb 0x164bc
movq %r14, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%r14), %rax
movq 0x10(%rax), %rsi
subq %rbx, %rsi
addq %rsi, 0x18(%rax)
movq (%r14), %rax
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToLeftSection(char, bool)
void String::TruncateToLeftSection(char separator, bool exclude_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindChar(separator);
        if (slice_at != -1)
        {
            TruncateToLeft(exclude_separator ? slice_at : slice_at + 1);
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testb %sil, %sil
je 0x16515
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x16515
movl %edx, %ebp
movsbl %sil, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15370
cmpq $-0x1, %rax
je 0x16515
xorb $0x1, %bpl
movzbl %bpl, %ecx
addq %rcx, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x163c8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToRightSection(char, bool)
void String::TruncateToRightSection(char separator, bool exclude_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            TruncateToRight(exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at);
        }
    }
}

// Assembly:
movl %esi, %eax
movq (%rdi), %rcx
testq %rcx, %rcx
sete %sil
testb %al, %al
sete %r8b
orb %sil, %r8b
jne 0x16577
movq 0x10(%rcx), %rsi
movq %rsi, %r8
decq %r8
js 0x16577
movq 0x18(%rcx), %r8
leaq -0x1(%r8), %r9
movq %rsi, %rcx
cmpb %al, (%r9,%rcx)
je 0x16561
leaq (%r9,%rcx), %r10
decq %r10
decq %rcx
cmpq %r8, %r10
jae 0x1654a
jmp 0x16577
testq %rcx, %rcx
je 0x16577
xorb $0x1, %dl
movzbl %dl, %eax
subq %rcx, %rax
addq %rax, %rsi
jmp 0x16486
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::TruncateToSection(char, unsigned long, unsigned long, bool, bool)
void String::TruncateToSection(char separator, size_t first, size_t last,
                          bool exclude_first_sep, bool exclude_last_sep)
{
    if (!_meta || !separator)
    {
        return;
    }

    size_t slice_from;
    size_t slice_to;
    if (FindSection(separator, first, last, exclude_first_sep, exclude_last_sep,
        slice_from, slice_to))
    {
        TruncateToMid(slice_from, slice_to - slice_from);
    }
    else
    {
        Empty();
    }
}

// Assembly:
testb %sil, %sil
je 0x165d5
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x165d0
movq %rsp, %rax
leaq 0x8(%rsp), %r10
movsbl %sil, %esi
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movq %rbx, %rdi
pushq %rax
pushq %r10
callq 0x15456
addq $0x10, %rsp
testb %al, %al
je 0x165c8
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x16412
jmp 0x165d0
movq %rbx, %rdi
callq 0x14e6e
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_stream.cpp
// Function: AGS::Common::Stream::WriteByteCount(unsigned char, unsigned long)
size_t Stream::WriteByteCount(uint8_t b, size_t count)
{
    if (!CanWrite())
        return 0;
    size_t size = 0;
    for (; count > 0; --count, ++size)
    {
        if (WriteByte(b) < 0)
            break;
    }
    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rax
callq *0x40(%rax)
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x16852
testb %al, %al
je 0x16852
xorl %r15d, %r15d
movzbl %bpl, %ebp
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
callq *0x68(%rax)
testl %eax, %eax
js 0x16852
incq %r15
cmpq %r15, %rbx
jne 0x16838
movq %rbx, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_compiler.cpp
// Function: ccAddDefaultHeader(char*, char*)
int ccAddDefaultHeader(char* nhead, char *nName)
{
    if (numheaders >= capacityHeaders)
    {
        capacityHeaders += 50;
        defaultheaders = (char**)realloc(defaultheaders, sizeof(char*) * capacityHeaders);
        defaultHeaderNames = (char**)realloc(defaultHeaderNames, sizeof(char*) * capacityHeaders);
    }

    defaultheaders[numheaders] = nhead;
    defaultHeaderNames[numheaders] = nName;
    numheaders++;
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x14e43(%rip), %r12     # 0x2b6b8
movslq 0x14e40(%rip), %rax     # 0x2b6bc
cmpl %eax, %r12d
jl 0x168bf
leaq 0x32(%rax), %rcx
movl %ecx, 0x14e31(%rip)     # 0x2b6bc
movq 0xf04e(%rip), %rdi      # 0x258e0
leaq 0x190(,%rax,8), %r15
movq %r15, %rsi
callq 0x3520
movq %rax, 0xf037(%rip)      # 0x258e0
movq 0xf038(%rip), %rdi      # 0x258e8
movq %r15, %rsi
callq 0x3520
movq %rax, 0xf029(%rip)      # 0x258e8
movq 0xf01a(%rip), %rax      # 0x258e0
movq %r14, (%rax,%r12,8)
movq 0xf017(%rip), %rax      # 0x258e8
movq %rbx, (%rax,%r12,8)
leal 0x1(%r12), %eax
movl %eax, 0x14dd8(%rip)     # 0x2b6b8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_macrotable.cpp
// Function: MacroTable::shutdown()
void MacroTable::shutdown() {
    int rr;
    for (rr=0;rr<num;rr++) {
        free(macro[rr]);
        free(name[rr]);
        macro[rr]=NULL;
        name[rr]=NULL;
    }
    num = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x16c7c
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x2ee8(%rbx,%r15,8), %rdi
callq 0x33c0
movq 0x8(%rbx,%r15,8), %rdi
callq 0x33c0
movq %r14, 0x2ee8(%rbx,%r15,8)
movq %r14, 0x8(%rbx,%r15,8)
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x16c4d
movl $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_macrotable.cpp
// Function: MacroTable::add(char*, char*)
void MacroTable::add(char*namm,char*mac) {
    if (find_name(namm) >= 0) {
        cc_error("macro '%s' already defined",namm);
        return;
    }
    if (num>=MAXDEFINES) {
        cc_error("too many macros defined");
        return;
    }
    name[num]=(char*)malloc(strlen(namm)+5);
    strcpy(name[num],namm);
    macro[num]=(char*)malloc(strlen(mac)+5);
    strcpy(macro[num],mac);
    size_t l = strlen(mac);
    // remove trailing whitespace, newlines and the like.
    // if a macro ends with a newline (as usual when passed from parser)
    // this would otherwise cause the expanded macro to mess up reported
    // linenumbers.
    while(l > 0 && isspace(macro[num][l-1]))
        macro[num][--l] = 0;
    num++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movslq (%rdi), %r12
testq %r12, %r12
jle 0x16d1c
xorl %r13d, %r13d
movq 0x8(%rbx,%r13,8), %rsi
movq %r15, %rdi
callq 0x3450
testl %eax, %eax
je 0x16da9
incq %r13
cmpq %r13, %r12
jne 0x16cdf
cmpl $0x5dc, %r12d           # imm = 0x5DC
jl 0x16d1c
leaq 0x6413(%rip), %rdi      # 0x1d11f
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x102f4
movq %r15, %rdi
callq 0x31a0
leaq 0x5(%rax), %rdi
callq 0x3440
movq %rax, 0x8(%rbx,%r12,8)
movq %rax, %rdi
movq %r15, %rsi
callq 0x32d0
movq %r14, %rdi
callq 0x31a0
leaq 0x5(%rax), %rdi
callq 0x3440
movq %rax, 0x2ee8(%rbx,%r12,8)
movq %rax, %rdi
movq %r14, %rsi
callq 0x32d0
movq %r14, %rdi
callq 0x31a0
testq %rax, %rax
je 0x16d99
movq %rax, %r14
movslq (%rbx), %r12
movq 0x2ee8(%rbx,%r12,8), %r15
movsbl -0x1(%r15,%r14), %edi
callq 0x3090
testl %eax, %eax
je 0x16d99
movb $0x0, -0x1(%r15,%r14)
decq %r14
jne 0x16d71
movl (%rbx), %r12d
incl %r12d
movl %r12d, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x6354(%rip), %rdi      # 0x1d104
movq %r15, %rsi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x102f4
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_macrotable.cpp
// Function: MacroTable::find_name(char*)
int MacroTable::find_name(char* namm) {
    int ss;
    for (ss=0;ss<num;ss++) {
        if (strcmp(namm,name[ss])==0) return ss;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq (%rdi), %r12
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
jle 0x16e01
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
movq 0x8(%r15,%r13,8), %rsi
movq %r14, %rdi
callq 0x3450
testl %eax, %eax
je 0x16dfe
incq %r13
cmpq %r13, %r12
jne 0x16de3
jmp 0x16e01
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_macrotable.cpp
// Function: MacroTable::remove(int)
void MacroTable::remove(int index) {
    if ((index < 0) || (index >= num)) {
        cc_error("MacroTable::Remove: index out of range");
        return;
    }
    // just blank out the entry, don't bother to remove it
    name[index][0] = 0;
    macro[index][0] = 0;
}

// Assembly:
testl %esi, %esi
js 0x16e2c
cmpl %esi, (%rdi)
jle 0x16e2c
movl %esi, %eax
movq 0x8(%rdi,%rax,8), %rcx
xorl %edx, %edx
movb %dl, (%rcx)
movq 0x2ee8(%rdi,%rax,8), %rax
movb %dl, (%rax)
retq
leaq 0x6304(%rip), %rdi      # 0x1d137
xorl %eax, %eax
jmp 0x102f4
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_prepro.cpp
// Function: get_next_word(char*, char*, bool)
void get_next_word(char*stin,char*wo, bool includeDots = false) {
  if (stin[0] == '\"') {
    // a string
    int breakout = 0;
//    char*oriwo=wo;
    wo[0] = stin[0];
    wo++; stin++;
    while (!breakout) {
      if ((stin[0] == '\"') && (stin[-1] != '\\')) breakout=1;
      if (stin[0] == 0) breakout = 1;
      wo[0] = stin[0];
      wo++; stin++;
      }
    wo[0] = 0;
//    printf("Word: '%s'\n",oriwo);
    return;
    }
  else if (stin[0] == '\'') {
    // a character constant
    int breakout = 0;
    wo[0] = stin[0];
    wo++; stin++;
    while (!breakout) {
      if ((stin[0] == '\'') && (stin[-1] != '\\')) breakout=1;
      if (stin[0] == 0) breakout = 1;
      wo[0] = stin[0];
      wo++; stin++;
      }
    wo[0] = 0;
    return;
  }

  while ((is_alphanum(stin[0])) || ((includeDots) && (stin[0] == '.'))) {
    wo[0] = stin[0];
    wo++;
    stin++;
  }

  wo[0]=0;
  return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rdi), %eax
cmpl $0x22, %eax
je 0x16e86
cmpl $0x27, %eax
jne 0x16ec0
movb $0x27, (%r14)
incq %r14
incq %rbx
movq %r14, %rax
movb (%rbx), %dl
movb $0x1, %cl
cmpb $0x27, %dl
jne 0x16e70
cmpb $0x5c, -0x1(%rbx)
sete %cl
leaq 0x1(%rax), %r14
movb %dl, (%rax)
testb %dl, %dl
je 0x16eb7
incq %rbx
movq %r14, %rax
testb %cl, %cl
jne 0x16e60
jmp 0x16eb7
movb $0x22, (%r14)
incq %r14
incq %rbx
movq %r14, %rax
movb (%rbx), %dl
movb $0x1, %cl
cmpb $0x22, %dl
jne 0x16ea3
cmpb $0x5c, -0x1(%rbx)
sete %cl
leaq 0x1(%rax), %r14
movb %dl, (%rax)
testb %dl, %dl
je 0x16eb7
incq %rbx
movq %r14, %rax
testb %cl, %cl
jne 0x16e93
movb $0x0, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
movl %edx, %ebp
movsbl %al, %edi
callq 0x13e19
testl %eax, %eax
je 0x16ed2
movb (%rbx), %al
jmp 0x16ede
testb %bpl, %bpl
je 0x16eb7
movb $0x2e, %al
cmpb $0x2e, (%rbx)
jne 0x16eb7
movb %al, (%r14)
incq %r14
movb 0x1(%rbx), %al
incq %rbx
jmp 0x16ec2
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_prepro.cpp
// Function: pre_process_line(char*)
void pre_process_line(char*lin) {

  if (deletingCurrentLine()) {
    lin[0] = 0;
    return;
  }

  char*oldl=(char*)malloc(strlen(lin)+5);
  strcpy(oldl,lin);
  char*opt=oldl;
  char charBefore = 0;

  while (opt[0]!=0) {
    while (is_alphanum(opt[0])==0) {
      if (opt[0]==0) break;
      lin[0]=opt[0]; lin++; opt++; }

    if (opt > oldl)
      charBefore = opt[-1];
    else
      charBefore = 0;

    char thisword[MAX_LINE_LENGTH];
    get_next_word(opt,thisword);
    opt+=strlen(thisword);

    int fni = -1;
    if (charBefore != '.') {
      // object.member -- if member is a #define, it shouldn't be replaced
      fni = macros.find_name(thisword);
    }

    if (fni >= 0) {
      strcpy(lin,macros.macro[fni]);
      lin+=strlen(macros.macro[fni]);
    }
    else {
      strcpy(lin,thisword);
      lin+=strlen(thisword);
    }

  }
  free(oldl);
  lin[0]=0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %rbx
movl 0x19e5a(%rip), %eax     # 0x31488
cmpl 0x19e58(%rip), %eax     # 0x3148c
jg 0x17728
movq %rbx, %rdi
callq 0x31a0
leaq 0x5(%rax), %rdi
callq 0x3440
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32d0
movb (%r14), %al
testb %al, %al
je 0x17720
movq %rsp, %r15
movq %r14, %r13
movsbl %al, %edi
callq 0x13e19
testl %eax, %eax
jne 0x1768d
movb (%r13), %al
testb %al, %al
je 0x1768d
movb %al, (%rbx)
incq %rbx
movsbl 0x1(%r13), %edi
incq %r13
jmp 0x1766d
cmpq %r14, %r13
jbe 0x1769d
cmpb $0x2e, -0x1(%r13)
sete %r12b
jmp 0x176a0
xorl %r12d, %r12d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x16e3c
movq %r15, %rdi
callq 0x31a0
movq %rax, %rbp
testb %r12b, %r12b
jne 0x176fb
leaq 0x13ffc(%rip), %rdi     # 0x2b6c0
movq %r15, %rsi
callq 0x16dc4
testl %eax, %eax
js 0x176fb
movl %eax, %r12d
leaq 0x13fe6(%rip), %rax     # 0x2b6c0
movq 0x2ee8(%rax,%r12,8), %rsi
movq %rbx, %rdi
callq 0x32d0
leaq 0x13fcf(%rip), %rax     # 0x2b6c0
movq 0x2ee8(%rax,%r12,8), %rdi
jmp 0x17709
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32d0
movq %r15, %rdi
addq %rbp, %r13
callq 0x31a0
addq %rax, %rbx
movb (%r13), %al
testb %al, %al
jne 0x1766a
movq %r14, %rdi
callq 0x33c0
movb $0x0, (%rbx)
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_prepro.cpp
// Function: cc_preprocess(char const*, char*)
void cc_preprocess(const char *inpu,char*outp) {
  reset_compiler();
  FMEM*temp=fmem_create();
  FMEM*iii=fmem_open(inpu);
  char linebuffer[1200];
  currentline=0;
  if_level = if_level_active = if_level_satisfied = 0;

  while (!fmem_eof(iii)) {
    fmem_gets(iii,linebuffer);
    currentline++;
    if (strlen(linebuffer) >= MAX_LINE_LENGTH) {  // stop array overflows in subroutines
      cc_error("line too long (%d chars max)", MAX_LINE_LENGTH);
      break; 
    }

    remove_comments(linebuffer);
    // need to check this, otherwise re-defining a macro causes
    // a big problem:
    // #define a int, #define a void  results in #define int void
    if (linebuffer[0]!='#')
      pre_process_line(linebuffer);
    if (ccError) break;
    if (linebuffer[0]=='#')
      pre_process_directive(linebuffer,temp);
    else {  // don't output the #define lines
//      printf("%s\n",linebuffer);
      fmem_puts(linebuffer,temp);
      }
    if (ccError) break;
    }

  strcpy(outp,temp->data);
  fmem_close(temp);
  fmem_close(iii);

  if ((if_level) && (!ccError))
    cc_error("missing #endif");

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xdf65(%rip), %r13      # 0x256c0
xorl %r12d, %r12d
movl %r12d, (%r13)
movl %r12d, 0x19d2b(%rip)    # 0x31494
leaq 0xe030(%rip), %rbp      # 0x257a0
movl %r12d, (%rbp)
callq 0x13158
movq %rax, %r14
movq %r15, %rdi
callq 0x131a7
movq %rax, %r15
movl %r12d, (%rbp)
movl %r12d, 0x19cfe(%rip)    # 0x31490
movl %r12d, 0x19cf3(%rip)    # 0x3148c
movl %r12d, 0x19ce8(%rip)    # 0x31488
movq %rsp, %r12
movq %r15, %rdi
callq 0x13377
testl %eax, %eax
jne 0x17824
movq %r15, %rdi
movq %r12, %rsi
callq 0x13385
incl (%rbp)
movq %r12, %rdi
callq 0x31a0
cmpq $0x1f4, %rax            # imm = 0x1F4
jae 0x17811
movq %r12, %rdi
callq 0x173f0
cmpb $0x23, (%rsp)
je 0x177e3
movq %r12, %rdi
callq 0x17614
cmpl $0x0, (%r13)
jne 0x17824
cmpb $0x23, (%rsp)
jne 0x177fd
movq %r12, %rdi
movq %r14, %rsi
callq 0x16f49
jmp 0x17808
movq %r12, %rdi
movq %r14, %rsi
callq 0x132db
cmpl $0x0, (%r13)
je 0x177a3
jmp 0x17824
leaq 0x5a7c(%rip), %rdi      # 0x1d294
movl $0x1f4, %esi            # imm = 0x1F4
xorl %eax, %eax
callq 0x102f4
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x32d0
movq %r14, %rdi
callq 0x13209
movq %r15, %rdi
callq 0x13209
cmpl $0x0, 0x19c42(%rip)     # 0x31488
je 0x1785d
cmpl $0x0, (%r13)
jne 0x1785d
leaq 0x5a5b(%rip), %rdi      # 0x1d2b1
xorl %eax, %eax
callq 0x102f4
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_peek
int tokenizer_peek(struct tokenizer *t) {
	if(t->peeking) return t->peek_token.value;
	int ret = tokenizer_getc(t);
	if(ret != EOF) tokenizer_ungetc(t, ret);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x0, 0x18(%rdi)
je 0x178d7
movl 0x1184(%r14), %ebx
jmp 0x178f7
movq %r14, %rdi
callq 0x17901
cmpl $-0x1, %eax
je 0x178f2
movl %eax, %ebx
movq %r14, %rdi
movl %eax, %esi
callq 0x17957
jmp 0x178f7
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_getc
static int tokenizer_getc(struct tokenizer *t)
{
	int c;
	if(t->getc_buf.buffered) {
		t->getc_buf.buffered--;
		c = t->getc_buf.buf[(t->getc_buf.cnt) % ARRAY_SIZE(t->getc_buf.buf)];
	} else {
		c = getc(t->input);
		t->getc_buf.buf[t->getc_buf.cnt % ARRAY_SIZE(t->getc_buf.buf)] = c;
	}
	++t->getc_buf.cnt;
	return c;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x1150(%rdi), %rax
testq %rax, %rax
je 0x17930
decq %rax
movq %rax, 0x1150(%rbx)
movq 0x1148(%rbx), %rcx
movl %ecx, %eax
andl $0x7, %eax
movl 0x1128(%rbx,%rax,4), %eax
jmp 0x1794b
movq (%rbx), %rdi
callq 0x3120
movq 0x1148(%rbx), %rcx
movl %ecx, %edx
andl $0x7, %edx
movl %eax, 0x1128(%rbx,%rdx,4)
incq %rcx
movq %rcx, 0x1148(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_ungetc
static int tokenizer_ungetc(struct tokenizer *t, int c)
{
	++t->getc_buf.buffered;
	assert(t->getc_buf.buffered<ARRAY_SIZE(t->getc_buf.buf));
	assert(t->getc_buf.cnt > 0);
	--t->getc_buf.cnt;
	assert(t->getc_buf.buf[t->getc_buf.cnt % ARRAY_SIZE(t->getc_buf.buf)] == c);
	return c;
}

// Assembly:
pushq %rax
movq 0x1150(%rdi), %rax
incq %rax
movq %rax, 0x1150(%rdi)
cmpq $0x8, %rax
jae 0x17995
movq 0x1148(%rdi), %rax
testq %rax, %rax
je 0x179b4
decq %rax
movq %rax, 0x1148(%rdi)
andl $0x7, %eax
cmpl %esi, 0x1128(%rdi,%rax,4)
jne 0x179d3
movl %esi, %eax
popq %rcx
retq
leaq 0x5b38(%rip), %rdi      # 0x1d4d4
leaq 0x59bc(%rip), %rsi      # 0x1d35f
leaq 0x5b5b(%rip), %rcx      # 0x1d505
movl $0x16, %edx
callq 0x3240
leaq 0x5b78(%rip), %rdi      # 0x1d533
leaq 0x599d(%rip), %rsi      # 0x1d35f
leaq 0x5b3c(%rip), %rcx      # 0x1d505
movl $0x17, %edx
callq 0x3240
leaq 0x5b6d(%rip), %rdi      # 0x1d547
leaq 0x597e(%rip), %rsi      # 0x1d35f
leaq 0x5b1d(%rip), %rcx      # 0x1d505
movl $0x19, %edx
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_peek_token
int tokenizer_peek_token(struct tokenizer *t, struct token *tok) {
	int ret = tokenizer_next(t, tok);
	t->peek_token = *tok;
	t->peeking = 1;
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x17cae
movups (%rbx), %xmm0
movups %xmm0, 0x1178(%r14)
movl $0x1, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_register_custom_token
void tokenizer_register_custom_token(struct tokenizer*t, int tokentype, const char* str) {
	assert(tokentype >= TT_CUSTOM && tokentype < TT_CUSTOM + MAX_CUSTOM_TOKENS);
	int pos = tokentype - TT_CUSTOM;
	t->custom_tokens[pos] = str;
	if(pos+1 > t->custom_count) t->custom_count = pos+1;
}

// Assembly:
leal -0x3e8(%rsi), %eax
cmpl $0x20, %eax
jae 0x17a42
movl %eax, %eax
movq %rdx, 0x20(%rdi,%rax,8)
addl $0xfffffc19, %esi       # imm = 0xFFFFFC19
cmpl 0x14(%rdi), %esi
jle 0x17a41
movl %esi, 0x14(%rdi)
retq
pushq %rax
leaq 0x58d1(%rip), %rdi      # 0x1d31b
leaq 0x590e(%rip), %rsi      # 0x1d35f
leaq 0x5913(%rip), %rcx      # 0x1d36b
movl $0x39, %edx
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/tokenizer.c
// Function: tokenizer_skip_chars
int tokenizer_skip_chars(struct tokenizer *t, const char *chars, int *count) {
	assert(!t->peeking);
	int c;
	*count = 0;
	while(1) {
		c = tokenizer_getc(t);
		if(c == EOF) return 0;
		const char *s = chars;
		int match = 0;
		while(*s) {
			if(c==*s) {
				++(*count);
				match = 1;
				break;
			}
			++s;
		}
		if(!match) {
			tokenizer_ungetc(t, c);
			return 1;
		}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x0, 0x18(%rdi)
jne 0x17af3
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0x0, (%rdx)
callq 0x17901
xorl %ebp, %ebp
cmpl $-0x1, %eax
je 0x17ae8
leaq 0x1(%r15), %r12
movb (%r15), %dl
movq %r12, %rcx
testb %dl, %dl
je 0x17ad9
movsbl %dl, %edx
cmpl %edx, %eax
je 0x17ac7
movb (%rcx), %dl
incq %rcx
jmp 0x17ab5
incl (%r14)
movq %rbx, %rdi
callq 0x17901
cmpl $-0x1, %eax
jne 0x17aaf
jmp 0x17ae8
movq %rbx, %rdi
movl %eax, %esi
callq 0x17957
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5939(%rip), %rdi      # 0x1d433
leaq 0x585e(%rip), %rsi      # 0x1d35f
leaq 0x5937(%rip), %rcx      # 0x1d43f
movl $0x14f, %edx            # imm = 0x14F
callq 0x3240