// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_compare_pairof_twobitencodings
int gt_encseq_compare_pairof_twobitencodings(bool fwd,
                                             bool complement,
                                             GtCommonunits *commonunits,
                                             const GtEndofTwobitencoding *ptbe1,
                                             const GtEndofTwobitencoding *ptbe2)
{
  GtTwobitencoding mask;

  if (ptbe1->unitsnotspecial < ptbe2->unitsnotspecial)
      /* GT_ISSPECIAL(seq1[ptbe1.unitsnotspecial]) &&
         GT_ISNOTSPECIAL(seq2[ptbe2.unitsnotspecial]) */ {
    GtTwobitencoding tbe1, tbe2;

    mask = GT_ENCSEQ_MASKEND(fwd, ptbe1->unitsnotspecial);
    tbe1 = ptbe1->tbe & mask;
    tbe2 = ptbe2->tbe & mask;
    if (tbe1 == tbe2) {
      gt_assert(ptbe1->unitsnotspecial < (unsigned int) GT_UNITSIN2BITENC &&
                commonunits != NULL);
      commonunits->common = ptbe1->unitsnotspecial;
      commonunits->leftspecial = true;
      commonunits->rightspecial = false;
      return 1;
    }
    return gt_encseq_compare_pairof_different_twobitencodings(fwd, complement,
                                                              commonunits,
                                                              tbe1, tbe2);
  }
  if (ptbe1->unitsnotspecial > ptbe2->unitsnotspecial)
     /* GT_ISSPECIAL(seq2[ptbe2->unitsnotspecial]) &&
        GT_ISNOTSPECIAL(seq1[ptbe2NOT->unitsnotspecial]) */ {
    GtTwobitencoding tbe1, tbe2;

    mask = GT_ENCSEQ_MASKEND(fwd, ptbe2->unitsnotspecial);
    tbe1 = ptbe1->tbe & mask;
    tbe2 = ptbe2->tbe & mask;
    if (tbe1 == tbe2) {
      gt_assert(ptbe2->unitsnotspecial < (unsigned int) GT_UNITSIN2BITENC &&
                commonunits != NULL);
      commonunits->common = ptbe2->unitsnotspecial;
      commonunits->leftspecial = false;
      commonunits->rightspecial = true;
      return -1;
    }
    return gt_encseq_compare_pairof_different_twobitencodings(fwd, complement,
                                                              commonunits,
                                                              tbe1, tbe2);
  }
  gt_assert(ptbe1->unitsnotspecial == ptbe2->unitsnotspecial);
  if (ptbe1->unitsnotspecial < (unsigned int) GT_UNITSIN2BITENC) {
    GtTwobitencoding tbe1, tbe2;

    mask = GT_ENCSEQ_MASKEND(fwd, ptbe1->unitsnotspecial);
    tbe1 = ptbe1->tbe & mask;
    tbe2 = ptbe2->tbe & mask;
    if (tbe1 == tbe2) {
      gt_assert(commonunits != NULL);
      commonunits->common = ptbe1->unitsnotspecial;
      commonunits->leftspecial = commonunits->rightspecial = true;
      return (ptbe1->referstartpos < ptbe2->referstartpos)
                ? -1
                : ((ptbe1->referstartpos > ptbe2->referstartpos) ? 1 : 0);
    }
    return gt_encseq_compare_pairof_different_twobitencodings(fwd, complement,
                                                              commonunits,
                                                              tbe1, tbe2);
  }
  gt_assert(ptbe1->unitsnotspecial == (unsigned int) GT_UNITSIN2BITENC &&
            ptbe2->unitsnotspecial == (unsigned int) GT_UNITSIN2BITENC);
  if (ptbe1->tbe != ptbe2->tbe) {
    return gt_encseq_compare_pairof_different_twobitencodings(fwd, complement,
                                                              commonunits,
                                                              ptbe1->tbe,
                                                              ptbe2->tbe);
  }
  gt_assert(commonunits != NULL);
  commonunits->common = (unsigned int) GT_UNITSIN2BITENC;
  commonunits->leftspecial = commonunits->rightspecial = false;
  return 0;
}

