// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/tir_stream.c
// Function: gt_tir_store_seeds
static int gt_tir_store_seeds(void *info, const GtGenericEncseq *genericencseq,
                              GtUword len, GtUword pos1,
                              GtUword pos2, GT_UNUSED GtError *err)
{
  GtUword seqnum1,
                seqnum2;
  Seed *nextfreeseedpointer;
  GtUword distance;
  SeedInfo *seeds = (SeedInfo *) info;
  const GtEncseq *encseq;
  gt_error_check(err);

  gt_assert(genericencseq->hasencseq);
  encseq = genericencseq->seqptr.encseq;
  /* ensure order of seeds */
  gt_assert(pos1 < pos2);

  /* match mirrored vs. unmirrored */
  if (pos1 > seeds->midpos || pos2 < seeds->midpos)
    return 0;

  /* check distance constraints */
  distance = (GT_REVERSEPOS(seeds->totallength, pos2) - len + 1) - pos1;
  if (distance < seeds->min_tir_distance || distance > seeds->max_tir_distance)
    return 0;

  /* check whether matches are on the `same' contig */
  seqnum1 = gt_encseq_seqnum(encseq, pos1);
  seqnum2 = gt_encseq_seqnum(encseq, pos2);
  if (seqnum2 != seeds->num_of_contigs - seqnum1 - 1)
    return 0;

  /* check length constraints */
  if (len > seeds->max_tir_length)
    return 0;

  GT_GETNEXTFREEINARRAY(nextfreeseedpointer, &seeds->seed, Seed, 256);
  nextfreeseedpointer->pos1 = pos1;
  nextfreeseedpointer->pos2 = pos2;
  nextfreeseedpointer->offset = distance;
  nextfreeseedpointer->len = len;
  nextfreeseedpointer->contignumber = seqnum1;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
testq %r9, %r9
je 0x1294c2
movq %r9, %rdi
callq 0x89eb7
testb %al, %al
jne 0x129622
cmpb $0x0, (%r13)
je 0x1295c6
cmpq %r14, %r15
jae 0x1295f4
movq 0x40(%r12), %rax
cmpq %r15, %rax
setb %cl
cmpq %r14, %rax
seta %al
orb %cl, %al
jne 0x1295b5
movq 0x48(%r12), %rbp
leaq (%r15,%rbx), %rax
addq %r14, %rax
subq %rax, %rbp
cmpq 0x30(%r12), %rbp
jb 0x1295b5
cmpq 0x28(%r12), %rbp
ja 0x1295b5
movq 0x8(%r13), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x74c9d
movq %r13, %rdi
movq %rax, %r13
movq %r14, %rsi
callq 0x74c9d
movq %r13, %rcx
notq %rcx
addq 0x38(%r12), %rcx
cmpq %rcx, %rax
jne 0x1295b5
cmpq %rbx, 0x18(%r12)
jb 0x1295b5
movq 0x8(%r12), %rax
cmpq %rax, 0x10(%r12)
jae 0x12955a
movq (%r12), %rax
jmp 0x129582
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x8(%r12)
movq (%r12), %rdi
imulq $0x28, %rax, %rsi
leaq 0x20d66f(%rip), %rdx    # 0x336be3
movl $0xab, %ecx
callq 0x93472
movq %rax, (%r12)
testq %rax, %rax
je 0x12965a
movq 0x10(%r12), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r12)
imulq $0x28, %rcx, %rcx
movq %r15, (%rax,%rcx)
movq %r14, 0x8(%rax,%rcx)
movq %rbp, 0x10(%rax,%rcx)
movq %rbx, 0x18(%rax,%rcx)
movq %r13, 0x20(%rax,%rcx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30e99b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1bba3c(%rip), %rsi    # 0x2e5013
leaq 0x1cc1cf(%rip), %rdx    # 0x2f57ad
leaq 0x20d727(%rip), %rcx    # 0x336d0c
leaq 0x20d5f7(%rip), %r8     # 0x336be3
movl $0x93, %r9d
jmp 0x12964e
movq 0x30e96d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1bba0e(%rip), %rsi    # 0x2e5013
leaq 0x1cc0cd(%rip), %rdx    # 0x2f56d9
leaq 0x20d6f9(%rip), %rcx    # 0x336d0c
leaq 0x20d5c9(%rip), %r8     # 0x336be3
movl $0x96, %r9d
jmp 0x12964e
movq 0x30e93f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1bb9e0(%rip), %rsi    # 0x2e5013
leaq 0x1bbb85(%rip), %rdx    # 0x2e51bf
leaq 0x20d6cb(%rip), %rcx    # 0x336d0c
leaq 0x20d59b(%rip), %r8     # 0x336be3
movl $0x91, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30e907(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1bb9a8(%rip), %rsi    # 0x2e5013
leaq 0x20d6ad(%rip), %rdx    # 0x336d1f
leaq 0x20d693(%rip), %rcx    # 0x336d0c
leaq 0x20d563(%rip), %r8     # 0x336be3
movl $0xab, %r9d
jmp 0x12964e