// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movb $0x0, 0x27(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x4e7d73
movq 0x28(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x4e7d3b
jmp 0x4e7d73
movq 0x15425e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e2c7(%rip), %rsi     # 0x516013
leaq 0x2e46c(%rip), %rdx     # 0x5161bf
leaq 0xd3877(%rip), %rcx     # 0x5bb5d1
leaq 0xd3880(%rip), %r8      # 0x5bb5e1
movl $0x43, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e7d75
movl $0x40, %edi
leaq 0xd3860(%rip), %rsi     # 0x5bb5e1
movl $0x44, %edx
callq 0xe80f0
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %r9
leaq 0xa7de7(%rip), %rsi     # 0x58fb96
leaq 0x18(%rsp), %rdx
leaq 0xd3826(%rip), %rcx     # 0x5bb5e1
movl $0x47, %r8d
callq 0xdb430
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x4e7de1
movb $0x1, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
jne 0x4e7e2d
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq $0x10, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jbe 0x4e7e2b
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0xd37d6(%rip), %rsi     # 0x5bb5f5
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x4e7e2d
testb $0x1, 0x27(%rsp)
jne 0x4e7f51
jmp 0x4e7e3a
movq 0x8(%rsp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x4e7e7e
movq 0x154153(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e1bc(%rip), %rsi     # 0x516013
leaq 0xd37bd(%rip), %rdx     # 0x5bb61b
leaq 0xd376c(%rip), %rcx     # 0x5bb5d1
leaq 0xd3775(%rip), %r8      # 0x5bb5e1
movl $0x59, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e7e80
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
addq 0x18(%rsp), %rdi
xorl %eax, %eax
subq 0x10(%rsp), %rax
addq %rax, %rdi
callq 0x4e7cb0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
addq 0x18(%rsp), %rdi
xorl %eax, %eax
subq 0x10(%rsp), %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x4e7cb0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rcx
shrq $0x2, %rcx
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
andq $0x3, %rsi
movl $0x1, %eax
xorl %edx, %edx
cmpq $0x0, %rsi
cmoveq %rdx, %rax
addq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
cmpq $0x0, %rdx
je 0x4e7f4f
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
subq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
leaq 0xd36f3(%rip), %rsi     # 0x5bb636
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x4e7f51
testb $0x1, 0x27(%rsp)
jne 0x4e8018
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x4e7fc1
movq 0x154010(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e079(%rip), %rsi     # 0x516013
leaq 0xd367a(%rip), %rdx     # 0x5bb61b
leaq 0xd3629(%rip), %rcx     # 0x5bb5d1
leaq 0xd3632(%rip), %r8      # 0x5bb5e1
movl $0x6d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e7fc3
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x4e7fe7
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rcx
addq $-0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x4e8016
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rcx
addq 0x18(%rsp), %rcx
xorl %eax, %eax
subq 0x10(%rsp), %rax
addq %rax, %rcx
movq 0x8(%rsp), %rdx
xorl %eax, %eax
subq 0x28(%rdx), %rax
addq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x4e8018
testb $0x1, 0x27(%rsp)
je 0x4e8059
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x4e8043
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0xdb2a0
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq 0x8(%rsp), %rdi
leaq 0xd3592(%rip), %rsi     # 0x5bb5e1
movl $0x7e, %edx
callq 0xe88c0
testb $0x1, 0x27(%rsp)
je 0x4e8068
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x4e8071
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)