// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/tyr-map.c
// Function: gt_tyrindex_new
Tyrindex *gt_tyrindex_new(const char *tyrindexname,GtError *err)
{
  bool haserr = false;
  size_t numofbytes, rest;
  Tyrindex *tyrindex;

  gt_error_check(err);
  tyrindex = gt_malloc(sizeof *tyrindex);
  tyrindex->indexfilename = tyrindexname;
  tyrindex->mappedfileptr = gt_fa_mmap_read_with_suffix(tyrindexname,MERSUFFIX,
                                                     &numofbytes,err);
  if (tyrindex->mappedfileptr == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    tyrindex->mertable = (GtUchar *) tyrindex->mappedfileptr;
    rest = sizeof (GtUword) * EXTRAINTEGERS;
    if (rest > numofbytes)
    {
      gt_error_set(err,"index must contain at least "GT_WU" bytes",
                        (GtUword) rest);
      haserr = true;
    }
  }
  if (!haserr)
  {
    gt_assert(tyrindex->mertable != NULL);
    tyrindex->mersize
      = gt_decodesingleinteger(tyrindex->mertable + numofbytes - rest);
    tyrindex->alphasize
      = (unsigned int) gt_decodesingleinteger(tyrindex->mertable +
                                           numofbytes - rest +
                                           sizeof (GtUword));
    tyrindex->merbytes = MERBYTES(tyrindex->mersize);
    if ((numofbytes - rest) % tyrindex->merbytes != 0)
    {
      gt_error_set(err,"size of index is "GT_WU
                   " which is not a multiple of "GT_WU,
                   (GtUword) (numofbytes - rest),
                   tyrindex->merbytes);
      haserr = true;
    }
  }
  if (!haserr)
  {
    tyrindex->numofmers = (numofbytes - rest) / tyrindex->merbytes;
    gt_assert(tyrindex->mertable != NULL);
    if (tyrindex->numofmers == 0)
    {
      tyrindex->lastmer = tyrindex->mertable - 1;
    } else
    {
      tyrindex->lastmer
        = tyrindex->mertable + numofbytes - rest - tyrindex->merbytes;
    }
  }
  if (haserr)
  {
    if (tyrindex->mappedfileptr != NULL)
    {
      gt_fa_xmunmap(tyrindex->mappedfileptr);
      tyrindex->mappedfileptr = NULL;
    }
    gt_free(tyrindex);
  }
  return haserr ? NULL : tyrindex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0x2cd254
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x2cd373
leaq 0xb8d59(%rip), %r12     # 0x385fb4
pushq $0x40
popq %rdi
pushq $0x44
popq %rdx
movq %r12, %rsi
callq 0x93160
movq %rax, %rbx
movq %r15, 0x8(%rax)
leaq 0x8fc2e(%rip), %rsi     # 0x35cea5
movq %rsp, %rdx
pushq $0x47
popq %r8
movq %r15, %rdi
movq %r12, %rcx
movq %r14, %r9
callq 0x8bb39
movq %rax, (%rbx)
testq %rax, %rax
je 0x2cd332
movq %rax, %r15
movq %rax, 0x30(%rbx)
movq (%rsp), %r12
cmpq $0xf, %r12
ja 0x2cd2bf
leaq 0xb8d18(%rip), %rsi     # 0x385fc8
pushq $0x10
popq %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x2cd321
leaq (%r15,%r12), %r13
addq $-0x10, %r13
movq %r13, %rdi
callq 0x2cd20c
movq %rax, %rbp
movq %rax, 0x20(%rbx)
leaq (%r15,%r12), %rdi
addq $-0x8, %rdi
callq 0x2cd20c
movl %eax, 0x10(%rbx)
movq %rbp, %rcx
shrq $0x2, %rcx
andl $0x3, %ebp
cmpq $0x1, %rbp
sbbq $-0x1, %rcx
movq %rcx, 0x28(%rbx)
addq $-0x10, %r12
movq %r12, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0x2cd358
leaq 0xb8cda(%rip), %rsi     # 0x385fee
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x89dbb
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2cd332
callq 0x8b9fa
andq $0x0, (%rbx)
leaq 0xb8c7b(%rip), %rsi     # 0x385fb4
pushq $0x7e
popq %rdx
movq %rbx, %rdi
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, 0x18(%rbx)
cmpq %r12, %rcx
jbe 0x2cd36a
decq %r15
movq %r15, 0x38(%rbx)
jmp 0x2cd346
subq %rcx, %r13
movq %r13, 0x38(%rbx)
jmp 0x2cd346
movq 0x16abee(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17c8f(%rip), %rsi     # 0x2e5013
leaq 0x17e34(%rip), %rdx     # 0x2e51bf
leaq 0xb8c12(%rip), %rcx     # 0x385fa4
leaq 0xb8c1b(%rip), %r8      # 0x385fb4
pushq $0x43
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390