// File: /workspace/github_cpp_makefile_star2_O1/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 0x1055e
xorl %edi, %edi
callq 0x4220
movl %eax, %edi
callq 0x4240
cmpl $0x2, %r14d
jl 0x10478
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 0x1017f
cmpb $0x2d, (%r15)
jne 0x1017f
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdx
callq 0x40e0
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %r15, %rdi
leaq 0x1e00(%rip), %rsi      # 0x11f44
leaq 0x1dfb(%rip), %rdx      # 0x11f46
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x102ae
testq %rdx, %rdx
je 0x10344
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0x10347
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rdi
leaq 0xf04(%rip), %rsi       # 0x11096
leaq 0xefe(%rip), %rdx       # 0x11097
callq 0x7c1e
movq (%rbx,%r12,8), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x40e0
movq -0x68(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
jne 0x101d3
testq %rdx, %rdx
je 0x101d8
movq -0x50(%rbp), %rsi
movq -0x70(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0x101db
xorl %r15d, %r15d
jmp 0x101db
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x101f4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1020d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
movq 0x8dc4(%rip), %rsi      # 0x18fd8
testb %r15b, %r15b
jne 0x1022d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x4160
movq %r14, %rsi
cmpl $0x2, %r13d
je 0x1028b
cmpl $0x1, %r13d
jne 0x1029e
movzbl %r15b, %edx
leaq -0xc8(%rbp), %rdi
xorl %ecx, %ecx
callq 0x9a8b
movl %eax, %r15d
movl $0x5, %edx
movq 0x8d6e(%rip), %rdi      # 0x18fc8
leaq 0x14a5(%rip), %rsi      # 0x11706
callq 0x42d0
movq (%rbx,%r12,8), %r13
testq %r13, %r13
je 0x102b6
movq %r13, %rdi
callq 0x4100
movq 0x8d4a(%rip), %rdi      # 0x18fc8
movq %r13, %rsi
movq %rax, %rdx
callq 0x42d0
jmp 0x102d4
movl $0x2, %r13d
movq %rsi, %rdi
callq 0xf520
jmp 0x10463
xorl %r13d, %r13d
movq %rsi, %rdi
callq 0x523c
jmp 0x10463
xorl %r15d, %r15d
jmp 0x10347
movq 0x8d0b(%rip), %rcx      # 0x18fc8
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 0x8ce8(%rip), %rdi      # 0x18fc8
leaq 0x1425(%rip), %rsi      # 0x1170c
callq 0x42d0
movq 0x8cd5(%rip), %rdi      # 0x18fc8
movl %r15d, %esi
callq 0x43f0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1403(%rip), %rsi      # 0x11710
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 0x10463
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x10360
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
xorl %r13d, %r13d
testb %r15b, %r15b
jne 0x1044a
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1bc8(%rip), %rsi      # 0x11f47
leaq 0x1bc3(%rip), %rdx      # 0x11f49
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x103af
testq %rdx, %rdx
je 0x103b4
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0x103b7
xorl %r15d, %r15d
jmp 0x103b7
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x103d0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
movl $0x1, %r13d
testb %r15b, %r15b
jne 0x1044a
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1b5c(%rip), %rsi      # 0x11f4a
leaq 0x1b57(%rip), %rdx      # 0x11f4c
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x1041e
testq %rdx, %rdx
je 0x10423
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0x10426
xorl %r15d, %r15d
jmp 0x10426
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1043f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
movl $0x2, %r13d
testb %r15b, %r15b
je 0x104c6
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x10463
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
movq %r14, %rdi
callq 0x4060
incq %r12
cmpq %r12, -0x78(%rbp)
jne 0x100ff
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x10495
leaq -0x98(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x107d2
movq -0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x104b2
callq 0x6810
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8b23(%rip), %rdi      # 0x18ff0
leaq 0x1a79(%rip), %rsi      # 0x11f4d
movl $0x1d, %edx
callq 0x42d0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x8b03(%rip), %rdi      # 0x18ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42f0
movq %rax, %rdi
callq 0x4d4d
jmp 0x10516
jmp 0x10516
jmp 0x10516
jmp 0x10516
jmp 0x1053b
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1053e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x1053e
jmp 0x1053b
movq %rax, %rbx
jmp 0x1054a
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x4060
leaq -0xc8(%rbp), %rdi
callq 0x10754
movq %rbx, %rdi
callq 0x4400