// File: /workspace/github_c_makefile_star2_O3/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
movq %rdx, 0x8(%rsp)
movl %esi, 0x14(%rsp)
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %r13
movq 0x68(%rsp), %r14
movq 0x60(%rsp), %rbx
movq %rdi, 0x18(%rsp)
movq 0x38(%rdi), %rbp
testq %r9, %r9
je 0xc6067
movq %r9, %r12
leaq (%rbx,%r9), %rax
cmpq %rax, %rbp
cmovbq %rbp, %rax
addq %r14, %r12
cmpq %r12, %rbp
cmovbq %rbp, %r12
movq %rax, %rbp
jmp 0xc606a
movq %rbp, %r12
testq %r13, %r13
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
movl %ecx, 0x24(%rsp)
movl %r8d, 0x20(%rsp)
jne 0xc60b8
movq %r13, %rdi
movq 0x18(%rsp), %r13
movq %r13, %rsi
movl 0x14(%rsp), %r15d
movl %r15d, %edx
movq %rbx, %rcx
callq 0xc12b5
movq 0x78(%rsp), %rdi
movq %r13, %rsi
movq 0x70(%rsp), %r13
movl %r15d, %edx
movq %r14, %rcx
callq 0xc12b5
jmp 0xc60c4
movq %r13, %rax
orq %rsi, %rax
jne 0xc61b8
cmpq %rbx, %rbp
seta %al
cmpq %r14, %r12
seta %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc614d
xorl %r15d, %r15d
movq 0x60(%rsp), %rbx
testq %r13, %r13
je 0xc60ee
movq %r13, %rdi
callq 0xc054e
jmp 0xc60ff
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movl 0x14(%rsp), %edx
callq 0xbff84
movl %eax, %r13d
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xc6113
callq 0xc054e
jmp 0xc6124
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
callq 0xbff84
cmpb $-0x2, %r13b
jae 0xc6156
cmpb $-0x2, %al
jae 0xc6185
cmpb %al, %r13b
jb 0xc6185
ja 0xc6176
incq %rbx
cmpq %rbp, %rbx
jae 0xc614d
incq %r14
decq %r15
cmpq %r12, %r14
movq 0x70(%rsp), %r13
jb 0xc60df
subq 0x60(%rsp), %rbx
xorl %eax, %eax
jmp 0xc6190
cmpb $-0x2, %al
jb 0xc6176
testq %r15, %r15
sete %al
andb 0x20(%rsp), %al
orb 0x24(%rsp), %al
cmpb $0x1, %al
jne 0xc6180
movl $0x1, %ebx
subq %r15, %rbx
jmp 0xc6152
negq %r15
movl $0x1, %eax
jmp 0xc618d
cmpq %r14, %rbx
jae 0xc61a7
negq %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r15, %rbx
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, %ebx
subq %r15, %rbx
movzbl %al, %eax
jmp 0xc6190
callq 0x2c2eb