// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/seed-extend.c
// Function: gt_greedy_extend_init
static void gt_greedy_extend_init(GtFTsequenceResources *ufsr,
                                  GtFTsequenceResources *vfsr,
                                  const GtSeqorEncseq *dbes,
                                  const GtSeqorEncseq *queryes,
                                  GtReadmode query_readmode,
                                  const GtUword query_seqlen,
                                  GtGreedyextendmatchinfo *ggemi)
{
  if (ggemi->left_front_trace != NULL)
  {
    front_trace_reset(ggemi->left_front_trace,0);
  }
  if (ggemi->right_front_trace != NULL)
  {
    front_trace_reset(ggemi->right_front_trace,0);
  }
  if (dbes->encseq != NULL)
  {
    if (ggemi->encseq_r_in_u == NULL)
    {
      ggemi->encseq_r_in_u
        = gt_encseq_create_reader_with_readmode(dbes->encseq,
                                                GT_READMODE_FORWARD,
                                                0);
      if (gt_encseq_wildcards(dbes->encseq) > 0)
      {
        ggemi->db_haswildcards = true;
        ggemi->db_twobit_possible = false;
      } else
      {
        ggemi->db_haswildcards = false;
        if (ggemi->db_extend_char_access == GT_EXTEND_CHAR_ACCESS_ANY &&
            gt_encseq_has_twobitencoding(dbes->encseq))
        {
          ggemi->db_twobit_possible = true;
        } else
        {
          ggemi->db_twobit_possible = false;
        }
      }
    }
  } else
  {
    ggemi->db_twobit_possible = false;
    ggemi->db_haswildcards = dbes->haswildcards;
  }
  if (queryes->encseq != NULL)
  {
    if (ggemi->encseq_r_in_v == NULL)
    {
      ggemi->encseq_r_in_v
        = gt_encseq_create_reader_with_readmode(queryes->encseq,
                                                query_readmode,0);
      if (gt_encseq_wildcards(queryes->encseq) > 0)
      {
        ggemi->query_haswildcards = true;
        ggemi->query_twobit_possible = false;
      } else
      {
        ggemi->query_haswildcards = false;
        if (ggemi->query_extend_char_access == GT_EXTEND_CHAR_ACCESS_ANY &&
            gt_encseq_has_twobitencoding(queryes->encseq))
        {
          ggemi->query_twobit_possible = true;
        } else
        {
          ggemi->query_twobit_possible = false;
        }
      }
    }
  } else
  {
    ggemi->query_twobit_possible = false;
    ggemi->query_haswildcards = queryes->haswildcards;
  }
  if (ggemi->db_totallength == GT_UWORD_MAX)
  {
    if (dbes->encseq != NULL)
    {
      ggemi->db_totallength = gt_encseq_total_length(dbes->encseq);
    } else
    {
      ggemi->db_totallength = 0;
    }
  }
  if (dbes->encseq != NULL)
  {
    gt_FTsequenceResources_init(ufsr,
                                dbes->encseq,
                                GT_READMODE_FORWARD,
                                ggemi->encseq_r_in_u,
                                &ggemi->usequence_cache,
                                NULL,
                                ggemi->db_totallength,
                                ggemi->db_totallength,
                                ggemi->db_extend_char_access,
                                ggemi->db_twobit_possible,
                                ggemi->db_haswildcards);
  } else
  {
    gt_FTsequenceResources_init(ufsr,
                                NULL,
                                GT_READMODE_FORWARD,
                                ggemi->encseq_r_in_u,
                                &ggemi->usequence_cache,
                                dbes->seq,
                                dbes->seqlength,
                                0,
                                GT_EXTEND_CHAR_ACCESS_DIRECT,
                                false,
                                ggemi->db_haswildcards);
  }
  if (queryes->encseq != NULL)
  {
    gt_FTsequenceResources_init(vfsr,
                                queryes->encseq,
                                query_readmode,
                                ggemi->encseq_r_in_v,
                                &ggemi->vsequence_cache,
                                NULL,
                                query_seqlen,
                                gt_encseq_total_length(queryes->encseq),
                                ggemi->query_extend_char_access,
                                ggemi->query_twobit_possible,
                                ggemi->query_haswildcards);
  } else
  {
    gt_FTsequenceResources_init(vfsr,
                                NULL,
                                query_readmode,
                                ggemi->encseq_r_in_v,
                                &ggemi->vsequence_cache,
                                queryes->seq,
                                query_seqlen,
                                0,
                                GT_EXTEND_CHAR_ACCESS_DIRECT,
                                false,
                                ggemi->query_haswildcards);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq 0x40(%rsp), %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x18f7fd
xorl %esi, %esi
callq 0x2ba420
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x18f80d
xorl %esi, %esi
callq 0x2ba420
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x18f842
cmpq $0x0, 0x58(%r14)
jne 0x18f888
xorl %esi, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, 0x58(%r14)
movq 0x8(%r13), %rdi
callq 0x7628b
testq %rax, %rax
je 0x18f857
movb $0x1, 0xc0(%r14)
jmp 0x18f880
movb $0x0, 0xbe(%r14)
movb 0x31(%r13), %al
movb %al, 0xc0(%r14)
jmp 0x18f888
movb $0x0, 0xc0(%r14)
cmpl $0x3, 0xb4(%r14)
jne 0x18f880
movq 0x8(%r13), %rdi
callq 0x72478
testb %al, %al
je 0x18f880
movb $0x1, 0xbe(%r14)
jmp 0x18f888
movb $0x0, 0xbe(%r14)
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x18f8bd
cmpq $0x0, 0x60(%r14)
jne 0x18f903
movl %ebp, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, 0x60(%r14)
movq 0x8(%r15), %rdi
callq 0x7628b
testq %rax, %rax
je 0x18f8d0
movb $0x1, 0xc1(%r14)
jmp 0x18f8f8
movb $0x0, 0xbf(%r14)
movb 0x31(%r15), %al
movl $0xc1, %ecx
jmp 0x18f8ff
movb $0x0, 0xc1(%r14)
cmpl $0x3, 0xb8(%r14)
jne 0x18f8f8
movq 0x8(%r15), %rdi
callq 0x72478
testb %al, %al
je 0x18f8f8
movb $0x1, %al
movl $0xbf, %ecx
jmp 0x18f8ff
movl $0xbf, %ecx
xorl %eax, %eax
movb %al, (%r14,%rcx)
movq 0x30(%r14), %rax
movq 0x8(%r13), %rdi
cmpq $-0x1, %rax
jne 0x18f923
testq %rdi, %rdi
je 0x18f93d
callq 0x7055e
movq %rax, 0x30(%r14)
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x18f942
movl 0xb4(%r14), %ecx
movb 0xbe(%r14), %sil
xorl %edx, %edx
movq %rax, %r8
jmp 0x18f954
andq $0x0, 0x30(%r14)
movq (%r13), %rdx
movq 0x20(%r13), %rax
pushq $0x2
popq %rcx
xorl %edi, %edi
xorl %r8d, %r8d
xorl %esi, %esi
movq 0x58(%r14), %r9
movb 0xc0(%r14), %r10b
movq %rdi, (%r12)
andl $0x0, 0x30(%r12)
leaq 0x68(%r14), %rdi
movq %rax, 0x20(%r12)
movq %r8, 0x28(%r12)
movq %r9, 0x10(%r12)
movq %rdi, 0x8(%r12)
movq %rdx, 0x18(%r12)
movl %ecx, 0x34(%r12)
movb %sil, 0x38(%r12)
movb %r10b, 0x39(%r12)
movq 0x8(%r15), %r12
movq 0x60(%r14), %r13
testq %r12, %r12
je 0x18f9bc
movq %r12, %rdi
callq 0x7055e
movl 0xb8(%r14), %ecx
movb 0xbf(%r14), %sil
xorl %edx, %edx
jmp 0x18f9c9
pushq $0x2
popq %rcx
movq (%r15), %rdx
xorl %r12d, %r12d
xorl %eax, %eax
xorl %esi, %esi
movb 0xc1(%r14), %dil
movq %r12, (%rbx)
movl %ebp, 0x30(%rbx)
subq $-0x80, %r14
movq (%rsp), %r8
movq %r8, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movq %r13, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq %rdx, 0x18(%rbx)
movl %ecx, 0x34(%rbx)
movb %sil, 0x38(%rbx)
movb %dil, 0x39(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq