// File: /workspace/github_c_makefile_star2_O3/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 0x18e622
movq 0x48(%rax,%rcx), %r13
subq 0x40(%rax,%rcx), %r13
jmp 0x18e627
movq 0x48(%rax,%rcx), %r13
movq (%r14), %rdi
leaq -0x1ea(%rip), %rdx      # 0x18e447
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x166b9a
testq %rax, %rax
je 0x18e671
movq (%rax), %rcx
movq (%r15), %rax
testb %bpl, %bpl
je 0x18e65f
leaq (%rcx,%rcx,4), %rdx
shlq $0x4, %rdx
movq 0x48(%rax,%rdx), %rcx
subq 0x40(%rax,%rdx), %rcx
jmp 0x18e66c
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movq 0x48(%rax,%rcx), %rcx
cmpq %rcx, %r13
jle 0x18e6c5
movq (%r14), %rdi
leaq 0x7(%rsp), %rdx
movq %rbx, %rsi
callq 0x1663b6
testq %rax, %rax
je 0x18e776
cmpb $0x0, 0x7(%rsp)
jne 0x18e70e
movq (%rax), %rcx
movq (%r15), %rsi
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
testb %bpl, %bpl
je 0x18e6e7
movq 0x48(%rsi,%rcx), %rdx
subq 0x40(%rsi,%rcx), %rdx
movq (%rbx), %rcx
leaq (%rcx,%rcx,4), %r8
shlq $0x4, %r8
movq 0x48(%rsi,%r8), %rdi
subq 0x40(%rsi,%r8), %rdi
jmp 0x18e6fc
leaq 0x2103ac(%rip), %rsi    # 0x39ea78
movq %rbx, %rdi
movl $0x384, %edx            # imm = 0x384
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1045eb
movq 0x48(%rsi,%rcx), %rdx
movq (%rbx), %rcx
leaq (%rcx,%rcx,4), %rdi
shlq $0x4, %rdi
movq 0x48(%rsi,%rdi), %rdi
cmpq %rdi, %rdx
jge 0x18e70e
movq 0x8(%rax), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x18e77b
movq %rcx, (%rax)
leaq -0x2ce(%rip), %r12      # 0x18e447
movq (%r14), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x166c18
testq %rax, %rax
je 0x18e767
movq (%rax), %rdx
movq (%r15), %rcx
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
testb %bpl, %bpl
je 0x18e749
movq 0x48(%rcx,%rdx), %rsi
subq 0x40(%rcx,%rdx), %rsi
jmp 0x18e74e
movq 0x48(%rcx,%rdx), %rsi
cmpq %rsi, %r13
jle 0x18e767
movq (%r14), %rdi
movq %rax, %rsi
callq 0x166432
testl %eax, %eax
je 0x18e715
callq 0x5c5c7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5c5ec
callq 0x5c58e