// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/chain2dim.c
// Function: gt_chain_fastchaining
void gt_chain_fastchaining(const GtChain2Dimmode *chainmode,
                           GtChain2Dim *chain,
                           GtChain2Dimmatchtable *matchtable,
                           bool gapsL1,
                           unsigned int presortdim,
                           bool withequivclasses,
                           GtChain2Dimprocessor chainprocessor,
                           void *cpinfo,
                           GtLogger *logger)
{
  GT_UNUSED unsigned int retval;
  GtChain2Dimgapcostfunction chaingapcostfunction;

  gt_assert(presortdim <= 1U);
  chaingapcostfunction
    = assignchaingapcostfunction(chainmode->chainkind,gapsL1);
  if (matchtable->nextfree > 1UL)
  {
    GtChain2DimMatchstore matchstore;

    gt_logger_log(logger,"compute chain scores");
    matchstore.dictroot = NULL;
    if (chainmode->chainkind == GLOBALCHAININGWITHOVERLAPS)
    {
      gt_chain2dim_bruteforcechainingscores(chainmode,matchtable,
                                            chaingapcostfunction);
    } else
    {
      if (chainmode->chainkind == GLOBALCHAININGALLCHAINS)
      {
        gt_chain2dim_ndbfchainscores(matchtable);
      } else
      {
        fastchainingscores(chainmode,
                           matchtable,
                           &matchstore,
                           presortdim,
                           gapsL1);
      }
    }
    gt_logger_log(logger,"retrieve optimal chains");
    retval = gt_chain2dim_findmaximalscores(chainmode,
                               chain,
                               matchtable,
                               &matchstore,
                               chainprocessor,
                               withequivclasses,
                               cpinfo,
                               logger);
    if (chainmode->chainkind != GLOBALCHAININGWITHOVERLAPS
        && chainmode->chainkind != GLOBALCHAININGALLCHAINS)
    {
      gt_rbtree_delete(matchstore.dictroot);
    }
  } else
  {
    gt_chain2dim_chainingboundarycases(chainmode, chain, matchtable);
    if (chainmode->chainkind != LOCALCHAININGTHRESHOLD ||
        matchtable->matches[0].weight >= chainmode->minimumscore)
    {
      chainprocessor(cpinfo,matchtable,chain);
    }
    retval = 0;
  }
  /* retval is not reported. */
}

// Assembly:
subq $0x58, %rsp
movb %r9b, %al
movq 0x70(%rsp), %r9
movq 0x68(%rsp), %r9
movq 0x60(%rsp), %r9
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
andb $0x1, %cl
movb %cl, 0x3f(%rsp)
movl %r8d, 0x38(%rsp)
andb $0x1, %al
movb %al, 0x37(%rsp)
cmpl $0x1, 0x38(%rsp)
jbe 0x207a36
movq 0x43459b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x30e604(%rip), %rsi    # 0x516013
leaq 0x369bd0(%rip), %rdx    # 0x5715e6
leaq 0x369bda(%rip), %rcx    # 0x5715f7
leaq 0x369ae4(%rip), %r8     # 0x571508
movl $0x5d1, %r9d            # imm = 0x5D1
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x207a38
movq 0x50(%rsp), %rax
movl (%rax), %edi
movb 0x3f(%rsp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x207bb0
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
cmpq $0x1, 0x18(%rax)
jbe 0x207b4d
movq 0x70(%rsp), %rdi
leaq 0x369b9f(%rip), %rsi    # 0x57160d
movb $0x0, %al
callq 0xe7cd0
movq $0x0, 0x18(%rsp)
movq 0x50(%rsp), %rax
cmpl $0x2, (%rax)
jne 0x207a9e
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x207c20
jmp 0x207ad8
movq 0x50(%rsp), %rax
cmpl $0x3, (%rax)
jne 0x207ab4
movq 0x40(%rsp), %rdi
callq 0x208040
jmp 0x207ad6
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x38(%rsp), %ecx
movb 0x3f(%rsp), %al
leaq 0x18(%rsp), %rdx
andb $0x1, %al
movzbl %al, %r8d
callq 0x208630
jmp 0x207ad8
movq 0x70(%rsp), %rdi
leaq 0x369b3e(%rip), %rsi    # 0x571622
movb $0x0, %al
callq 0xe7cd0
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x60(%rsp), %r8
movb 0x37(%rsp), %r9b
movq 0x68(%rsp), %r10
movq 0x70(%rsp), %rax
leaq 0x18(%rsp), %rcx
andb $0x1, %r9b
movzbl %r9b, %r9d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2086e0
movl %eax, 0x30(%rsp)
movq 0x50(%rsp), %rax
cmpl $0x2, (%rax)
je 0x207b4b
movq 0x50(%rsp), %rax
cmpl $0x3, (%rax)
je 0x207b4b
movq 0x18(%rsp), %rdi
callq 0x1b7f50
jmp 0x207ba0
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x208a10
movq 0x50(%rsp), %rax
cmpl $0x5, (%rax)
jne 0x207b82
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x207b98
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq *%rax
movl $0x0, 0x30(%rsp)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)