// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_mark_mates_of_contained
GtUword gt_reads2twobit_mark_mates_of_contained(GtReads2Twobit *r2t,
    GtBitsequence *list)
{
  GtUword libnum, noflibs = gt_array_size(r2t->collection), nofmarked = 0;
  for (libnum = 0; libnum < noflibs; libnum++)
  {
    GtReadsLibraryInfo *rli = gt_array_get(r2t->collection, libnum);
    if (rli->paired && rli->nofseqs > 0)
    {
      GtUword seqnum,
                    last_seqnum = rli->first_seqnum + rli->nofseqs - 1UL;
      gt_assert(rli->nofseqs % 2 == 0);
      for (seqnum = rli->first_seqnum; seqnum < last_seqnum; seqnum += 2UL)
      {
        if (GT_ISIBITSET(list, seqnum) && !GT_ISIBITSET(list, seqnum + 1))
        {
          GT_SETIBIT(list, seqnum + 1UL);
          nofmarked++;
        }
        else if (GT_ISIBITSET(list, seqnum + 1UL) &&
            !GT_ISIBITSET(list, seqnum))
        {
          GT_SETIBIT(list, seqnum);
          nofmarked++;
        }
      }
    }
  }
  return nofmarked;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x81370
movq %rax, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2a35d2
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x30(%rsp), %rsi
callq 0x80b60
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
testb $0x1, (%rax)
je 0x2a35bd
movq 0x18(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jbe 0x2a35bd
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x18(%rsp), %rcx
addq 0x40(%rcx), %rax
subq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x2a341f
movq 0x398bb2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x272c1b(%rip), %rsi    # 0x516013
leaq 0x2e1e09(%rip), %rdx    # 0x585208
leaq 0x2e1e18(%rip), %rcx    # 0x58521e
leaq 0x2e1ba3(%rip), %r8     # 0x584fb0
movl $0x73d, %r9d            # imm = 0x73D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a3421
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jae 0x2a35bb
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2a34fa
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x2a34fa
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2a35a6
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2a35a4
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x2a35a4
movq 0x10(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2a35a6
jmp 0x2a35a8
movq 0x10(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x10(%rsp)
jmp 0x2a342f
jmp 0x2a35bd
jmp 0x2a35bf
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x2a3373
movq 0x20(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)