// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::parse_uid_param(file_pos_ref, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*, unsigned int*)
inline uid_t parse_uid_param(file_pos_ref input_pos, const std::string &param,
        const std::string &service_name, const char *setting_name, gid_t *group_p)
{
    const char * uid_err_msg = "specified user 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 a signed or unsigned type, but regardless
        // is is probably safe to assume that valid values are positive. We'll also assert
        // that the value range fits within "unsigned long long" since it seems unlikely
        // that would ever not be the case.
        static_assert((uintmax_t)std::numeric_limits<uid_t>::max()
                <= (uintmax_t)std::numeric_limits<unsigned long long>::max(), "uid_t is too large");
        unsigned long long v = std::stoull(param, &ind, 0);
        if (v > static_cast<unsigned long long>(std::numeric_limits<uid_t>::max())
                || ind != param.length()) {
            throw service_description_exc(service_name, std::string(setting_name) + ": "
                    + uid_err_msg, input_pos);
        }
        return v;
    }
    catch (std::out_of_range &exc) {
        throw service_description_exc(service_name, uid_err_msg, input_pos);
    }
    catch (std::invalid_argument &exc) {
        // Ok, so it doesn't look like a number: proceed...
    }

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

    if (group_p) {
        *group_p = pwent->pw_gid;
    }

    return pwent->pw_uid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, %r15
movq %r8, 0x60(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, %r14
movl %edi, 0x88(%rsp)
movq %rsi, 0x90(%rsp)
movq (%rdx), %r12
callq 0x4060
movq %rax, %rbp
movl (%rax), %r13d
movl $0x0, (%rax)
leaq 0x18(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44e0
movq (%rbx), %rcx
subq %r12, %rcx
je 0x17816
movl (%rbp), %edx
cmpl $0x22, %edx
je 0x17822
testl %edx, %edx
jne 0x177f5
movl %r13d, (%rbp)
movq %rax, %rdx
shrq $0x20, %rdx
jne 0x1782e
cmpq 0x8(%r14), %rcx
jne 0x1782e
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d35(%rip), %rdi      # 0x1d552
callq 0x4270
leaq 0x5d29(%rip), %rdi      # 0x1d552
callq 0x4550
movl $0x70, %edi
callq 0x41c0
movq %rax, %r13
leaq 0x68(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq 0x60(%rsp), %rsi
callq 0xfff2
leaq 0x4ef7(%rip), %rsi      # 0x1c750
leaq 0x68(%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 0x17888
movups (%rcx), %xmm0
leaq 0x50(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x17895
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 0x5c0f(%rip), %rsi      # 0x1d4c7
callq 0x46a0
leaq 0x28(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x178e2
movups (%rcx), %xmm0
leaq 0x28(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x178ef
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, %bl
leaq 0x88(%rsp), %rcx
movq %r13, %rdi
movq 0x38(%rsp), %rsi
callq 0x16d7c
xorl %ebx, %ebx
leaq 0xe2f5(%rip), %rsi      # 0x25c20
leaq -0xd8c(%rip), %rdx      # 0x16ba6
movq %r13, %rdi
callq 0x4620
jmp 0x17c83
movq %rdx, %r12
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1796f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1796f
movq %rdx, %r12
movq %rax, 0x8(%rsp)
movb $0x1, %bl
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1798b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x179a6
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bl, %bl
jne 0x179d9
jmp 0x179f5
movq %rdx, %r12
movq %rax, 0x8(%rsp)
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x179d9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x179d9
movq %rdx, %r12
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x42d0
jmp 0x179f5
movq %rdx, %r12
movq %rax, 0x8(%rsp)
cmpl $0x0, (%rbp)
jne 0x179f5
movl %r13d, (%rbp)
cmpl $0x2, %r12d
je 0x17a3f
cmpl $0x1, %r12d
jne 0x17dc1
movq 0x8(%rsp), %rdi
callq 0x4170
callq 0x4600
movl $0x0, (%rbp)
movq (%r14), %rdi
callq 0x4300
testq %rax, %rax
je 0x17ab1
testq %r15, %r15
je 0x17a37
movl 0x14(%rax), %ecx
movl %ecx, (%r15)
movl 0x10(%rax), %eax
jmp 0x17804
movq 0x8(%rsp), %rdi
callq 0x4170
movl $0x70, %edi
callq 0x41c0
movq %rax, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x5a61(%rip), %rsi      # 0x1d4c7
leaq 0x5aac(%rip), %rdx      # 0x1d519
leaq 0x18(%rsp), %rdi
callq 0x129da
movb $0x1, %bpl
leaq 0x18(%rsp), %rdx
leaq 0x88(%rsp), %rcx
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xe183(%rip), %rsi      # 0x25c20
leaq -0xefe(%rip), %rdx      # 0x16ba6
movq %r14, %rdi
callq 0x4620
jmp 0x17c83
movl (%rbp), %ebx
movl $0x70, %edi
callq 0x41c0
movq %rax, %r15
testl %ebx, %ebx
jne 0x17b10
leaq 0x98(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq 0x60(%rsp), %rsi
callq 0xfff2
leaq 0x5a37(%rip), %rsi      # 0x1d51a
leaq 0x98(%rsp), %rdi
callq 0x46a0
leaq 0x78(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17b67
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
jmp 0x17b74
leaq 0x50(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x5015(%rip), %rsi      # 0x1cb35
leaq 0x502d(%rip), %rdx      # 0x1cb54
leaq 0x40(%rsp), %rdi
callq 0x129da
movl (%rbp), %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 0x17bcf
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x17bdc
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0x12017
leaq 0x5989(%rip), %rsi      # 0x1d52d
leaq 0x40(%rsp), %rdi
callq 0x46a0
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x17c2a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x17c37
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 0x88(%rsp), %rcx
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xe007(%rip), %rsi      # 0x25c20
leaq -0x107a(%rip), %rdx     # 0x16ba6
movq %r15, %rdi
callq 0x4620
jmp 0x17c83
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 0x88(%rsp), %rcx
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x16d7c
xorl %ebp, %ebp
leaq 0xdfac(%rip), %rsi      # 0x25c20
leaq -0x10d5(%rip), %rdx     # 0x16ba6
movq %r15, %rdi
callq 0x4620
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x17ca9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17ca9
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17cce
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17cce
movq %rax, 0x8(%rsp)
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x17ce5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17d33
movq 0xa8(%rsp), %rsi
jmp 0x17d2b
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x17d1c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x17d33
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bpl, %bpl
jne 0x17d82
jmp 0x17dc1
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x17d82
movq 0x50(%rsp), %rsi
jmp 0x17d71
movq %rax, 0x8(%rsp)
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17d82
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x17d82
jmp 0x17d7d
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x42d0
jmp 0x17dc1
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x17da8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
testb %bpl, %bpl
jne 0x17db4
jmp 0x17dbc
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x42d0
callq 0x4600
movq 0x8(%rsp), %rdi
callq 0x4630
movq %rax, %rdi
callq 0x1002f