// Assembly:
pushq %rax
movq %rcx, %rax
movl 0x8(%rcx), %r10d
movl 0x8(%r8), %r11d
cmpl %r11d, %r10d
jae 0xc5505
testl %r10d, %r10d
je 0xc555b
leal (%r10,%r10), %ecx
testb %dil, %dil
je 0xc5560
negb %cl
movq $-0x1, %r9
shlq %cl, %r9
jmp 0xc556d
jbe 0xc552e
testl %r11d, %r11d
je 0xc55da
leal (%r11,%r11), %ecx
testb %dil, %dil
je 0xc55df
negb %cl
movq $-0x1, %r9
shlq %cl, %r9
jmp 0xc55ec
cmpl $0x1f, %r10d
ja 0xc55a5
testl %r10d, %r10d
je 0xc5669
leaq (%r10,%r10), %rcx
testb %dil, %dil
je 0xc566e
negb %cl
movq $-0x1, %r9
shlq %cl, %r9
jmp 0xc567b
xorl %r9d, %r9d
jmp 0xc556d
movq $-0x1, %r9
shlq %cl, %r9
notq %r9
movq (%rax), %rax
andq %r9, %rax
andq (%r8), %r9
cmpq %r9, %rax
jne 0xc5620
testq %rdx, %rdx
je 0xc56d2
cmpl $0x20, %r10d
jae 0xc56d2
movl %r10d, (%rdx)
movw $0x1, 0x4(%rdx)
movl $0x1, %eax
jmp 0xc56ac
cmpl $0x20, %r11d
jne 0xc56d7
movq (%rax), %rax
movq (%r8), %rcx
cmpq %rcx, %rax
jne 0xc5646
testq %rdx, %rdx
je 0xc56e6
movl $0x20, (%rdx)
movw $0x0, 0x4(%rdx)
xorl %eax, %eax
jmp 0xc56ac
xorl %r9d, %r9d
jmp 0xc55ec
movq $-0x1, %r9
shlq %cl, %r9
notq %r9
movq (%rax), %rax
andq %r9, %rax
andq (%r8), %r9
cmpq %r9, %rax
jne 0xc5620
testq %rdx, %rdx
je 0xc56dc
cmpl $0x20, %r11d
jae 0xc56dc
movl %r11d, (%rdx)
movw $0x100, 0x4(%rdx)       # imm = 0x100
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc56ac
leaq -0x285(%rip), %rcx      # 0xc53a2
leaq -0x1ca(%rip), %r8       # 0xc5464
testb %dil, %dil
cmovneq %rcx, %r8
movzbl %sil, %edi
movq %rdx, %rsi
movq %rax, %rdx
movq %r9, %rcx
popq %rax
jmpq *%r8
leaq -0x2ab(%rip), %r8       # 0xc53a2
leaq -0x1f0(%rip), %r9       # 0xc5464
testb %dil, %dil
cmovneq %r8, %r9
movzbl %sil, %edi
movq %rdx, %rsi
movq %rax, %rdx
popq %rax
jmpq *%r9
xorl %r9d, %r9d
jmp 0xc567b
movq $-0x1, %r9
shlq %cl, %r9
notq %r9
movq (%rax), %rcx
andq %r9, %rcx
andq (%r8), %r9
cmpq %r9, %rcx
jne 0xc56ae
testq %rdx, %rdx
je 0xc56e1
movl %r10d, (%rdx)
movw $0x101, 0x4(%rdx)       # imm = 0x101
movq 0x10(%rax), %rax
xorl %ecx, %ecx
cmpq 0x10(%r8), %rax
seta %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovael %ecx, %eax
popq %rcx
retq
leaq -0x313(%rip), %rax      # 0xc53a2
leaq -0x258(%rip), %r8       # 0xc5464
testb %dil, %dil
cmovneq %rax, %r8
movzbl %sil, %edi
movq %rdx, %rsi
movq %rcx, %rdx
jmp 0xc563f
callq 0x2bfcd
callq 0x2bee9
callq 0x2bf94
callq 0x2bf5b
callq 0x2bf22