// File: davmac314[P]dinit/src/includes/load-service.h
// Function: dinit_load::parse_timespec(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*, timespec&)
inline void parse_timespec(file_pos_ref input_pos, const std::string &paramval,
        const std::string &servicename, const char * paramname, timespec &ts)
{
    decltype(ts.tv_sec) isec = 0;
    decltype(ts.tv_nsec) insec = 0;
    auto max_secs = std::numeric_limits<decltype(isec)>::max() / 10;
    auto len = paramval.length();
    decltype(len) i;
    for (i = 0; i < len; i++) {
        char ch = paramval[i];
        if (ch == '.' || ch == ',') {
            i++;
            break;
        }
        if (ch < '0' || ch > '9') {
            throw service_description_exc(servicename, std::string("bad value for ") + paramname, input_pos);
        }
        // check for overflow
        if (isec >= max_secs) {
           throw service_description_exc(servicename, std::string("too-large value for ") + paramname, input_pos);
        }
        isec *= 10;
        isec += ch - '0';
    }
    decltype(insec) insec_m = 100000000; // 10^8
    for ( ; i < len; i++) {
        char ch = paramval[i];
        if (ch < '0' || ch > '9') {
            throw service_description_exc(servicename, std::string("bad value for ") + paramname, input_pos);
        }
        insec += (ch - '0') * insec_m;
        insec_m /= 10;
    }
    ts.tv_sec = isec;
    ts.tv_nsec = insec;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movl %edi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
callq 0x33700
movl $0xa, %ecx
cqto
idivq %rcx
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5770
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x31f59
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x5540
movb (%rax), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x2e, %eax
je 0x31cac
movsbl -0x59(%rbp), %eax
cmpl $0x2c, %eax
jne 0x31cbd
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x31f59
movsbl -0x59(%rbp), %eax
cmpl $0x30, %eax
jl 0x31cd3
movsbl -0x59(%rbp), %eax
cmpl $0x39, %eax
jle 0x31df5
movb $0x1, -0xb5(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x170(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x5880
movq -0x160(%rbp), %rdx
leaq 0x893a(%rip), %rsi      # 0x3a651
leaq -0xa0(%rbp), %rdi
callq 0x13710
jmp 0x31d25
movq -0x28(%rbp), %rdx
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x16640
jmp 0x31d3b
movq -0x168(%rbp), %rsi
movq -0x170(%rbp), %rdi
leaq -0x80(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x31d58
movq -0x170(%rbp), %rdi
movb $0x0, -0xb5(%rbp)
leaq 0x1ee83(%rip), %rsi     # 0x50bf0
leaq -0x4024(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x3213c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x31dcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x31dc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5320
leaq -0xa0(%rbp), %rdi
callq 0x5320
leaq -0xa1(%rbp), %rdi
callq 0x5520
testb $0x1, -0xb5(%rbp)
jne 0x31de4
jmp 0x31df0
movq -0x170(%rbp), %rdi
callq 0x53a0
jmp 0x32130
movq -0x38(%rbp), %rax
cmpq -0x48(%rbp), %rax
jl 0x31f2e
movb $0x1, -0xfa(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x188(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x5880
movq -0x178(%rbp), %rdx
leaq 0x8819(%rip), %rsi      # 0x3a660
leaq -0xf8(%rbp), %rdi
callq 0x13710
jmp 0x31e55
movq -0x28(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x16640
jmp 0x31e6e
movq -0x180(%rbp), %rsi
movq -0x188(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x31e8e
movq -0x188(%rbp), %rdi
movb $0x0, -0xfa(%rbp)
leaq 0x1ed4d(%rip), %rsi     # 0x50bf0
leaq -0x415a(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x3213c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x31f06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x31efa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5320
leaq -0xf8(%rbp), %rdi
callq 0x5320
leaq -0xf9(%rbp), %rdi
callq 0x5520
testb $0x1, -0xfa(%rbp)
jne 0x31f1d
jmp 0x31f29
movq -0x188(%rbp), %rdi
callq 0x53a0
jmp 0x32130
imulq $0xa, -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movsbl -0x59(%rbp), %eax
subl $0x30, %eax
cltq
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x31c7a
movq $0x5f5e100, -0x108(%rbp) # imm = 0x5F5E100
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x32110
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x5540
movb (%rax), %al
movb %al, -0x109(%rbp)
movsbl -0x109(%rbp), %eax
cmpl $0x30, %eax
jl 0x31fa3
movsbl -0x109(%rbp), %eax
cmpl $0x39, %eax
jle 0x320cb
movb $0x1, -0x152(%rbp)
movl $0x70, %edi
callq 0x5220
movq %rax, -0x1a0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0x151(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x5880
movq -0x190(%rbp), %rdx
leaq 0x866a(%rip), %rsi      # 0x3a651
leaq -0x150(%rbp), %rdi
callq 0x13710
jmp 0x31ff5
movq -0x28(%rbp), %rdx
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x16640
jmp 0x3200e
movq -0x198(%rbp), %rsi
movq -0x1a0(%rbp), %rdi
leaq -0x130(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x2e2d0
jmp 0x3202e
movq -0x1a0(%rbp), %rdi
movb $0x0, -0x152(%rbp)
leaq 0x1ebad(%rip), %rsi     # 0x50bf0
leaq -0x42fa(%rip), %rdx     # 0x2dd50
callq 0x5840
jmp 0x3213c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x320a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x3209a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x5320
leaq -0x150(%rbp), %rdi
callq 0x5320
leaq -0x151(%rbp), %rdi
callq 0x5520
testb $0x1, -0x152(%rbp)
jne 0x320bd
jmp 0x320c9
movq -0x1a0(%rbp), %rdi
callq 0x53a0
jmp 0x32130
movsbl -0x109(%rbp), %eax
subl $0x30, %eax
cltq
imulq -0x108(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x108(%rbp), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movq %rax, -0x108(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x31f64
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x5870
nopl (%rax)