// File: /workspace/github_c_makefile_star2_O3/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 0x1998fe
movq %rdx, %r14
testq %rdx, %rdx
je 0x1998fe
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
decq %rdi
callq 0x2f09dd
movl %eax, %ebp
leaq 0x2088c9(%rip), %rsi    # 0x3a2032
movl $0x30, %edi
movl $0xce, %edx
callq 0x104226
movq %rax, %r13
movzwl 0x1a(%r12), %ecx
movw %cx, 0x28(%rax)
movw %bp, 0x2a(%rax)
movq %r15, 0x10(%rax)
movl $0x1, %ebx
movl $0x1, %eax
shll %cl, %eax
cltq
movq %rax, (%r13)
decq %rax
movq %rax, 0x8(%r13)
movq (%r12), %rdx
movzwl %bp, %esi
movl %ecx, %edi
movq %r14, %rcx
movl $0x1, %r8d
movq %r13, %r9
callq 0x19990d
testb %al, %al
je 0x199884
movq 0x20(%r13), %rax
movq %rax, (%rsp)
movq %r13, 0x18(%rsp)
movzwl 0x2a(%r13), %r15d
movb 0x1a(%r12), %cl
shll %cl, %ebx
movq 0x20(%r12), %r13
movq (%r12), %rax
movslq %ebx, %rdx
leaq (%rax,%rdx), %rbx
decq %rbx
shrq %cl, %rbx
leaq 0x3ff(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x17cf0
cmpl $-0x1, %eax
je 0x199903
movq %rbx, 0x10(%rsp)
cmpq $0x400, %rbx            # imm = 0x400
movq %r14, 0x8(%rsp)
jl 0x19989c
movq %r14, %rbx
sarq $0xa, %rbx
movl %r15d, %r14d
shll $0xa, %r14d
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 0x1998f9
movl $0x400, %ecx            # imm = 0x400
movq (%rsp), %rdi
movq %rbp, %rsi
movl %r15d, %edx
movq %r12, %r8
callq 0x2f3d9c
addq %r14, %rbp
decq %rbx
jne 0x199842
jmp 0x19989e
leaq 0x2087a7(%rip), %rsi    # 0x3a2032
movq %r13, %rdi
movl $0xd7, %edx
callq 0x1045eb
xorl %eax, %eax
jmp 0x1998e7
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
andq $-0x400, %rax           # imm = 0xFC00
movq 0x10(%rsp), %rbx
subq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl $0x8, %esi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x17b40
cmpq %rbx, %rax
jne 0x199908
leaq 0x20(%rsp), %r8
movq (%rsp), %rdi
movq %rbp, %rsi
movl %r15d, %edx
movq %rbx, %rcx
callq 0x2f3d9c
movq 0x18(%rsp), %rax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5e709
callq 0x5e6d0
callq 0x5e797
callq 0x5e750