// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::parse_snum_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&, long long, long long)
inline long long parse_snum_param(file_pos_ref input_pos, const std::string &param,
        const std::string &service_name, long long min = std::numeric_limits<long long>::min(),
        long long max = std::numeric_limits<long long>::max())
{
    const char * num_err_msg = "specified value contains invalid numeric characters or is outside "
            "allowed range.";

    std::size_t ind = 0;
    try {
        long long v = std::stoll(param, &ind, 0);
        if (v < min || v > max || ind != param.length()) {
            throw service_description_exc(service_name, num_err_msg, input_pos);
        }
        return v;
    }
    catch (std::out_of_range &exc) {
        throw service_description_exc(service_name, num_err_msg, input_pos);
    }
    catch (std::invalid_argument &exc) {
        throw service_description_exc(service_name, num_err_msg, input_pos);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl %edi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq 0xa198(%rip), %rax      # 0x3a451
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x32e00
movq %rax, -0xe8(%rbp)
jmp 0x302dd
movq -0xe8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0x30323
movq -0x48(%rbp), %rax
cmpq -0x30(%rbp), %rax
jg 0x30323
movq -0x40(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5770
movq %rax, %rcx
movq -0xf0(%rbp), %rax
cmpq %rcx, %rax
je 0x30596
movb $0x1, -0x7a(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x5880
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x13710
jmp 0x30377
movq -0x108(%rbp), %rsi
movq -0x110(%rbp), %rdi
leaq -0x78(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x30394
movq -0x110(%rbp), %rdi
movb $0x0, -0x7a(%rbp)
leaq 0x2084a(%rip), %rsi     # 0x50bf0
leaq -0x265d(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x30658
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x30407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x303e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5320
leaq -0x79(%rbp), %rdi
callq 0x5520
testb $0x1, -0x7a(%rbp)
jne 0x303f9
jmp 0x30405
movq -0x110(%rbp), %rdi
callq 0x53a0
jmp 0x30407
movl -0x54(%rbp), %eax
movl %eax, -0x114(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x304d0
movq -0x50(%rbp), %rdi
callq 0x51a0
movq %rax, -0xb8(%rbp)
movb $0x1, -0xda(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x138(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x5880
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0x13710
jmp 0x3048a
movq -0x130(%rbp), %rsi
movq -0x138(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x304aa
movq -0x138(%rbp), %rdi
movb $0x0, -0xda(%rbp)
leaq 0x20731(%rip), %rsi     # 0x50bf0
leaq -0x2776(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x30658
movl -0x114(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x30647
movq -0x50(%rbp), %rdi
callq 0x51a0
movq %rax, -0x88(%rbp)
movb $0x1, -0xaa(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x158(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x5880
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x13710
jmp 0x30550
movq -0x150(%rbp), %rsi
movq -0x158(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x30570
movq -0x158(%rbp), %rdi
movb $0x0, -0xaa(%rbp)
leaq 0x2066b(%rip), %rsi     # 0x50bf0
leaq -0x283c(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x30658
movq -0x48(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x305c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x5320
leaq -0xa9(%rbp), %rdi
callq 0x5520
testb $0x1, -0xaa(%rbp)
jne 0x305e0
jmp 0x305ec
movq -0x158(%rbp), %rdi
callq 0x53a0
callq 0x5810
jmp 0x305f3
jmp 0x30647
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3061b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5320
leaq -0xd9(%rbp), %rdi
callq 0x5520
testb $0x1, -0xda(%rbp)
jne 0x30632
jmp 0x3063e
movq -0x138(%rbp), %rdi
callq 0x53a0
callq 0x5810
jmp 0x30645
jmp 0x30647
movq -0x50(%rbp), %rdi
callq 0x5870
movq %rax, %rdi
callq 0x138d0
nopl (%rax,%rax)