// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %r8, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbp
movq 0x98(%rsp), %r15
movq 0x90(%rsp), %r12
movl %ecx, %eax
andl $-0x3, %eax
movl %eax, 0xc(%rsp)
movl %ecx, 0x4(%rsp)
andl $-0x2, %ecx
movl %ecx, 0x8(%rsp)
movq (%r12), %rax
leaq 0x40(%rsp), %rcx
movq %rax, 0x10(%rcx)
movq (%r15), %rax
leaq 0x28(%rsp), %rcx
movq %rax, 0x10(%rcx)
movq (%r12), %r13
cmpq 0x10(%r12), %r13
jae 0xc493d
movq (%r15), %rax
cmpq 0x10(%r15), %rax
jae 0xc496a
xorl %r13d, %r13d
cmpl $0x2, 0x8(%rsp)
sete %r13b
movq %rbx, 0x20(%rsp)
movq %rbp, %rbx
xorl %ebp, %ebp
cmpl $0x1, 0xc(%rsp)
setne %bpl
movq 0x8(%r12), %rcx
movq 0x18(%r12), %r8
leaq 0x40(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %ebp, %edx
movq %r12, %r14
movq %r9, %r12
callq 0xc3ecd
movq %rax, 0x8(%r14)
movq 0x8(%r15), %rcx
movq 0x18(%r15), %r8
leaq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0xc3ecd
movq %r15, %r14
movq %rax, 0x8(%r15)
movl %ebp, %edi
movq %rbx, %rbp
movq 0x20(%rsp), %rbx
movl %r13d, %esi
movq %rbp, %rdx
leaq 0x40(%rsp), %rcx
leaq 0x28(%rsp), %r8
callq 0xc44cc
movq %r12, %r9
testq %r12, %r12
je 0xc4918
movl (%rbp), %ecx
addq %rbx, %rcx
cmpq %r9, %rcx
jae 0xc4986
movl (%rbp), %ecx
addq %rcx, %rbx
movq 0x90(%rsp), %r12
addq %rcx, (%r12)
movq %r14, %r15
addq %rcx, (%r14)
testl %eax, %eax
je 0xc4866
jmp 0xc49d5
addq $0x100, %r13            # imm = 0x100
movb $0x1, 0x4(%rbp)
movq (%r15), %rsi
cmpq 0x10(%r15), %rsi
jae 0xc498a
movq 0x10(%rsp), %rdi
movl 0x4(%rsp), %edx
callq 0xbef7c
cmpb $-0x3, %al
ja 0xc49b9
movzbl %al, %esi
xorl %eax, %eax
jmp 0xc49c3
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movl 0x4(%rsp), %edx
callq 0xbef7c
cmpb $-0x3, %al
ja 0xc4993
movzbl %al, %ecx
xorl %eax, %eax
jmp 0xc499e
xorl %eax, %eax
jmp 0xc49d8
addq $0x100, %rsi            # imm = 0x100
jmp 0xc49c1
movl $0x100, %ecx            # imm = 0x100
addq (%r12), %rcx
movb $0x1, %al
movb %al, 0x4(%rbp)
movl $0x100, %edx            # imm = 0x100
addq (%r15), %rdx
movb $0x1, 0x5(%rbp)
cmpq %rdx, %rcx
je 0xc49f0
xorl %eax, %eax
cmpq %rdx, %rcx
jmp 0xc49d0
movl $0x100, %esi            # imm = 0x100
addq (%r15), %rsi
movb $0x1, %al
movb %al, 0x5(%rbp)
cmpq %rsi, %r13
je 0xc49eb
xorl %eax, %eax
cmpq %rsi, %r13
sbbl %eax, %eax
orl $0x1, %eax
movq %rbx, %r9
movq %r9, 0x8(%rbp)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2c357
callq 0x2c390