// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_diagbandseed_verify
static int gt_diagbandseed_verify(const GtSeedpairlist *seedpairlist,
                                  const GtEncseq *aencseq,
                                  const GtEncseq *bencseq,
                                  unsigned int seedlength,
                                  bool reverse,
                                  bool verbose,
                                  FILE *stream,
                                  GtError *err) {
  const GtUword mlistlen = gt_seedpairlist_length(seedpairlist);
  GtTimer *timer = NULL;
  GtUword idx;
  char *buf1 = gt_malloc(3 * (seedlength + 1) * sizeof *buf1);
  char *buf2 = buf1 + 1 + seedlength;
  char *buf3 = buf2 + 1 + seedlength;
  buf1[seedlength] = buf2[seedlength] = buf3[seedlength] = '\0';

  if (verbose) {
    fprintf(stream, "# start verifying seeds ...\n");
    timer = gt_timer_new();
    gt_timer_start(timer);
  }

  gt_assert(aencseq != NULL && bencseq != NULL);
  for (idx = 0; idx < mlistlen; idx++)
  {
    GtDiagbandseedSeedPair seedpair;
    GtDiagbandseedPosition abs_apos, abs_bpos;

    gt_seedpairlist_at(&seedpair,seedpairlist,idx);
    /* extract decoded k-mers at seed positions */
    abs_apos = GT_DIAGBANDSEED_GETPOS_A(&seedpair) +
               gt_encseq_seqstartpos(aencseq, seedpair.aseqnum);
    gt_encseq_extract_decoded(aencseq, buf1, abs_apos + 1 - seedlength,
                              abs_apos);

    if (!reverse) {
      GtDiagbandseedPosition apos = GT_DIAGBANDSEED_GETPOS_A(&seedpair),
                             bpos = GT_DIAGBANDSEED_GETPOS_B(&seedpair);

      abs_bpos = GT_DIAGBANDSEED_CONV_B(apos,bpos) +
                 gt_encseq_seqstartpos(bencseq,seedpair.bseqnum);
      gt_encseq_extract_decoded(bencseq, buf2, abs_bpos + 1 - seedlength,
                                abs_bpos);
      if (strcmp(buf1, buf2) != 0) {
        gt_error_set(err, "Wrong SeedPair (%" PRIu32
                          ",%" PRIu32 ",%" PRIu32 ",%" GT_WUS "): %s != %s\n",
                     seedpair.aseqnum, seedpair.bseqnum,
                     apos,
                     GT_DIAGBANDSEED_CONV_B(apos,bpos),
                     buf1, buf2);
        gt_free(buf1);
        if (verbose)
        {
          gt_timer_delete(timer);
        }
        return -1;
      }
    } else {
      /* get reverse k-mer */
      char *bufptr;
      abs_bpos = gt_encseq_seqstartpos(bencseq, seedpair.bseqnum) +
                 gt_encseq_seqlength(bencseq, seedpair.bseqnum)
                 - GT_DIAGBANDSEED_GETPOS_B(&seedpair) - 1;
      gt_encseq_extract_decoded(bencseq, buf2, abs_bpos,
                                abs_bpos + seedlength - 1);

      for (bufptr = buf3; bufptr < buf3 + seedlength; bufptr++) {
        gt_complement(bufptr, buf2[seedlength + buf3 - bufptr - 1], NULL);
      }
      if (strcmp(buf1, buf3) != 0) {
        gt_error_set(err, "Wrong SeedPair (" "%"PRIu32
                          ",%"PRIu32",%"PRIu32",%"PRIu32"): %s != %s\n",
                     seedpair.aseqnum, seedpair.bseqnum,
                     GT_DIAGBANDSEED_GETPOS_A(&seedpair),
                     GT_DIAGBANDSEED_GETPOS_B(&seedpair), buf1, buf3);
        gt_free(buf1);
        if (verbose)
        {
          gt_timer_delete(timer);
        }
        return -1;
      }
    }
  }
  if (verbose) {
    fprintf(stream, "# ...successfully verified all seeds ");
    gt_timer_show_formatted(timer, GT_DIAGBANDSEED_FMT, stream);
    gt_timer_delete(timer);
  }
  gt_free(buf1);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, %ebp
movl %r8d, 0x44(%rsp)
movl %ecx, %r13d
movq %rdx, 0x30(%rsp)
movq %rsi, 0x78(%rsp)
movq 0xc0(%rsp), %r12
movq %rdi, 0x38(%rsp)
callq 0x1952d2
movq %rax, 0x70(%rsp)
leal 0x3(%r13,%r13,2), %edi
leaq 0x20a867(%rip), %rsi    # 0x39fbdc
movl $0x808, %edx            # imm = 0x808
callq 0x104226
movl %r13d, %r14d
leaq (%rax,%r14), %rbx
leaq (%r14,%rbx), %r15
incq %r15
xorl %ecx, %ecx
movb %cl, 0x1(%r14,%r15)
movb %cl, 0x1(%r14,%rbx)
movq %rax, 0x58(%rsp)
movb %cl, (%rax,%r14)
movl %ebp, 0x4(%rsp)
testl %ebp, %ebp
je 0x1953d7
leaq 0x20baba(%rip), %rdi    # 0x3a0e6b
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x17fa0
callq 0x11c954
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x11c9e3
jmp 0x1953e0
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x78(%rsp)
movq 0x58(%rsp), %rbp
je 0x1956db
cmpq $0x0, 0x30(%rsp)
je 0x1956db
cmpq $0x0, 0x70(%rsp)
je 0x1955b8
leaq (%r14,%rbp), %rax
incq %rax
movq %rax, 0x28(%rsp)
leaq 0x2(%r14,%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x1(%r14,%r15), %rbx
leal -0x1(%r13), %eax
movl %eax, 0x40(%rsp)
leaq (,%r14,2), %rax
addq %rbp, %rax
movq %rax, 0x80(%rsp)
xorl %r14d, %r14d
movq %r13, 0x68(%rsp)
leaq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %r14, %rdx
callq 0x197a2c
movl 0x4c(%rsp), %esi
movq %rbp, %r12
movl 0x50(%rsp), %ebp
movq 0x78(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x60(%rsp)
callq 0xeb6ee
movq %rbp, 0x8(%rsp)
leal (%rax,%rbp), %ecx
movq %r12, %rbp
movl %ecx, %edx
subl %r13d, %edx
incl %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xe92be
cmpb $0x0, 0x44(%rsp)
je 0x195534
movq %r13, %r15
movl 0x48(%rsp), %r12d
movq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0xeb6ee
movq %rax, %r13
movq %rbp, %rdi
movq %r12, %rsi
callq 0xeb9d2
addq %rax, %r13
movl 0x54(%rsp), %ecx
movq %rcx, 0x18(%rsp)
notq %rcx
addq %r13, %rcx
movl %ecx, %edx
addl 0x40(%rsp), %ecx
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0xe92be
testl %r15d, %r15d
je 0x195514
movq 0x80(%rsp), %rbp
movq 0x20(%rsp), %r13
movsbl (%rbp), %esi
movq %r13, %rdi
xorl %edx, %edx
callq 0x2f7ce8
incq %r13
decq %rbp
cmpq %rbx, %r13
jb 0x1954fb
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0x17a40
testl %eax, %eax
movq 0x68(%rsp), %r13
je 0x1955a2
jmp 0x19566e
movl 0x54(%rsp), %ecx
movq 0x38(%rsp), %rdx
cmpb $0x1, 0xb0(%rdx)
movq %rcx, %r13
jne 0x195559
movq 0x8(%rsp), %rax
leaq (%rcx,%rax), %r13
subq 0xb8(%rdx), %r13
movq %rcx, 0x18(%rsp)
movl 0x48(%rsp), %r12d
movq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xeb6ee
addq %r13, %rax
movl %eax, %ecx
movq 0x68(%rsp), %r13
subl %r13d, %eax
leal 0x1(%rax), %edx
movq %r15, %rdi
movq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0xe92be
movq %rbp, %rdi
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x195612
incq %r14
cmpq 0x70(%rsp), %r14
movq 0xc0(%rsp), %r12
jne 0x195447
cmpb $0x0, 0x4(%rsp)
je 0x1955f7
leaq 0x20b94d(%rip), %rdi    # 0x3a0f13
movl $0x25, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x17fa0
leaq 0x20b053(%rip), %rsi    # 0x3a0632
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x11ca64
movq %rbx, %rdi
callq 0x11d054
leaq 0x20a5de(%rip), %rsi    # 0x39fbdc
movq %rbp, %rdi
movl $0x856, %edx            # imm = 0x856
callq 0x1045eb
xorl %eax, %eax
jmp 0x1956c9
movq 0x38(%rsp), %rax
cmpb $0x1, 0xb0(%rax)
movq 0x18(%rsp), %r9
jne 0x195631
addq 0x8(%rsp), %r9
subq 0xb8(%rax), %r9
leaq 0x20b88a(%rip), %rsi    # 0x3a0ec2
movq 0xc8(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl %r12d, %ecx
movq 0x8(%rsp), %r8
xorl %eax, %eax
pushq 0x28(%rsp)
pushq %rbp
callq 0xfcb67
addq $0x10, %rsp
leaq 0x20a578(%rip), %rsi    # 0x39fbdc
movq %rbp, %rdi
movl $0x82f, %edx            # imm = 0x82F
jmp 0x1956ae
leaq 0x20b876(%rip), %rsi    # 0x3a0eeb
movq 0xc8(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl %r12d, %ecx
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r9
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %rbp
callq 0xfcb67
addq $0x10, %rsp
leaq 0x20a536(%rip), %rsi    # 0x39fbdc
movq %rbp, %rdi
movl $0x848, %edx            # imm = 0x848
callq 0x1045eb
cmpb $0x0, 0x4(%rsp)
je 0x1956c4
movq 0x10(%rsp), %rdi
callq 0x11d054
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5d683