// File: /workspace/github_cpp_makefile_star2_O3/kmiya[P]Needleman-Wunsch/src/main.cpp
// Function: main
int main(int argc, char **argv)
{
  // --- open files ---
  ifstream inputFile1, inputFile2;
  ofstream outputFile;
  if (argc < 4) {
    usage();
    exit(EXIT_FAILURE);
  } else {
    inputFile1.open(argv[1]);
    inputFile2.open(argv[2]);
    outputFile.open(argv[3], ios::app);
  }
  if (inputFile1.fail() || inputFile2.fail() || outputFile.fail()) {
    cerr << "Error: Could not open files\n";
    usage();
    exit(EXIT_FAILURE);
  }
  // --- read sequences from files ---
  string input1, input2;
  inputFile1 >> input1;
  inputFile2 >> input2;
  if (input1.empty() || input2.empty()) {
    cerr << "Error: invalid files\n";
    usage();
    exit(EXIT_FAILURE);
  }
  // translate input_files into Base-type
  Base seq1(input1), seq2(input2);
  cout << "input file1:\n";
  seq1.PrintString();              // print input_file1
  cout << "input file2:\n";
  seq2.PrintString();              // print input_file2
  BaseAlgorithms tmp;              // create an instance for alignment
  tmp.Alignment(seq1, seq2);       // DO alignment
  tmp.PrintAlignment();            // print alignment result
  printDate(&outputFile);          // save time stamp to output_file
  tmp.SaveAlignment(&outputFile);  // save result to output_file
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x6f8, %rsp            # imm = 0x6F8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4f0(%rsp), %rdi
callq 0x21a0
leaq 0x2e8(%rsp), %rdi
callq 0x21a0
leaq 0xe8(%rsp), %rdi
callq 0x2230
cmpl $0x3, %ebp
jle 0x395a
movq 0x8(%rbx), %rsi
leaq 0x4f0(%rsp), %rdi
movl $0x8, %edx
callq 0x20b0
movq 0x10(%rbx), %rsi
leaq 0x2e8(%rsp), %rdi
movl $0x8, %edx
callq 0x20b0
movq 0x18(%rbx), %rsi
leaq 0xe8(%rsp), %rdi
movl $0x1, %edx
callq 0x2050
movq 0x4f0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x510(%rsp,%rax)
jne 0x393b
movq 0x2e8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x308(%rsp,%rax)
jne 0x393b
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x108(%rsp,%rax)
jne 0x393b
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x4f0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x21d0
leaq 0x2e8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x21d0
cmpq $0x0, 0x30(%rsp)
je 0x3961
cmpq $0x0, 0x10(%rsp)
je 0x3961
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2506
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2506
movq 0x2838(%rip), %rdi      # 0x5fd0
leaq 0xa00(%rip), %rsi       # 0x419f
movl $0xd, %edx
callq 0x21b0
leaq 0x80(%rsp), %rdi
callq 0x273a
movq 0x2813(%rip), %rdi      # 0x5fd0
leaq 0x9e9(%rip), %rsi       # 0x41ad
movl $0xd, %edx
callq 0x21b0
leaq 0x48(%rsp), %rdi
callq 0x273a
leaq 0xb8(%rsp), %rdi
callq 0x2b90
leaq 0xb8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x2d02
leaq 0xb8(%rsp), %rdi
callq 0x3424
leaq 0xe8(%rsp), %rdi
callq 0x3a72
leaq 0xb8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3430
leaq 0xb8(%rsp), %rdi
callq 0x2c70
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x3852
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x386d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x388a
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38ab
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x38c2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x38d9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x26e8(%rip), %rax      # 0x5fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0xf0(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0xe8(%rsp,%rcx)
callq 0x2130
leaq 0x1e0(%rsp), %rdi
callq 0x2070
leaq 0x2e8(%rsp), %rdi
callq 0x2060
leaq 0x4f0(%rsp), %rdi
callq 0x2060
xorl %eax, %eax
addq $0x6f8, %rsp            # imm = 0x6F8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x26ae(%rip), %rdi      # 0x5ff0
leaq 0x823(%rip), %rsi       # 0x416c
movl $0x1c, %edx
callq 0x21b0
callq 0x3a2e
jmp 0x397e
callq 0x3a2e
jmp 0x397e
movq 0x2688(%rip), %rdi      # 0x5ff0
leaq 0x81a(%rip), %rsi       # 0x4189
movl $0x15, %edx
callq 0x21b0
callq 0x3a2e
movl $0x1, %edi
callq 0x21c0
jmp 0x39b2
movq %rax, %rbx
jmp 0x39bf
jmp 0x399b
movq %rax, %rbx
jmp 0x3a0c
movq %rax, %rbx
jmp 0x3a19
movq %rax, %rbx
jmp 0x39cc
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x2c70
jmp 0x39b5
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3b84
leaq 0x80(%rsp), %rdi
callq 0x3b84
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x39e3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x39ff
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x39ff
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x21f0
leaq 0x2e8(%rsp), %rdi
callq 0x2060
leaq 0x4f0(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2250