// File: /workspace/github_cpp_makefile_star2_O1/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 0x28fd
leaq -0x130(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x3c12
leaq -0xc0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x2ae8
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 0x2bfc
leaq -0x110(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x3c12
leaq -0xa8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3a54
leaq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movl %ebx, %edx
callq 0x2ca3
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 0x2e7d
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3ad4
leaq -0x368(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movq %rbx, %rsi
callq 0x3166
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x266e
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
cmpl $0x0, 0x6ae3(%rip)      # 0x9158
je 0x26b4
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3ad4
movq -0x60(%rbp), %rbx
movq -0x58(%rbp), %r13
cmpq %r13, %rbx
je 0x269f
movq (%rbx), %rdi
callq 0x4390
addq $0x8, %rbx
jmp 0x268c
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x26b4
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
cmpl $0x0, 0x6aa1(%rip)      # 0x915c
je 0x26c2
callq 0x3500
cmpl $0x0, 0x6a97(%rip)      # 0x9160
je 0x26f6
leaq -0x78(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3ad4
leaq -0x78(%rbp), %rdi
callq 0x3579
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x26f6
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2050
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2717
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2080
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x273e
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x2759
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x100(%rbp), %rdi
cmpq %r15, %rdi
je 0x2774
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x160(%rbp), %rdi
cmpq %r14, %rdi
je 0x278f
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 0x2868
movq -0x68(%rbp), %rsi
jmp 0x2860
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x2868
movq -0x80(%rbp), %rsi
jmp 0x2860
movq %rax, %rbx
jmp 0x287d
jmp 0x2824
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x2805
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
jmp 0x2805
movq %rax, %rbx
movq -0x120(%rbp), %rdi
cmpq %r13, %rdi
je 0x2889
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x2889
jmp 0x2824
movq %rax, %rbx
jmp 0x2889
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x28a4
movq -0x130(%rbp), %rsi
incq %rsi
jmp 0x289f
jmp 0x2846
movq %rax, %rbx
jmp 0x28a4
movq %rax, %rbx
jmp 0x2868
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2868
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x287d
movq -0x38(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2080
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x28a4
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x28bf
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x100(%rbp), %rdi
cmpq %r15, %rdi
je 0x28da
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x160(%rbp), %rdi
cmpq %r14, %rdi
je 0x28f5
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2230