// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::parse_gid_param(file_pos_ref, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, string_view, char const*)
inline gid_t parse_gid_param(file_pos_ref input_pos, const std::string &param,
        ::string_view service_name, const char *setting_name)
{
    const char * gid_err_msg = "specified group id contains invalid numeric characters or is "
            "outside allowed range.";

    // Could be a name or a numeric id. But we should assume numeric first, just in case
    // a user manages to give themselves a username that parses as a number.
    std::size_t ind = 0;
    try {
        // POSIX does not specify whether uid_t is an signed or unsigned, but regardless
        // is is probably safe to assume that valid values are positive. We'll also assume
        // that the value range fits with "unsigned long long" since it seems unlikely
        // that would ever not be the case.
        static_assert((uintmax_t)std::numeric_limits<gid_t>::max()
                <= (uintmax_t)std::numeric_limits<unsigned long long>::max(), "gid_t is too large");
        unsigned long long v = std::stoull(param, &ind, 0);
        if (v > static_cast<unsigned long long>(std::numeric_limits<gid_t>::max())
                || ind != param.length()) {
            throw service_description_exc(service_name, std::string(setting_name) + ": " + gid_err_msg,
                    input_pos);
        }
        return v;
    }
    catch (std::out_of_range &exc) {
        throw service_description_exc(service_name, std::string(setting_name) + ": " + gid_err_msg,
                input_pos);
    }
    catch (std::invalid_argument &exc) {
        // Ok, so it doesn't look like a number: proceed...
    }

    errno = 0;
    struct group * grent = getgrnam(param.c_str());
    if (grent == nullptr) {
        // Maybe an error, maybe just no entry.
        if (errno == 0) {
            throw service_description_exc(service_name, std::string(setting_name) + ": specified group \""
                    + param + "\" does not exist in system database.", input_pos);
        }
        else {
            throw service_description_exc(service_name, std::string("error accessing group database: ")
                    + strerror(errno), input_pos);
        }
    }

    return grent->gr_gid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, 0x80(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, %rbp
movq %rdx, %r15
movl %edi, 0xa8(%rsp)
movq %rsi, 0xb0(%rsp)
movq (%rdx), %rbx
callq 0x4060
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
leaq 0x60(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x44e0
movq (%r12), %rcx
subq %rbx, %rcx
je 0x17d60
movl (%r14), %edx
cmpl $0x22, %edx
je 0x17d6c
testl %edx, %edx
jne 0x17d3f
movl %r13d, (%r14)
movq %rax, %rdx
shrq $0x20, %rdx
jne 0x17d78
cmpq 0x8(%r15), %rcx
jne 0x17d78
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57ed(%rip), %rdi      # 0x1d554
callq 0x4270
leaq 0x57e1(%rip), %rdi      # 0x1d554
callq 0x4550
movl $0x70, %edi
callq 0x41c0
movq %rax, %r13
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbp, %rsi
movq 0x38(%rsp), %rax
leaq (%rax,%rbp), %rdx
leaq 0x60(%rsp), %rdi
callq 0x127a8
leaq 0x88(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfcc6
leaq 0x498a(%rip), %rsi      # 0x1c752
leaq 0x88(%rsp), %rdi
callq 0x46a0
leaq 0x50(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17dfa
movups (%rcx), %xmm0
leaq 0x50(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x17e07
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5731(%rip), %rsi      # 0x1d55b
callq 0x46a0
leaq 0x28(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17e54
movups (%rcx), %xmm0
leaq 0x28(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x17e61
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rsi
leaq 0x18(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %r12b
leaq 0x60(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r13, %rdi
callq 0x16cc4
xorl %r12d, %r12d
leaq 0xdd81(%rip), %rsi      # 0x25c20
leaq -0x13de(%rip), %rdx     # 0x16ac8
movq %r13, %rdi
callq 0x4620
jmp 0x1833e
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x17ee4
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17ee4
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %r12b
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x17f0d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17f0d
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %r12b
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17f3b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17f3b
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %r12b
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x17f64
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17f64
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %r12b
testb %r12b, %r12b
je 0x17f84
movq %r13, %rdi
callq 0x42d0
jmp 0x17f84
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
cmpl $0x0, (%r14)
jne 0x17f84
movl %r13d, (%r14)
cmpl $0x2, %ebx
je 0x17fc1
cmpl $0x1, %ebx
jne 0x184ef
movq 0x8(%rsp), %rdi
callq 0x4170
callq 0x4600
movl $0x0, (%r14)
movq (%r15), %rdi
callq 0x4360
testq %rax, %rax
je 0x1804f
movl 0x10(%rax), %eax
jmp 0x17d4e
movq 0x8(%rsp), %rdi
callq 0x4170
movl $0x70, %edi
callq 0x41c0
movq %rax, %r14
leaq 0x70(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x38(%rsp), %rdx
addq %rbp, %rdx
leaq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x127a8
leaq 0x88(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfcc6
leaq 0x4738(%rip), %rsi      # 0x1c752
leaq 0x88(%rsp), %rdi
callq 0x46a0
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x18155
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x18162
movl (%r14), %ebx
movl $0x70, %edi
callq 0x41c0
movq %rax, %r12
addq %rbp, 0x38(%rsp)
testl %ebx, %ebx
jne 0x180dc
leaq 0x70(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x60(%rsp), %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
callq 0x127a8
leaq 0xb8(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfcc6
leaq 0x550b(%rip), %rsi      # 0x1d5af
leaq 0xb8(%rsp), %rdi
callq 0x46a0
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x181b4
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x181c7
leaq 0x70(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x60(%rsp), %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
callq 0x127a8
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x54bc(%rip), %rsi      # 0x1d5c3
leaq 0x54d5(%rip), %rdx      # 0x1d5e3
leaq 0x40(%rsp), %rdi
callq 0x127a8
movl (%r14), %edi
callq 0x4140
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x46a0
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1822c
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x18239
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x53d6(%rip), %rsi      # 0x1d55b
callq 0x46a0
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1828a
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x18297
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r15, %rdx
callq 0x11d3f
leaq 0x5335(%rip), %rsi      # 0x1d52f
leaq 0x40(%rsp), %rdi
callq 0x46a0
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x182e5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x182f2
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rsi
leaq 0x18(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x60(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
callq 0x16cc4
xorl %ebp, %ebp
leaq 0xd9aa(%rip), %rsi      # 0x25c20
leaq -0x17b5(%rip), %rdx     # 0x16ac8
movq %r12, %rdi
callq 0x4620
jmp 0x1833e
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rsi
leaq 0x18(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x60(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r14, %rdi
callq 0x16cc4
xorl %ebp, %ebp
leaq 0xd94c(%rip), %rsi      # 0x25c20
leaq -0x1813(%rip), %rdx     # 0x16ac8
movq %r14, %rdi
callq 0x4620
jmp 0x1833e
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rsi
leaq 0x18(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x60(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
callq 0x16cc4
xorl %ebp, %ebp
leaq 0xd8f1(%rip), %rsi      # 0x25c20
leaq -0x186e(%rip), %rdx     # 0x16ac8
movq %r12, %rdi
callq 0x4620
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x18364
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18364
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18389
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18389
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x1842a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1842a
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x183f0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x183f0
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x18411
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18411
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x18478
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18478
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x18457
movq 0x50(%rsp), %rsi
jmp 0x18443
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18457
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18457
jmp 0x1844f
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %rbx, %rdi
je 0x184a5
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x184a5
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x184bc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x184bc
jmp 0x1849d
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
testb %bpl, %bpl
je 0x184ef
movq %r12, %rdi
callq 0x42d0
jmp 0x184ef
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %rbx, %rdi
je 0x184dd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x184dd
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
testb %bpl, %bpl
je 0x184ea
movq %r14, %rdi
callq 0x42d0
callq 0x4600
movq 0x8(%rsp), %rdi
callq 0x4630
movq %rax, %rdi
callq 0xfd03
nop