// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq-context.c
// Function: gt_BWTSeqCRLoad
BWTSeqContextRetriever *
gt_BWTSeqCRLoad(const BWTSeq *bwtSeq,
             const char *projectName,
             short mapIntervalLog2)
{
  GtUword seqLen;
  unsigned short bitsPerUlong;
  BWTSeqContextRetriever *gt_newBWTSeqCR;
  gt_assert(bwtSeq && projectName);
  seqLen = BWTSeqLength(bwtSeq);
  bitsPerUlong = requiredUlongBits(seqLen - 1);
  gt_newBWTSeqCR = gt_malloc(sizeof (*gt_newBWTSeqCR));
  gt_newBWTSeqCR->bitsPerUlong = bitsPerUlong;
  gt_newBWTSeqCR->bwtSeq = bwtSeq;
  if (mapIntervalLog2 != CTX_MAP_ILOG_AUTOSIZE)
  {
    if (!BWTSeqCRMapOpen(mapIntervalLog2, bitsPerUlong, seqLen,
                         projectName, false, gt_newBWTSeqCR))
    {
      gt_free(gt_newBWTSeqCR);
      return NULL;
    }
  }
  else
  {
    short mapIntervalLog2Max = bitsPerUlong;
    mapIntervalLog2 = 0;
    while (!BWTSeqCRMapOpen(mapIntervalLog2, bitsPerUlong, seqLen,
                            projectName, false, gt_newBWTSeqCR)
           && mapIntervalLog2 < mapIntervalLog2Max)
      ++mapIntervalLog2;
    if (!gt_newBWTSeqCR->revMap)
    {
      gt_free(gt_newBWTSeqCR);
      return NULL;
    }
  }
  gt_newBWTSeqCR->mapIntervalLog2 = mapIntervalLog2;
  gt_newBWTSeqCR->mapInterval = 1 << mapIntervalLog2;
  gt_newBWTSeqCR->mapMask = gt_newBWTSeqCR->mapInterval - 1;
  return gt_newBWTSeqCR;
}

// Assembly:
subq $0x48, %rsp
movw %dx, %ax
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movw %ax, 0x2e(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x2202b6
cmpq $0x0, 0x30(%rsp)
jne 0x2202ee
movq 0x41bce3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2f5d4c(%rip), %rsi    # 0x516013
leaq 0x3543cf(%rip), %rdx    # 0x57469d
leaq 0x3543de(%rip), %rcx    # 0x5746b3
leaq 0x354316(%rip), %r8     # 0x5745f2
movl $0x15a, %r9d            # imm = 0x15A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2202f0
movq 0x38(%rsp), %rdi
callq 0x2204a0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
subq $0x1, %rdi
callq 0x46ec80
movw %ax, 0x1e(%rsp)
movl $0x30, %edi
leaq 0x3542d4(%rip), %rsi    # 0x5745f2
movl $0x15d, %edx            # imm = 0x15D
callq 0xe80f0
movq %rax, 0x10(%rsp)
movw 0x1e(%rsp), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x2a(%rax)
movq 0x38(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movswl 0x2e(%rsp), %eax
cmpl $-0x1, %eax
je 0x2203a7
movw 0x2e(%rsp), %si
movw 0x1e(%rsp), %ax
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %r9
xorl %r8d, %r8d
movzwl %si, %edi
movzwl %ax, %esi
callq 0x21fd00
testb $0x1, %al
jne 0x2203a2
movq 0x10(%rsp), %rdi
leaq 0x354268(%rip), %rsi    # 0x5745f2
movl $0x165, %edx            # imm = 0x165
callq 0xe88c0
movq $0x0, 0x40(%rsp)
jmp 0x22048c
jmp 0x220448
movw 0x1e(%rsp), %ax
movw %ax, 0xe(%rsp)
movw $0x0, 0x2e(%rsp)
movw 0x2e(%rsp), %si
movw 0x1e(%rsp), %ax
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %r9
xorl %r8d, %r8d
movzwl %si, %edi
movzwl %ax, %esi
callq 0x21fd00
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xd(%rsp)
jne 0x2203ff
movswl 0x2e(%rsp), %eax
movswl 0xe(%rsp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x220409
jmp 0x220419
movw 0x2e(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x2e(%rsp)
jmp 0x2203b8
movq 0x10(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x220446
movq 0x10(%rsp), %rdi
leaq 0x3541c1(%rip), %rsi    # 0x5745f2
movl $0x173, %edx            # imm = 0x173
callq 0xe88c0
movq $0x0, 0x40(%rsp)
jmp 0x22048c
jmp 0x220448
movw 0x2e(%rsp), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x28(%rax)
movswl 0x2e(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rcx
subq $0x1, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)