// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rsi, %rbx
xorl %r12d, %r12d
movq %r12, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb $0x0, (%rax)
movq 0x8(%rsi), %rbp
testq %rbp, %rbp
movq %rdi, 0x40(%rsp)
je 0xaf56
movq %rdx, 0x90(%rsp)
negq %rdx
movq %rdx, 0x88(%rsp)
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movq (%rbx), %r14
xorl %r13d, %r13d
movq %r15, %rbx
movq %r15, %rcx
movq %rcx, %r12
movsbl (%r14,%rcx), %edi
cmpl $0xa, %edi
je 0xadb6
callq 0x5050
leaq 0x1(%r12), %rcx
testl %eax, %eax
cmovneq %rcx, %rbx
cmpq $0x0, 0x90(%rsp)
je 0xada9
cmpq %r13, 0x18(%rsp)
je 0xae64
decq %r13
cmpq %rbp, %rcx
jb 0xad76
jmp 0xaf47
negq %r13
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x5450
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x68(%rsp), %r13
movq %r13, %rsi
movq %r14, %rdx
movq 0x40(%rsp), %r14
callq 0xbe4c
movq %r14, %rdi
movq %r15, %rsi
callq 0x9ed0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xae18
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x70(%rsp), %rdx
movq %r13, %rdi
xorl %esi, %esi
leaq 0x16281(%rip), %rcx     # 0x210aa
xorl %r8d, %r8d
callq 0x5630
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xae4d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
incq %r12
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq $0x0, 0x18(%rsp)
jmp 0xaf35
cmpq %r15, %rbx
cmovneq %rbx, %r12
movq %r12, %rcx
subq %r15, %rcx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5450
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x68(%rsp), %r13
movq %r13, %rsi
movq %r14, %rdx
movq 0x40(%rsp), %r14
callq 0xbe4c
movq %r14, %rdi
movq %r15, %rsi
callq 0x9ed0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaecd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
testb $0x1, 0xc(%rsp)
je 0xaf19
xorl %ebx, %ebx
cmpq 0x28(%rsp), %rbx
jae 0xaf0c
movq 0x20(%rsp), %rax
movzbl (%rax,%rbx), %eax
cmpl $0x2d, %eax
je 0xaefa
cmpl $0x20, %eax
jne 0xaf0c
incq %rbx
movq %r13, %rdi
movl $0x20, %esi
callq 0x5390
jmp 0xaee0
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xaf35
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x8(%rbx), %rbp
movq %r12, %r15
cmpq %rbp, %r12
jb 0xad58
jmp 0xaf59
movq %r15, %r12
movq 0x40(%rsp), %r14
movq 0x10(%rsp), %rbx
jmp 0xaf59
movq %rdi, %r14
subq %r12, %rbp
jbe 0xaf99
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x5450
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x9ed0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf99
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xafb5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5410
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0xb017
jmp 0xb005
jmp 0xb00a
jmp 0xb005
jmp 0xafe4
jmp 0xb00a
jmp 0xb00a
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb00d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xb00d
movq %rax, %r14
jmp 0xb029
movq %rax, %r14
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb029
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb045
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x40(%rsp), %rdi
callq 0x88ce
movq %r14, %rdi
callq 0x5720