// File: ahupowerdns[P]mcounter/./ext/doctest.h
// Function: doctest::(anonymous namespace)::parseIntOption(int, char const* const*, char const*, doctest::(anonymous namespace)::optionType, int&)
bool parseIntOption(int argc, const char* const* argv, const char* pattern, optionType type,
                        int& res) {
        String parsedValue;
        if(!parseOption(argc, argv, pattern, &parsedValue))
            return false;

        if(type == 0) {
            // boolean
            const char positive[][5] = {"1", "true", "on", "yes"};  // 5 - strlen("true") + 1
            const char negative[][6] = {"0", "false", "off", "no"}; // 6 - strlen("false") + 1

            // if the value matches any of the positive/negative possibilities
            for(unsigned i = 0; i < 4; i++) {
                if(parsedValue.compare(positive[i], true) == 0) {
                    res = 1; //!OCLINT parameter reassignment
                    return true;
                }
                if(parsedValue.compare(negative[i], true) == 0) {
                    res = 0; //!OCLINT parameter reassignment
                    return true;
                }
            }
        } else {
            // integer
            // TODO: change this to use std::stoi or something else! currently it uses undefined behavior - assumes '0' on failed parse...
            int theInt = std::atoi(parsedValue.c_str()); // NOLINT
            if(theInt != 0) {
                res = theInt; //!OCLINT parameter reassignment
                return true;
            }
        }
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x78d0
movl -0x8(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x78d0
jmp 0xe530
movq -0xb0(%rbp), %rdx
movq -0xb8(%rbp), %rsi
movl -0xbc(%rbp), %edi
leaq -0x40(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0xe460
movb %al, -0xbd(%rbp)
jmp 0xe559
movb -0xbd(%rbp), %al
xorb $-0x1, %al
movb %al, -0xbe(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7900
movb -0xbe(%rbp), %al
testb $0x1, %al
jne 0xe57c
jmp 0xe5b7
movb $0x0, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0xe713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe72a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7900
jmp 0xe72a
cmpl $0x0, -0x1c(%rbp)
jne 0xe6cd
movq 0x29b78(%rip), %rax     # 0x38140
movq %rax, -0x80(%rbp)
movq 0x29b75(%rip), %rax     # 0x38148
movq %rax, -0x78(%rbp)
movl 0x29b73(%rip), %eax     # 0x38150
movl %eax, -0x70(%rbp)
movq 0x29b79(%rip), %rax     # 0x38160
movq %rax, -0xa0(%rbp)
movq 0x29b73(%rip), %rax     # 0x38168
movq %rax, -0x98(%rbp)
movq 0x29b6d(%rip), %rax     # 0x38170
movq %rax, -0x90(%rbp)
movl $0x0, -0xa4(%rbp)
cmpl $0x4, -0xa4(%rbp)
jae 0xe6cb
movl -0xa4(%rbp), %eax
leaq (%rax,%rax,4), %rax
leaq -0x80(%rbp,%rax), %rsi
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
callq 0x7ea0
movl %eax, -0xc4(%rbp)
jmp 0xe646
movl -0xc4(%rbp), %eax
cmpl $0x0, %eax
jne 0xe66b
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movb $0x1, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0xe713
movl -0xa4(%rbp), %eax
leaq (%rax,%rax,2), %rax
leaq -0xa0(%rbp,%rax,2), %rsi
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
callq 0x7ea0
movl %eax, -0xc8(%rbp)
jmp 0xe693
movl -0xc8(%rbp), %eax
cmpl $0x0, %eax
jne 0xe6b5
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0xe713
jmp 0xe6b7
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0xe614
jmp 0xe708
leaq -0x40(%rbp), %rdi
callq 0x20dc0
movq %rax, %rdi
callq 0x6700
movl %eax, -0xa8(%rbp)
cmpl $0x0, -0xa8(%rbp)
je 0xe706
movl -0xa8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0xe713
jmp 0xe708
movb $0x0, -0x1(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x7900
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x7900
movq -0x60(%rbp), %rdi
callq 0x6800
nopl (%rax)