// File: MUST-Quick-Fry[P]Process-Scheduler/scheduler.cpp
// Function: Project::Scheduler::driveRR()
void Scheduler::driveRR(){
    
    // create a schedule
    queue<Job> pq_arr;
    queue<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());
     
    for(int i = 0; i < len; ++i){
        pq_arr.emplace(job_queue[i]);  
    }
       
    int time = 0;
    int wait_for_empty = 0;
   
    while(true){
                                 
        while(!pq_arr.empty() && time == pq_arr.front().get_arr_time()){
            Job tmp = pq_arr.front();
            pq_arr.pop(); 
                
            if(tmp.get_dur_time() > QUANT){
                tmp.service_time_left = tmp.get_dur_time();
                scheduler.emplace(tmp);
                scheduler.back().set_dur_time(QUANT);
                tmp.set_dur_time(tmp.get_dur_time()-QUANT);
                wait_q.emplace(tmp);
                wait_for_empty += QUANT;
            }
            else{
                tmp.service_time_left = tmp.get_dur_time();
                scheduler.emplace(tmp);
                wait_for_empty += tmp.get_dur_time();
            }
                 
        }
        
        if(wait_for_empty == 0){
            if(wait_q.empty()){;}
            else{
                Job tmp2 = wait_q.front();
                wait_q.pop();
                tmp2.set_arr_time(time);
                if(tmp2.get_dur_time() > QUANT){
                    tmp2.service_time_left = tmp2.get_dur_time();
                    scheduler.emplace(tmp2);
                    scheduler.back().set_dur_time(QUANT);
                    tmp2.set_dur_time(tmp2.get_dur_time()-QUANT);
                    wait_q.emplace(tmp2);
                    wait_for_empty += QUANT;
                }
                else{
                    tmp2.service_time_left = tmp2.get_dur_time();
                    scheduler.emplace(tmp2);
                    wait_for_empty += tmp2.get_dur_time();
                }
            }
        }
        
        time++;
        if(wait_for_empty > 0){wait_for_empty--;}
        
        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_RR);
                         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
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x308(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4230
leaq -0xa8(%rbp), %rdi
callq 0x4230
jmp 0xb721
movq -0x308(%rbp), %rdi
callq 0x86a0
movl %eax, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0xb863
movslq -0xbc(%rbp), %rsi
leaq 0x18123(%rip), %rdi     # 0x23880
callq 0xf730
movq %rax, %rdi
callq 0x5b30
movl %eax, -0x30c(%rbp)
jmp 0xb772
movl -0x30c(%rbp), %eax
cmpl $-0x1, %eax
jne 0xb84d
movl $0x0, -0xc0(%rbp)
movslq -0xbc(%rbp), %rsi
leaq 0x180e7(%rip), %rdi     # 0x23880
callq 0xf730
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x5c00
jmp 0xb7af
movq -0x308(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x9240
jmp 0xb7cb
leaq -0x118(%rbp), %rdi
callq 0x4190
movslq -0xbc(%rbp), %rsi
leaq 0x1809b(%rip), %rdi     # 0x23880
callq 0xf730
movq %rax, %rdi
movl -0xc0(%rbp), %esi
callq 0x5aa0
jmp 0xb7fa
jmp 0xb84d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xc3da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xc3ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4190
jmp 0xc3ce
jmp 0xb84f
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0xb73d
leaq 0x18016(%rip), %rdi     # 0x23880
movq %rdi, -0x318(%rbp)
callq 0xf800
movq -0x318(%rbp), %rdi
movq %rax, -0x120(%rbp)
callq 0xf830
movq %rax, -0x128(%rbp)
movq -0x120(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0xf7c0
jmp 0xb8a5
movl $0x0, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0xb8f1
movslq -0x12c(%rbp), %rsi
leaq 0x17fb5(%rip), %rdi     # 0x23880
callq 0xf730
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0xf860
jmp 0xb8de
jmp 0xb8e0
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0xb8af
movl $0x0, -0x130(%rbp)
movl $0x0, -0x134(%rbp)
jmp 0xb907
jmp 0xb909
leaq -0x58(%rbp), %rdi
callq 0xf8c0
movb %al, -0x319(%rbp)
jmp 0xb91a
movb -0x319(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x31a(%rbp)
jne 0xb978
jmp 0xb92f
movl -0x130(%rbp), %eax
movl %eax, -0x32c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xf8e0
movq %rax, -0x328(%rbp)
jmp 0xb94d
movq -0x328(%rbp), %rdi
callq 0x5b10
movl %eax, -0x330(%rbp)
jmp 0xb961
movl -0x32c(%rbp), %eax
movl -0x330(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x31a(%rbp)
movb -0x31a(%rbp), %al
testb $0x1, %al
jne 0xb987
jmp 0xbb25
leaq -0x58(%rbp), %rdi
callq 0xf8e0
movq %rax, -0x338(%rbp)
jmp 0xb999
movq -0x338(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x5c00
jmp 0xb9ae
leaq -0x58(%rbp), %rdi
callq 0xf900
jmp 0xb9b9
leaq -0x190(%rbp), %rdi
callq 0x5b30
movl %eax, -0x33c(%rbp)
jmp 0xb9cd
movl -0x33c(%rbp), %eax
cmpl 0x178b3(%rip), %eax     # 0x2328c
jle 0xbab9
leaq -0x190(%rbp), %rdi
callq 0x5b30
movl %eax, -0x340(%rbp)
jmp 0xb9f3
movl -0x340(%rbp), %eax
movl %eax, -0x160(%rbp)
leaq 0x17e92(%rip), %rdi     # 0x23898
leaq -0x190(%rbp), %rsi
callq 0xf860
jmp 0xba14
leaq 0x17e7d(%rip), %rdi     # 0x23898
callq 0xfb00
movq %rax, -0x348(%rbp)
jmp 0xba29
movq -0x348(%rbp), %rdi
movl 0x17856(%rip), %esi     # 0x2328c
callq 0x5aa0
jmp 0xba3d
leaq -0x190(%rbp), %rdi
callq 0x5b30
movl %eax, -0x34c(%rbp)
jmp 0xba51
movl -0x34c(%rbp), %esi
movl 0x1782f(%rip), %eax     # 0x2328c
subl %eax, %esi
leaq -0x190(%rbp), %rdi
callq 0x5aa0
jmp 0xba6d
leaq -0xa8(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xf860
jmp 0xba82
movl 0x17804(%rip), %eax     # 0x2328c
addl -0x134(%rbp), %eax
movl %eax, -0x134(%rbp)
jmp 0xbb14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4190
jmp 0xc3ce
leaq -0x190(%rbp), %rdi
callq 0x5b30
movl %eax, -0x350(%rbp)
jmp 0xbacd
movl -0x350(%rbp), %eax
movl %eax, -0x160(%rbp)
leaq 0x17db8(%rip), %rdi     # 0x23898
leaq -0x190(%rbp), %rsi
callq 0xf860
jmp 0xbaee
leaq -0x190(%rbp), %rdi
callq 0x5b30
movl %eax, -0x354(%rbp)
jmp 0xbb02
movl -0x354(%rbp), %eax
addl -0x134(%rbp), %eax
movl %eax, -0x134(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4190
jmp 0xb909
cmpl $0x0, -0x134(%rbp)
jne 0xbd0c
leaq -0xa8(%rbp), %rdi
callq 0xf8c0
movb %al, -0x355(%rbp)
jmp 0xbb46
movb -0x355(%rbp), %al
testb $0x1, %al
jne 0xbb52
jmp 0xbb57
jmp 0xbd0a
leaq -0xa8(%rbp), %rdi
callq 0xf8e0
movq %rax, -0x360(%rbp)
jmp 0xbb6c
movq -0x360(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x5c00
jmp 0xbb81
leaq -0xa8(%rbp), %rdi
callq 0xf900
jmp 0xbb8f
movl -0x130(%rbp), %esi
leaq -0x1e8(%rbp), %rdi
callq 0x5a80
jmp 0xbba3
leaq -0x1e8(%rbp), %rdi
callq 0x5b30
movl %eax, -0x364(%rbp)
jmp 0xbbb7
movl -0x364(%rbp), %eax
cmpl 0x176c9(%rip), %eax     # 0x2328c
jle 0xbca3
leaq -0x1e8(%rbp), %rdi
callq 0x5b30
movl %eax, -0x368(%rbp)
jmp 0xbbdd
movl -0x368(%rbp), %eax
movl %eax, -0x1b8(%rbp)
leaq 0x17ca8(%rip), %rdi     # 0x23898
leaq -0x1e8(%rbp), %rsi
callq 0xf860
jmp 0xbbfe
leaq 0x17c93(%rip), %rdi     # 0x23898
callq 0xfb00
movq %rax, -0x370(%rbp)
jmp 0xbc13
movq -0x370(%rbp), %rdi
movl 0x1766c(%rip), %esi     # 0x2328c
callq 0x5aa0
jmp 0xbc27
leaq -0x1e8(%rbp), %rdi
callq 0x5b30
movl %eax, -0x374(%rbp)
jmp 0xbc3b
movl -0x374(%rbp), %esi
movl 0x17645(%rip), %eax     # 0x2328c
subl %eax, %esi
leaq -0x1e8(%rbp), %rdi
callq 0x5aa0
jmp 0xbc57
leaq -0xa8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0xf860
jmp 0xbc6c
movl 0x1761a(%rip), %eax     # 0x2328c
addl -0x134(%rbp), %eax
movl %eax, -0x134(%rbp)
jmp 0xbcfe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4190
jmp 0xc3ce
leaq -0x1e8(%rbp), %rdi
callq 0x5b30
movl %eax, -0x378(%rbp)
jmp 0xbcb7
movl -0x378(%rbp), %eax
movl %eax, -0x1b8(%rbp)
leaq 0x17bce(%rip), %rdi     # 0x23898
leaq -0x1e8(%rbp), %rsi
callq 0xf860
jmp 0xbcd8
leaq -0x1e8(%rbp), %rdi
callq 0x5b30
movl %eax, -0x37c(%rbp)
jmp 0xbcec
movl -0x37c(%rbp), %eax
addl -0x134(%rbp), %eax
movl %eax, -0x134(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4190
jmp 0xbd0c
movl -0x130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x130(%rbp)
cmpl $0x0, -0x134(%rbp)
jle 0xbd33
movl -0x134(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x134(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xf8c0
movb %al, -0x37d(%rbp)
jmp 0xbd47
movb -0x37d(%rbp), %al
testb $0x1, %al
jne 0xbd53
jmp 0xbd72
leaq -0x58(%rbp), %rdi
callq 0xf8c0
movb %al, -0x37e(%rbp)
jmp 0xbd64
movb -0x37e(%rbp), %al
testb $0x1, %al
jne 0xbd70
jmp 0xbd72
jmp 0xbd77
jmp 0xb905
movq -0x308(%rbp), %rdi
movl -0x130(%rbp), %esi
callq 0x8660
leaq 0x17ba8(%rip), %rdi     # 0x23938
leaq 0x17b01(%rip), %rsi     # 0x23898
callq 0xf890
jmp 0xbd9e
movq 0x1721b(%rip), %rdi     # 0x22fc0
movq 0x17204(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbdb3
movq 0x17206(%rip), %rdi     # 0x22fc0
movq 0x171ef(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbdc8
movq 0x171f1(%rip), %rdi     # 0x22fc0
movq 0x171da(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbddd
movq 0x171dc(%rip), %rdi     # 0x22fc0
leaq 0xd516(%rip), %rsi      # 0x19301
callq 0x3270
movq %rax, -0x388(%rbp)
jmp 0xbdf9
movq -0x388(%rbp), %rdi
movq 0x171a9(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbe0e
movq 0x171ab(%rip), %rdi     # 0x22fc0
leaq 0xd451(%rip), %rsi      # 0x1926d
callq 0x3270
movq %rax, -0x390(%rbp)
jmp 0xbe2a
movq -0x390(%rbp), %rdi
movq 0x17178(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbe3f
movq 0x1717a(%rip), %rdi     # 0x22fc0
leaq 0xd4b4(%rip), %rsi      # 0x19301
callq 0x3270
movq %rax, -0x398(%rbp)
jmp 0xbe5b
movq -0x398(%rbp), %rdi
movq 0x17147(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbe70
movl $0x0, -0x1ec(%rbp)
movl $0x1, -0x1f0(%rbp)
movb 0x17b6e(%rip), %al      # 0x239f8
xorb $-0x1, %al
testb $0x1, %al
jne 0xbe95
jmp 0xc2ad
movq 0x17124(%rip), %rdi     # 0x22fc0
leaq 0xd3e6(%rip), %rsi      # 0x19289
callq 0x3270
movq %rax, -0x3a0(%rbp)
jmp 0xbeb1
movq -0x3a0(%rbp), %rdi
movl -0x1ec(%rbp), %esi
callq 0x3440
movq %rax, -0x3a8(%rbp)
jmp 0xbecc
movq -0x3a8(%rbp), %rdi
leaq 0xd3ba(%rip), %rsi      # 0x19294
callq 0x3270
movq %rax, -0x3b0(%rbp)
jmp 0xbee8
movq -0x3b0(%rbp), %rdi
movq 0x170ba(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xbefd
jmp 0xbeff
leaq 0x17992(%rip), %rdi     # 0x23898
callq 0xf8c0
movb %al, -0x3b1(%rbp)
jmp 0xbf13
movb -0x3b1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x3b2(%rbp)
jne 0xbf74
jmp 0xbf28
movl -0x1ec(%rbp), %eax
movl %eax, -0x3c4(%rbp)
leaq 0x1795d(%rip), %rdi     # 0x23898
callq 0xf8e0
movq %rax, -0x3c0(%rbp)
jmp 0xbf49
movq -0x3c0(%rbp), %rdi
callq 0x5b10
movl %eax, -0x3c8(%rbp)
jmp 0xbf5d
movl -0x3c4(%rbp), %eax
movl -0x3c8(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x3b2(%rbp)
movb -0x3b2(%rbp), %al
testb $0x1, %al
jne 0xbf83
jmp 0xc284
leaq 0x1790e(%rip), %rdi     # 0x23898
callq 0xf8e0
movq %rax, -0x3d0(%rbp)
jmp 0xbf98
movq -0x3d0(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x5c00
jmp 0xbfad
leaq 0x178e4(%rip), %rdi     # 0x23898
callq 0xf900
jmp 0xbfbb
leaq -0x21c(%rbp), %rsi
leaq 0x179f7(%rip), %rdi     # 0x239c0
callq 0xf920
movq %rax, -0x3d8(%rbp)
jmp 0xbfd7
movq -0x3d8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xc156
callq 0x30a0
movl %eax, -0x1f0(%rbp)
cmpl $0x0, -0x1f0(%rbp)
jne 0xc11d
movl $0xd0, %edi
callq 0x3280
movq %rax, -0x3e0(%rbp)
jmp 0xc012
movb $0x1, -0x2a9(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x5c00
jmp 0xc02e
movq -0x3e0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x5ec0
jmp 0xc043
movb $0x0, -0x2a9(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x4190
movq -0x3e0(%rbp), %rax
movq %rax, -0x250(%rbp)
movq 0x16f55(%rip), %rdi     # 0x22fc0
leaq 0xd225(%rip), %rsi      # 0x19297
callq 0x3270
movq %rax, -0x3e8(%rbp)
jmp 0xc080
callq 0x3390
movq -0x3e8(%rbp), %rdi
movl %eax, %esi
callq 0x3440
movq %rax, -0x3f0(%rbp)
jmp 0xc09c
movq -0x3f0(%rbp), %rdi
movq 0x16f06(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xc0b1
xorl %edi, %edi
callq 0x32e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xc273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xc101
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x4190
testb $0x1, -0x2a9(%rbp)
jne 0xc10c
jmp 0xc118
movq -0x3e0(%rbp), %rdi
callq 0x3250
jmp 0xc273
movl -0x1f0(%rbp), %eax
movl %eax, -0x3fc(%rbp)
leaq -0x21c(%rbp), %rsi
leaq 0x17889(%rip), %rdi     # 0x239c0
callq 0xf920
movq %rax, -0x3f8(%rbp)
jmp 0xc145
movq -0x3f8(%rbp), %rax
movl -0x3fc(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xc156
cmpl $0x0, -0x1f0(%rbp)
je 0xc262
testb $0x1, 0x1711e(%rip)     # 0x23288
je 0xc1e9
movb $0x0, 0x17115(%rip)     # 0x23288
leaq 0x176ae(%rip), %rdi     # 0x23828
leaq -0x248(%rbp), %rsi
callq 0xf950
jmp 0xc188
leaq -0x21c(%rbp), %rsi
leaq 0x1782a(%rip), %rdi     # 0x239c0
callq 0xf920
movq %rax, -0x408(%rbp)
jmp 0xc1a4
movq -0x408(%rbp), %rax
movl (%rax), %edi
movl $0x12, %esi
callq 0x3360
leaq 0x9c2(%rip), %rsi       # 0xcb80
movl $0xe, %edi
callq 0x32d0
leaq -0x248(%rbp), %rdi
callq 0x5b30
movl %eax, -0x40c(%rbp)
jmp 0xc1dc
movl -0x40c(%rbp), %edi
callq 0x3480
jmp 0xc260
leaq 0x176f8(%rip), %rdi     # 0x238e8
leaq -0x248(%rbp), %rsi
callq 0xf860
jmp 0xc1fe
leaq -0x21c(%rbp), %rsi
leaq 0x177b4(%rip), %rdi     # 0x239c0
callq 0xf920
movq %rax, -0x418(%rbp)
jmp 0xc21a
movq -0x418(%rbp), %rax
movl (%rax), %edi
movl $0x14, %esi
callq 0x3360
movq 0x16d8c(%rip), %rdi     # 0x22fc0
leaq 0xd07b(%rip), %rsi      # 0x192b6
callq 0x3270
movq %rax, -0x420(%rbp)
jmp 0xc249
movq -0x420(%rbp), %rdi
movq 0x16d59(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xc25e
jmp 0xc260
jmp 0xc262
leaq -0x248(%rbp), %rdi
callq 0x4190
jmp 0xbeff
leaq -0x248(%rbp), %rdi
callq 0x4190
jmp 0xc3ce
cmpl $0x0, -0x1f0(%rbp)
je 0xc2a8
movl $0x1, %edi
callq 0x31e0
jmp 0xc299
movl -0x1ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ec(%rbp)
jmp 0xbe84
cmpl $0x0, -0x1f0(%rbp)
je 0xc3b0
movq 0x16cff(%rip), %rdi     # 0x22fc0
leaq 0xcfc1(%rip), %rsi      # 0x19289
callq 0x3270
movq %rax, -0x428(%rbp)
jmp 0xc2d6
movq -0x428(%rbp), %rdi
movl -0x1ec(%rbp), %esi
callq 0x3440
movq %rax, -0x430(%rbp)
jmp 0xc2f1
movq -0x430(%rbp), %rdi
leaq 0xcf95(%rip), %rsi      # 0x19294
callq 0x3270
movq %rax, -0x438(%rbp)
jmp 0xc30d
movq -0x438(%rbp), %rdi
movq 0x16c95(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xc322
movl $0x2, %edi
callq 0x31e0
jmp 0xc32e
movq 0x16c8b(%rip), %rdi     # 0x22fc0
movq 0x16c74(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xc343
movq 0x16c76(%rip), %rdi     # 0x22fc0
movq 0x16c5f(%rip), %rsi     # 0x22fb0
callq 0x3290
jmp 0xc358
leaq 0x175d9(%rip), %rsi     # 0x23938
leaq -0x300(%rbp), %rdi
callq 0xf9a0
jmp 0xc36d
movq -0x308(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0xc530
jmp 0xc382
leaq -0x300(%rbp), %rdi
callq 0x4260
jmp 0xc3b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x4260
jmp 0xc3ce
leaq -0xa8(%rbp), %rdi
callq 0x4260
leaq -0x58(%rbp), %rdi
callq 0x4260
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
leaq -0xa8(%rbp), %rdi
callq 0x4260
leaq -0x58(%rbp), %rdi
callq 0x4260
movq -0xb0(%rbp), %rdi
callq 0x3450
nop