// File: /workspace/github_cpp_makefile_star2_O3/eva23511[P]OS-Virtual-Memory-Management/main.cpp
// Function: main
int main(int argc, char * argv[]) {
    string input_filename;
    string rand_filename;
    int num_frames = 0;
    string algo;
    
    ParseCommand(argc, argv, num_frames, algo, input_filename, rand_filename);
    
    // get randoms
    vector<int> randoms = ParseRandFile(rand_filename);
    
    // initialzie frames and pager
    initFrames(num_frames);
    Pager * pager = GetPager(algo, randoms, num_frames);
    
    
    // parse input_file and Initialzie process
    ifstream input_file (input_filename);
    vector<Process *> processes = GetProcess(input_file);
    
    Simulation(input_file, pager, processes);
    
    if (P_option) {
        PrintPagetable(processes);
    }
    
    if (F_option) {
        PrintFrameTable();
    }
    
    if (S_option) {
        PrintSummary(processes);
    }
    
    input_file.close();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
leaq -0x150(%rbp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq -0xf0(%rbp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq -0x2c(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0xd0(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0xe0(%rbp), %rcx
leaq -0x160(%rbp), %r8
leaq -0x100(%rbp), %r9
callq 0x2903
leaq -0x130(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x3c76
leaq -0xc0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x2b32
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x2575
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2150
movl -0x2c(%rbp), %ebx
movl %ebx, %edi
callq 0x2c46
leaq -0x110(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x3c76
leaq -0xa8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3ab8
leaq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movl %ebx, %edx
callq 0x2ced
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x25ed
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x120(%rbp), %rdi
cmpq %r13, %rdi
je 0x2608
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
leaq -0x160(%rbp), %rsi
movl $0x8, %edx
callq 0x21f0
leaq -0x48(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x2ec7
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3b38
leaq -0x368(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movq %rbx, %rsi
callq 0x31b0
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x266e
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
cmpl $0x0, 0x6ae3(%rip)      # 0x9158
je 0x26ba
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3b38
movq -0x60(%rbp), %rbx
movq -0x58(%rbp), %r13
cmpq %r13, %rbx
je 0x26a6
movq (%rbx), %rdi
callq 0x4400
addq $0x8, %rbx
cmpq %r13, %rbx
jne 0x2691
movq -0x60(%rbp), %rbx
testq %rbx, %rbx
je 0x26ba
movq -0x50(%rbp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0x2150
cmpl $0x0, 0x6a9b(%rip)      # 0x915c
je 0x26c8
callq 0x3555
cmpl $0x0, 0x6a91(%rip)      # 0x9160
je 0x26fc
leaq -0x78(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3b38
leaq -0x78(%rbp), %rdi
callq 0x35ce
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x26fc
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2050
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x271d
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2080
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x2744
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x275f
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x100(%rbp), %rdi
cmpq %r15, %rdi
je 0x277a
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x160(%rbp), %rdi
cmpq %r14, %rdi
je 0x2795
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2150
xorl %eax, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x286e
movq -0x68(%rbp), %rsi
jmp 0x2866
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x286e
movq -0x80(%rbp), %rsi
jmp 0x2866
movq %rax, %rbx
jmp 0x2883
jmp 0x282a
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x280b
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
jmp 0x280b
movq %rax, %rbx
movq -0x120(%rbp), %rdi
cmpq %r13, %rdi
je 0x288f
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x288f
jmp 0x282a
movq %rax, %rbx
jmp 0x288f
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x28aa
movq -0x130(%rbp), %rsi
incq %rsi
jmp 0x28a5
jmp 0x284c
movq %rax, %rbx
jmp 0x28aa
movq %rax, %rbx
jmp 0x286e
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x286e
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2883
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2080
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x28aa
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x28c5
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x100(%rbp), %rdi
cmpq %r15, %rdi
je 0x28e0
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x160(%rbp), %rdi
cmpq %r14, %rdi
je 0x28fb
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2230