// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/condenseq_creator.c
// Function: ces_c_xdrop
static int ces_c_xdrop(GtCondenseqCreator *ces_c,
                       GtUword i,
                       GtUword j,
                       GtRange query_bounds,
                       GtRange subject_bounds,
                       GtUword unique_id,
                       GtCondenseqLink *best_link,
                       GtUword *best_match,
                       GtError *err)
{
  int had_err = 0;
  GtXdropbest left_xdrop = {0,0,0,0,0}, right_xdrop = {0,0,0,0,0};
  GtCondenseqCreatorXdrop *xdrop = &ces_c->xdrop;
  const bool forward = true;

  gt_assert(subject_bounds.start <= i);
  gt_assert(i + ces_c->kmersize - 1 < subject_bounds.end);

  /* left xdrop */
  if (query_bounds.start < j && subject_bounds.start < i) {
    gt_seqabstract_reinit_encseq(!forward,
                                 GT_READMODE_FORWARD,
                                 xdrop->unique_seq_bwd,
                                 ces_c->input_es,
                                 i - subject_bounds.start,
                                 subject_bounds.start);
    ces_c_xdrops++;
    gt_evalxdroparbitscoresextend(!forward,
                                  &left_xdrop,
                                  xdrop->left_xdrop_res,
                                  xdrop->unique_seq_bwd,
                                  xdrop->current_seq_bwd,
                                  xdrop->xdropscore);
  }
  /* right xdrop (i < subject_bounds.end by assertion) */
  if (j < query_bounds.end) {
    gt_seqabstract_reinit_encseq(forward,
                                 GT_READMODE_FORWARD,
                                 xdrop->unique_seq_fwd,
                                 ces_c->input_es,
                                 subject_bounds.end - i,
                                 i);
    ces_c_xdrops++;
    gt_evalxdroparbitscoresextend(forward,
                                  &right_xdrop,
                                  xdrop->right_xdrop_res,
                                  xdrop->unique_seq_fwd,
                                  xdrop->current_seq_fwd,
                                  xdrop->xdropscore);
  }

  /* ivalue corresponds to length of alignment in unique_seq (match) and jvalue
     to length of alignment in current_seq (seed) */
  if (left_xdrop.jvalue + right_xdrop.jvalue >= ces_c->min_align_len &&
      left_xdrop.score + right_xdrop.score >
        xdrop->left->score + xdrop->right->score) {
    GtXdropresources *swap = NULL;

    *xdrop->left = left_xdrop;
    *xdrop->right = right_xdrop;

    swap = xdrop->best_left_res;
    xdrop->best_left_res = xdrop->left_xdrop_res;
    xdrop->left_xdrop_res = swap;

    swap = xdrop->best_right_res;
    xdrop->best_right_res = xdrop->right_xdrop_res;
    xdrop->right_xdrop_res = swap;

    GT_CES_LENCHECK((i - left_xdrop.ivalue) - subject_bounds.start);
    if (!had_err) {
      /* left started att i-1 */
      best_link->unique_offset = (i - left_xdrop.ivalue) - subject_bounds.start;
      GT_CES_LENCHECK(xdrop->left->jvalue + xdrop->right->jvalue);
    }
    if (!had_err) {
      best_link->len = xdrop->left->jvalue + xdrop->right->jvalue;
      GT_CES_LENCHECK(unique_id);
    }
    if (!had_err) {
      best_link->unique_id = unique_id;
      best_link->orig_startpos = j;
      /* left started at j-1, so j-length is the first char on the left */
      best_link->orig_startpos -= left_xdrop.jvalue;
      *best_match = i;
    }
  }
  gt_xdrop_resources_reset(xdrop->left_xdrop_res);
  gt_xdrop_resources_reset(xdrop->right_xdrop_res);
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movq 0xd0(%rsp), %rax
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rax
leaq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movq %rcx, 0x98(%rsp)
movq %r8, 0xa0(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19360
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19360
movq 0x90(%rsp), %rax
addq $0x58, %rax
movq %rax, 0x18(%rsp)
movb $0x1, 0x17(%rsp)
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x88(%rsp), %rax
jbe 0x1468d1
movq 0x4f5700(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3cf769(%rip), %rsi    # 0x516013
leaq 0x4057d0(%rip), %rdx    # 0x54c081
leaq 0x4057e3(%rip), %rcx    # 0x54c09b
leaq 0x40512f(%rip), %r8     # 0x54b9ee
movl $0x1d9, %r9d            # imm = 0x1D9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1468d3
jmp 0x1468d5
movq (%rsp), %rcx
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rdx
movl 0x138(%rdx), %edx
addq %rdx, %rax
subq $0x1, %rax
cmpq 0x8(%rcx), %rax
jb 0x146934
movq 0x4f569d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3cf706(%rip), %rsi    # 0x516013
leaq 0x405793(%rip), %rdx    # 0x54c0a7
leaq 0x405780(%rip), %rcx    # 0x54c09b
leaq 0x4050cc(%rip), %r8     # 0x54b9ee
movl $0x1da, %r9d            # imm = 0x1DA
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x146936
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
jae 0x1469cd
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x88(%rsp), %rax
jae 0x1469cd
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x38(%rcx), %rdx
movq 0x90(%rsp), %rcx
movq (%rcx), %rcx
movq 0x88(%rsp), %r8
subq (%rax), %r8
movq (%rax), %r9
xorl %esi, %esi
movl %esi, %edi
callq 0x2b0bc0
movq 0x4fc3b5(%rip), %rax    # 0x642d48
addq $0x1, %rax
movq %rax, 0x4fc3aa(%rip)    # 0x642d48
movq 0x18(%rsp), %rax
movq (%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r8
movq 0x18(%rsp), %rax
movq 0x50(%rax), %r9
xorl %edi, %edi
leaq 0x48(%rsp), %rsi
callq 0x2f8690
movq 0x80(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jae 0x146a5c
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x30(%rcx), %rdx
movq 0x90(%rsp), %rcx
movq (%rcx), %rcx
movq 0x8(%rax), %r8
subq 0x88(%rsp), %r8
movq 0x88(%rsp), %r9
movl $0x1, %edi
xorl %esi, %esi
callq 0x2b0bc0
movq 0x4fc32a(%rip), %rax    # 0x642d48
addq $0x1, %rax
movq %rax, 0x4fc31f(%rip)    # 0x642d48
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x20(%rax), %r8
movq 0x18(%rsp), %rax
movq 0x50(%rax), %r9
movl $0x1, %edi
leaq 0x20(%rsp), %rsi
callq 0x2f8690
movq 0x50(%rsp), %rax
addq 0x28(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq 0x100(%rcx), %rax
jb 0x146ce3
movq 0x58(%rsp), %rax
addq 0x30(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x40(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x18(%rsp), %rdx
movq 0x48(%rdx), %rdx
addq 0x10(%rdx), %rcx
cmpq %rcx, %rax
jle 0x146ce3
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0x28, %edx
callq 0x19610
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rdi
leaq 0x20(%rsp), %rsi
movl $0x28, %edx
callq 0x19610
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq (%rsp), %rcx
movq 0x88(%rsp), %rax
subq 0x48(%rsp), %rax
subq (%rcx), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jbe 0x146b90
movq (%rsp), %rax
movq 0xd0(%rsp), %rdi
movq 0x88(%rsp), %rdx
subq 0x48(%rsp), %rdx
subq (%rax), %rdx
leaq 0x405558(%rip), %rsi    # 0x54c0d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x146b92
cmpl $0x0, 0x74(%rsp)
jne 0x146c23
movq (%rsp), %rcx
movq 0x88(%rsp), %rax
subq 0x48(%rsp), %rax
subq (%rcx), %rax
movl %eax, %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x48(%rcx), %rcx
addq 0x8(%rcx), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jbe 0x146c1f
movq 0xd0(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
addq 0x8(%rax), %rdx
leaq 0x4054c9(%rip), %rsi    # 0x54c0d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x146c21
jmp 0x146c23
cmpl $0x0, 0x74(%rsp)
jne 0x146c89
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x48(%rcx), %rcx
addq 0x8(%rcx), %rax
movl %eax, %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x10(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, 0x78(%rsp)
jbe 0x146c85
movq 0xd0(%rsp), %rdi
movq 0x78(%rsp), %rdx
leaq 0x405463(%rip), %rsi    # 0x54c0d4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x146c87
jmp 0x146c89
cmpl $0x0, 0x74(%rsp)
jne 0x146ce1
movq 0x78(%rsp), %rax
movl %eax, %ecx
movq 0xc0(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x80(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rdx
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq 0x88(%rsp), %rcx
movq 0xc8(%rsp), %rax
movq %rcx, (%rax)
jmp 0x146ce3
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x2f8330
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2f8330
movl 0x74(%rsp), %eax
addq $0xa8, %rsp
retq
nopw (%rax,%rax)