// File: /workspace/github_cpp_makefile_star2_O3/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::splitLines(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long)
std::vector<std::string> splitLines(const std::string& s, size_t wrapCol)
{
    std::vector<std::string> r;
    size_t                   start    = 0;
    size_t                   pos      = 0;
    size_t                   splitPos = 0;
    size_t                   col      = 0;
    std::string              indent;
    bool                     firstPart = true; // First subline of a wrapped line.
    while (pos < s.length())
    {
        if (s[pos] == '\n')
        {
            std::string line = s.substr(start, pos - start);
            r.push_back(indent + line);
            pos++;
            start     = pos;
            splitPos  = pos;
            col       = 0;
            indent    = "";
            firstPart = true;
            continue;
        }
        if (std::isspace(unsigned(s[pos])))
        {
            splitPos = pos + 1;
        }
        if ((wrapCol > 0) && (col == wrapCol))
        {
            if (splitPos == start)
            {
                splitPos = pos;
            }
            std::string line = s.substr(start, splitPos - start);
            r.push_back(indent + line);
            pos   = splitPos;
            start = pos;
            col   = indent.length();
            if (firstPart)
            {
                firstPart = false;
                size_t i  = 0;
                while ((i < line.size()) && ((line[i] == ' ') || (line[i] == '-')))
                {
                    i++;
                    indent += ' ';
                }
            }
            continue;
        }
        pos++;
        col++;
    }
    if (start < s.length())
    {
        r.push_back(s.substr(start, s.length() - start));
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorl %eax, %eax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
leaq 0x78(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq 0x8(%rsi), %r13
testq %r13, %r13
je 0xaf8a
movq %rsi, %r15
movq %rdx, 0x90(%rsp)
negq %rdx
movq %rdx, 0x88(%rsp)
movb $0x1, %r14b
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
movq %rsi, 0x38(%rsp)
movb %r14b, 0x7(%rsp)
movq 0x10(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x10(%rsp)
movq (%r15), %r15
xorl %ebp, %ebp
movq %rcx, %rbx
movq %rcx, 0x40(%rsp)
movq %rcx, %r12
movsbl (%r15,%rcx), %edi
cmpl $0xa, %edi
sete %r14b
je 0xadc1
callq 0x5050
leaq 0x1(%r12), %rcx
testl %eax, %eax
cmovneq %rcx, %rbx
cmpq $0x0, 0x90(%rsp)
je 0xadb4
cmpq %rbp, 0x10(%rsp)
je 0xae68
decq %rbp
cmpq %r13, %rcx
jb 0xad7d
jmp 0xaf3d
negq %rbp
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x38(%rsp), %r15
movq %r15, %rsi
movq 0x40(%rsp), %rdx
movq %rbp, %rcx
callq 0x5450
leaq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x68(%rsp), %rbp
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xbe76
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x9efa
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xae22
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x70(%rsp), %rdx
movq %rbp, %rdi
xorl %esi, %esi
leaq 0x16277(%rip), %rcx     # 0x210aa
xorl %r8d, %r8d
callq 0x5630
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xae57
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5410
incq %r12
movq $0x0, 0x10(%rsp)
jmp 0xaf2b
movq 0x40(%rsp), %rdx
cmpq %rdx, %rbx
cmovneq %rbx, %r12
movq %r12, %rcx
subq %rdx, %rcx
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x38(%rsp), %r15
movq %r15, %rsi
callq 0x5450
leaq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x68(%rsp), %rbp
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xbe76
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x9efa
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaed0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
testb $0x1, 0x7(%rsp)
je 0xaf0f
xorl %ebx, %ebx
cmpq 0x20(%rsp), %rbx
jae 0xaf0f
movq 0x18(%rsp), %rax
movzbl (%rax,%rbx), %eax
cmpl $0x2d, %eax
je 0xaefd
cmpl $0x20, %eax
jne 0xaf0f
incq %rbx
movq %rbp, %rdi
movl $0x20, %esi
callq 0x5390
jmp 0xaee3
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xaf2b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x8(%r15), %r13
movq %r12, %rcx
cmpq %r13, %r12
jb 0xad59
jmp 0xaf47
movq 0x40(%rsp), %r12
movq 0x38(%rsp), %r15
subq %r12, %r13
jbe 0xaf8a
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x5450
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x9efa
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xaf8a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xafa6
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x8(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaff1
jmp 0xafec
jmp 0xaff1
jmp 0xafec
jmp 0xafcb
jmp 0xaff1
jmp 0xaff1
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaff4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xaff4
movq %rax, %r14
jmp 0xb010
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xb010
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb02c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x8(%rsp), %rdi
callq 0x896e
movq %r14, %rdi
callq 0x5720