// File: /workspace/github_c_makefile_star2_O1/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 0x19d824
movq %rax, 0x70(%rsp)
leal 0x3(%r13,%r13,2), %edi
leaq 0x20b805(%rip), %rsi    # 0x3a90cc
movl $0x808, %edx            # imm = 0x808
callq 0x1092b2
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 0x19d929
leaq 0x20cae8(%rip), %rdi    # 0x3aa3eb
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x17fa0
callq 0x1226a4
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x122733
jmp 0x19d932
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x78(%rsp)
movq 0x58(%rsp), %rbp
je 0x19dc2d
cmpq $0x0, 0x30(%rsp)
je 0x19dc2d
cmpq $0x0, 0x70(%rsp)
je 0x19db0a
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 0x19feef
movl 0x4c(%rsp), %esi
movq %rbp, %r12
movl 0x50(%rsp), %ebp
movq 0x78(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x60(%rsp)
callq 0xefce0
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 0xed87b
cmpb $0x0, 0x44(%rsp)
je 0x19da86
movq %r13, %r15
movl 0x48(%rsp), %r12d
movq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0xefce0
movq %rax, %r13
movq %rbp, %rdi
movq %r12, %rsi
callq 0xeffd3
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 0xed87b
testl %r15d, %r15d
je 0x19da66
movq 0x80(%rsp), %rbp
movq 0x20(%rsp), %r13
movsbl (%rbp), %esi
movq %r13, %rdi
xorl %edx, %edx
callq 0x301930
incq %r13
decq %rbp
cmpq %rbx, %r13
jb 0x19da4d
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0x17a40
testl %eax, %eax
movq 0x68(%rsp), %r13
je 0x19daf4
jmp 0x19dbc0
movl 0x54(%rsp), %ecx
movq 0x38(%rsp), %rdx
cmpb $0x1, 0xb0(%rdx)
movq %rcx, %r13
jne 0x19daab
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 0xefce0
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 0xed87b
movq %rbp, %rdi
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x19db64
incq %r14
cmpq 0x70(%rsp), %r14
movq 0xc0(%rsp), %r12
jne 0x19d999
cmpb $0x0, 0x4(%rsp)
je 0x19db49
leaq 0x20c958(%rip), %rdi    # 0x3aa470
movl $0x25, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x17fa0
leaq 0x20c081(%rip), %rsi    # 0x3a9bb2
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1227b4
movq %rbx, %rdi
callq 0x122d79
leaq 0x20b57c(%rip), %rsi    # 0x3a90cc
movq %rbp, %rdi
movl $0x856, %edx            # imm = 0x856
callq 0x109670
xorl %eax, %eax
jmp 0x19dc1b
movq 0x38(%rsp), %rax
cmpb $0x1, 0xb0(%rax)
movq 0x18(%rsp), %r9
jne 0x19db83
addq 0x8(%rsp), %r9
subq 0xb8(%rax), %r9
leaq 0x20c895(%rip), %rsi    # 0x3aa41f
movq 0xc8(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl %r12d, %ecx
movq 0x8(%rsp), %r8
xorl %eax, %eax
pushq 0x28(%rsp)
pushq %rbp
callq 0x1019cf
addq $0x10, %rsp
leaq 0x20b516(%rip), %rsi    # 0x3a90cc
movq %rbp, %rdi
movl $0x82f, %edx            # imm = 0x82F
jmp 0x19dc00
leaq 0x20c881(%rip), %rsi    # 0x3aa448
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 0x1019cf
addq $0x10, %rsp
leaq 0x20b4d4(%rip), %rsi    # 0x3a90cc
movq %rbp, %rdi
movl $0x848, %edx            # imm = 0x848
callq 0x109670
cmpb $0x0, 0x4(%rsp)
je 0x19dc16
movq 0x10(%rsp), %rdi
callq 0x122d79
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5eaf7