// File: /workspace/github_c_makefile_star2_O1/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 $0x2028, %rsp           # imm = 0x2028
testq %rdi, %rdi
je 0x1a1e1c
movq %rdx, %r14
testq %rdx, %rdx
je 0x1a1e1c
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
decq %rdi
callq 0x2f9d41
movl %eax, %ebp
leaq 0x20990b(%rip), %rsi    # 0x3ab592
movl $0x30, %edi
movl $0xce, %edx
callq 0x1092b2
movzwl 0x1a(%r12), %ecx
movw %cx, 0x28(%rax)
movw %bp, 0x2a(%rax)
movq %r15, 0x10(%rax)
movl $0x1, %ebx
movl $0x1, %edx
shll %cl, %edx
movslq %edx, %rdx
movq %rdx, (%rax)
decq %rdx
movq %rdx, 0x8(%rax)
movq (%r12), %rdx
movzwl %bp, %esi
movq %rax, %r15
movl %ecx, %edi
movq %r14, %rcx
movl $0x1, %r8d
movq %rax, %r9
callq 0x1a1e2b
testb %al, %al
je 0x1a1da2
movq 0x20(%r12), %r13
movq 0x20(%r15), %rax
movq %rax, (%rsp)
movb 0x1a(%r12), %cl
shll %cl, %ebx
movzwl 0x2a(%r15), %r14d
movq (%r12), %rax
movslq %ebx, %rdx
leaq (%rax,%rdx), %rbx
decq %rbx
shrq %cl, %rbx
leaq 0x3ff(%rbx), %r12
testq %rbx, %rbx
cmovnsq %rbx, %r12
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x17cf0
cmpl $-0x1, %eax
je 0x1a1e21
movq %r15, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
cmpq $0x400, %rbx            # imm = 0x400
movq %r12, 0x10(%rsp)
jl 0x1a1dba
movq %r12, %rbx
sarq $0xa, %rbx
movl %r14d, %r15d
shll $0xa, %r15d
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
movl $0x8, %esi
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
movq %r13, %rcx
callq 0x17b40
cmpq $0x400, %rax            # imm = 0x400
jne 0x1a1e17
movl $0x400, %ecx            # imm = 0x400
movq (%rsp), %rdi
movq %rbp, %rsi
movl %r14d, %edx
movq %r12, %r8
callq 0x2fd259
addq %r15, %rbp
decq %rbx
jne 0x1a1d60
jmp 0x1a1dbc
leaq 0x2097e9(%rip), %rsi    # 0x3ab592
movq %r15, %rdi
movl $0xd7, %edx
callq 0x109670
xorl %eax, %eax
jmp 0x1a1e05
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
andq $-0x400, %rax           # imm = 0xFC00
movq 0x18(%rsp), %rbx
subq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl $0x8, %esi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x17b40
cmpq %rbx, %rax
jne 0x1a1e26
leaq 0x20(%rsp), %r8
movq (%rsp), %rdi
movq %rbp, %rsi
movl %r14d, %edx
movq %rbx, %rcx
callq 0x2fd259
movq 0x8(%rsp), %rax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5fb7d
callq 0x5fb44
callq 0x5fc0b
callq 0x5fbc4