// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
movb $0x0, (%rax)
movq %rdx, 0x50(%rsp)
negq %rdx
movb $0x1, 0x7(%rsp)
xorl %ecx, %ecx
xorl %eax, %eax
movq %rsi, 0x10(%rsp)
movq %rdx, 0x28(%rsp)
addq %rdx, %rax
movq %rax, 0x20(%rsp)
movq (%r15), %rbp
movq 0x8(%r15), %rbx
xorl %eax, %eax
movq %rcx, %r13
movq %rcx, 0x18(%rsp)
movq %rcx, %r15
cmpq %rbx, %r13
jae 0x950d
movq %rax, %r12
movsbl (%rbp,%r13), %edi
cmpl $0xa, %edi
sete %r14b
je 0x9473
callq 0x5050
incq %r13
testl %eax, %eax
cmovneq %r13, %r15
leaq -0x1(%r12), %rax
cmpq $0x0, 0x50(%rsp)
je 0x9392
cmpq %r12, 0x20(%rsp)
jne 0x9392
decq %r13
movq 0x18(%rsp), %rdx
cmpq %rdx, %r15
cmovneq %r15, %r13
movq %r13, %rcx
subq %rdx, %rcx
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x5460
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
leaq 0x58(%rsp), %rbp
movq %rbp, %rsi
movq %r12, %rdx
callq 0x9fbf
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x8926
movq %rbx, %rdi
callq 0x51f0
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
testb $0x1, 0x7(%rsp)
je 0x94ee
xorl %ebx, %ebx
cmpq 0x38(%rsp), %rbx
jae 0x94ee
movq 0x30(%rsp), %rax
movzbl (%rax,%rbx), %eax
cmpl $0x2d, %eax
je 0x9463
cmpl $0x20, %eax
jne 0x94ee
incq %rbx
movq %rbp, %rdi
pushq $0x20
popq %rsi
callq 0x53a0
jmp 0x9441
negq %r12
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rcx
callq 0x5460
leaq 0x78(%rsp), %r12
movq %r12, %rdi
leaq 0x58(%rsp), %rbp
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x9fbf
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x8926
movq %r12, %rdi
callq 0x51f0
movq %rbp, %rdi
leaq 0x11be0(%rip), %rsi     # 0x1b0aa
callq 0x57e0
incq %r13
movq %rbx, %rdi
callq 0x51f0
movq %r13, %rcx
xorl %eax, %eax
movb %r14b, 0x7(%rsp)
movq 0x28(%rsp), %rdx
jmp 0x9376
movq %r12, %rdi
callq 0x51f0
movq %r13, %rcx
movb %r14b, 0x7(%rsp)
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rax
jmp 0x9376
movq 0x18(%rsp), %rdx
subq %rdx, %rbx
jbe 0x9542
leaq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rcx
callq 0x5460
leaq 0x30(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x8926
leaq 0x30(%rsp), %rdi
callq 0x51f0
leaq 0x58(%rsp), %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9585
jmp 0x9580
jmp 0x956f
jmp 0x9580
jmp 0x9585
jmp 0x9585
movq %rax, %r14
leaq 0x78(%rsp), %rdi
callq 0x51f0
jmp 0x9588
jmp 0x9585
movq %rax, %r14
jmp 0x9592
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x51f0
leaq 0x58(%rsp), %rdi
callq 0x51f0
movq 0x8(%rsp), %rdi
callq 0x7646
movq %r14, %rdi
callq 0x5730