// File: ahupowerdns[P]mcounter/./ext/doctest.h
// Function: doctest::(anonymous namespace)::parseCommaSepArgs(int, char const* const*, char const*, std::vector<doctest::String, std::allocator<doctest::String>>&)
bool parseCommaSepArgs(int argc, const char* const* argv, const char* pattern,
                           std::vector<String>& res) {
        String filtersString;
        if(parseOption(argc, argv, pattern, &filtersString)) {
            // tokenize with "," as a separator, unless escaped with backslash
            std::ostringstream s;
            auto flush = [&s, &res]() {
                auto string = s.str();
                if(string.size() > 0) {
                    res.push_back(string.c_str());
                }
                s.str("");
            };

            bool seenBackslash = false;
            const char* current = filtersString.c_str();
            const char* end = current + strlen(current);
            while(current != end) {
                char character = *current++;
                if(seenBackslash) {
                    seenBackslash = false;
                    if(character == ',') {
                        s.put(',');
                        continue;
                    }
                    s.put('\\');
                }
                if(character == '\\') {
                    seenBackslash = true;
                } else if(character == ',') {
                    flush();
                } else {
                    s.put(character);
                }
            }

            if(seenBackslash) {
                s.put('\\');
            }
            flush();
            return true;
        }
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x78d0
movl -0x8(%rbp), %eax
movl %eax, -0x21c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x78d0
jmp 0xe21d
movq -0x210(%rbp), %rdx
movq -0x218(%rbp), %rsi
movl -0x21c(%rbp), %edi
leaq -0x38(%rbp), %rcx
leaq -0x50(%rbp), %r8
callq 0xe460
movb %al, -0x21d(%rbp)
jmp 0xe246
leaq -0x50(%rbp), %rdi
callq 0x7900
movb -0x21d(%rbp), %al
testb $0x1, %al
jne 0xe25e
jmp 0xe424
leaq -0x1d8(%rbp), %rdi
callq 0x6640
jmp 0xe26c
leaq -0x1d8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movb $0x0, -0x1e9(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x20dc0
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x1f8(%rbp), %rdi
callq 0x61b0
movq %rax, %rcx
movq -0x228(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x200(%rbp)
movq -0x1f8(%rbp), %rax
cmpq -0x200(%rbp), %rax
je 0xe3dc
movq -0x1f8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1f8(%rbp)
movb (%rax), %al
movb %al, -0x201(%rbp)
testb $0x1, -0x1e9(%rbp)
je 0xe38d
movb $0x0, -0x1e9(%rbp)
movsbl -0x201(%rbp), %eax
cmpl $0x2c, %eax
jne 0xe378
leaq -0x1d8(%rbp), %rdi
movl $0x2c, %esi
callq 0x6040
jmp 0xe32e
jmp 0xe2ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xe449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7900
jmp 0xe449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x60f0
jmp 0xe449
leaq -0x1d8(%rbp), %rdi
movl $0x5c, %esi
callq 0x6040
jmp 0xe38b
jmp 0xe38d
movsbl -0x201(%rbp), %eax
cmpl $0x5c, %eax
jne 0xe3a2
movb $0x1, -0x1e9(%rbp)
jmp 0xe3d7
movsbl -0x201(%rbp), %eax
cmpl $0x2c, %eax
jne 0xe3be
leaq -0x1e8(%rbp), %rdi
callq 0x115d0
jmp 0xe3bc
jmp 0xe3d5
movsbl -0x201(%rbp), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x6040
jmp 0xe3d3
jmp 0xe3d5
jmp 0xe3d7
jmp 0xe2ca
testb $0x1, -0x1e9(%rbp)
je 0xe3fa
leaq -0x1d8(%rbp), %rdi
movl $0x5c, %esi
callq 0x6040
jmp 0xe3f8
jmp 0xe3fa
leaq -0x1e8(%rbp), %rdi
callq 0x115d0
jmp 0xe408
movb $0x1, -0x1(%rbp)
movl $0x1, -0x208(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x60f0
jmp 0xe432
movb $0x0, -0x1(%rbp)
movl $0x1, -0x208(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7900
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x7900
movq -0x58(%rbp), %rdi
callq 0x6800
nopl (%rax,%rax)