// File: /workspace/github_cpp_makefile_star2_O1/MUST-Quick-Fry[P]Process-Scheduler/scheduler.cpp
// Function: Project::Scheduler::splitToken(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Scheduler::splitToken(string str)
{
    int cnt = 0;
    char *strBuf = const_cast<char *>(str.c_str());

    char *token = strtok(strBuf, "\t\n");
    Job job = Job();
    while (token != NULL)
    {
        cnt++;
        if (cnt % 3 == 1)
        {
            job.ID = 1 + cnt/3; // assign job id
            Utils::arg_check(token);
            string buf(token);
            job.set_arr_time(stoi(buf));
        }
        else if (cnt % 3 == 2)
        {
            string buf(token);
            job.set_cmd(buf);
        }
        else
        {
            Utils::arg_check(token);
            string buf(token);
            job.set_dur_time(stoi(buf));
            job_queue.push_back(job);
        }
        token = strtok(NULL, "\t\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq (%rsi), %rdi
leaq 0xb459(%rip), %rsi      # 0x10299
callq 0x2360
movq %rax, %r14
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rcx
movaps %xmm0, -0x10(%rcx)
movaps %xmm0, (%rcx)
movaps %xmm0, 0x10(%rcx)
xorl %eax, %eax
movq %rax, 0x40(%rcx)
movaps %xmm0, 0x30(%rcx)
movaps %xmm0, 0x20(%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movl $0x0, 0x18(%rcx)
testq %r14, %r14
je 0x5092
leaq -0x38(%rbp), %rbx
movl $0x1, %r12d
leaq -0x70(%rbp), %r15
leaq -0xd0(%rbp), %r13
movl %r12d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %edx
movl %r12d, %ecx
subl %edx, %ecx
cmpl $0x2, %ecx
je 0x4f64
cmpl $0x1, %ecx
jne 0x4fc6
incl %eax
movl %eax, -0xa4(%rbp)
movq %r14, %rdi
callq 0x31b7
movq %rbx, -0x48(%rbp)
movq %r14, %rdi
callq 0x2110
leaq (%rax,%r14), %rdx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0xcd16
movq -0x48(%rbp), %r13
callq 0x2050
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
movl $0xa, %edx
callq 0x2300
cmpq %r13, -0x50(%rbp)
je 0x50e0
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
leaq -0xd0(%rbp), %r13
jb 0x50d4
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x50d4
testl %ecx, %ecx
jne 0x4f55
movl %r15d, (%r14)
movq %r13, %rdi
movl %eax, %esi
callq 0x36f2
jmp 0x5063
movq %rbx, -0x48(%rbp)
movq %r14, %rdi
callq 0x2110
leaq (%rax,%r14), %rdx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0xcd16
leaq -0x60(%rbp), %r14
movq %r14, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x37c8
movq %r13, %rdi
movq %r15, %rsi
callq 0x36e8
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x4fb4
callq 0x2250
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x5070
jmp 0x5075
movq %r14, %rdi
callq 0x31b7
movq %rbx, -0x48(%rbp)
movq %r14, %rdi
callq 0x2110
leaq (%rax,%r14), %rdx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0xcd16
movq -0x48(%rbp), %r13
callq 0x2050
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
movl $0xa, %edx
callq 0x2300
cmpq %r13, -0x50(%rbp)
je 0x50c8
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
leaq -0xd0(%rbp), %r13
jb 0x50bc
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x50bc
testl %ecx, %ecx
jne 0x504a
movl %r15d, (%r14)
movq %r13, %rdi
movl %eax, %esi
callq 0x36fc
leaq 0x107d5(%rip), %rdi     # 0x15830
movq %r13, %rsi
callq 0xa5d4
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x70(%rbp), %r15
je 0x5075
callq 0x2250
xorl %edi, %edi
leaq 0xb21b(%rip), %rsi      # 0x10299
callq 0x2360
movq %rax, %r14
incl %r12d
testq %rax, %rax
jne 0x4e9b
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x50aa
callq 0x2250
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xafbd(%rip), %rdi      # 0x10080
callq 0x2320
leaq 0xafb1(%rip), %rdi      # 0x10080
callq 0x2170
leaq 0xafa5(%rip), %rdi      # 0x10080
callq 0x2320
leaq 0xaf99(%rip), %rdi      # 0x10080
callq 0x2170
jmp 0x510e
jmp 0x510e
movq %rax, %r12
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x5121
callq 0x2250
jmp 0x5121
jmp 0x5109
jmp 0x5109
jmp 0x510e
movq %rax, %r12
jmp 0x5121
movq %rax, %r12
jmp 0x512f
jmp 0x5115
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x5121
movl %r15d, (%r14)
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0x512f
callq 0x2250
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x5147
callq 0x2250
movq %r12, %rdi
callq 0x23e0
nop