// File: /workspace/github_c_makefile_star2_O3/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, 0x58(%rsp)
movsd %xmm0, 0x48(%rsp)
movq %r8, 0x68(%rsp)
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x30(%rsp)
movl %edi, 0x2c(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0x2fbbfc
movq %rax, 0x18(%rsp)
movq %rbx, 0x8(%rsp)
shlq $0x4, %rbx
leaq 0xdf3da(%rip), %rsi     # 0x3ddf0a
movq %rbx, %rdi
movl $0x198, %edx            # imm = 0x198
callq 0x104226
movq %rax, 0x20(%rsp)
callq 0x103d66
testb %al, %al
je 0x2febc4
leaq 0xdf3d6(%rip), %rdi     # 0x3ddf28
xorl %eax, %eax
callq 0x103d72
cmpq $0x0, 0x8(%rsp)
je 0x2ff187
movq 0x10(%rsp), %rax
leaq 0x20(%rax), %r15
leaq 0xdf3cb(%rip), %rbx     # 0x3ddf40
xorl %r14d, %r14d
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 0x103d72
addq $0x20, %rsp
incq %r14
addq $0x30, %r15
cmpq %r14, 0x8(%rsp)
jne 0x2feb78
cmpq $0x2, 0x8(%rsp)
jb 0x2febe1
cmpb $0x0, 0x2c(%rsp)
je 0x2fec1c
movq $0x0, 0x38(%rsp)
jmp 0x2fec78
movq 0x18(%rsp), %rdi
callq 0x2fbc2d
cmpq $0x0, 0x8(%rsp)
je 0x2ff191
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2fbc58
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2fbc68
jmp 0x2ff191
movq 0x8(%rsp), %rdi
shlq $0x5, %rdi
leaq 0xdf2de(%rip), %rsi     # 0x3ddf0a
movl $0x19e, %edx            # imm = 0x19E
callq 0x104226
movq %rax, %rcx
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %rcx, 0x38(%rsp)
addq $0x18, %rcx
xorl %edx, %edx
movb $0x1, -0x18(%rcx)
movq %rdx, -0x10(%rcx)
movq (%rax), %rsi
subq -0x8(%rax), %rsi
movq %rsi, -0x8(%rcx)
movq 0x8(%rsp), %rsi
movq %rsi, (%rcx)
incq %rdx
addq $0x30, %rax
addq $0x20, %rcx
cmpq %rdx, %rsi
jne 0x2fec4d
movq 0x30(%rsp), %r8
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rax, (%rcx)
movq 0x10(%rsp), %rdx
movq 0x20(%rdx), %rax
leaq 0x8(%rcx), %rsi
movq %rsi, 0x90(%rsp)
movq %rax, 0x8(%rcx)
leaq 0x18(%rdx), %rax
movq %rax, 0x88(%rsp)
movl $0x1, %ebx
movq $0x0, 0x60(%rsp)
movq $0x0, 0x40(%rsp)
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax), %r14
movq 0x20(%rcx,%rax), %rdi
xorl %r9d, %r9d
movq 0x88(%rsp), %r12
movq 0x90(%rsp), %r13
xorl %r15d, %r15d
movq %rdi, 0x98(%rsp)
movq (%r14), %rax
testq %r8, %r8
je 0x2fed37
movq -0x10(%r12), %rcx
cmpq %rcx, %rax
jbe 0x2fed1b
notq %rcx
addq %rax, %rcx
cmpq %r8, %rcx
ja 0x2fee06
movq 0x10(%r14), %rcx
movq (%r12), %rdx
cmpq %rdx, %rcx
jbe 0x2fed37
notq %rdx
addq %rdx, %rcx
cmpq %r8, %rcx
ja 0x2fee06
cmpq %rax, -0x18(%r12)
jae 0x2fee06
movq -0x10(%r12), %rdx
cmpq 0x8(%r14), %rdx
jae 0x2fee06
movq 0x10(%r14), %rcx
cmpq %rcx, -0x8(%r12)
jae 0x2fee06
movq (%r12), %rsi
cmpq 0x18(%r14), %rsi
jae 0x2fee06
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 0xdf1dd(%rip), %rdi     # 0x3ddf7c
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
xorl %eax, %eax
movq %r9, 0x70(%rsp)
callq 0x103d72
movq 0xa0(%rsp), %rcx
movq 0x70(%rsp), %r9
movq 0x98(%rsp), %rdi
movq 0x30(%rsp), %r8
subq %rbp, %rcx
testq %rcx, %rcx
movl $0x0, %eax
cmovgq %rcx, %rax
addq %rdi, %rax
testb $0x1, %r9b
je 0x2feded
cmpq %rax, 0x60(%rsp)
jge 0x2fee06
testq %rcx, %rcx
movq 0x8(%rsp), %rcx
cmovgq %r15, %rcx
movq %rcx, 0x40(%rsp)
movb $0x1, %r9b
movq %rax, 0x60(%rsp)
incq %r15
addq $0x10, %r13
addq $0x30, %r12
cmpq %r15, %rbx
jne 0x2fecfa
movq %rbx, %rax
shlq $0x4, %rax
addq 0x20(%rsp), %rax
testb $0x1, %r9b
je 0x2feeb2
movq 0x40(%rsp), %rcx
movq %rcx, (%rax)
movq 0x60(%rsp), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x38(%rsp)
je 0x2feebe
movq 0x8(%rsp), %rax
cmpq %rax, 0x40(%rsp)
je 0x2feebe
movq 0x40(%rsp), %rsi
movq %rsi, %rax
shlq $0x5, %rax
movq 0x38(%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
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movq 0x10(%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 0x2feebe
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rdi, 0x8(%rax)
incq %rbx
cmpq 0x8(%rsp), %rbx
jne 0x2fecc6
cmpb $0x0, 0x2c(%rsp)
je 0x2fefb2
movq 0x8(%rsp), %rax
leaq -0x1(%rax), %r14
movq 0x20(%rsp), %rax
addq $0x8, %rax
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %edx, %edx
cmpq %rdx, %r14
je 0x2fef04
cmpq 0x8(%rax), %rdx
jne 0x2fef04
movq 0x10(%rax), %rsi
cmpq (%rax), %rsi
jge 0x2fef16
movq (%rax), %rsi
testb $0x1, %cl
je 0x2fef11
cmpq %rsi, %r15
jge 0x2fef16
movb $0x1, %cl
movq %rsi, %r15
incq %rdx
addq $0x10, %rax
cmpq %rdx, 0x8(%rsp)
jne 0x2feef0
testb $0x1, %cl
je 0x2ff210
movq 0x20(%rsp), %r12
addq $0x8, %r12
xorl %ebx, %ebx
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %rbp
cmpq %rbx, %r14
je 0x2fef59
cmpq 0x8(%r12), %rbx
jne 0x2fef59
movq 0x10(%r12), %rax
cmpq (%r12), %rax
jge 0x2fef9f
cmpq %r15, (%r12)
jl 0x2fef9f
movq %r13, %rdi
callq 0x2fbc2d
movq (%r12), %rsi
movq %r13, %rdi
callq 0x2fbc58
movq %r13, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x2ff290
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %r8
callq *0x58(%rsp)
incq %rbx
addq $0x10, %r12
cmpq %rbx, 0x8(%rsp)
jne 0x2fef42
jmp 0x2ff210
movq 0x68(%rsp), %rbx
cmpq $-0x1, %rbx
je 0x2ff246
movsd 0x48(%rsp), %xmm0
ucomisd 0x48d41(%rip), %xmm0    # 0x347d10
jne 0x2fefd7
jnp 0x2ff24b
movl $0x8, %edi
callq 0xd214c
movq %rbx, %xmm0
punpckldq 0x488f2(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x488fa(%rip), %xmm0    # 0x3478f0
movq %rax, %rbp
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movq 0x38(%rsp), %rbx
leaq 0x8(%rbx), %r15
xorl %r14d, %r14d
movq 0x488c7(%rip), %xmm3    # 0x3478e0
movapd 0x488cf(%rip), %xmm4    # 0x3478f0
movapd %xmm2, 0x70(%rsp)
cmpb $0x1, -0x8(%r15)
jne 0x2ff0ad
movq (%r15), %rax
movq 0x8(%r15), %rcx
shlq $0x5, %rax
addq %rbx, %rax
addq $0x18, %rax
movq (%rax), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x2ff09f
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 0x48(%rsp), %xmm1
jb 0x2ff0ad
movq %r14, (%rax)
movl $0x8, %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd2410
movapd 0x48866(%rip), %xmm4    # 0x3478f0
movq 0x4884e(%rip), %xmm3    # 0x3478e0
movapd 0x70(%rsp), %xmm2
movq 0x38(%rsp), %rbx
jmp 0x2ff0ad
shlq $0x5, %rdx
cmpq 0x10(%rbx,%rdx), %rcx
jbe 0x2ff0ad
movq %r14, (%rax)
incq %r14
addq $0x20, %r15
cmpq %r14, 0x8(%rsp)
jne 0x2ff027
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x2ff166
xorl %r15d, %r15d
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd2207
movq (%rax), %rax
shlq $0x5, %rax
movq 0x8(%rsp), %rcx
cmpq %rcx, 0x18(%rbx,%rax)
je 0x2ff241
leaq (%rbx,%rax), %r14
addq $0x18, %r14
movq %r12, %rdi
callq 0x2fbc2d
movq (%r14), %rax
shlq $0x4, %rax
movq 0x8(%r13,%rax), %rsi
movq %r12, %rdi
callq 0x2fbc58
movq (%r14), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x2ff290
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %r8
callq *0x58(%rsp)
incq %r15
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %r15
jb 0x2ff0dd
movq %rbp, %rdi
callq 0xd2938
leaq 0xded95(%rip), %rsi     # 0x3ddf0a
movq %rbx, %rdi
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x1045eb
jmp 0x2ff210
movq 0x18(%rsp), %rdi
callq 0x2fbc2d
cmpb $0x0, 0x2c(%rsp)
jne 0x2ff1f3
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movq %rax, %xmm0
movq 0x4872f(%rip), %xmm1    # 0x3478e0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x48733(%rip), %xmm2    # 0x3478f0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x68(%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 0x48(%rsp), %xmm3
jb 0x2ff210
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %r8
callq *0x58(%rsp)
leaq 0xdecf3(%rip), %rsi     # 0x3ddf0a
movq 0x20(%rsp), %rdi
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x1045eb
movq 0x18(%rsp), %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2fbd14
callq 0x8bdfd
callq 0x8be36
callq 0x8bdc4