// File: /workspace/github_c_makefile_star2_O2/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 0xa8f9f
cmpq 0x10(%rbp), %rsi
jae 0xa8fce
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 0xa8312
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 0xa8312
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 0xa8a60
movl (%r12), %esi
addq %rsi, %r13
cmpq %r13, 0x38(%rsp)
jb 0xa8fea
addq %rsi, (%r14)
addq (%rbp), %rsi
movq %rsi, (%rbp)
testl %eax, %eax
je 0xa8ee5
jmp 0xa9049
addq $0x100, %r12            # imm = 0x100
movq 0x8(%rsp), %rax
movb $0x1, 0x4(%rax)
cmpq 0x10(%rbp), %rsi
jae 0xa8ff3
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %edx
callq 0xa1fd0
cmpb $-0x3, %al
ja 0xa9027
movzbl %al, %esi
xorl %eax, %eax
jmp 0xa9032
movq 0x28(%rsp), %rdi
movq %r12, %rsi
movl 0x14(%rsp), %edx
callq 0xa1fd0
cmpb $-0x3, %al
ja 0xa8ffc
movzbl %al, %ecx
xorl %eax, %eax
jmp 0xa9006
xorl %eax, %eax
movq 0x30(%rsp), %r13
jmp 0xa9049
addq $0x100, %rsi            # imm = 0x100
jmp 0xa9030
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 0xa908f
xorl %eax, %eax
cmpq %rdx, %rcx
jmp 0xa9044
movl $0x100, %esi            # imm = 0x100
addq (%rbp), %rsi
movb $0x1, %al
movq 0x8(%rsp), %rcx
movb %al, 0x5(%rcx)
cmpq %rsi, %r12
je 0xa9061
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
movq 0x84f50(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x20ff4(%rip), %rsi     # 0xca066
leaq 0x43dc0(%rip), %rdx     # 0xece39
leaq 0x43dc4(%rip), %rcx     # 0xece44
leaq 0x42b13(%rip), %r8      # 0xebb9a
movl $0x1a20, %r9d           # imm = 0x1A20
jmp 0xa90bb
movq 0x84f22(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x20fc6(%rip), %rsi     # 0xca066
leaq 0x43d92(%rip), %rdx     # 0xece39
leaq 0x43d96(%rip), %rcx     # 0xece44
leaq 0x42ae5(%rip), %r8      # 0xebb9a
movl $0x1a10, %r9d           # imm = 0x1A10
xorl %eax, %eax
callq 0xb8c0
callq 0xb300