// File: /workspace/github_c_makefile_star2_O1/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 0x1ea6f3
xorl %esi, %esi
callq 0x3243af
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x1ea703
xorl %esi, %esi
callq 0x3243af
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x1ea738
cmpq $0x0, 0x58(%r14)
jne 0x1ea77e
xorl %esi, %esi
xorl %edx, %edx
callq 0xed76d
movq %rax, 0x58(%r14)
movq 0x8(%r13), %rdi
callq 0xf0c8a
testq %rax, %rax
je 0x1ea74d
movb $0x1, 0xc0(%r14)
jmp 0x1ea776
movb $0x0, 0xbe(%r14)
movb 0x31(%r13), %al
movb %al, 0xc0(%r14)
jmp 0x1ea77e
movb $0x0, 0xc0(%r14)
cmpl $0x3, 0xb4(%r14)
jne 0x1ea776
movq 0x8(%r13), %rdi
callq 0xed91a
testb %al, %al
je 0x1ea776
movb $0x1, 0xbe(%r14)
jmp 0x1ea77e
movb $0x0, 0xbe(%r14)
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x1ea7b3
cmpq $0x0, 0x60(%r14)
jne 0x1ea7f9
movl %ebp, %esi
xorl %edx, %edx
callq 0xed76d
movq %rax, 0x60(%r14)
movq 0x8(%r15), %rdi
callq 0xf0c8a
testq %rax, %rax
je 0x1ea7c6
movb $0x1, 0xc1(%r14)
jmp 0x1ea7ee
movb $0x0, 0xbf(%r14)
movb 0x31(%r15), %al
movl $0xc1, %ecx
jmp 0x1ea7f5
movb $0x0, 0xc1(%r14)
cmpl $0x3, 0xb8(%r14)
jne 0x1ea7ee
movq 0x8(%r15), %rdi
callq 0xed91a
testb %al, %al
je 0x1ea7ee
movb $0x1, %al
movl $0xbf, %ecx
jmp 0x1ea7f5
movl $0xbf, %ecx
xorl %eax, %eax
movb %al, (%r14,%rcx)
cmpq $-0x1, 0x30(%r14)
jne 0x1ea816
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x1ea810
callq 0xec1d8
jmp 0x1ea812
xorl %eax, %eax
movq %rax, 0x30(%r14)
movq 0x8(%r13), %rdx
leaq 0x68(%r14), %rax
movq 0x58(%r14), %rcx
testq %rdx, %rdx
je 0x1ea840
movq 0x30(%r14), %r8
movl 0xb4(%r14), %esi
movb 0xbe(%r14), %r9b
xorl %edi, %edi
movq %r8, %r10
jmp 0x1ea855
movq (%r13), %rdi
movq 0x20(%r13), %r8
movl $0x2, %esi
xorl %edx, %edx
xorl %r10d, %r10d
xorl %r9d, %r9d
movb 0xc0(%r14), %r11b
movq %rdx, (%r12)
movl $0x0, 0x30(%r12)
movq %r8, 0x20(%r12)
movq %r10, 0x28(%r12)
movq %rcx, 0x10(%r12)
movq %rax, 0x8(%r12)
movq %rdi, 0x18(%r12)
movl %esi, 0x34(%r12)
movb %r9b, 0x38(%r12)
movb %r11b, 0x39(%r12)
movq 0x8(%r15), %r12
movq 0x60(%r14), %r13
testq %r12, %r12
je 0x1ea8b8
movq %r12, %rdi
callq 0xec1d8
movl 0xb8(%r14), %ecx
movb 0xbf(%r14), %sil
xorl %edx, %edx
jmp 0x1ea8c7
movq (%r15), %rdx
movl $0x2, %ecx
xorl %r12d, %r12d
xorl %eax, %eax
xorl %esi, %esi
movb 0xc1(%r14), %dil
subq $-0x80, %r14
movq %r12, (%rbx)
movl %ebp, 0x30(%rbx)
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