// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/chain2dim.c
// Function: gt_chain2dim_activatematchpoint
static void gt_chain2dim_activatematchpoint(bool addterminal,
                               const GtChain2Dimmatchtable *matchtable,
                               GtChain2DimMatchstore *matchstore,
                               GtChain2DimMatchpoint *qmatch2)
{
  GtChain2DimMatchpoint *tmp2;
  GtChain2Dimscoretype qpriority;

  qpriority = gt_chain2dim_evalpriority(addterminal,matchtable,
                                        FRAGIDENT(qmatch2));
  tmp2 = (GtChain2DimMatchpoint *) gt_rbtree_previous_equal_key(
                                     matchstore->dictroot,
                                     qmatch2,
                                     gt_chain2dim_cmpendMatchpoint2,
                                     NULL);
  if (tmp2 == NULL ||
      qpriority > gt_chain2dim_evalpriority(addterminal,matchtable,
                                            FRAGIDENT(tmp2)))
  {
    gt_chain2dim_insertintodict(addterminal,matchtable,matchstore,qmatch2);
    while (true)
    {
      tmp2 = (GtChain2DimMatchpoint *) gt_rbtree_next_key(
                                               matchstore->dictroot,
                                               qmatch2,
                                               gt_chain2dim_cmpendMatchpoint2,
                                               NULL);
      if (tmp2 == NULL ||
          qpriority <= gt_chain2dim_evalpriority(addterminal,matchtable,
                                                 FRAGIDENT(tmp2)))
      {
        break;
      }
      if (gt_rbtree_erase(matchstore->dictroot, tmp2) != 0)
      {
        fprintf(stderr,"cannot delete successor node\n");
        exit(GT_EXIT_PROGRAMMING_ERROR);
      }
    }
  } else
  {
    gt_free(qmatch2);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq (%rcx), %rcx
movq (%rsi), %rax
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
testl %edi, %edi
je 0x196c5a
movq 0x48(%rax,%rcx), %r13
subq 0x40(%rax,%rcx), %r13
jmp 0x196c5f
movq 0x48(%rax,%rcx), %r13
movq (%r14), %rdi
leaq -0x1c4(%rip), %rdx      # 0x196aa5
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x16eb23
testq %rax, %rax
je 0x196ca9
movq (%rax), %rcx
movq (%r15), %rax
testb %bpl, %bpl
je 0x196c97
leaq (%rcx,%rcx,4), %rdx
shlq $0x4, %rdx
movq 0x48(%rax,%rdx), %rcx
subq 0x40(%rax,%rdx), %rcx
jmp 0x196ca4
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movq 0x48(%rax,%rcx), %rcx
cmpq %rcx, %r13
jle 0x196cec
movq (%r14), %rdi
leaq 0x7(%rsp), %rdx
movq %rbx, %rsi
callq 0x16e310
testq %rax, %rax
je 0x196dc1
cmpb $0x0, 0x7(%rsp)
jne 0x196d59
movq (%rax), %rdx
movq (%r15), %rcx
testb %bpl, %bpl
je 0x196d0e
leaq (%rdx,%rdx,4), %rsi
shlq $0x4, %rsi
movq 0x48(%rcx,%rsi), %rdx
subq 0x40(%rcx,%rsi), %rdx
jmp 0x196d1b
leaq 0x211255(%rip), %rsi    # 0x3a7f48
movq %rbx, %rdi
movl $0x384, %edx            # imm = 0x384
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x109670
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
movq 0x48(%rcx,%rdx), %rdx
movq (%rbx), %rcx
movq (%r15), %rsi
testb %bpl, %bpl
je 0x196d3a
leaq (%rcx,%rcx,4), %r8
shlq $0x4, %r8
movq 0x48(%rsi,%r8), %rdi
subq 0x40(%rsi,%r8), %rdi
jmp 0x196d47
leaq (%rcx,%rcx,4), %rdi
shlq $0x4, %rdi
movq 0x48(%rsi,%rdi), %rdi
cmpq %rdi, %rdx
jge 0x196d59
movq 0x8(%rax), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x196dc6
movq %rcx, (%rax)
leaq -0x2bb(%rip), %r12      # 0x196aa5
movq (%r14), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x16eba7
testq %rax, %rax
je 0x196db2
movq (%rax), %rdx
movq (%r15), %rcx
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
testb %bpl, %bpl
je 0x196d94
movq 0x48(%rcx,%rdx), %rsi
subq 0x40(%rcx,%rdx), %rsi
jmp 0x196d99
movq 0x48(%rcx,%rdx), %rsi
cmpq %rsi, %r13
jle 0x196db2
movq (%r14), %rdi
movq %rax, %rsi
callq 0x16e38c
testl %eax, %eax
je 0x196d60
callq 0x5d91e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5d943
callq 0x5d8e5