// File: /workspace/github_c_makefile_star2_O3/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 0x32b8c9
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x32ba31
leaq 0xba2e4(%rip), %r12     # 0x3e5bb4
movl $0x40, %edi
movq %r12, %rsi
movl $0x44, %edx
callq 0x104226
movq %rax, %rbx
movq %r15, 0x8(%rax)
leaq 0x91161(%rip), %rsi     # 0x3bca51
movq %rsp, %rdx
movq %r15, %rdi
movq %r12, %rcx
movl $0x47, %r8d
movq %r14, %r9
callq 0xfdd02
movq %rax, (%rbx)
testq %rax, %rax
je 0x32b9f1
movq %rax, %rsi
movq %rax, 0x30(%rbx)
movq (%rsp), %r8
cmpq $0xf, %r8
ja 0x32b93f
leaq 0xba29d(%rip), %rsi     # 0x3e5bc8
movl $0x10, %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x32b9dd
leaq (%rsi,%r8), %rdi
addq $-0x10, %rdi
movzbl -0x10(%rsi,%r8), %eax
leaq (%rsi,%r8), %rdx
addq $-0xf, %rdx
movl $0x8, %ecx
movzbl (%rdx), %r9d
shlq %cl, %r9
orq %r9, %rax
addq $0x8, %rcx
incq %rdx
cmpq $0x40, %rcx
jne 0x32b95a
movq %rax, 0x20(%rbx)
movzbl -0x8(%rsi,%r8), %edx
leaq (%rsi,%r8), %r9
addq $-0x7, %r9
movl $0x8, %ecx
movzbl (%r9), %r10d
shlq %cl, %r10
orq %r10, %rdx
addq $0x8, %rcx
incq %r9
cmpq $0x40, %rcx
jne 0x32b988
movl %edx, 0x10(%rbx)
movq %rax, %rcx
shrq $0x2, %rcx
andl $0x3, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rcx
movq %rcx, 0x28(%rbx)
addq $-0x10, %r8
movq %r8, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0x32ba16
leaq 0xba21e(%rip), %rsi     # 0x3e5bee
movq %r14, %rdi
movq %r8, %rdx
xorl %eax, %eax
callq 0xfcb67
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x32b9f1
callq 0xfdc54
movq $0x0, (%rbx)
leaq 0xba1bc(%rip), %rsi     # 0x3e5bb4
movq %rbx, %rdi
movl $0x7e, %edx
callq 0x1045eb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, 0x18(%rbx)
cmpq %r8, %rcx
jbe 0x32ba28
decq %rsi
movq %rsi, 0x38(%rbx)
jmp 0x32ba07
subq %rcx, %rdi
movq %rdi, 0x38(%rbx)
jmp 0x32ba07
callq 0x95930