// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %r9, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq 0xa0(%rsp), %r13
cmpq %r13, %rsi
jb 0x1368ac
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa0(%rsp), %rax
movl 0x138(%rdi), %edx
addq %rsi, %rdx
decq %rdx
movq 0x8(%rax), %r12
cmpq %r12, %rdx
jae 0x1368b1
movq %r8, %rbp
cmpq %r15, %rcx
setae %al
movq %r14, %r8
subq %r13, %r8
setbe %cl
orb %al, %cl
jne 0x136706
movq (%rbx), %rcx
movq 0x90(%rbx), %rdx
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %r9
callq 0x1ec1ee
incq 0x393007(%rip)          # 0x4c96e8
movq 0x90(%rbx), %rcx
movq 0x58(%rbx), %rdx
movq 0x80(%rbx), %r8
movq 0xa8(%rbx), %r9
leaq 0x10(%rsp), %rsi
xorl %edi, %edi
callq 0x20cec8
cmpq %rbp, %r15
jae 0x136756
movq (%rbx), %rcx
movq 0x88(%rbx), %rdx
subq %r14, %r12
movl $0x1, %edi
xorl %esi, %esi
movq %r12, %r8
movq %r14, %r9
callq 0x1ec1ee
incq 0x392fb7(%rip)          # 0x4c96e8
movq 0x88(%rbx), %rcx
movq 0x60(%rbx), %rdx
movq 0x78(%rbx), %r8
movq 0xa8(%rbx), %r9
leaq 0x40(%rsp), %rsi
movl $0x1, %edi
callq 0x20cec8
movq 0x48(%rsp), %rax
addq 0x18(%rsp), %rax
xorl %ebp, %ebp
cmpq 0x100(%rbx), %rax
jb 0x136882
movq 0x50(%rsp), %rcx
addq 0x20(%rsp), %rcx
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
movq 0x10(%rdx), %rdx
addq 0x10(%rax), %rdx
cmpq %rdx, %rcx
jle 0x136882
movq 0xb0(%rsp), %r12
movq 0x30(%rsp), %rcx
movq %rcx, 0x20(%rax)
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq 0xa0(%rbx), %rax
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movq 0x60(%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 0x10(%rsp), %r13
movq %r14, %rdx
subq %r13, %rdx
movq %rdx, %rax
shrq $0x20, %rax
jne 0x136836
movl %edx, 0x18(%r12)
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rcx
movq 0x8(%rcx), %rdx
addq 0x8(%rax), %rdx
movq %rdx, %rax
shrq $0x20, %rax
jne 0x136836
movl %edx, 0x10(%r12)
movq 0x8(%rsp), %rdx
movq %rdx, %rax
shrq $0x20, %rax
je 0x1368a5
movq 0xc0(%rsp), %rdi
leaq 0x24c845(%rip), %rsi    # 0x38308a
xorl %r13d, %r13d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r13b, %r13b
je 0x136882
movq 0xb8(%rsp), %rax
movq 0x8(%rsp), %rcx
movl %ecx, 0x14(%r12)
movq %r15, 0x8(%r12)
subq 0x18(%rsp), %r15
movq %r15, 0x8(%r12)
movq %r14, (%rax)
movq 0x58(%rbx), %rdi
callq 0x20cd72
movq 0x60(%rbx), %rdi
callq 0x20cd72
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movb $0x1, %r13b
jmp 0x136859
callq 0x3ed6e
callq 0x3ed35