// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_diagbandseed_merge
static void gt_diagbandseed_merge(GtSeedpairlist *seedpairlist,
                                  GtUword *histogram,
                                  bool knowthesize,
                                  GtDiagbandseedKmerIterator *aiter,
                                  GtDiagbandseedKmerIterator *biter,
                                  GtUword maxfreq,
                                  GtUword maxgram,
                                  const GtRange *seedpairdistance,
                                  bool selfcomp)
{
  const GtKmerPosList *alist, *blist;
  const bool count_cartesian = (histogram != NULL && !selfcomp) ? true : false;

  gt_assert(aiter != NULL && biter != NULL &&
            ((histogram == NULL && seedpairlist != NULL) ||
            (histogram != NULL && seedpairlist == NULL)));
  alist = gt_diagbandseed_kmer_iter_next(aiter);
  blist = gt_diagbandseed_kmer_iter_next(biter);
  while (alist != NULL && blist != NULL)
  {
    const GtDiagbandseedKmerPos *asegment = alist->spaceGtDiagbandseedKmerPos,
                                *bsegment = blist->spaceGtDiagbandseedKmerPos;
    GtUword alen = alist->nextfree,
            blen = blist->nextfree;
    if (asegment->code < bsegment->code)
    {
      alist = gt_diagbandseed_kmer_iter_next(aiter);
    } else
    {
      if (asegment->code > bsegment->code)
      {
        blist = gt_diagbandseed_kmer_iter_next(biter);
      } else
      {
        GtUword frequency = GT_MAX(alen, blen);

        if (frequency <= maxfreq)
        {
          /* add all equal k-mers */
          frequency = GT_MIN(maxgram, frequency);
          gt_assert(frequency > 0);
          if (count_cartesian)
          {
            histogram[frequency - 1] += alen * blen;
          } else
          {
            const GtDiagbandseedKmerPos *aptr, *bptr;
            for (aptr = asegment; aptr < asegment + alen; aptr++)
            {
              for (bptr = bsegment; bptr < bsegment + blen; bptr++)
              {
                if (!selfcomp || aptr->seqnum < bptr->seqnum ||
                    (aptr->seqnum == bptr->seqnum &&
                     aptr->endpos + seedpairdistance->start <= bptr->endpos &&
                     aptr->endpos + seedpairdistance->end >= bptr->endpos))
                {
                  /* no duplicates from the same dataset */
                  if (histogram == NULL)
                  {
                    /* save SeedPair in seedpairlist */
                    gt_seedpairlist_add(seedpairlist,
                                        knowthesize,
                                        aptr->seqnum,
                                        bptr->seqnum,
                                        bptr->endpos,
                                        aptr->endpos);
                  } else
                  {
                    /* count seed frequency in histogram */
                    histogram[frequency - 1]++;
                  }
                }
              }
            }
          }
        } /* else: ignore all equal elements */
        alist = gt_diagbandseed_kmer_iter_next(aiter);
        blist = gt_diagbandseed_kmer_iter_next(biter);
      }
    }
  }
}

// Assembly:
subq $0xa8, %rsp
movb 0xc0(%rsp), %al
movq 0xb8(%rsp), %r10
movq 0xb0(%rsp), %r10
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
andb $0x1, %dl
movb %dl, 0x97(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
andb $0x1, %al
movb %al, 0x77(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x98(%rsp)
movb %al, 0x1f(%rsp)
je 0x2190ee
movb 0x77(%rsp), %al
xorb $-0x1, %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x5f(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x21914d
cmpq $0x0, 0x80(%rsp)
je 0x21914d
cmpq $0x0, 0x98(%rsp)
jne 0x219137
cmpq $0x0, 0xa0(%rsp)
jne 0x219185
cmpq $0x0, 0x98(%rsp)
je 0x21914d
cmpq $0x0, 0xa0(%rsp)
je 0x219185
movq 0x422e4c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2fceb5(%rip), %rsi    # 0x516013
leaq 0x359b1b(%rip), %rdx    # 0x572c80
leaq 0x359b93(%rip), %rcx    # 0x572cff
leaq 0x358e21(%rip), %r8     # 0x571f94
movl $0x7b8, %r9d            # imm = 0x7B8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x219187
movq 0x88(%rsp), %rdi
callq 0x219880
movq %rax, 0x68(%rsp)
movq 0x80(%rsp), %rdi
callq 0x219880
movq %rax, 0x60(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x68(%rsp)
movb %al, 0x1e(%rsp)
je 0x2191c6
cmpq $0x0, 0x60(%rsp)
setne %al
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0x2191d3
jmp 0x2194c1
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x219232
movq 0x88(%rsp), %rdi
callq 0x219880
movq %rax, 0x68(%rsp)
jmp 0x2194bc
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x21925b
movq 0x80(%rsp), %rdi
callq 0x219880
movq %rax, 0x60(%rsp)
jmp 0x2194ba
movq 0x40(%rsp), %rax
cmpq 0x38(%rsp), %rax
jbe 0x219273
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x21927d
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x78(%rsp), %rax
ja 0x219496
movq 0xb0(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x2192b5
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x2192bf
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
ja 0x219309
movq 0x422cc8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2fcd31(%rip), %rsi    # 0x516013
leaq 0x359a2c(%rip), %rdx    # 0x572d15
leaq 0x359a0f(%rip), %rcx    # 0x572cff
leaq 0x358c9d(%rip), %r8     # 0x571f94
movl $0x7d1, %r9d            # imm = 0x7D1
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x21930b
testb $0x1, 0x5f(%rsp)
je 0x21933b
movq 0x40(%rsp), %rdx
imulq 0x38(%rsp), %rdx
movq 0x98(%rsp), %rax
movq 0x30(%rsp), %rcx
subq $0x1, %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x219494
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x219492
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq 0x38(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x21947d
testb $0x1, 0x77(%rsp)
je 0x219401
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x219401
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x219468
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
movq 0xb8(%rsp), %rcx
addq (%rcx), %rax
movq 0x20(%rsp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
ja 0x219468
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
movq 0xb8(%rsp), %rcx
addq 0x8(%rcx), %rax
movq 0x20(%rsp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jb 0x219468
cmpq $0x0, 0x98(%rsp)
jne 0x219449
movq 0xa0(%rsp), %rdi
movb 0x97(%rsp), %al
movq 0x28(%rsp), %rcx
movl 0x8(%rcx), %edx
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq 0x20(%rsp), %rsi
movl 0xc(%rsi), %r8d
movq 0x28(%rsp), %rsi
movl 0xc(%rsi), %r9d
andb $0x1, %al
movzbl %al, %esi
callq 0x219d10
jmp 0x219466
movq 0x98(%rsp), %rax
movq 0x30(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x219468
jmp 0x21946a
movq 0x20(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
jmp 0x21936e
jmp 0x21947f
movq 0x28(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x28(%rsp)
jmp 0x219345
jmp 0x219494
jmp 0x219496
movq 0x88(%rsp), %rdi
callq 0x219880
movq %rax, 0x68(%rsp)
movq 0x80(%rsp), %rdi
callq 0x219880
movq %rax, 0x60(%rsp)
jmp 0x2194bc
jmp 0x2191ab
addq $0xa8, %rsp
retq
nopl (%rax)