// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %r12
movq %rdi, %r14
movq 0x98(%rdi), %rax
movq 0xf0(%rdi), %rcx
movq %rcx, 0x30(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0xa0(%rdi), %rax
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
andq $0x0, 0x20(%rax)
movaps %xmm0, 0x40(%rsp)
movq 0xb0(%rdi), %rax
movl 0xc0(%rdi), %ecx
testl %ecx, %ecx
jne 0xc4ae2
movl 0xc4(%r14), %ecx
decl %ecx
imulq $0x18, %rcx, %rcx
movq 0x10(%rax,%rcx), %rbx
testq %rbx, %rbx
je 0xc4c64
movq (%rax,%rcx), %rdx
movq %rdx, 0x60(%rsp)
movq 0x8(%rax,%rcx), %rax
movq %rax, 0x58(%rsp)
movq 0xc8(%r14), %rax
movq 0xd0(%r14), %r13
addq 0xe0(%r14), %r13
movq 0x30(%rsp), %r8
movq %rax, 0x38(%rsp)
subq %rax, %r8
jbe 0xc4b45
movq (%r14), %rcx
movq 0x80(%r14), %rdx
xorl %edi, %edi
xorl %esi, %esi
movq 0x38(%rsp), %r9
callq 0x191910
movq %r13, %r8
subq 0x30(%rsp), %r8
jbe 0xc4b65
movq (%r14), %rcx
movq 0x78(%r14), %rdx
pushq $0x1
popq %rdi
xorl %esi, %esi
movq 0x30(%rsp), %r9
callq 0x191910
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %eax, %eax
testl %eax, %eax
jne 0xc4c29
cmpq %rbx, %r15
jae 0xc4c29
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq 0x58(%rsp), %rax
movq (%rax,%r15,8), %r9
cmpq %rsi, %rbp
setae %al
testq %rbp, %rbp
setne %cl
testb %cl, %al
jne 0xc4bea
movq 0x28(%r14), %rax
cmpq 0x98(%rax), %r9
je 0xc4ca3
movq 0x10(%rax), %rax
imulq $0x28, %r9, %rcx
movq 0x18(%rax,%rcx), %rdx
movq %rdx, 0x40(%rsp)
movl 0x20(%rax,%rcx), %ebp
addq %rdx, %rbp
movq %rbp, 0x48(%rsp)
cmpq %rsi, %rdx
ja 0xc4c75
movl 0x138(%r14), %eax
addq %rsi, %rax
cmpq %rbp, %rax
ja 0xc4c75
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq %r13, %r8
callq 0xc6764
incq %r15
jmp 0xc4b6c
testl %eax, %eax
je 0xc4c32
pushq $-0x1
popq %rax
jmp 0xc4c66
movl 0x10(%r12), %eax
cmpq %rax, 0x100(%r14)
jbe 0xc4c48
andl $0x0, 0x10(%r12)
jmp 0xc4c64
movq 0x8(%r12), %rcx
cmpq 0x38(%rsp), %rcx
jb 0xc4cdb
addq %rax, %rcx
cmpq %r13, %rcx
ja 0xc4d09
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3732ec(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22038d(%rip), %rsi    # 0x2e5013
leaq 0x255241(%rip), %rdx    # 0x319ece
leaq 0x2555fd(%rip), %rcx    # 0x31a291
leaq 0x254d39(%rip), %r8     # 0x3199d4
movl $0x306, %r9d            # imm = 0x306
jmp 0xc4ccf
movq 0x3732be(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22035f(%rip), %rsi    # 0x2e5013
leaq 0x2551f2(%rip), %rdx    # 0x319ead
leaq 0x2555cf(%rip), %rcx    # 0x31a291
leaq 0x254d0b(%rip), %r8     # 0x3199d4
movl $0x301, %r9d            # imm = 0x301
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x373286(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x220327(%rip), %rsi    # 0x2e5013
leaq 0x255283(%rip), %rdx    # 0x319f76
leaq 0x255597(%rip), %rcx    # 0x31a291
leaq 0x254cd3(%rip), %r8     # 0x3199d4
movl $0x316, %r9d            # imm = 0x316
jmp 0xc4ccf
movq 0x373258(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2202f9(%rip), %rsi    # 0x2e5013
leaq 0x255284(%rip), %rdx    # 0x319fa5
leaq 0x255569(%rip), %rcx    # 0x31a291
leaq 0x254ca5(%rip), %r8     # 0x3199d4
movl $0x317, %r9d            # imm = 0x317
jmp 0xc4ccf