// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0x336499
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x33662e
leaq 0xb8f0c(%rip), %r12     # 0x3ef3ac
movl $0x40, %edi
movq %r12, %rsi
movl $0x44, %edx
callq 0x1092b2
movq %rax, %rbx
movq %r15, 0x8(%rax)
leaq 0x8fc01(%rip), %rsi     # 0x3c60c1
movq %rsp, %rdx
movq %r15, %rdi
movq %r12, %rcx
movl $0x47, %r8d
movq %r14, %r9
callq 0x102bc0
movq %rax, (%rbx)
testq %rax, %rax
sete %sil
je 0x336507
movq %rax, 0x30(%rbx)
cmpq $0xf, (%rsp)
ja 0x336507
leaq 0xb8ecb(%rip), %rsi     # 0x3ef3c0
movl $0x10, %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %sil
testb %sil, %sil
jne 0x3365ba
movq 0x30(%rbx), %rdx
testq %rdx, %rdx
je 0x336633
movq (%rsp), %r8
leaq (%rdx,%r8), %rdi
addq $-0xf, %rdi
movzbl -0x1(%rdi), %eax
movl $0x8, %ecx
movzbl (%rdi), %r9d
shlq %cl, %r9
orq %r9, %rax
addq $0x8, %rcx
incq %rdi
cmpq $0x40, %rcx
jne 0x336532
movq %rax, 0x20(%rbx)
leaq (%rdx,%r8), %rdi
addq $-0x7, %rdi
movzbl -0x1(%rdi), %edx
movl $0x8, %ecx
movzbl (%rdi), %r9d
shlq %cl, %r9
orq %r9, %rdx
addq $0x8, %rcx
incq %rdi
cmpq $0x40, %rcx
jne 0x33655e
movq %rax, %rcx
shrq $0x2, %rcx
andl $0x3, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rcx
movl %edx, 0x10(%rbx)
movq %rcx, 0x28(%rbx)
addq $-0x10, %r8
movq %r8, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0x3365b5
leaq 0xb8e5b(%rip), %rsi     # 0x3ef401
movq %r14, %rdi
movq %r8, %rdx
xorl %eax, %eax
callq 0x1019cf
jmp 0x3365ba
testb %sil, %sil
je 0x3365f3
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3365ce
callq 0x102b12
movq $0x0, (%rbx)
leaq 0xb8dd7(%rip), %rsi     # 0x3ef3ac
movq %rbx, %rdi
movl $0x7e, %edx
callq 0x109670
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq (%rsp), %rdi
leaq -0x10(%rdi), %rcx
movq 0x28(%rbx), %r8
movq 0x30(%rbx), %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r8
movq %rax, 0x18(%rbx)
testq %rsi, %rsi
je 0x336638
cmpq %rcx, %r8
jbe 0x33661e
decq %rsi
jmp 0x336628
addq %rdi, %rsi
subq %r8, %rsi
addq $-0x10, %rsi
movq %rsi, 0x38(%rbx)
jmp 0x3365e4
callq 0x97997
callq 0x97a05
callq 0x979ce