// File: /workspace/github_cpp_makefile_star2_O3/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, 0x58(%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 0x18(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x44e0
movq (%r12), %rcx
subq %rbx, %rcx
je 0x17e65
movl (%r14), %edx
cmpl $0x22, %edx
je 0x17e71
testl %edx, %edx
jne 0x17e44
movl %r13d, (%r14)
movq %rax, %rdx
shrq $0x20, %rdx
jne 0x17e7d
cmpq 0x8(%r15), %rcx
jne 0x17e7d
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56e6(%rip), %rdi      # 0x1d552
callq 0x4270
leaq 0x56da(%rip), %rdi      # 0x1d552
callq 0x4550
movl $0x70, %edi
callq 0x41c0
movq %rax, %r13
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rbp, %rsi
movq 0x58(%rsp), %rax
leaq (%rax,%rbp), %rdx
leaq 0x18(%rsp), %rdi
callq 0x129da
leaq 0x88(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfff2
leaq 0x4882(%rip), %rsi      # 0x1c750
leaq 0x88(%rsp), %rdi
callq 0x46a0
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17f00
movups (%rcx), %xmm0
leaq 0x70(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x17f0d
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5629(%rip), %rsi      # 0x1d559
callq 0x46a0
leaq 0x48(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17f5a
movups (%rcx), %xmm0
leaq 0x48(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x17f67
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rsi
leaq 0x38(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %al
movl %eax, 0x10(%rsp)
leaq 0x18(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r13, %rdi
callq 0x16d7c
movl $0x0, 0x10(%rsp)
leaq 0xdc73(%rip), %rsi      # 0x25c20
leaq -0x140e(%rip), %rdx     # 0x16ba6
movq %r13, %rdi
callq 0x4620
jmp 0x18460
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x17ff5
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17ff5
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x18021
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18021
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18042
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x18059
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
cmpb $0x0, 0x10(%rsp)
jne 0x1808b
jmp 0x180a6
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x1808b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1808b
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x42d0
jmp 0x180a6
movq %rdx, %rbx
movq %rax, 0x8(%rsp)
cmpl $0x0, (%r14)
jne 0x180a6
movl %r13d, (%r14)
cmpl $0x2, %ebx
je 0x180e3
cmpl $0x1, %ebx
jne 0x18640
movq 0x8(%rsp), %rdi
callq 0x4170
callq 0x4600
movl $0x0, (%r14)
movq (%r15), %rdi
callq 0x4360
testq %rax, %rax
je 0x18171
movl 0x10(%rax), %eax
jmp 0x17e53
movq 0x8(%rsp), %rdi
callq 0x4170
movl $0x70, %edi
callq 0x41c0
movq %rax, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x58(%rsp), %rdx
addq %rbp, %rdx
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x129da
leaq 0x88(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfff2
leaq 0x4614(%rip), %rsi      # 0x1c750
leaq 0x88(%rsp), %rdi
callq 0x46a0
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x18277
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x18284
movl (%r14), %ebx
movl $0x70, %edi
callq 0x41c0
movq %rax, %r12
addq %rbp, 0x58(%rsp)
testl %ebx, %ebx
jne 0x181fe
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq 0x58(%rsp), %rdx
callq 0x129da
leaq 0xb8(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq 0x80(%rsp), %rsi
callq 0xfff2
leaq 0x53e7(%rip), %rsi      # 0x1d5ad
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 0x182d6
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x182e9
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq 0x58(%rsp), %rdx
callq 0x129da
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5398(%rip), %rsi      # 0x1d5c1
leaq 0x53b1(%rip), %rdx      # 0x1d5e1
leaq 0x60(%rsp), %rdi
callq 0x129da
movl (%r14), %edi
callq 0x4140
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x46a0
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1834e
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x1835b
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x52b2(%rip), %rsi      # 0x1d559
callq 0x46a0
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x183ac
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x183b9
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 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0x12017
leaq 0x5211(%rip), %rsi      # 0x1d52d
leaq 0x60(%rsp), %rdi
callq 0x46a0
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x18407
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x18414
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rsi
leaq 0x38(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xd888(%rip), %rsi      # 0x25c20
leaq -0x17f9(%rip), %rdx     # 0x16ba6
movq %r12, %rdi
callq 0x4620
jmp 0x18460
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rsi
leaq 0x38(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r14, %rdi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xd82a(%rip), %rsi      # 0x25c20
leaq -0x1857(%rip), %rdx     # 0x16ba6
movq %r14, %rdi
callq 0x4620
jmp 0x18460
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rsi
leaq 0x38(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xd7cf(%rip), %rsi      # 0x25c20
leaq -0x18b2(%rip), %rdx     # 0x16ba6
movq %r12, %rdi
callq 0x4620
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x18486
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18486
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x184ab
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x184ab
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x18556
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18556
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x18515
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18515
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x1853d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1853d
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x185c0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x185c0
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x18577
movq 0x70(%rsp), %rsi
jmp 0x1856f
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18577
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1858e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bpl, %bpl
jne 0x18606
jmp 0x18640
jmp 0x1859a
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x18606
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18606
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x185e1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x185f8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bpl, %bpl
jne 0x18633
jmp 0x1863b
jmp 0x18601
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x42d0
jmp 0x18640
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x18633
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x18633
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x42d0
callq 0x4600
movq 0x8(%rsp), %rdi
callq 0x4630
movq %rax, %rdi
callq 0x1002f