// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/globalchaining.c
// Function: globalchaining_generic
static void globalchaining_generic(bool maxscore_chains,
                                   GtUword max_gap_width,
                                   GtFragment *fragments,
                                   GtUword num_of_fragments,
                                   GtUword seqlen1, double mincoverage,
                                   GtChainProc chainprocessor, void *cpinfo)
{
  Overlapinfo *overlapinfo = NULL;
  GtChaininfo *chaininfo;
  GtChain *chain;
  chain = gt_chain_new();
  chaininfo = gt_malloc(sizeof (GtChaininfo) * num_of_fragments);
  if (gt_log_enabled())
    log_fragments(fragments, num_of_fragments);
  if (num_of_fragments > 1UL) {
    /* compute chains */
    if (!maxscore_chains) {
      overlapinfo = gt_malloc(sizeof (Overlapinfo) * num_of_fragments);
      initoverlapinfo(overlapinfo, fragments, num_of_fragments);
    }
    bruteforcechainingscores(chaininfo, max_gap_width, fragments,
                             num_of_fragments, overlapinfo);
    if (maxscore_chains) {
      findmaximalscores(chain, chaininfo, fragments, num_of_fragments,
                        max_gap_width, chainprocessor, cpinfo);
    }
    else {
      findmaximalscores_withoverlaps(chain, chaininfo, fragments,
                                     num_of_fragments, max_gap_width, seqlen1,
                                     mincoverage, chainprocessor, cpinfo,
                                     overlapinfo);
      gt_free(overlapinfo);
    }
  }
  else {
    chainingboundarycases(chain, fragments, num_of_fragments);
    if (maxscore_chains ||
        ((double) GETSTOREDLENGTH(1, 0) / (double) seqlen1) >= mincoverage) {
      chainprocessor(chain, fragments, num_of_fragments, max_gap_width, cpinfo);
    }
  }
  gt_free(chaininfo);
  gt_chain_delete(chain);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, 0x48(%rsp)
movsd %xmm0, 0x38(%rsp)
movq %r8, 0x58(%rsp)
movq %rcx, %rbp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x20(%rsp)
movl %edi, 0x1c(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x40(%rsp)
callq 0x2980f8
movq %rax, 0x28(%rsp)
movq %rbp, %rdi
shlq $0x4, %rdi
leaq 0xe2441(%rip), %rsi     # 0x37e2da
movl $0x198, %edx            # imm = 0x198
callq 0x93160
movq %rax, %r13
callq 0x92a76
testb %al, %al
je 0x29bf1c
leaq 0xe2442(%rip), %rdi     # 0x37e2f8
xorl %eax, %eax
callq 0x92a82
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %r15
leaq 0xe2443(%rip), %rbx     # 0x37e310
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x29bf1c
movq -0x20(%r15), %rdx
movq -0x18(%r15), %rcx
movq %rcx, %r8
subq %rdx, %r8
incq %r8
movq -0x10(%r15), %r9
movq -0x8(%r15), %r10
movq %r10, %r11
subq %r9, %r11
incq %r11
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
pushq (%r15)
pushq %r11
pushq %r10
callq 0x92a82
addq $0x20, %rsp
incq %r14
addq $0x30, %r15
jmp 0x29bed0
cmpq $0x2, %rbp
jb 0x29c18b
cmpb $0x0, 0x1c(%rsp)
je 0x29c28d
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %r8
movq %rbp, (%r13)
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rax
leaq 0x8(%r13), %rdx
movq %rdx, 0x80(%rsp)
movq %rax, 0x8(%r13)
leaq 0x18(%rcx), %rax
movq %rax, 0x78(%rsp)
pushq $0x1
popq %rbx
movq $0x0, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
movq %r13, 0x88(%rsp)
movq %rbp, 0x90(%rsp)
cmpq %rbp, %rbx
jae 0x29c23e
imulq $0x30, %rbx, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %r14
movq 0x20(%rcx,%rax), %rdi
xorl %r15d, %r15d
movq 0x78(%rsp), %r12
movq 0x80(%rsp), %r13
xorl %r9d, %r9d
movq %rdi, 0x98(%rsp)
cmpq %r15, %rbx
je 0x29c0eb
movq (%r14), %rax
testq %r8, %r8
je 0x29c006
movq -0x10(%r12), %rcx
cmpq %rcx, %rax
jbe 0x29bfea
notq %rcx
addq %rax, %rcx
cmpq %r8, %rcx
ja 0x29c0db
movq 0x10(%r14), %rcx
movq (%r12), %rdx
cmpq %rdx, %rcx
jbe 0x29c006
notq %rdx
addq %rdx, %rcx
cmpq %r8, %rcx
ja 0x29c0db
cmpq %rax, -0x18(%r12)
jae 0x29c0db
movq -0x10(%r12), %rdx
cmpq 0x8(%r14), %rdx
jae 0x29c0db
movq 0x10(%r14), %rcx
cmpq %rcx, -0x8(%r12)
jae 0x29c0db
movq (%r12), %rsi
cmpq 0x18(%r14), %rsi
jae 0x29c0db
movq (%r13), %r8
movq %r8, 0xa0(%rsp)
subq %rax, %rdx
leaq 0x1(%rdx), %rax
movl $0x0, %edx
cmovbq %rdx, %rax
subq %rcx, %rsi
leaq 0x1(%rsi), %rbp
cmovbq %rdx, %rbp
addq %rax, %rbp
leaq 0xe22de(%rip), %rdi     # 0x37e34c
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
xorl %eax, %eax
movq %r9, 0x60(%rsp)
callq 0x92a82
movq 0xa0(%rsp), %rcx
movq 0x60(%rsp), %r9
movq 0x98(%rsp), %rdi
movq 0x20(%rsp), %r8
subq %rbp, %rcx
movq 0x90(%rsp), %rbp
testq %rcx, %rcx
movl $0x0, %eax
cmovgq %rcx, %rax
addq %rdi, %rax
testb $0x1, %r9b
je 0x29c0c4
cmpq %rax, 0x50(%rsp)
jge 0x29c0db
testq %rcx, %rcx
movq %rbp, %rcx
cmovgq %r15, %rcx
movq %rcx, 0x30(%rsp)
movb $0x1, %r9b
movq %rax, 0x50(%rsp)
incq %r15
addq $0x10, %r13
addq $0x30, %r12
jmp 0x29bfc0
movq %rbx, %rax
shlq $0x4, %rax
movq 0x88(%rsp), %r13
addq %r13, %rax
testb $0x1, %r9b
je 0x29c17c
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x10(%rsp)
je 0x29c183
cmpq %rbp, 0x30(%rsp)
je 0x29c183
movq 0x30(%rsp), %rsi
movq %rsi, %rax
shlq $0x5, %rax
movq 0x10(%rsp), %r9
movb $0x0, (%r9,%rax)
movq 0x8(%r9,%rax), %rcx
movq %rbx, %rdx
shlq $0x5, %rdx
movq %rcx, 0x8(%r9,%rdx)
movq (%r14), %rcx
imulq $0x30, %rsi, %rsi
movq 0x8(%rsp), %rdi
movq 0x8(%rdi,%rsi), %rsi
movq %rsi, %rdi
notq %rdi
addq %rcx, %rdi
cmpq %rsi, %rcx
movl $0x0, %ecx
cmovbeq %rdi, %rcx
addq 0x10(%r9,%rax), %rcx
addq %rcx, 0x10(%r9,%rdx)
jmp 0x29c183
movq %rbp, (%rax)
movq %rdi, 0x8(%rax)
incq %rbx
jmp 0x29bf8a
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x298121
testq %rbp, %rbp
je 0x29c1b8
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x2981ab
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2981ec
cmpb $0x0, 0x1c(%rsp)
jne 0x29c21e
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movq %rax, %xmm0
movq 0x4b708(%rip), %xmm1    # 0x2e78e0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4b70c(%rip), %xmm2    # 0x2e78f0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x58(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm3
ucomisd 0x38(%rsp), %xmm3
jb 0x29c524
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %r8
callq *0x48(%rsp)
jmp 0x29c524
cmpb $0x0, 0x1c(%rsp)
je 0x29c2ed
leaq 0x8(%r13), %r15
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %rbx, %rbp
je 0x29c3fb
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x29c65a
testb %al, %al
je 0x29c284
movq (%r15), %rax
testb $0x1, %r12b
je 0x29c27e
cmpq %rax, %r14
jge 0x29c284
movb $0x1, %r12b
movq %rax, %r14
incq %rbx
addq $0x10, %r15
jmp 0x29c255
movq %rbp, %rdi
shlq $0x5, %rdi
leaq 0xe203f(%rip), %rsi     # 0x37e2da
movl $0x19e, %edx            # imm = 0x19E
callq 0x93160
movq %rax, %rcx
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rcx, 0x10(%rsp)
addq $0x18, %rcx
xorl %edx, %edx
movq 0x20(%rsp), %r8
cmpq %rdx, %rbp
je 0x29bf3f
movb $0x1, -0x18(%rcx)
movq %rdx, -0x10(%rcx)
movq (%rax), %rsi
subq -0x8(%rax), %rsi
movq %rsi, -0x8(%rcx)
movq %rbp, (%rcx)
incq %rdx
addq $0x30, %rax
addq $0x20, %rcx
jmp 0x29c2c1
movq 0x58(%rsp), %rbx
cmpq $-0x1, %rbx
je 0x29c58b
movsd 0x38(%rsp), %xmm0
ucomisd 0x4ba06(%rip), %xmm0    # 0x2e7d10
jne 0x29c312
jnp 0x29c5b9
pushq $0x8
popq %r12
movq %r12, %rdi
callq 0x5809c
movq %rbx, %xmm0
punpckldq 0x4b5b5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x4b5bd(%rip), %xmm0    # 0x2e78f0
movq %rax, %rbx
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movq 0x10(%rsp), %rsi
leaq 0x8(%rsi), %r15
xorl %r14d, %r14d
movq 0x4b58a(%rip), %xmm3    # 0x2e78e0
movapd 0x4b592(%rip), %xmm4    # 0x2e78f0
movapd %xmm2, 0x60(%rsp)
cmpq %r14, %rbp
je 0x29c479
cmpb $0x1, -0x8(%r15)
jne 0x29c3ef
movq (%r15), %rax
movq 0x8(%r15), %rcx
shlq $0x5, %rax
addq %rsi, %rax
addq $0x18, %rax
movq (%rax), %rdx
cmpq %rbp, %rdx
jne 0x29c3e1
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm2, %xmm1
ucomisd 0x38(%rsp), %xmm1
jb 0x29c3ef
movq %r14, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5851d
movapd 0x4b524(%rip), %xmm4    # 0x2e78f0
movq 0x4b50c(%rip), %xmm3    # 0x2e78e0
movapd 0x60(%rsp), %xmm2
movq 0x10(%rsp), %rsi
jmp 0x29c3ef
shlq $0x5, %rdx
cmpq 0x10(%rsi,%rdx), %rcx
jbe 0x29c3ef
movq %r14, (%rax)
incq %r14
addq $0x20, %r15
jmp 0x29c364
testb $0x1, %r12b
je 0x29c524
movq %r13, %r15
addq $0x8, %r15
xorl %ebx, %ebx
movq 0x28(%rsp), %r12
cmpq %rbx, %rbp
je 0x29c524
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x29c65a
testb %al, %al
je 0x29c470
cmpq %r14, (%r15)
jl 0x29c470
movq %r12, %rdi
callq 0x298121
movq (%r15), %rsi
movq %r12, %rdi
callq 0x2981ab
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x29c683
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %r8
callq *0x48(%rsp)
incq %rbx
addq $0x10, %r15
jmp 0x29c413
xorl %r15d, %r15d
movq 0x28(%rsp), %r12
movq %rbx, %rdi
callq 0x586a4
cmpq %rax, %r15
jae 0x29c506
movq %rbx, %rdi
movq %r15, %rsi
callq 0x581aa
movq (%rax), %rax
shlq $0x5, %rax
movq 0x10(%rsp), %rcx
cmpq %rbp, 0x18(%rcx,%rax)
je 0x29c553
leaq (%rcx,%rax), %r14
addq $0x18, %r14
movq %r12, %rdi
callq 0x298121
movq (%r14), %rax
shlq $0x4, %rax
movq 0x8(%r13,%rax), %rsi
movq %r12, %rdi
callq 0x2981ab
movq (%r14), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x29c683
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %r8
callq *0x48(%rsp)
incq %r15
jmp 0x29c481
movq %rbx, %rdi
callq 0x58eb9
leaq 0xe1dc5(%rip), %rsi     # 0x37e2da
movq 0x10(%rsp), %rdi
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x936f9
leaq 0xe1daf(%rip), %rsi     # 0x37e2da
movq %r13, %rdi
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x936f9
movq 0x28(%rsp), %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2983a4
movq 0x19ba0e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x48aaf(%rip), %rsi     # 0x2e5013
leaq 0xe1e9f(%rip), %rdx     # 0x37e40a
leaq 0xe1e5a(%rip), %rcx     # 0x37e3cc
leaq 0xe1d61(%rip), %r8      # 0x37e2da
movl $0x173, %r9d            # imm = 0x173
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x19b9d6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x48a77(%rip), %rsi     # 0x2e5013
leaq 0xe1e0f(%rip), %rdx     # 0x37e3b2
leaq 0xe1e22(%rip), %rcx     # 0x37e3cc
leaq 0xe1d29(%rip), %r8      # 0x37e2da
movl $0x151, %r9d            # imm = 0x151
jmp 0x29c57f
movq 0x19b9a8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x48a49(%rip), %rsi     # 0x2e5013
leaq 0xe1e1a(%rip), %rdx     # 0x37e3eb
leaq 0xe1df4(%rip), %rcx     # 0x37e3cc
leaq 0xe1cfb(%rip), %r8      # 0x37e2da
movl $0x152, %r9d            # imm = 0x152
jmp 0x29c57f