// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x43d0
movq %rax, %rdi
callq 0x4140
movq %rax, %r15
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rax
testb %bpl, %bpl
je 0x11608
movzbl (%rax), %ecx
movq 0x30(%r15), %rdx
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x116aa
cmpq %r12, %rax
je 0x11695
movzbl (%rax), %ecx
leal -0x2d(%rcx), %edx
cmpb $0x2, %dl
jb 0x11695
movq 0x30(%r15), %rdx
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x11695
leaq 0x8(%rsp), %r13
movzbl (%rax), %eax
cmpq $0x2d, %rax
jne 0x1163c
testb %bpl, %bpl
jne 0x11651
jmp 0x11661
cmpq $0x2e, %rax
setne %cl
orb %bpl, %cl
cmpq $0x5f, %rax
setne %dl
testb %cl, %dl
je 0x11661
movq 0x30(%r15), %rcx
movzwl (%rcx,%rax,2), %ecx
testl $0x2006, %ecx           # imm = 0x2006
jne 0x1167a
movsbl %al, %esi
movq %r13, %rdi
callq 0x42a0
movq (%r14), %rax
incq %rax
movq %rax, (%r14)
cmpq %r12, %rax
jne 0x1162c
movq 0x8(%rsp), %rax
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
leaq 0x18(%rsp), %rdx
cmpq %rdx, %rax
je 0x11709
movq %rax, (%rbx)
jmp 0x116f6
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
jmp 0x11718
leaq 0x8(%rsp), %r12
movsbl %cl, %esi
movq %r12, %rdi
callq 0x42a0
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movzbl 0x1(%rax), %ecx
movq 0x30(%r15), %rax
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x116af
testq %r13, %r13
je 0x116dd
movb $0x1, (%r13)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %rdx
cmpq %rdx, %rcx
je 0x11701
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1170f
movups (%rdx), %xmm0
movups %xmm0, (%rax)
jmp 0x1170f
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1172e
jmp 0x1172e
movq %rax, %rdi
callq 0xe590