// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/chain2dim.c
// Function: mergestartandendpoints
static void mergestartandendpoints(const GtChain2Dimmode *chainmode,
                                   GtChain2Dimmatchtable *matchtable,
                                   GtChain2DimMatchstore *matchstore,
                                   bool gapsL1,
                                   unsigned int presortdim)
{
  GtUword startcount, endcount;
  const unsigned int postsortdim = 1U - presortdim;
  bool addterminal = (chainmode->chainkind == GLOBALCHAINING) ? false : true;

  matchstore->dictroot = gt_rbtree_new(gt_chain2dim_cmpendMatchpoint2,
                                       gt_free_func, NULL);
  for (startcount = 0, endcount = 0;
       startcount < matchtable->nextfree &&
       endcount < matchtable->nextfree;
       /*Nothing*/)
  {
    if (comparestartandend(matchtable->matches + startcount,
                           matchtable->matches +
                           matchstore->endpointperm[endcount],
                           presortdim) < 0)
    {
      gt_chain2dim_evalmatchscore(chainmode,
                     matchtable,
                     matchstore,
                     gapsL1,
                     startcount,
                     presortdim);
      startcount++;
    } else
    {
      gt_chain2dim_activatematchpoint(addterminal,matchtable,matchstore,
                        makeactivationpoint(matchtable,
                                            matchstore->
                                            endpointperm[endcount],
                                            postsortdim));
      endcount++;
    }
  }
  while (startcount < matchtable->nextfree)
  {
    gt_chain2dim_evalmatchscore(chainmode,
                   matchtable,
                   matchstore,
                   gapsL1,
                   startcount,
                   presortdim);
    startcount++;
  }
  while (endcount < matchtable->nextfree)
  {
    gt_chain2dim_activatematchpoint(addterminal,matchtable,matchstore,
                      makeactivationpoint(matchtable,
                                          matchstore->
                                          endpointperm[endcount],
                                          postsortdim));
    endcount++;
  }
}

// Assembly:
subq $0x68, %rsp
movb %cl, %al
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
andb $0x1, %al
movb %al, 0x4f(%rsp)
movl %r8d, 0x48(%rsp)
movl $0x1, %eax
subl 0x48(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x60(%rsp), %rax
movl (%rax), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x33(%rsp)
leaq 0x20c(%rip), %rdi       # 0x209d20
leaq -0x1210eb(%rip), %rsi   # 0xe8a30
xorl %eax, %eax
movl %eax, %edx
callq 0x1b7e90
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x40(%rsp), %rcx
movq 0x58(%rsp), %rdx
xorl %eax, %eax
cmpq 0x18(%rdx), %rcx
movb %al, 0x32(%rsp)
jae 0x209b6c
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x18(%rcx), %rax
setb %al
movb %al, 0x32(%rsp)
movb 0x32(%rsp), %al
testb $0x1, %al
jne 0x209b79
jmp 0x209c57
movq 0x58(%rsp), %rax
movq (%rax), %rdi
imulq $0x50, 0x40(%rsp), %rax
addq %rax, %rdi
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
imulq $0x50, (%rax,%rcx,8), %rax
addq %rax, %rsi
movl 0x48(%rsp), %edx
callq 0x209db0
cmpl $0x0, %eax
jge 0x209bed
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movb 0x4f(%rsp), %al
movq 0x40(%rsp), %r8
movl 0x48(%rsp), %r9d
andb $0x1, %al
movzbl %al, %ecx
callq 0x209e20
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x209c52
movb 0x33(%rsp), %al
movb %al, 0x31(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl 0x34(%rsp), %edx
callq 0x20a280
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rax, %rcx
movb 0x31(%rsp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x20a100
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x209b41
jmp 0x209c59
movq 0x40(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x209ca0
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movb 0x4f(%rsp), %al
movq 0x40(%rsp), %r8
movl 0x48(%rsp), %r9d
andb $0x1, %al
movzbl %al, %ecx
callq 0x209e20
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x209c59
jmp 0x209ca2
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x209d19
movb 0x33(%rsp), %al
movb %al, 0x1f(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl 0x34(%rsp), %edx
callq 0x20a280
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x20a100
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x209ca2
addq $0x68, %rsp
retq
nop