// File: /workspace/github_cpp_makefile_star2_O3/UBOdin[P]jitd-cpp/src/driver.cpp
// Function: main
int main(int argc, char **argv)
{
  istream *src;
  TestMode mode = JITD_TEST;
  int i, t = 0;
  bool interactive;
  JITD<Record, PureLocalPolicy<Record>> jitd;
  
  srand(time(NULL));
//  sleep(1);
  for(i = 1; i < argc; i++){
    ifstream srcF;
    if((strlen(argv[i]) > 1) && (argv[i][0] == '-')){
      string flag(argv[i]);
      if(string("-c") == flag){ mode = COG_TEST; }
      else if(string("-j") == flag){ mode = JITD_TEST; }
      else if(string("-m") == flag){ mode = MAP_TEST; }
      else {
        cerr << "Invalid command line switch: " << flag << endl;
        exit(-1);
      }
    } else {
      if(string("-") == string(argv[i])){
        src = &cin;
        interactive = true;
      } else {
        srcF.open(argv[i], std::ios_base::in);
        src = &srcF;
        interactive = false;
      }
      switch(mode){
        case COG_TEST:
          cog_test(*src);
          break;
        case JITD_TEST:
          t = jitd_test(jitd, *src, interactive, 0);
          cout << "Time[" << argv[i] << "]: " << t << " s" << endl;
          break;
        case MAP_TEST:
          ds_test(*src);
      }
    }
  }
//  sleep(60);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movl %edi, %r14d
leaq -0xc8(%rbp), %rdi
callq 0x1050a
xorl %edi, %edi
callq 0x4220
movl %eax, %edi
callq 0x4240
cmpl $0x2, %r14d
jl 0x10423
movl %r14d, %eax
movq %rax, -0x78(%rbp)
movl $0x1, %r13d
movl $0x1, %r12d
leaq -0x2d0(%rbp), %r14
movq %r14, %rdi
callq 0x42c0
movq (%rbx,%r12,8), %r15
movq %r15, %rdi
callq 0x4100
cmpq $0x2, %rax
jb 0x10103
cmpb $0x2d, (%r15)
jne 0x10103
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
leaq -0x50(%rbp), %r14
movq %r14, %rdx
callq 0x40e0
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %r14, %rdi
leaq 0x1e44(%rip), %rsi      # 0x11f09
leaq 0x1e3f(%rip), %rdx      # 0x11f0b
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x1023f
movq -0x50(%rbp), %r15
testq %rdx, %rdx
je 0x102d9
movq -0x70(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x102dc
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rdi
leaq 0xf78(%rip), %rsi       # 0x1108e
leaq 0xf72(%rip), %rdx       # 0x1108f
callq 0x78c0
movq (%rbx,%r12,8), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x40e0
movq -0x68(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
jne 0x1015a
movq -0x50(%rbp), %r15
testq %rdx, %rdx
je 0x10163
movq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x10166
movq -0x50(%rbp), %r15
xorl %r14d, %r14d
jmp 0x10166
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %r15
je 0x1017e
movq -0x40(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x10197
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
movq 0x7e3a(%rip), %rsi      # 0x17fd8
testb %r14b, %r14b
jne 0x101be
movq (%rbx,%r12,8), %rsi
leaq -0x2d0(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x4160
movq %r15, %rsi
cmpl $0x2, %r13d
je 0x1021c
cmpl $0x1, %r13d
jne 0x1022f
movzbl %r14b, %edx
leaq -0xc8(%rbp), %rdi
xorl %ecx, %ecx
callq 0x9746
movl %eax, %r15d
movl $0x5, %edx
movq 0x7ddd(%rip), %rdi      # 0x17fc8
leaq 0x140c(%rip), %rsi      # 0x115fe
callq 0x42d0
movq (%rbx,%r12,8), %r13
testq %r13, %r13
je 0x1024b
movq %r13, %rdi
callq 0x4100
movq 0x7db9(%rip), %rdi      # 0x17fc8
movq %r13, %rsi
movq %rax, %rdx
callq 0x42d0
jmp 0x10269
movl $0x2, %r13d
movq %rsi, %rdi
callq 0xf47c
jmp 0x10407
xorl %r13d, %r13d
movq %rsi, %rdi
callq 0x4fd5
jmp 0x10407
movq -0x50(%rbp), %r15
xorl %r14d, %r14d
jmp 0x102dc
movq 0x7d76(%rip), %rcx      # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x43c0
movl $0x3, %edx
movq 0x7d53(%rip), %rdi      # 0x17fc8
leaq 0x1388(%rip), %rsi      # 0x11604
callq 0x42d0
movq 0x7d40(%rip), %rdi      # 0x17fc8
movl %r15d, %esi
callq 0x43f0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1366(%rip), %rsi      # 0x11608
callq 0x42d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movl $0x1, %r13d
movq %rax, %rdi
callq 0x4190
jmp 0x10407
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %r15
je 0x102f4
movq -0x40(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
xorl %r13d, %r13d
testb %r14b, %r14b
jne 0x103ee
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1bf9(%rip), %rsi      # 0x11f0c
leaq 0x1bf4(%rip), %rdx      # 0x11f0e
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x10346
movq -0x50(%rbp), %r15
testq %rdx, %rdx
je 0x1034f
movq -0x70(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x10352
movq -0x50(%rbp), %r15
xorl %r14d, %r14d
jmp 0x10352
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %r15
je 0x1036a
movq -0x40(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
movl $0x1, %r13d
testb %r14b, %r14b
jne 0x103ee
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1b87(%rip), %rsi      # 0x11f0f
leaq 0x1b82(%rip), %rdx      # 0x11f11
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x103bb
movq -0x50(%rbp), %r15
testq %rdx, %rdx
je 0x103c4
movq -0x70(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x103c7
movq -0x50(%rbp), %r15
xorl %r14d, %r14d
jmp 0x103c7
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %r15
je 0x103df
movq -0x40(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
movl $0x2, %r13d
testb %r14b, %r14b
je 0x10471
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x10407
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x2d0(%rbp), %r14
movq %r14, %rdi
callq 0x4060
incq %r12
cmpq %r12, -0x78(%rbp)
jne 0x10080
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x10440
leaq -0x98(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x10798
movq -0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1045d
callq 0x65c2
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7b78(%rip), %rdi      # 0x17ff0
leaq 0x1a93(%rip), %rsi      # 0x11f12
movl $0x1d, %edx
callq 0x42d0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x7b58(%rip), %rdi      # 0x17ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42f0
movq %rax, %rdi
callq 0x4acd
jmp 0x104c1
jmp 0x104c1
jmp 0x104c1
jmp 0x104c1
jmp 0x104e6
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x104e9
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x104e9
jmp 0x104e6
movq %rax, %rbx
jmp 0x104f5
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x4060
leaq -0xc8(%rbp), %rdi
callq 0x1071a
movq %rbx, %rdi
callq 0x4400
nop