// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-suffixgetset.c
// Function: gt_SSSPbuf_fillspecialnextpage
bool gt_SSSPbuf_fillspecialnextpage(GtSuffixsortspace *sssp,
                                    GtReadmode readmode,
                                    GtSpecialrangeiterator *sri,
                                    GtUword totallength,
                                    GtSSSPbuf *sssp_buf)
{
  bool exhausted = false;

  gt_assert(sssp_buf != NULL);
  sssp_buf->nextfree = 0;
  while (true)
  {
    if (sssp_buf->overhang.start < sssp_buf->overhang.end)
    {
      GtUword width = sssp_buf->overhang.end - sssp_buf->overhang.start;
      if (sssp_buf->nextfree + width > sssp_buf->size)
      {
        /* does not fit into the buffer, so only output a part */
        GtUword rest = sssp_buf->nextfree + width - sssp_buf->size;
        gt_assert(rest > 0);
        if (GT_ISDIRREVERSE(readmode))
        {
          gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                            sssp_buf->overhang.start + rest,
                                            sssp_buf->overhang.end);
          sssp_buf->overhang.end = sssp_buf->overhang.start + rest;
        } else
        {
          gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                            sssp_buf->overhang.start,
                                            sssp_buf->overhang.end - rest);
          sssp_buf->overhang.start = sssp_buf->overhang.end - rest;
        }
        break;
      }
      if (sssp_buf->nextfree + width == sssp_buf->size)
      { /* overhang fits into the buffer and buffer is full */
        gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                          sssp_buf->overhang.start,
                                          sssp_buf->overhang.end);
        sssp_buf->overhang.start = sssp_buf->overhang.end = 0;
        break;
      }
      /* overhang fits into the buffer and buffer is not full */
      gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                        sssp_buf->overhang.start,
                                        sssp_buf->overhang.end);
      sssp_buf->overhang.start = sssp_buf->overhang.end = 0;
    } else
    {
      GtRange range;

      if (sri != NULL && gt_specialrangeiterator_next(sri,&range))
      {
        GtUword width = range.end - range.start;
        gt_assert(width > 0);
        if (sssp_buf->nextfree + width > sssp_buf->size)
        { /* does not fit into the buffer, so only output a part */
          GtUword rest = sssp_buf->nextfree + width - sssp_buf->size;
          if (GT_ISDIRREVERSE(readmode))
          {
            gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,
                                              totallength,
                                              range.start + rest,
                                              range.end);
            sssp_buf->overhang.start = range.start;
            sssp_buf->overhang.end = range.start + rest;
          } else
          {
            gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,
                                              totallength,
                                              range.start,
                                              range.end - rest);
            sssp_buf->overhang.start = range.end - rest;
            sssp_buf->overhang.end = range.end;
          }
          break;
        }
        if (sssp_buf->nextfree + width == sssp_buf->size)
        { /* overhang fits into the buffer and buffer is full */
          gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                            range.start,range.end);
          sssp_buf->overhang.start = sssp_buf->overhang.end = 0;
          break;
        }
        /* overhang fits into the buffer and buffer is not full */
        gt_SSSPbuf_insertfullspecialrange(sssp,readmode,sssp_buf,totallength,
                                          range.start,range.end);
        sssp_buf->overhang.start = sssp_buf->overhang.end = 0;
      } else
      {
        if (sssp_buf->nextfree < sssp_buf->size)
        {
          /* add last suffix for start position totallength */
          gt_suffixsortspace_setdirect(sssp,sssp_buf->nextfree,totallength);
          sssp_buf->nextfree++;
          exhausted = true;
        }
        break;
      }
    }
  }
  gt_assert(sssp_buf->nextfree > 0);
  return exhausted;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movb $0x0, 0x3f(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x2eaba1
movq 0x351430(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x22b499(%rip), %rsi    # 0x516013
leaq 0x2a3975(%rip), %rdx    # 0x58e4f6
leaq 0x2a3991(%rip), %rcx    # 0x58e519
leaq 0x2a3434(%rip), %r8     # 0x58dfc3
movl $0x252, %r9d            # imm = 0x252
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2eaba3
movq 0x40(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x40(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2ead9c
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rcx
subq (%rcx), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x2eacf5
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
ja 0x2eac56
movq 0x35137b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x22b3e4(%rip), %rsi    # 0x516013
leaq 0x2a3902(%rip), %rdx    # 0x58e538
leaq 0x2a38dc(%rip), %rcx    # 0x58e519
leaq 0x2a337f(%rip), %r8     # 0x58dfc3
movl $0x25d, %r9d            # imm = 0x25D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2eac58
cmpl $0x1, 0x5c(%rsp)
je 0x2eac66
cmpl $0x3, 0x5c(%rsp)
jne 0x2eacac
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r8
addq 0x28(%rsp), %r8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq (%rax), %rcx
addq 0x28(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x2eacf0
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r9
subq 0x28(%rsp), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rcx
subq 0x28(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2eafce
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2ead55
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2eafce
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2eafc9
cmpq $0x0, 0x50(%rsp)
je 0x2eaf83
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xaf770
testb $0x1, %al
jne 0x2eadc0
jmp 0x2eaf83
movq 0x20(%rsp), %rax
subq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
ja 0x2eae0f
movq 0x3511c2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x22b22b(%rip), %rsi    # 0x516013
leaq 0x2cc9dd(%rip), %rdx    # 0x5b77cc
leaq 0x2a3723(%rip), %rcx    # 0x58e519
leaq 0x2a31c6(%rip), %r8     # 0x58dfc3
movl $0x281, %r9d            # imm = 0x281
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2eae11
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x2eaeed
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x8(%rsp)
cmpl $0x1, 0x5c(%rsp)
je 0x2eae58
cmpl $0x3, 0x5c(%rsp)
jne 0x2eaea1
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x18(%rsp), %r8
addq 0x8(%rsp), %r8
movq 0x20(%rsp), %r9
callq 0x2eb030
movq 0x18(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rcx
addq 0x8(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x2eaee8
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
subq 0x8(%rsp), %r9
callq 0x2eb030
movq 0x20(%rsp), %rcx
subq 0x8(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x2eafce
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
addq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2eaf46
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2eafce
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
callq 0x2eb030
movq 0x40(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2eafc7
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2eafc5
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x48(%rsp), %rdx
callq 0x2ea1a0
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movb $0x1, 0x3f(%rsp)
jmp 0x2eafce
jmp 0x2eafc9
jmp 0x2eabb0
jmp 0x2eafd0
movq 0x40(%rsp), %rax
cmpq $0x0, 0x18(%rax)
ja 0x2eb014
movq 0x350fbd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x22b026(%rip), %rsi    # 0x516013
leaq 0x2a354d(%rip), %rdx    # 0x58e541
leaq 0x2a351e(%rip), %rcx    # 0x58e519
leaq 0x2a2fc1(%rip), %r8     # 0x58dfc3
movl $0x2b0, %r9d            # imm = 0x2B0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2eb016
movb 0x3f(%rsp), %al
andb $0x1, %al
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)