// File: /workspace/github_cpp_makefile_star2_O3/MUST-Quick-Fry[P]Process-Scheduler/scheduler.cpp
// Function: Project::Scheduler::driveSJF2()
void Scheduler::driveSJF2(){

    // create a schedule
    queue<Job> pq_arr; 
    priority_queue<Job,vector<Job>,greater<Job> > wait_q; 
    int len = get_job_num();

    // clear -1
    for(int i = 0; i < len; ++i){
        if(job_queue[i].get_dur_time()==-1){ 
            int t = 0;
            find_dur_time(job_queue[i], t);
            //cout << t << endl;
            job_queue[i].set_dur_time(t);
        }
    }
         
    sort(job_queue.begin(), job_queue.end(), [](const Job &a, const Job &b)->bool
    {   if(a.get_arr_time() == b.get_arr_time()){return a.get_dur_time() < b.get_dur_time();}
        else{return a.get_arr_time() < b.get_arr_time();}
    });
         
    for(int i = 0; i < len; ++i){
        pq_arr.emplace(job_queue[i]);  
    }
       
      
    int time = 0;
    Job con;
    con.ID = 0;
    unordered_map<int, int> jobmap;
    Job lastjob = con;
    
    while(true){                                          
        while(!pq_arr.empty() && time == pq_arr.front().get_arr_time()){
            Job tmp = pq_arr.front();
            pq_arr.pop(); 
            
            if(!wait_q.empty() && tmp.get_dur_time() < wait_q.top().get_dur_time() && wait_q.top().ID == lastjob.ID)
                wait_q.pop();
            wait_q.emplace(tmp);         
        }
        
   
        if(!wait_q.empty()){
            
            Job it = wait_q.top();
            wait_q.pop();
            
            if(lastjob.ID == it.ID || lastjob.ID == 0){
            
                if(jobmap[it.ID] == 0){
                    scheduler.emplace(it);
                    jobmap[it.ID] = 1;
                }
            
                it.has_exp_time++;
                it.set_dur_time(it.get_dur_time()-1);
                           
                if(it.get_dur_time() == 0){
                    scheduler.back().set_dur_time(it.has_exp_time);
                    scheduler.back().service_time_left = 2;
                    //cout << scheduler.back().ID << " arr " << scheduler.back().get_arr_time() << " dur "<< scheduler.back().get_dur_time()<< endl;
                    jobmap[it.ID] = 0;
                    lastjob = con;
                }
                else{ 
                    if(wait_q.empty() || it.get_dur_time() < wait_q.top().get_dur_time())
                        wait_q.emplace(it); 
                        
                    lastjob = it;
                }
                
            }
            else{
                scheduler.back().set_dur_time(lastjob.has_exp_time);
                //cout << scheduler.back().ID << " arr " << scheduler.back().get_arr_time() << " dur "<< scheduler.back().get_dur_time()<< endl;
                jobmap[lastjob.ID] = 0;
                lastjob.has_exp_time = 0;
                lastjob.set_arr_time(time);
                wait_q.emplace(lastjob);
                
             
                if(jobmap[it.ID] == 0){
                    scheduler.emplace(it);
                    jobmap[it.ID] = 1;
                }
            
                it.has_exp_time++;
                it.set_dur_time(it.get_dur_time()-1);
                
                
                if(it.get_dur_time() == 0){
                    scheduler.back().set_dur_time(it.has_exp_time);
                    scheduler.back().service_time_left = 2;
                    //cout << scheduler.back().ID << " arr " << scheduler.back().get_arr_time() << " dur "<< scheduler.back().get_dur_time()<< endl;
                    jobmap[it.ID] = 0;
                    lastjob = con;
                }
                else{ 
                    if(wait_q.empty() || it.get_dur_time() < wait_q.top().get_dur_time())
                        wait_q.emplace(it); 
                        
                    lastjob = it;
                }            
                
            }
                
                
        }
        
        time++;
        //cout << "now is " << time << " " << wait_q.size() << endl;
        if(wait_q.empty() && pq_arr.empty()){break;}    
    }
    
       
    // copy
    set_total_time(time);
    real_job_queue = scheduler;
    cout << endl;
    cout << endl;
    cout << endl;
    
    // execute
    cout << "==================================================="<< endl;
    cout << "Now start the Scheduler !!!"<< endl;
    cout << "==================================================="<< endl;
    
    int realtime = 0;
    int pid = 1;
   
    while(!stop_flag){
     
        cout << "now time: " << realtime << " s" << endl;    
        
        while(!scheduler.empty() && realtime >= scheduler.front().get_arr_time()){
            auto it = scheduler.front();
            scheduler.pop();
                        
            if(monitor_map[it.ID]==0){
                pid = fork();
                if(pid == 0){
                    Monitor* monitor = new Monitor(it);                       
                    cout << "Terminate the Parent Process: " << getpid() <<endl;     
                    
                    //kill(getpid(), SIGKILL);
                    exit(0);
  
                }
                else{ 
                    monitor_map[it.ID]=pid;
                }
            }
            
            
            if(pid !=0){     
                                           
                     if(allow_preem){                 
                         allow_preem = false;                                  
                         this_job = it;
                         
                         kill(monitor_map[it.ID], SIGCONT);
                         signal(SIGALRM, signal_preemSJF);
                         alarm(it.get_dur_time());
 
                     }
                     else{
                         wait_queue.emplace(it);
                         kill(monitor_map[it.ID], SIGTSTP);
                         std::cout<<"Child Process Suspend" << std::endl;
                     }
                 
             }
        }
        
        
        if(pid!=0){       
             sleep(1); 
             realtime++;
                          
        }
                        
    }
    
    if(pid !=0){ 
        cout << "now time: " << realtime << " s" << endl;       
        sleep(2);
        cout << endl;
        cout << endl;
        
        // draw Gantt diagram
        Display(real_job_queue);

    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x1a0(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x356c
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq %rbx, -0xb8(%rbp)
movslq 0x58(%rbx), %rax
movq %rax, -0xb0(%rbp)
testq %rax, %rax
jle 0x65f4
leaq -0x298(%rbp), %r15
imulq $0x58, -0xb0(%rbp), %r13
xorl %r12d, %r12d
leaq -0x2a8(%rbp), %rbx
movq 0xf2e5(%rip), %rdi      # 0x15830
addq %r12, %rdi
callq 0x3762
cmpl $-0x1, %eax
jne 0x65e7
movl $0x0, -0x1f8(%rbp)
movq 0xf2c3(%rip), %r14      # 0x15830
movq %r15, -0x2a8(%rbp)
movq (%r14,%r12), %rsi
movq 0x8(%r14,%r12), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x37e4
movq 0x4e(%r14,%r12), %rax
movq %rax, 0x3e(%r15)
movups 0x20(%r14,%r12), %xmm0
movups 0x30(%r14,%r12), %xmm1
movups 0x40(%r14,%r12), %xmm2
movups %xmm2, 0x30(%r15)
movups %xmm1, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movq %rbx, %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x51d6
movq -0x2a8(%rbp), %rdi
cmpq %r15, %rdi
je 0x65d2
callq 0x2250
movq 0xf257(%rip), %rdi      # 0x15830
addq %r12, %rdi
movl -0x1f8(%rbp), %esi
callq 0x3718
addq $0x58, %r12
cmpq %r12, %r13
jne 0x6544
movq 0xf235(%rip), %r14      # 0x15830
movq 0xf236(%rip), %rbx      # 0x15838
cmpq %rbx, %r14
movq -0xb0(%rbp), %r12
je 0x667a
movq %rbx, %r15
subq %r14, %r15
movq %r15, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x95c4
cmpq $0x581, %r15            # imm = 0x581
jl 0x666f
leaq 0x580(%r14), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xa19e
cmpq %rbx, %r15
je 0x667a
movq %r15, %rdi
callq 0xa35d
addq $0x58, %r15
jmp 0x665c
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa19e
testl %r12d, %r12d
jle 0x66a8
imulq $0x58, %r12, %r14
xorl %r15d, %r15d
leaq -0x1a0(%rbp), %rbx
movq 0xf19c(%rip), %rsi      # 0x15830
addq %r15, %rsi
movq %rbx, %rdi
callq 0xe7e0
addq $0x58, %r15
cmpq %r15, %r14
jne 0x668d
leaq -0x1e8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
xorl %eax, %eax
movq %rax, -0x8(%rdx)
movb $0x0, (%rdx)
movq %rax, 0x18(%rdx)
leaq -0x118(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x110(%rbp), %rdi
movq %rdx, %rsi
callq 0x37e4
leaq -0xf0(%rbp), %rcx
leaq -0x1d8(%rbp), %rdx
movq 0x2e(%rdx), %rax
movq %rax, 0x2e(%rcx)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups %xmm2, 0x20(%rcx)
movups %xmm1, 0x10(%rcx)
movups %xmm0, (%rcx)
leaq -0x88(%rbp), %r15
leaq -0xa8(%rbp), %r13
leaq -0x50(%rbp), %rbx
xorl %r12d, %r12d
movq -0x190(%rbp), %rdi
cmpq %rdi, -0x170(%rbp)
je 0x682d
callq 0x3758
cmpl %eax, %r12d
jne 0x682d
movq -0x190(%rbp), %r14
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x37e4
movq 0x4e(%r14), %rax
movq %rax, 0x2e(%r15)
movups 0x20(%r14), %xmm0
movups 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
leaq -0x1a0(%rbp), %rdi
callq 0xcdea
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x67f4
movq %r13, %rdi
callq 0x3762
movl %eax, %r14d
movq -0x50(%rbp), %rdi
callq 0x3762
cmpl %eax, %r14d
jge 0x67f4
movq -0x50(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0xe4(%rbp), %eax
jne 0x67f4
movq %rbx, %rdi
callq 0xa62c
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa5aa
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xee0b
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6740
callq 0x2250
jmp 0x6740
movq -0x50(%rbp), %r14
cmpq -0x48(%rbp), %r14
je 0x69a1
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x37e4
movq 0x4e(%r14), %rax
movq %rax, 0x2e(%r15)
movups 0x20(%r14), %xmm0
movups 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %rbx, %rdi
callq 0xa62c
movl -0xe4(%rbp), %eax
testl %eax, %eax
je 0x69a9
cmpl -0x7c(%rbp), %eax
je 0x69a9
movq 0xefd2(%rip), %rdi      # 0x15878
cmpq 0xefd3(%rip), %rdi      # 0x15880
jne 0x68c2
movq 0xefda(%rip), %rax      # 0x15890
movq -0x8(%rax), %rdi
movl $0x1b8, %eax            # imm = 0x1B8
addq %rax, %rdi
addq $-0x58, %rdi
movl -0xdc(%rbp), %esi
callq 0x3718
leaq -0x148(%rbp), %rdi
leaq -0xe4(%rbp), %rsi
callq 0xcd2a
xorl %ecx, %ecx
movl %ecx, (%rax)
movl %ecx, -0xdc(%rbp)
leaq -0x110(%rbp), %rdi
movl %r12d, %esi
callq 0x370e
movq %rbx, %rdi
leaq -0x110(%rbp), %rsi
callq 0xa5aa
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xee0b
leaq -0x148(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
cmpl $0x0, (%rax)
jne 0x6953
leaq 0xef13(%rip), %rdi      # 0x15848
movq %r13, %rsi
callq 0xe7e0
leaq -0x148(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl $0x1, (%rax)
incl -0x74(%rbp)
movq %r13, %rdi
callq 0x3762
decl %eax
movq %r13, %rdi
movl %eax, %esi
callq 0x3718
movq %r13, %rdi
callq 0x3762
testl %eax, %eax
je 0x6a89
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x6a29
movq %r13, %rdi
callq 0x3762
movl %eax, %r14d
movq -0x50(%rbp), %rdi
callq 0x3762
jmp 0x6a24
incl %r12d
jmp 0x6b60
leaq -0x148(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
cmpl $0x0, (%rax)
jne 0x69e3
leaq 0xee83(%rip), %rdi      # 0x15848
movq %r13, %rsi
callq 0xe7e0
leaq -0x148(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl $0x1, (%rax)
incl -0x74(%rbp)
movq %r13, %rdi
callq 0x3762
decl %eax
movq %r13, %rdi
movl %eax, %esi
callq 0x3718
movq %r13, %rdi
callq 0x3762
testl %eax, %eax
je 0x6a58
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x6a29
movq %r13, %rdi
callq 0x3762
movl %eax, %r14d
movq -0x50(%rbp), %rdi
callq 0x3762
cmpl %eax, %r14d
jge 0x6a41
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa5aa
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xee0b
leaq -0x110(%rbp), %rdi
movq %r13, %rsi
callq 0x2150
movq %r15, %rax
jmp 0x6b12
movq 0xee19(%rip), %rdi      # 0x15878
cmpq 0xee1a(%rip), %rdi      # 0x15880
jne 0x6a7b
movq 0xee21(%rip), %rax      # 0x15890
movq -0x8(%rax), %rdi
movl $0x1b8, %eax            # imm = 0x1B8
addq %rax, %rdi
addq $-0x58, %rdi
movl -0x74(%rbp), %esi
callq 0x3718
jmp 0x6ab8
movq 0xede8(%rip), %rdi      # 0x15878
cmpq 0xede9(%rip), %rdi      # 0x15880
jne 0x6aac
movq 0xedf0(%rip), %rax      # 0x15890
movq -0x8(%rax), %rdi
movl $0x1b8, %eax            # imm = 0x1B8
addq %rax, %rdi
addq $-0x58, %rdi
movl -0x74(%rbp), %esi
callq 0x3718
movq 0xedb9(%rip), %rax      # 0x15878
cmpq 0xedba(%rip), %rax      # 0x15880
jne 0x6adb
movq 0xedc1(%rip), %rax      # 0x15890
movq -0x8(%rax), %rax
movl $0x1b8, %ecx            # imm = 0x1B8
addq %rcx, %rax
movl $0x2, -0x28(%rax)
leaq -0x148(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl $0x0, (%rax)
leaq -0x110(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x2150
leaq -0x1d8(%rbp), %rax
movq 0x2e(%rax), %rcx
leaq -0xf0(%rbp), %rdx
movq %rcx, 0x2e(%rdx)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6b4f
callq 0x2250
movq -0x50(%rbp), %rax
incl %r12d
cmpq -0x48(%rbp), %rax
jne 0x6740
movq -0x170(%rbp), %rax
cmpq -0x190(%rbp), %rax
jne 0x6740
movq -0xb8(%rbp), %rax
movl %r12d, 0x5c(%rax)
leaq 0xed62(%rip), %rdi      # 0x158e8
leaq 0xecbb(%rip), %rsi      # 0x15848
callq 0xa71e
movq 0xe42f(%rip), %rdi      # 0x14fc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe414(%rip), %rbx      # 0x14fc8
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe3e6(%rip), %rbx      # 0x14fc8
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe3b8(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq 0xe3a4(%rip), %rbx      # 0x14fc8
leaq 0x9715(%rip), %rsi      # 0x10340
movl $0x33, %edx
movq %rbx, %rdi
callq 0x22a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe372(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq 0xe35e(%rip), %rbx      # 0x14fc8
leaq 0x963b(%rip), %rsi      # 0x102ac
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x22a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe32c(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq 0xe318(%rip), %rbx      # 0x14fc8
leaq 0x9689(%rip), %rsi      # 0x10340
movl $0x33, %edx
movq %rbx, %rdi
callq 0x22a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe2e6(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
xorl %ebx, %ebx
cmpb $0x0, 0xecb0(%rip)      # 0x159a8
jne 0x6f54
leaq -0x88(%rbp), %r15
xorl %ebx, %ebx
leaq -0xa8(%rbp), %r12
leaq 0xec5b(%rip), %r13      # 0x15970
movl $0xa, %edx
movq 0xe2a7(%rip), %rdi      # 0x14fc8
leaq 0x95a0(%rip), %rsi      # 0x102c8
callq 0x22a0
movq 0xe294(%rip), %rdi      # 0x14fc8
movl %ebx, %esi
callq 0x23d0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x9586(%rip), %rsi      # 0x102d3
callq 0x22a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq 0xead8(%rip), %rdi      # 0x15858
cmpq %rdi, 0xeaf1(%rip)      # 0x15878
je 0x6f3b
callq 0x3758
cmpl %eax, %ebx
jl 0x6f3b
movq 0xeab7(%rip), %r14      # 0x15858
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x37e4
movq 0x4e(%r14), %rax
movq %rax, 0x2e(%r15)
movups 0x20(%r14), %xmm0
movups 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
leaq 0xea5b(%rip), %rdi      # 0x15848
callq 0xcdea
movq %r13, %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
cmpl $0x0, (%rax)
jne 0x6e22
callq 0x20a0
testl %eax, %eax
je 0x70b3
movl %eax, %r14d
movq %r13, %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl %r14d, (%rax)
cmpb $0x0, 0xeb80(%rip)      # 0x159a9
je 0x6e9e
leaq 0xea66(%rip), %rdi      # 0x15898
movq %r12, %rsi
callq 0xe7e0
movq %r13, %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl (%rax), %edi
movl $0x14, %esi
callq 0x2310
movl $0x15, %edx
movq 0xe16a(%rip), %rdi      # 0x14fc8
leaq 0x9490(%rip), %rsi      # 0x102f5
callq 0x22a0
movq 0xe157(%rip), %rcx      # 0x14fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xe139(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
jmp 0x6f1a
movb $0x1, 0xeb04(%rip)      # 0x159a9
leaq 0xe92c(%rip), %rdi      # 0x157d8
movq %r12, %rsi
callq 0x2150
movq 0x2e(%r15), %rax
movq %rax, 0xe967(%rip)      # 0x15826
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0xe944(%rip)     # 0x15818
movups %xmm1, 0xe92d(%rip)     # 0x15808
movups %xmm0, 0xe916(%rip)     # 0x157f8
movq %r13, %rdi
leaq -0x7c(%rbp), %rsi
callq 0xcd2a
movl (%rax), %edi
movl $0x12, %esi
callq 0x2310
movl $0xe, %edi
leaq 0x1644(%rip), %rsi      # 0x854a
callq 0x22b0
movq %r12, %rdi
callq 0x3762
movl %eax, %edi
callq 0x2410
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6d79
callq 0x2250
jmp 0x6d79
movl $0x1, %edi
callq 0x21f0
incl %ebx
cmpb $0x1, 0xea5a(%rip)      # 0x159a8
jne 0x6d15
movq 0xe06d(%rip), %rdi      # 0x14fc8
leaq 0x9366(%rip), %rsi      # 0x102c8
movl $0xa, %edx
callq 0x22a0
movq 0xe055(%rip), %r14      # 0x14fc8
movq %r14, %rdi
movl %ebx, %esi
callq 0x23d0
movq %rax, %rbx
leaq 0x934c(%rip), %rsi      # 0x102d3
movl $0x2, %edx
movq %rax, %rdi
callq 0x22a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
movl $0x2, %edi
callq 0x21f0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xdfe5(%rip), %rbx      # 0x14fc8
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2260
movsbl %al, %esi
movq 0xdfb7(%rip), %rdi      # 0x14fc8
callq 0x2040
movq %rax, %rdi
callq 0x2190
leaq 0xe8c3(%rip), %rsi      # 0x158e8
leaq -0x2f8(%rbp), %rdi
callq 0xcbaa
leaq -0x2f8(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x7e6e
leaq -0x2f8(%rbp), %rdi
callq 0x3378
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x7068
callq 0x2250
leaq -0x148(%rbp), %rdi
callq 0x34f6
movq -0x1f8(%rbp), %rdi
leaq -0x1e8(%rbp), %rax
cmpq %rax, %rdi
je 0x708c
callq 0x2250
leaq -0x50(%rbp), %rdi
callq 0x32fe
leaq -0x1a0(%rbp), %rdi
callq 0x3378
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xd0, %edi
callq 0x2280
movq %rax, %r14
leaq -0x240(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x250(%rbp), %rdi
callq 0x37e4
movq 0x2e(%r15), %rax
leaq -0x250(%rbp), %rsi
movq %rax, 0x4e(%rsi)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x40(%rsi)
movups %xmm1, 0x30(%rsi)
movups %xmm0, 0x20(%rsi)
movq %r14, %rdi
callq 0x3a72
movq -0x250(%rbp), %rdi
cmpq %r12, %rdi
je 0x712b
callq 0x2250
movq 0xde96(%rip), %rdi      # 0x14fc8
leaq 0x919d(%rip), %rsi      # 0x102d6
movl $0x1e, %edx
callq 0x22a0
callq 0x2340
movq 0xde79(%rip), %rdi      # 0x14fc8
movl %eax, %esi
callq 0x23d0
movq %rax, %rdi
callq 0x2120
xorl %edi, %edi
callq 0x22c0
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x3378
jmp 0x71fd
movq %rax, %rbx
jmp 0x7215
jmp 0x71c6
jmp 0x71c6
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r12, %rdi
je 0x71b8
callq 0x2250
jmp 0x71b8
movq %rax, %rbx
movq -0x2a8(%rbp), %rdi
cmpq %r15, %rdi
jne 0x7234
jmp 0x7239
jmp 0x71db
movq %rax, %rbx
movq %r14, %rdi
callq 0x2250
jmp 0x71e5
jmp 0x71c6
jmp 0x71c6
movq %rax, %rbx
jmp 0x7239
jmp 0x71db
jmp 0x71db
jmp 0x71e2
jmp 0x71db
jmp 0x71db
jmp 0x71db
jmp 0x71e2
jmp 0x71db
movq %rax, %rbx
jmp 0x71fd
jmp 0x71e2
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x71fd
callq 0x2250
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x7215
callq 0x2250
leaq -0x148(%rbp), %rdi
callq 0x34f6
movq -0x1f8(%rbp), %rdi
leaq -0x1e8(%rbp), %rax
cmpq %rax, %rdi
je 0x7239
callq 0x2250
leaq -0x50(%rbp), %rdi
callq 0x32fe
leaq -0x1a0(%rbp), %rdi
callq 0x3378
movq %rbx, %rdi
callq 0x23e0