// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
cmpq %r9, %rsi
jb 0x130676
movq %rsi, %r14
movq %rdi, %rbx
movq 0x90(%rsp), %r13
movl 0x138(%rdi), %eax
addq %rsi, %rax
decq %rax
cmpq %r13, %rax
jae 0x13067b
movq %r9, %r12
movq %r8, %rbp
movq %rdx, %r15
cmpq %rdx, %rcx
setae %al
movq %r14, %r8
subq %r9, %r8
setbe %cl
orb %al, %cl
jne 0x1304d3
movq (%rbx), %rcx
movq 0x90(%rbx), %rdx
xorl %edi, %edi
xorl %esi, %esi
movq %r12, %r9
callq 0x1e2956
incq 0x38e238(%rip)          # 0x4be6e8
movq 0x90(%rbx), %rcx
movq 0x58(%rbx), %rdx
movq 0x80(%rbx), %r8
movq 0xa8(%rbx), %r9
movq %rsp, %rsi
xorl %edi, %edi
callq 0x203536
cmpq %rbp, %r15
jae 0x13052c
movq (%rbx), %rcx
movq 0x88(%rbx), %rdx
subq %r14, %r13
movl $0x1, %edi
xorl %esi, %esi
movq %r13, %r8
movq %r14, %r9
callq 0x1e2956
incq 0x38e1ea(%rip)          # 0x4be6e8
movq 0x88(%rbx), %rcx
movq 0x60(%rbx), %rdx
movq 0x78(%rbx), %r8
movq 0xa8(%rbx), %r9
leaq 0x30(%rsp), %r13
movl $0x1, %edi
movq %r13, %rsi
callq 0x203536
movq 0x8(%r13), %rax
jmp 0x13052e
xorl %eax, %eax
addq 0x8(%rsp), %rax
cmpq 0x100(%rbx), %rax
jb 0x13064f
movq 0x40(%rsp), %rcx
addq 0x10(%rsp), %rcx
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
movq 0x10(%rdx), %rdx
addq 0x10(%rax), %rdx
cmpq %rdx, %rcx
jle 0x13064f
movq 0xb0(%rsp), %rdi
movq 0x20(%rsp), %rcx
movq %rcx, 0x20(%rax)
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq 0xa0(%rbx), %rax
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x20(%rax)
movups %xmm0, (%rax)
movups 0x58(%rbx), %xmm0
movups 0x68(%rbx), %xmm1
movups %xmm0, 0x68(%rbx)
movups %xmm1, 0x58(%rbx)
addq (%rsp), %r12
movq %r14, %rdx
subq %r12, %rdx
movq %rdx, %rax
shrq $0x20, %rax
jne 0x1305f8
movq 0xa0(%rsp), %rcx
movl %edx, 0x18(%rcx)
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
movq 0x8(%rdx), %rdx
addq 0x8(%rax), %rdx
movq %rdx, %rax
shrq $0x20, %rax
je 0x130613
leaq 0x24976d(%rip), %rsi    # 0x379d6c
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x130652
movq 0x98(%rsp), %rax
movl %edx, 0x10(%rcx)
movq %rax, %rdx
shrq $0x20, %rdx
je 0x130638
leaq 0x24973e(%rip), %rsi    # 0x379d6c
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rax, %rdx
jmp 0x130604
movq 0xa8(%rsp), %rdx
movl %eax, 0x14(%rcx)
subq 0x8(%rsp), %r15
movq %r15, 0x8(%rcx)
movq %r14, (%rdx)
xorl %r14d, %r14d
movq 0x58(%rbx), %rdi
callq 0x2033e0
movq 0x60(%rbx), %rdi
callq 0x2033e0
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3e2f0
callq 0x3e2b7