// File: isovic[P]cigargen/cigargen_main.cc
// Function: main
int main() {
  std::string reference = "ACTGCTGCCTGCAAAAAAAAAAA";
  std::string query = "AGTGTGCCCT";

  std::string cigar;
  std::string alignment = "";
  uint32_t alignment_length = 0;
  int32_t edit_distance = GenerateCigar((char *) query.c_str(), query.size(), (char *) reference.c_str(), reference.size(), &cigar, &alignment_length, &alignment);

  printf ("Reference sequence:\t%s\n", reference.c_str());
  printf ("Query sequence:\t\t%s\n", query.c_str());
  printf ("Returned CIGAR: %s\n", cigar.c_str());
  printf ("Alignment: %s\n", alignment.c_str());
  printf ("Alignment length: %d\n", alignment_length);
  printf ("Edit distance: %d\n", edit_distance);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movl $0x0, -0x4(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x22a0
movq -0xc0(%rbp), %rdx
leaq 0x4c04(%rip), %rsi      # 0x7004
leaq -0x28(%rbp), %rdi
callq 0x26a0
jmp 0x240b
leaq -0x29(%rbp), %rdi
callq 0x21d0
leaq -0x61(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x22a0
movq -0xc8(%rbp), %rdx
leaq 0x4bea(%rip), %rsi      # 0x701c
leaq -0x60(%rbp), %rdi
callq 0x26a0
jmp 0x243d
leaq -0x61(%rbp), %rdi
callq 0x21d0
leaq -0x88(%rbp), %rdi
callq 0x2240
leaq -0xa9(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x22a0
movq -0xd0(%rbp), %rdx
leaq 0x4c6a(%rip), %rsi      # 0x70dd
leaq -0xa8(%rbp), %rdi
callq 0x26a0
jmp 0x2481
leaq -0xa9(%rbp), %rdi
callq 0x21d0
movl $0x0, -0xb0(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x2090
movq -0x100(%rbp), %rdi
movq %rax, -0xf0(%rbp)
callq 0x2110
movl %eax, -0xe4(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x2090
movq -0xf8(%rbp), %rdi
movq %rax, -0xe0(%rbp)
callq 0x2110
movq -0xf0(%rbp), %rdi
movl -0xe4(%rbp), %esi
movq -0xe0(%rbp), %rdx
movl %eax, %ecx
movq %rsp, %rax
leaq -0xa8(%rbp), %r8
movq %r8, (%rax)
leaq -0x88(%rbp), %r8
leaq -0xb0(%rbp), %r9
callq 0x29f0
movl %eax, -0xd4(%rbp)
jmp 0x2521
movl -0xd4(%rbp), %eax
movl %eax, -0xb4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2090
movq %rax, %rsi
leaq 0x4ae7(%rip), %rdi      # 0x7027
xorl %eax, %eax
callq 0x2040
jmp 0x2549
leaq -0x60(%rbp), %rdi
callq 0x2090
movq %rax, %rsi
leaq 0x4ae3(%rip), %rdi      # 0x703f
xorl %eax, %eax
callq 0x2040
jmp 0x2565
leaq -0x88(%rbp), %rdi
callq 0x2090
movq %rax, %rsi
leaq 0x4ad9(%rip), %rdi      # 0x7054
xorl %eax, %eax
callq 0x2040
jmp 0x2584
leaq -0xa8(%rbp), %rdi
callq 0x2090
movq %rax, %rsi
leaq 0x4ace(%rip), %rdi      # 0x7068
xorl %eax, %eax
callq 0x2040
jmp 0x25a3
movl -0xb0(%rbp), %esi
leaq 0x4ac7(%rip), %rdi      # 0x7077
xorl %eax, %eax
callq 0x2040
jmp 0x25b9
movl -0xb4(%rbp), %esi
leaq 0x4ac7(%rip), %rdi      # 0x708d
xorl %eax, %eax
callq 0x2040
jmp 0x25cf
movl $0x0, -0x4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x20e0
leaq -0x88(%rbp), %rdi
callq 0x20e0
leaq -0x60(%rbp), %rdi
callq 0x20e0
leaq -0x28(%rbp), %rdi
callq 0x20e0
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x21d0
jmp 0x268a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x21d0
jmp 0x2681
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0x21d0
jmp 0x266c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x20e0
leaq -0x88(%rbp), %rdi
callq 0x20e0
leaq -0x60(%rbp), %rdi
callq 0x20e0
leaq -0x28(%rbp), %rdi
callq 0x20e0
movq -0x38(%rbp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)
nopl (%rax)