// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::read_config_name(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, bool, bool*)
inline string read_config_name(string_iterator & i, string_iterator end, bool env = false, bool *num = nullptr) noexcept
{
    using std::locale;
    using std::ctype;
    using std::use_facet;

    // To avoid the horror of locales, we'll use the classic facet only, to identify digits, control
    // characters and punctuation. (Unless something is totally crazy, we are talking about ASCII or
    // a superset of it, but using the facet allows us to avoid that assumption). However, we're only
    // working with "narrow" char type so accuracy is limited. In general, that's not going to matter
    // much, but may allow certain unicode punctuation characters to be used as part of a name for example.
    const ctype<char> & facet = use_facet<ctype<char>>(locale::classic());

    string rval;

    // For environment lookups, integers are valid names (particularly for argument)
    if (env && facet.is(ctype<char>::digit, *i)) {
        while (facet.is(ctype<char>::digit, *i)) {
            rval += *i;
            ++i;
        }
        if (num) {
            *num = true;
        }
        return rval;
    }

    // Don't allow empty name, numeric digit, or dash/dot at start of setting name
    if (i == end || (*i == '-' || *i == '.' || facet.is(ctype<char>::digit, *i))) {
        return {};
    }

    // Within the setting name, allow dash and dot unless parsing envvar name
    // also allow any non-control, non-punctuation non-space character.
    while (i != end && (((*i == '-' || *i == '.') && !env) || *i == '_'
            || (!facet.is(ctype<char>::cntrl, *i) && !facet.is(ctype<char>::punct, *i)
                    && !facet.is(ctype<char>::space, *i)))) {
        rval += *i;
        ++i;
    }
    return rval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x43d0
movq %rax, %rdi
callq 0x4140
movq %rax, %r15
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %r13
movq $0x0, (%r13)
movb $0x0, 0x8(%r13)
testb %bpl, %bpl
je 0x11823
movq (%r14), %rax
movzbl (%rax), %eax
movq 0x30(%r15), %rcx
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x118ad
movq (%r14), %rax
cmpq %r12, %rax
je 0x11898
movzbl (%rax), %eax
leal -0x2d(%rax), %ecx
cmpb $0x2, %cl
jb 0x11898
movq 0x30(%r15), %rcx
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x11898
movq (%r14), %rax
cmpq %r12, %rax
je 0x118f3
movzbl (%rax), %eax
cmpq $0x2d, %rax
jne 0x1185d
testb %bpl, %bpl
jne 0x11872
jmp 0x11882
cmpq $0x2e, %rax
setne %cl
orb %bpl, %cl
cmpq $0x5f, %rax
setne %dl
testb %cl, %dl
je 0x11882
movq 0x30(%r15), %rcx
movzwl (%rcx,%rax,2), %ecx
testl $0x2006, %ecx           # imm = 0x2006
jne 0x118f3
movsbl %al, %esi
movq %rsp, %rdi
callq 0x42a0
movq (%r14), %rax
incq %rax
movq %rax, (%r14)
jmp 0x11844
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8(%rbx), %r13
leaq 0x10(%rsp), %rcx
jmp 0x1192f
movq (%r14), %rax
movzbl (%rax), %eax
movq 0x30(%r15), %rcx
testb $0x8, 0x1(%rcx,%rax,2)
movq 0x20(%rsp), %rbp
je 0x118ea
movq %rsp, %r12
movsbl %al, %esi
movq %r12, %rdi
callq 0x42a0
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movzbl 0x1(%rax), %eax
movq 0x30(%r15), %rcx
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x118c6
testq %rbp, %rbp
je 0x118f3
movb $0x1, (%rbp)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
leaq 0x10(%rsp), %rdx
cmpq %rdx, %rcx
je 0x11916
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1191c
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq %rdx, %rcx
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, (%rsp)
movq %rdx, %rax
movq $0x0, (%r13)
movb $0x0, (%rax)
movq (%rsp), %rdi
cmpq %rcx, %rdi
je 0x11950
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11966
jmp 0x11966
movq %rax, %rdi
callq 0xe564