// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_twobitencoding_strcmp
int gt_encseq_twobitencoding_strcmp(GtCommonunits *commonunits,
                                    const GtEncseq *encseq1,
                                    const GtEncseq *encseq2,
                                    GtReadmode readmode,
                                    GtUword depth,
                                    GtUword maxdepth,
                                    GtViatwobitkeyvalues *vtk1,
                                    GtViatwobitkeyvalues *vtk2)
{
  GtEndofTwobitencoding ptbe1, ptbe2;
  int retval;
  GtUword cc1, cc2;
  bool fwd = GT_ISDIRREVERSE(readmode) ? false : true,
       complement = GT_ISDIRCOMPLEMENT(readmode) ? true : false;
  GtUchar tmp;

  ptbe1.referstartpos = vtk1->pos;
  ptbe2.referstartpos = vtk2->pos;
  do {
    if (vtk1->pos < vtk1->endpos) {
      if (vtk2->pos < vtk2->endpos) {
        vtk1->twobitcurrentpos =
          gt_encseq_extract2bitenc(&ptbe1, encseq1, fwd, vtk1->twobitcurrentpos,
                                   vtk1->twobitencodingstoppos);
        vtk2->twobitcurrentpos =
          gt_encseq_extract2bitenc(&ptbe2, encseq2, fwd, vtk2->twobitcurrentpos,
                                   vtk2->twobitencodingstoppos);
        retval = gt_encseq_compare_pairof_twobitencodings(fwd, complement,
                                                          commonunits,
                                                          &ptbe1, &ptbe2);
        if (maxdepth == 0 || depth + commonunits->common < maxdepth) {
          depth += commonunits->common;
          vtk1->pos += commonunits->common;
          vtk2->pos += commonunits->common;
        }
        else {
          depth = maxdepth;
          retval = 0;
          break;
        }
      }
      else {
        GT_ENCSEQ_DEREF_STOPPOS(cc1, commonunits->leftspecial, tmp, encseq1,
                                readmode, vtk1->pos);
        cc2 = GT_UNIQUEINT(vtk2->pos);
        commonunits->rightspecial = true;
        gt_assert(cc1 != cc2);
        retval = (cc1 < cc2) ? -1 : 1;
        break;
      }
    }
    else {
      cc1 = GT_UNIQUEINT(vtk1->pos);
      commonunits->leftspecial = true;
      if (vtk2->pos < vtk2->endpos) {
        GT_ENCSEQ_DEREF_STOPPOS(cc2, commonunits->rightspecial, tmp, encseq2,
                                readmode, vtk2->pos);
      }
      else {
        cc2 = GT_UNIQUEINT(vtk2->pos);
        commonunits->rightspecial = true;
      }
      gt_assert(cc1 != cc2);
      retval = (cc1 < cc2) ? -1 : 1;
      break;
    }
  } while (retval == 0);
  commonunits->finaldepth = depth;
  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r13
movq %rdx, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, 0x8(%rsp)
movq 0xb8(%rsp), %rbp
movq 0xb0(%rsp), %r14
movl %ecx, %eax
andl $-0x3, %eax
movl %eax, 0x1c(%rsp)
movl %ecx, 0x14(%rsp)
andl $-0x2, %ecx
movl %ecx, 0x18(%rsp)
movq (%r14), %rax
leaq 0x60(%rsp), %rcx
movq %rax, 0x10(%rcx)
movq (%rbp), %rsi
leaq 0x48(%rsp), %rax
movq %rsi, 0x10(%rax)
movq %r9, 0x30(%rsp)
leaq -0x1(%r9), %rax
movq %rax, 0x38(%rsp)
movq (%r14), %r12
cmpq 0x10(%r14), %r12
jae 0xc5929
cmpq 0x10(%rbp), %rsi
jae 0xc5958
xorl %r12d, %r12d
cmpl $0x2, 0x18(%rsp)
sete %r12b
movq %r13, 0x40(%rsp)
xorl %r13d, %r13d
cmpl $0x1, 0x1c(%rsp)
setne %r13b
movq 0x8(%r14), %rcx
movq 0x18(%r14), %r8
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq 0x28(%rsp), %rsi
movl %r13d, %edx
callq 0xc4efb
movq %rax, 0x8(%r14)
movq 0x8(%rbp), %rcx
movq 0x18(%rbp), %r8
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0xc4efb
movq %rax, 0x8(%rbp)
movl %r13d, %edi
movq 0x40(%rsp), %r13
movl %r12d, %esi
movq 0x8(%rsp), %r12
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0xc54d8
movl (%r12), %esi
addq %rsi, %r13
cmpq %r13, 0x38(%rsp)
jb 0xc5974
addq %rsi, (%r14)
addq (%rbp), %rsi
movq %rsi, (%rbp)
testl %eax, %eax
je 0xc586f
jmp 0xc59d3
addq $0x100, %r12            # imm = 0x100
movq 0x8(%rsp), %rax
movb $0x1, 0x4(%rax)
cmpq 0x10(%rbp), %rsi
jae 0xc597d
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %edx
callq 0xbff84
cmpb $-0x3, %al
ja 0xc59b1
movzbl %al, %esi
xorl %eax, %eax
jmp 0xc59bc
movq 0x28(%rsp), %rdi
movq %r12, %rsi
movl 0x14(%rsp), %edx
callq 0xbff84
cmpb $-0x3, %al
ja 0xc5986
movzbl %al, %ecx
xorl %eax, %eax
jmp 0xc5990
xorl %eax, %eax
movq 0x30(%rsp), %r13
jmp 0xc59d3
addq $0x100, %rsi            # imm = 0x100
jmp 0xc59ba
movl $0x100, %ecx            # imm = 0x100
addq (%r14), %rcx
movb $0x1, %al
movq 0x8(%rsp), %rsi
movb %al, 0x4(%rsi)
movl $0x100, %edx            # imm = 0x100
addq (%rbp), %rdx
movb $0x1, 0x5(%rsi)
cmpq %rdx, %rcx
je 0xc59f0
xorl %eax, %eax
cmpq %rdx, %rcx
jmp 0xc59ce
movl $0x100, %esi            # imm = 0x100
addq (%rbp), %rsi
movb $0x1, %al
movq 0x8(%rsp), %rcx
movb %al, 0x5(%rcx)
cmpq %rsi, %r12
je 0xc59eb
xorl %eax, %eax
cmpq %rsi, %r12
sbbl %eax, %eax
orl $0x1, %eax
movq 0x8(%rsp), %rcx
movq %r13, 0x8(%rcx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2c03f
callq 0x2c078