// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/chain2dim.c
// Function: gt_chain2dim_retrievechainthreshold
static void gt_chain2dim_retrievechainthreshold(
                             const GtChain2Dimmode *chainmode,
                             GtChain2Dimmatchtable *matchtable,
                             GtChain2Dim *chain,
                             GtChain2Dimscoretype minscore,
                             GtChain2DimBestofclass *chainequivalenceclasses,
                             GtChain2Dimprocessor chainprocessor,
                             void *cpinfo)
{
  GtUword matchnum;
  GtArrayGtChain2DimEdgelevel stack;

  GT_INITARRAY(&stack,GtChain2DimEdgelevel);
  for (matchnum=0; matchnum < matchtable->nextfree; matchnum++)
  {
    if (gt_chain2dim_isrightmaximal_chain(matchtable,matchnum))
    {
      GtChain2Dimscoretype tgap;

      if (chainmode->chainkind == GLOBALCHAININGWITHGAPCOST)
      {
        tgap = GT_CHAIN2DIM_TERMINALGAP(matchnum);
      } else
      {
        tgap = 0;
      }
      if (matchtable->matches[matchnum].score - tgap >= minscore)
      {
        if (chainequivalenceclasses != NULL)
        {
          GtChain2DimBestofclass *classrep
            = gt_chain2dim_local_getclassrep(chainequivalenceclasses,
                                             matchtable,matchnum);

          gt_assert(classrep != NULL &&
                    !chain2dim_chainkind_global(chainmode->chainkind));
          if (classrep->isavailable &&
              classrep->score == matchtable->matches[matchnum].score - tgap)
          {
            chain->scoreofchain = classrep->score;
            classrep->isavailable = false;
            gt_chain2dim_retrace_previousinchain(chain, matchtable, matchnum);
            chainprocessor(cpinfo,matchtable,chain);
          }
        } else
        {
          chain->scoreofchain = matchtable->matches[matchnum].score - tgap;
          if (chainmode->chainkind != GLOBALCHAININGALLCHAINS)
          {
            gt_chain2dim_retrace_previousinchain(chain, matchtable,
                                                 matchnum);
            chainprocessor(cpinfo,matchtable,chain);
          } else
          {
            gt_chain2dim_nd_retrace_allprevious(&stack,chain, matchtable,
                                                matchnum,chainprocessor,
                                                cpinfo);
          }
        }
      }
    }
  }
  GT_FREEARRAY(&stack,GtChain2DimEdgelevel);
}

// Assembly:
subq $0x68, %rsp
movq 0x70(%rsp), %rax
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x20ab33
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x20ab80
testb $0x1, %al
jne 0x20a957
jmp 0x20ab1e
movq 0x60(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x20a97d
movq 0x58(%rsp), %rax
movq (%rax), %rax
imulq $0x50, 0x30(%rsp), %rcx
addq %rcx, %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x20a986
movq $0x0, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
imulq $0x50, 0x30(%rsp), %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
subq 0x10(%rsp), %rax
cmpq 0x48(%rsp), %rax
jl 0x20ab1c
cmpq $0x0, 0x40(%rsp)
je 0x20aa9c
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x20ac20
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x20a9ea
movq 0x60(%rsp), %rax
movl (%rax), %edi
callq 0x20a4e0
testb $0x1, %al
jne 0x20a9ea
jmp 0x20aa22
movq 0x4315af(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x30b618(%rip), %rsi    # 0x516013
leaq 0x366fbf(%rip), %rdx    # 0x5719c1
leaq 0x366ffe(%rip), %rcx    # 0x571a07
leaq 0x366af8(%rip), %r8     # 0x571508
movl $0x499, %r9d            # imm = 0x499
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x20aa24
movq 0x8(%rsp), %rax
testb $0x1, (%rax)
je 0x20aa9a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
imulq $0x50, 0x30(%rsp), %rdx
addq %rdx, %rcx
movq 0x48(%rcx), %rcx
subq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x20aa9a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x20acc0
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
jmp 0x20ab1a
movq 0x58(%rsp), %rax
movq (%rax), %rax
imulq $0x50, 0x30(%rsp), %rcx
addq %rcx, %rax
movq 0x48(%rax), %rcx
subq 0x10(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rax
cmpl $0x3, (%rax)
je 0x20aaf5
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x20acc0
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
jmp 0x20ab18
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x70(%rsp), %r9
leaq 0x18(%rsp), %rdi
callq 0x20aec0
jmp 0x20ab1a
jmp 0x20ab1c
jmp 0x20ab1e
jmp 0x20ab20
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x20a92b
jmp 0x20ab35
cmpq $0x0, 0x18(%rsp)
je 0x20ab6e
movq 0x18(%rsp), %rdi
leaq 0x3669bf(%rip), %rsi    # 0x571508
movl $0x4b4, %edx            # imm = 0x4B4
callq 0xe88c0
movq $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
jmp 0x20ab70
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)