// File: /workspace/github_cpp_makefile_star2_O3/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 0xb495(%rip), %rsi      # 0x10299
callq 0x2360
movq %rax, %r14
leaq -0xb8(%rbp), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
xorl %eax, %eax
movq %rax, 0x40(%rcx)
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, (%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movl $0x0, 0x18(%rcx)
testq %r14, %r14
je 0x5067
leaq -0x38(%rbp), %rbx
movl $0x1, %r12d
leaq -0x70(%rbp), %r15
leaq -0xc8(%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 0x4f21
cmpl $0x1, %ecx
jne 0x4f83
incl %eax
movl %eax, -0x9c(%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 0xcc8c
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 0x509d
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
leaq -0xc8(%rbp), %r13
jb 0x5091
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x5091
testl %ecx, %ecx
jne 0x4f12
movl %r15d, (%r14)
movq %r13, %rdi
movl %eax, %esi
callq 0x370e
jmp 0x5020
movq %rbx, -0x48(%rbp)
movq %r14, %rdi
callq 0x2110
leaq (%rax,%r14), %rdx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0xcc8c
leaq -0x60(%rbp), %r14
movq %r14, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x37e4
movq %r13, %rdi
movq %r15, %rsi
callq 0x3704
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x4f71
callq 0x2250
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x502d
jmp 0x5032
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 0xcc8c
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 0x5085
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
leaq -0xc8(%rbp), %r13
jb 0x5079
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x5079
testl %ecx, %ecx
jne 0x5007
movl %r15d, (%r14)
movq %r13, %rdi
movl %eax, %esi
callq 0x3718
leaq 0x10818(%rip), %rdi     # 0x15830
movq %r13, %rsi
callq 0xa528
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x70(%rbp), %r15
je 0x5032
callq 0x2250
xorl %edi, %edi
leaq 0xb25e(%rip), %rsi      # 0x10299
callq 0x2360
movq %rax, %r14
incl %r12d
testq %rax, %rax
jne 0x4e58
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x5067
callq 0x2250
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb000(%rip), %rdi      # 0x10080
callq 0x2320
leaq 0xaff4(%rip), %rdi      # 0x10080
callq 0x2170
leaq 0xafe8(%rip), %rdi      # 0x10080
callq 0x2320
leaq 0xafdc(%rip), %rdi      # 0x10080
callq 0x2170
jmp 0x50cb
jmp 0x50cb
movq %rax, %r12
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x50de
callq 0x2250
jmp 0x50de
jmp 0x50c6
jmp 0x50c6
jmp 0x50cb
movq %rax, %r12
jmp 0x50de
movq %rax, %r12
jmp 0x50ec
jmp 0x50d2
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x50de
movl %r15d, (%r14)
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0x50ec
callq 0x2250
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x5104
callq 0x2250
movq %r12, %rdi
callq 0x23e0