// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_check_comparetwosuffixes
int gt_encseq_check_comparetwosuffixes(const GtEncseq *encseq,
                                       GtReadmode readmode,
                                       GtUword *maxlcp,
                                       bool specialsareequal,
                                       bool specialsareequalatdepth0,
                                       GtUword maxdepth,
                                       GtUword start1,
                                       GtUword start2,
                                       GtEncseqReader *esr1,
                                       GtEncseqReader *esr2)
{
  GtUchar cc1, cc2;
  GtUword pos1, pos2, end1, end2;
  int retval;

  end1 = end2 = encseq->logicaltotallength;
  if (maxdepth > 0) {
    if (end1 > start1 + maxdepth)
      end1 = start1 + maxdepth;
    if (end2 > start2 + maxdepth)
      end2 = start2 + maxdepth;
  }
  if (esr1 != NULL && esr2 != NULL) {
    gt_encseq_reader_reinit_with_readmode(esr1, encseq, readmode, start1);
    gt_encseq_reader_reinit_with_readmode(esr2, encseq, readmode, start2);
  }
  else
    gt_assert(esr1 == NULL && esr2 == NULL);
  for (pos1=start1, pos2=start2; /* Nothing */; pos1++, pos2++) {
    if (pos1 >= end1 || pos2 >= end2) {
      *maxlcp = pos1 - start1;
      retval = 0;
      break;
    }
    if (esr1 != NULL) {
      cc1 = gt_encseq_reader_next_encoded_char(esr1);
      GT_CHECKENCCHAR(cc1, encseq, pos1, readmode);
    }
    else {
      cc1 = gt_encseq_get_encoded_char(encseq, pos1, readmode);
    }
    if (esr2 != NULL) {
      cc2 = gt_encseq_reader_next_encoded_char(esr2);
      GT_CHECKENCCHAR(cc2, encseq, pos2, readmode);
    }
    else {
      cc2 = gt_encseq_get_encoded_char(encseq, pos2, readmode);
    }
    if (GT_ISSPECIAL(cc1)) {
      if (GT_ISSPECIAL(cc2)) {
        if (specialsareequal || (pos1 == start1 && specialsareequalatdepth0)) {
          *maxlcp = pos1 - start1 + 1;
          retval = 0;
          break;
        }
        if (pos1 < pos2) {
          *maxlcp = pos1  - start1;
          retval = -1; /* a < b */
          break;
        }
        if (pos1 > pos2) {
          *maxlcp = pos1 - start1;
          retval = 1; /* a > b */
          break;
        }
        *maxlcp = pos1 - start1 + 1;
        retval = 0; /* a = b */
        break;
      }
      *maxlcp = pos1 - start1;
      retval = 1; /* a > b */
      break;
    }
    else {
      if (GT_ISSPECIAL(cc2)) {
        *maxlcp = pos1 - start1;
        retval = -1; /* a < b */
        break;
      }
      if (cc1 < cc2) {
        *maxlcp = pos1 - start1;
        retval = -1; /* a < b */
        break;
      }
      if (cc1 > cc2) {
        *maxlcp = pos1 - start1;
        retval = 1; /* a > b */
        break;
      }
    }
  }
  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movq %rdx, 0x8(%rsp)
movl %esi, 0x14(%rsp)
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rbp
movq 0x68(%rsp), %r14
movq 0x60(%rsp), %r12
movq %rdi, 0x18(%rsp)
movq 0x38(%rdi), %r15
testq %r9, %r9
je 0xa9908
movq %r9, %r13
leaq (%r12,%r9), %rax
cmpq %rax, %r15
cmovbq %r15, %rax
addq %r14, %r13
cmpq %r13, %r15
cmovbq %r15, %r13
movq %rax, %r15
jmp 0xa990b
movq %r15, %r13
testq %rbp, %rbp
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0xa994d
movq %rbp, %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
movl 0x14(%rsp), %ebx
movl %ebx, %edx
movq %r12, %rcx
callq 0xa3924
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
movq 0x70(%rsp), %rbp
movl %ebx, %edx
movq %r14, %rcx
callq 0xa3924
jmp 0xa9959
movq %rbp, %rax
orq %rdx, %rax
jne 0xa9a2e
xorl %ebx, %ebx
cmpq %r15, %r12
jae 0xa99ca
cmpq %r13, %r14
jae 0xa99ca
testq %rbp, %rbp
je 0xa9974
movq %rbp, %rdi
callq 0xa2941
jmp 0xa9985
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movl 0x14(%rsp), %edx
callq 0xa1fd0
movl %eax, %ebp
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xa9998
callq 0xa2941
jmp 0xa99a9
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
callq 0xa1fd0
cmpb $-0x2, %bpl
jae 0xa99d1
cmpb $-0x2, %al
jae 0xa99fd
cmpb %al, %bpl
jb 0xa99fd
ja 0xa99f1
incq %r12
incq %r14
decq %rbx
movq 0x70(%rsp), %rbp
jmp 0xa995b
negq %rbx
xorl %eax, %eax
jmp 0xa9a03
cmpb $-0x2, %al
jb 0xa99f1
testq %rbx, %rbx
sete %al
andb 0x20(%rsp), %al
orb 0x24(%rsp), %al
cmpb $0x1, %al
jne 0xa99f8
pushq $0x1
popq %rcx
subq %rbx, %rcx
xorl %eax, %eax
jmp 0xa9a29
negq %rbx
pushq $0x1
jmp 0xa9a02
cmpq %r14, %r12
jae 0xa9a1a
negq %rbx
pushq $-0x1
popq %rax
movq 0x8(%rsp), %rcx
movq %rbx, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
seta %al
setbe %cl
movzbl %cl, %ecx
subq %rbx, %rcx
movzbl %al, %eax
movq %rcx, %rbx
jmp 0xa9a03
movq 0x84583(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x20627(%rip), %rsi     # 0xca066
leaq 0x4361e(%rip), %rdx     # 0xed064
leaq 0x43634(%rip), %rcx     # 0xed081
leaq 0x42146(%rip), %r8      # 0xebb9a
movl $0x1cf0, %r9d           # imm = 0x1CF0
xorl %eax, %eax
callq 0xb8c0
callq 0xb300