// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/condenseq_creator.c
// Function: ces_c_extend_seeds_brute_force
static int ces_c_extend_seeds_brute_force(GtCondenseqCreator *ces_c,
                                          GtCondenseqLink *best_link,
                                          GtError *err)
{
  int had_err = 0;
  GtRange query_bounds,
          subject_bounds;
  GtKmerStartpos match_positions;
  GtCondenseqCreatorWindow *win = &ces_c->window;
  GtCondenseqCreatorXdrop *xdrop = &ces_c->xdrop;
  GtUword best_match = GT_UNDEF_UWORD,
          idx_cur,
          querypos = ces_c->main_pos;
  const bool forward = true;
  GtXdropbest empty = {0,0,0,0,0};

  *xdrop->left = empty;
  *xdrop->right = empty;

  subject_bounds.end =
    subject_bounds.start = 0;

  match_positions = win->pos_arrs[GT_CONDENSEQ_CREATOR_LAST_WIN(win)];

  if (match_positions.no_positions == 0) /* nothing there */
    return had_err;

  /* get bounds for current */
  query_bounds.start = ces_c->current_orig_start;
  query_bounds.end = ces_c->current_seq_start + ces_c->current_seq_len;

  if (query_bounds.start < querypos) {
    gt_seqabstract_reinit_encseq(!forward,
                                 GT_READMODE_FORWARD,
                                 xdrop->current_seq_bwd,
                                 ces_c->input_es,
                                 querypos - query_bounds.start,
                                 query_bounds.start);
  }
  if (querypos < query_bounds.end) {
    gt_seqabstract_reinit_encseq(forward,
                                 GT_READMODE_FORWARD,
                                 xdrop->current_seq_fwd,
                                 ces_c->input_es,
                                 query_bounds.end - querypos,
                                 querypos);
  }

  for (idx_cur = 0;
       !had_err && idx_cur < match_positions.no_positions;
       ++idx_cur) {
    GtUword subjectpos = match_positions.startpos[idx_cur],
            new_id = match_positions.unique_ids[idx_cur];
    if (subject_bounds.end < subjectpos || subject_bounds.end == 0) {
      gt_assert(new_id != ces_c->ces->uds_nelems);
      subject_bounds.start = ces_c->ces->uniques[new_id].orig_startpos;
      subject_bounds.end = subject_bounds.start +
        ces_c->ces->uniques[new_id].len;
      gt_assert(subject_bounds.start <= subjectpos &&
                subjectpos + ces_c->kmersize <= subject_bounds.end);
    }
    had_err = ces_c_xdrop(ces_c,
                          subjectpos, querypos,
                          query_bounds,
                          subject_bounds,
                          new_id,
                          best_link,
                          &best_match,
                          err);
  }

  if (!had_err) {
    if (best_link->len < ces_c->min_align_len)
      best_link->len = 0;
    else {
      gt_assert(best_link->orig_startpos >= query_bounds.start);
      gt_assert(best_link->orig_startpos + best_link->len <= query_bounds.end);
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x68(%rsp)
movq %rdi, %r14
movq $-0x1, 0x70(%rsp)
movq 0x98(%rdi), %rcx
movq 0xf0(%rdi), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
movq 0xa0(%rdi), %rcx
movq %rax, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
movaps %xmm0, 0x50(%rsp)
movq 0xb0(%rdi), %rcx
movl 0xc0(%rdi), %edx
testl %edx, %edx
jne 0x134f52
movl 0xc4(%r14), %edx
decl %edx
leaq (%rdx,%rdx,2), %rdx
movq 0x10(%rcx,%rdx,8), %rbx
testq %rbx, %rbx
je 0x1350ce
movq %rsi, 0x48(%rsp)
movq (%rcx,%rdx,8), %r15
movq 0x8(%rcx,%rdx,8), %r12
movq 0xc8(%r14), %rcx
movq 0xd0(%r14), %rax
addq 0xe0(%r14), %rax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %r8
movq %rcx, 0x38(%rsp)
subq %rcx, %r8
jbe 0x134fb5
movq (%r14), %rcx
movq 0x80(%r14), %rdx
xorl %edi, %edi
xorl %esi, %esi
movq 0x38(%rsp), %r9
callq 0x1ec1ee
movq 0x40(%rsp), %r8
subq 0x30(%rsp), %r8
jbe 0x134fd9
movq (%r14), %rcx
movq 0x78(%r14), %rdx
movl $0x1, %edi
xorl %esi, %esi
movq 0x30(%rsp), %r9
callq 0x1ec1ee
movl $0x1, %ebp
movq 0x58(%rsp), %r13
movq -0x8(%r15,%rbp,8), %rsi
movq -0x8(%r12,%rbp,8), %r9
cmpq %rsi, %r13
setae %al
testq %r13, %r13
setne %cl
testb %cl, %al
jne 0x135049
movq 0x28(%r14), %rax
cmpq 0x98(%rax), %r9
je 0x1350e2
movq 0x10(%rax), %rax
leaq (%r9,%r9,4), %rcx
movq 0x18(%rax,%rcx,8), %rdx
movq %rdx, 0x50(%rsp)
movl 0x20(%rax,%rcx,8), %r13d
addq %rdx, %r13
movq %r13, 0x58(%rsp)
cmpq %rsi, %rdx
ja 0x1350dd
movl 0x138(%r14), %eax
addq %rsi, %rax
cmpq %r13, %rax
ja 0x1350dd
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r8
callq 0x13663d
testl %eax, %eax
jne 0x13509b
leaq 0x1(%rbp), %rcx
cmpq %rbx, %rbp
movq %rcx, %rbp
jb 0x134fe3
testl %eax, %eax
jne 0x1350ce
movq 0x48(%rsp), %rdx
movl 0x10(%rdx), %ecx
cmpq %rcx, 0x100(%r14)
jbe 0x1350b9
movl $0x0, 0x10(%rdx)
jmp 0x1350ce
movq 0x8(%rdx), %rdx
cmpq 0x38(%rsp), %rdx
jb 0x1350e7
addq %rcx, %rdx
cmpq 0x40(%rsp), %rdx
ja 0x1350ec
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3e9a5
callq 0x3e9de
callq 0x3e96c
callq 0x3e933