// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x6f8, %rsp            # imm = 0x6F8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4f0(%rsp), %rdi
callq 0x21b0
leaq 0x2e8(%rsp), %rdi
callq 0x21b0
leaq 0xe8(%rsp), %rdi
callq 0x2240
cmpl $0x3, %ebp
jle 0x3534
movq 0x8(%rbx), %rsi
leaq 0x4f0(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x20e0
movq 0x10(%rbx), %rsi
leaq 0x2e8(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x20e0
movq 0x18(%rbx), %rsi
leaq 0xe8(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x2040
movq 0x4f0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x510(%rsp,%rax)
jne 0x351a
movq 0x2e8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x308(%rsp,%rax)
jne 0x351a
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x108(%rsp,%rax)
jne 0x351a
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x4f0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x21e0
leaq 0x2e8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x21e0
cmpq $0x0, 0x30(%rsp)
je 0x353b
cmpq $0x0, 0x10(%rsp)
je 0x353b
leaq 0xb0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x24a8
leaq 0x78(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x24a8
movq 0x2b9e(%rip), %rdi      # 0x5fd0
leaq 0xd66(%rip), %rsi       # 0x419f
callq 0x2180
leaq 0xb0(%rsp), %rdi
callq 0x2610
movq 0x2b7e(%rip), %rdi      # 0x5fd0
leaq 0xd54(%rip), %rsi       # 0x41ad
callq 0x2180
leaq 0x78(%rsp), %rdi
callq 0x2610
leaq 0x48(%rsp), %rdi
callq 0x2a90
leaq 0x48(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2b88
leaq 0x48(%rsp), %rdi
callq 0x3142
leaq 0xe8(%rsp), %rdi
callq 0x3601
leaq 0x48(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x314e
leaq 0x48(%rsp), %rdi
callq 0x2b42
leaq 0x78(%rsp), %rdi
callq 0x32c0
leaq 0xb0(%rsp), %rdi
callq 0x32c0
leaq 0x8(%rsp), %rdi
callq 0x20a0
leaq 0x28(%rsp), %rdi
callq 0x20a0
leaq 0xe8(%rsp), %rdi
callq 0x2200
leaq 0x2e8(%rsp), %rdi
callq 0x2050
leaq 0x4f0(%rsp), %rdi
callq 0x2050
xorl %eax, %eax
addq $0x6f8, %rsp            # imm = 0x6F8
popq %rbx
popq %rbp
retq
movq 0x2acf(%rip), %rdi      # 0x5ff0
leaq 0xc44(%rip), %rsi       # 0x416c
callq 0x2180
callq 0x35e4
jmp 0x3553
callq 0x35e4
jmp 0x3553
movq 0x2aae(%rip), %rdi      # 0x5ff0
leaq 0xc40(%rip), %rsi       # 0x4189
callq 0x2180
callq 0x35e4
pushq $0x1
popq %rdi
callq 0x21d0
jmp 0x3582
movq %rax, %rbx
jmp 0x358f
jmp 0x356e
movq %rax, %rbx
jmp 0x35c2
movq %rax, %rbx
jmp 0x35cf
movq %rax, %rbx
jmp 0x359c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2b42
jmp 0x3585
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x32c0
leaq 0xb0(%rsp), %rdi
callq 0x32c0
leaq 0x8(%rsp), %rdi
callq 0x20a0
leaq 0x28(%rsp), %rdi
callq 0x20a0
jmp 0x35b5
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2200
leaq 0x2e8(%rsp), %rdi
callq 0x2050
leaq 0x4f0(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2260