// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-bwtseq-context.c
// Function: gt_BWTSCRFGet
BWTSeqContextRetriever *
gt_BWTSCRFGet(BWTSeqContextRetrieverFactory *factory,
              const BWTSeq *bwtSeq,
              const char *projectName)
{
  unsigned short bitsPerUlong, mapIntervalLog2;
  BWTSeqContextRetriever *gt_newBWTSeqCR;
  gt_assert(factory && projectName);
  bitsPerUlong = requiredUlongBits(factory->seqLen - 1);
  gt_newBWTSeqCR = gt_malloc(sizeof (*gt_newBWTSeqCR));
  gt_newBWTSeqCR->mapIntervalLog2 = mapIntervalLog2 = factory->mapIntervalLog2;
  gt_newBWTSeqCR->bitsPerUlong = bitsPerUlong;
  gt_newBWTSeqCR->bwtSeq = bwtSeq;
  gt_newBWTSeqCR->mapInterval = 1 << factory->mapIntervalLog2;
  gt_newBWTSeqCR->mapMask = gt_newBWTSeqCR->mapInterval - 1;
  if (!BWTSeqCRMapOpen(mapIntervalLog2, bitsPerUlong, factory->seqLen,
                       projectName, true, gt_newBWTSeqCR))
  {
    gt_free(gt_newBWTSeqCR);
    return NULL;
  }
  readBS2Map(factory, gt_newBWTSeqCR);
  return gt_newBWTSeqCR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
testq %rdi, %rdi
je 0x143d93
movq %rdx, %r14
testq %rdx, %rdx
je 0x143d93
movq %rsi, %r15
movq %rdi, %r13
movq (%rdi), %rdi
decq %rdi
callq 0x28a939
movl %eax, %ebx
leaq 0x1fe6b8(%rip), %rsi    # 0x342322
pushq $0x30
popq %rdi
movl $0xce, %edx
callq 0x93160
movq %rax, %r12
movzwl 0x1a(%r13), %ecx
movw %cx, 0x28(%rax)
movw %bx, 0x2a(%rax)
movq %r15, 0x10(%rax)
pushq $0x1
popq %rbp
movl %ebp, %eax
shll %cl, %eax
cltq
movq %rax, (%r12)
decq %rax
movq %rax, 0x8(%r12)
movq (%r13), %rdx
movzwl %bx, %esi
movl %ecx, %edi
movq %r14, %rcx
movl %ebp, %r8d
movq %r12, %r9
callq 0x143ddc
testb %al, %al
je 0x143d4a
movq 0x20(%r13), %r15
movq 0x20(%r12), %r14
movb 0x1a(%r13), %cl
shll %cl, %ebp
movq %r12, 0x8(%rsp)
movzwl 0x2a(%r12), %ebx
movq (%r13), %rax
movslq %ebp, %rdx
leaq (%rax,%rdx), %r12
decq %r12
shrq %cl, %r12
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x17c70
cmpl $-0x1, %eax
je 0x143dcb
movl $0x400, %ecx            # imm = 0x400
movq %r12, %rax
cqto
idivq %rcx
movq %rax, %rbp
movq %rdx, (%rsp)
movl %ebx, %r12d
shll $0xa, %r12d
xorl %r13d, %r13d
testq %rax, %rax
cmovleq %r13, %rbp
subq $0x1, %rbp
jb 0x143d62
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rcx
movq %r13, %r8
movl %ebx, %r9d
callq 0x14468e
addq %r12, %r13
jmp 0x143d24
leaq 0x1fe5d1(%rip), %rsi    # 0x342322
movq %r12, %rdi
movl $0xd7, %edx
callq 0x936f9
xorl %eax, %eax
jmp 0x143d81
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq (%rsp), %rdx
movq %r14, %rcx
movq %r13, %r8
movl %ebx, %r9d
callq 0x14468e
movq 0x8(%rsp), %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2f41ce(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1a126f(%rip), %rsi    # 0x2e5013
leaq 0x1fe5fd(%rip), %rdx    # 0x3423a8
leaq 0x1fe60d(%rip), %rcx    # 0x3423bf
leaq 0x1fe569(%rip), %r8     # 0x342322
movl $0xcc, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
leaq 0x1fe71f(%rip), %rdi    # 0x3424f1
movl $0x101, %esi            # imm = 0x101
callq 0x144645