// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-pairwise.c
// Function: rdj_pairwise_generic
static inline void rdj_pairwise_generic(bool use_dp, GtOvlfindMode m,
    GtEncseq *encseq, bool revcompl, bool show_progressbar, bool use_kmp,
    double max_error, GtUword min_length, bool find_nonmaximal,
    GtSpmproc proc, GtSpmprocA proc_a, void* procdata, bool cntfilter,
    GtBitsequence *cntreads_in, GtBitsequence **cntreads_out,
    GtUword *nofreads)
{
  GtContfind containment_status;
  GtBitsequence *cntreads = NULL;
  GtUint64 progress = 0;
  GtUword i, j, startpos, v_seqnum, nofsequences, n;
  struct Read u, v;
  struct Data d;
  gt_kmp_t** kmp_values = NULL;

  GT_RDJ_PAIRWISE_INIT_STRUCT_DATA(d, proc, proc_a, procdata, &u, &v, 0);

  gt_assert(encseq != NULL);

  d.mode = m;
  if ((m == GT_OVLFIND_ALL) && cntfilter)
    d.mode = GT_OVLFIND_PROPER_SPM;

  n = gt_encseq_num_of_sequences(encseq);
  if (use_kmp)
    kmp_values = prepare_kmp_values(encseq, n);
  nofsequences = n;
  if (revcompl)
    n = n >> 1;
  if (cntreads_in != NULL)
    cntreads = cntreads_in;
  else if (m != GT_OVLFIND_SPM)
    GT_INITBITTAB(cntreads, n);
  if (show_progressbar) gt_progressbar_start(&progress, (GtUint64)n *
      ((GtUint64)n - 1ULL) / 2ULL);

  for (i = 0; i < n; i++)
  {
    u.seqnum = i;
    u.direct = true;
    u.len = gt_encseq_seqlength(encseq, i);
    u.seq = gt_malloc(sizeof (char) * (u.len + 1));
    startpos = gt_encseq_seqstartpos(encseq, i);
    gt_encseq_extract_decoded(encseq, u.seq, startpos, startpos + u.len - 1);
    u.seq[u.len] = '\0';
    if (use_kmp)
    {
      gt_assert(kmp_values != NULL);
      u.pi = kmp_values[i];
    }

    for (j = i; j < n; j++)
    {
      if (cntfilter)
      {
        gt_assert(cntreads != NULL);
        if ((bool)GT_ISIBITSET(cntreads, i)) break;
        if ((bool)GT_ISIBITSET(cntreads, j)) continue;
      }

      v.seqnum = j;

      /* find overlaps using direct v */
      v.direct = true;
      v.len = gt_encseq_seqlength(encseq, j);
      v.seq = gt_malloc(sizeof (char) * (v.len + 1));
      startpos = gt_encseq_seqstartpos(encseq, j);
      gt_encseq_extract_decoded(encseq, v.seq, startpos,
          startpos + v.len - 1);
      v.seq[v.len] = '\0';
      if (use_kmp)
      {
        gt_assert(kmp_values != NULL);
        v.pi = kmp_values[j];
      }
      containment_status = use_dp
          ? find_approx_overlaps(&d, max_error, min_length, find_nonmaximal)
          : find_exact_overlaps(&d, use_kmp, min_length, find_nonmaximal);
      if (m != GT_OVLFIND_SPM)
        mark_contained(containment_status, u.seqnum, v.seqnum, cntreads);

      /* find overlaps using reverse complement of v */
      if (revcompl)
      {
        v_seqnum =  nofsequences - j - 1;
        v.direct = false;
        gt_assert(gt_encseq_seqlength(encseq, j) ==
            gt_encseq_seqlength(encseq, v_seqnum));
        startpos = gt_encseq_seqstartpos(encseq, v_seqnum);
        gt_encseq_extract_decoded(encseq, v.seq, startpos,
            startpos + v.len - 1);
        if (use_kmp)
        {
          gt_assert(kmp_values != NULL);
          v.pi = kmp_values[v_seqnum];
        }
        containment_status = use_dp
          ? find_approx_overlaps(&d, max_error, min_length, find_nonmaximal)
          : find_exact_overlaps(&d, use_kmp, min_length, find_nonmaximal);
        if (m != GT_OVLFIND_SPM)
          mark_contained(containment_status, u.seqnum, v.seqnum, cntreads);
      }
      gt_free(v.seq);
      progress++;
    }
    gt_free(u.seq);
  }

  if (cntreads_out != NULL)
    *cntreads_out = cntreads;
  else if (cntreads_in == NULL)
    gt_free(cntreads);
  if (nofreads != NULL)
    *nofreads = n;
  if (use_kmp)
    free_kmp_values(kmp_values, revcompl ? n << 1 : n);
  if (show_progressbar)
    gt_progressbar_stop();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movsd %xmm0, 0x60(%rsp)
movl %r8d, 0x2c(%rsp)
movl %edi, 0x34(%rsp)
movq 0x150(%rsp), %rax
andq $0x0, 0x68(%rsp)
movaps 0x140(%rsp), %xmm0
movups %xmm0, 0xc8(%rsp)
movq %rax, 0xd8(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0xe8(%rsp)
testq %rdx, %rdx
je 0x17b508
movl %r9d, %ebp
movq %rdx, %r12
movl %ecx, 0x18(%rsp)
cmpb $0x0, 0x158(%rsp)
pushq $0x3
popq %rax
cmovel %esi, %eax
cmpl $0x2, %esi
movl %esi, 0x1c(%rsp)
cmovnel %esi, %eax
movl %eax, 0xf0(%rsp)
movq %rdx, %rdi
callq 0x705a1
movq %rax, %r13
testb %bpl, %bpl
je 0x17af32
leaq (,%r13,8), %rdi
leaq 0x1d37f6(%rip), %rsi    # 0x34e68b
movl $0x88, %edx
callq 0x93160
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x17af36
movq %r12, %rdi
movq %r14, %rsi
callq 0x75173
movq %rax, %r15
leaq 0x1(%rax), %rdi
leaq 0x1d37c2(%rip), %rsi    # 0x34e68b
movl $0x8d, %edx
callq 0x93160
movq %r13, %rbx
movq %rax, %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x74d9c
leaq (%r15,%rax), %rcx
decq %rcx
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x7239d
movb $0x0, (%r13,%r15)
movq %r13, %rdi
movq %r15, %rsi
callq 0x2c94f4
movq 0x10(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
movq %r13, %rdi
movq %rbx, %r13
leaq 0x1d376b(%rip), %rsi    # 0x34e68b
movl $0x93, %edx
callq 0x936f9
incq %r14
jmp 0x17aea7
xorl %ebx, %ebx
jmp 0x17af3b
movq 0x10(%rsp), %rbx
movq %rbx, 0x10(%rsp)
movq %r13, %rax
movl 0x18(%rsp), %ebx
movl %ebx, %ecx
shrq %cl, %rax
movq %rax, 0x20(%rsp)
movq 0x160(%rsp), %rax
movq %rax, %r15
testq %rax, %rax
jne 0x17afb7
cmpl $0x0, 0x1c(%rsp)
je 0x17afb4
movq 0x20(%rsp), %rcx
leaq -0x1(%rcx), %rax
shrq $0x6, %rax
cmpq $0x40, %rcx
leaq 0x8(,%rax,8), %rax
pushq $0x8
popq %rbx
cmovaeq %rax, %rbx
leaq 0x1d36fc(%rip), %rdx    # 0x34e68b
xorl %edi, %edi
movq %rbx, %rsi
movl $0xd7, %ecx
callq 0x93472
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl 0x18(%rsp), %ebx
callq 0x17380
jmp 0x17afb7
xorl %r15d, %r15d
movzbl %bl, %eax
movq %rax, 0x98(%rsp)
movb 0x138(%rsp), %bl
cmpb $0x0, 0x2c(%rsp)
je 0x17afea
movq 0x20(%rsp), %rax
leaq -0x1(%rax), %rsi
imulq %rax, %rsi
shrq %rsi
leaq 0x68(%rsp), %rdi
callq 0x9c79c
decq %r13
xorl %r14d, %r14d
movzbl %bl, %eax
movl %eax, 0xc(%rsp)
movzbl %bpl, %eax
movl %eax, 0x30(%rsp)
movq 0x10(%rsp), %rbx
movq %r14, %rcx
movq 0x20(%rsp), %rax
cmpq %r14, %rax
cmovaq %rax, %rcx
movq %rcx, 0xc0(%rsp)
je 0x17b34c
movq %r14, 0x80(%rsp)
movb $0x1, 0x88(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x75173
movq %rax, 0x78(%rsp)
leaq 0x1(%rax), %rdi
leaq 0x1d363f(%rip), %rsi    # 0x34e68b
movl $0xe0, %edx
callq 0x93160
movq %rax, 0x70(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x74d9c
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rcx
addq %rax, %rcx
decq %rcx
movq %r12, %rdi
movq %rax, %rdx
callq 0x7239d
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movb $0x0, (%rax,%rcx)
testb %bpl, %bpl
je 0x17b0a9
testq %rbx, %rbx
je 0x17b4da
movq (%rbx,%r14,8), %rax
movq %rax, 0x90(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movl %r14d, %ecx
shrq %cl, %rax
movq %rax, 0xb8(%rsp)
movq %r14, %rax
shrq $0x6, %rax
movq %rax, 0xb0(%rsp)
movq %r13, 0xa8(%rsp)
movq %r14, 0xa0(%rsp)
cmpq %r14, 0xc0(%rsp)
je 0x17b31b
cmpb $0x0, 0x158(%rsp)
je 0x17b13c
testq %r15, %r15
je 0x17b415
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rcx
testq %rax, (%r15,%rcx,8)
jne 0x17b31b
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movl %r14d, %ecx
shrq %cl, %rax
movq %r14, %rcx
shrq $0x6, %rcx
testq %rax, (%r15,%rcx,8)
jne 0x17b310
movq %r14, 0x48(%rsp)
movb $0x1, 0x50(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x75173
movq %rax, 0x40(%rsp)
leaq 0x1(%rax), %rdi
leaq 0x1d352a(%rip), %rsi    # 0x34e68b
movl $0xf8, %edx
callq 0x93160
movq %rax, 0x38(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x74d9c
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rcx
addq %rax, %rcx
decq %rcx
movq %r12, %rdi
movq %rax, %rdx
callq 0x7239d
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
movb $0x0, (%rax,%rcx)
testb %bpl, %bpl
je 0x17b1bb
testq %rbx, %rbx
je 0x17b474
movq (%rbx,%r14,8), %rax
movq %rax, 0x58(%rsp)
cmpb $0x0, 0x34(%rsp)
je 0x17b1e3
leaq 0xc8(%rsp), %rdi
movsd 0x60(%rsp), %xmm0
movq 0x130(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x17b63e
jmp 0x17b200
leaq 0xc8(%rsp), %rdi
movl 0x30(%rsp), %esi
movq 0x130(%rsp), %rdx
movl 0xc(%rsp), %ecx
callq 0x17b6c3
cmpl $0x0, 0x1c(%rsp)
je 0x17b21e
movq 0x80(%rsp), %rsi
movq 0x48(%rsp), %rdx
movl %eax, %edi
movq %r15, %rcx
callq 0x17b7d8
cmpb $0x0, 0x18(%rsp)
je 0x17b2f5
movb $0x0, 0x50(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x75173
movq %rax, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0x75173
cmpq %rax, %rbx
jne 0x17b446
movq %r12, %rdi
movq %r13, %rsi
callq 0x74d9c
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rcx
addq %rax, %rcx
decq %rcx
movq %r12, %rdi
movq %rax, %rdx
callq 0x7239d
testb %bpl, %bpl
movq 0x10(%rsp), %rbx
je 0x17b292
testq %rbx, %rbx
je 0x17b4a2
movq (%rbx,%r13,8), %rax
movq %rax, 0x58(%rsp)
cmpb $0x0, 0x34(%rsp)
je 0x17b2ba
leaq 0xc8(%rsp), %rdi
movsd 0x60(%rsp), %xmm0
movq 0x130(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x17b63e
jmp 0x17b2d7
leaq 0xc8(%rsp), %rdi
movl 0x30(%rsp), %esi
movq 0x130(%rsp), %rdx
movl 0xc(%rsp), %ecx
callq 0x17b6c3
cmpl $0x0, 0x1c(%rsp)
je 0x17b2f5
movq 0x80(%rsp), %rsi
movq 0x48(%rsp), %rdx
movl %eax, %edi
movq %r15, %rcx
callq 0x17b7d8
movq 0x38(%rsp), %rdi
leaq 0x1d338a(%rip), %rsi    # 0x34e68b
movl $0x11d, %edx            # imm = 0x11D
callq 0x936f9
incq 0x68(%rsp)
incq %r14
decq %r13
jmp 0x17b0e0
movq 0x70(%rsp), %rdi
leaq 0x1d3364(%rip), %rsi    # 0x34e68b
movl $0x120, %edx            # imm = 0x120
callq 0x936f9
movq 0xa0(%rsp), %r14
incq %r14
movq 0xa8(%rsp), %r13
decq %r13
jmp 0x17b004
movq 0x168(%rsp), %rax
testq %rax, %rax
je 0x17b366
movq %r15, (%rax)
movq 0x170(%rsp), %r14
jmp 0x17b38d
cmpq $0x0, 0x160(%rsp)
movq 0x170(%rsp), %r14
jne 0x17b38d
leaq 0x1d330b(%rip), %rsi    # 0x34e68b
movq %r15, %rdi
movl $0x126, %edx            # imm = 0x126
callq 0x936f9
testq %r14, %r14
je 0x17b39a
movq 0x20(%rsp), %rax
movq %rax, (%r14)
testb %bpl, %bpl
je 0x17b3f7
movq 0x98(%rsp), %rcx
shlq %cl, 0x20(%rsp)
testq %rbx, %rbx
je 0x17b536
xorl %r14d, %r14d
leaq 0x1d32cc(%rip), %rbx    # 0x34e68b
cmpq %r14, 0x20(%rsp)
je 0x17b3e1
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movl $0x9c, %edx
callq 0x936f9
incq %r14
jmp 0x17b3bf
leaq 0x1d32a3(%rip), %rsi    # 0x34e68b
movq 0x10(%rsp), %rdi
movl $0x9d, %edx
callq 0x936f9
cmpb $0x0, 0x2c(%rsp)
je 0x17b403
callq 0x9cce9
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bcb4c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169bed(%rip), %rsi    # 0x2e5013
leaq 0x1d336b(%rip), %rdx    # 0x34e798
leaq 0x1d333c(%rip), %rcx    # 0x34e770
leaq 0x1d3250(%rip), %r8     # 0x34e68b
movl $0xee, %r9d
jmp 0x17b4ce
movq 0x2bcb1b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169bbc(%rip), %rsi    # 0x2e5013
leaq 0x1d334b(%rip), %rdx    # 0x34e7a9
leaq 0x1d330b(%rip), %rcx    # 0x34e770
leaq 0x1d321f(%rip), %r8     # 0x34e68b
movl $0x10e, %r9d            # imm = 0x10E
jmp 0x17b4ce
movq 0x2bcaed(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169b8e(%rip), %rsi    # 0x2e5013
leaq 0x1d32f9(%rip), %rdx    # 0x34e785
leaq 0x1d32dd(%rip), %rcx    # 0x34e770
leaq 0x1d31f1(%rip), %r8     # 0x34e68b
movl $0xff, %r9d
jmp 0x17b4ce
movq 0x2bcabf(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169b60(%rip), %rsi    # 0x2e5013
leaq 0x1d32cb(%rip), %rdx    # 0x34e785
leaq 0x1d32af(%rip), %rcx    # 0x34e770
leaq 0x1d31c3(%rip), %r8     # 0x34e68b
movl $0x114, %r9d            # imm = 0x114
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2bca87(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169b28(%rip), %rsi    # 0x2e5013
leaq 0x1d3293(%rip), %rdx    # 0x34e785
leaq 0x1d3277(%rip), %rcx    # 0x34e770
leaq 0x1d318b(%rip), %r8     # 0x34e68b
movl $0xe6, %r9d
jmp 0x17b4ce
movq 0x2bca59(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169afa(%rip), %rsi    # 0x2e5013
leaq 0x1c4d92(%rip), %rdx    # 0x3402b2
leaq 0x1d3249(%rip), %rcx    # 0x34e770
leaq 0x1d315d(%rip), %r8     # 0x34e68b
movl $0xc8, %r9d
jmp 0x17b4ce
movq 0x2bca2b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x169acc(%rip), %rsi    # 0x2e5013
leaq 0x1d3237(%rip), %rdx    # 0x34e785
leaq 0x1d32ab(%rip), %rcx    # 0x34e800
leaq 0x1d312f(%rip), %r8     # 0x34e68b
movl $0x9b, %r9d
jmp 0x17b4ce