// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/tyr-map.c
// Function: gt_tyrcountinfo_new
Tyrcountinfo *gt_tyrcountinfo_new(const Tyrindex *tyrindex,
                                  const char *tyrindexname,
                                  GtError *err)
{
  size_t numofbytes;
  void *tmp;
  bool haserr = false;
  Tyrcountinfo *tyrcountinfo;

  gt_error_check(err);
  tyrcountinfo = gt_malloc(sizeof *tyrcountinfo);
  tyrcountinfo->indexfilename = tyrindexname;
  tyrcountinfo->mappedmctfileptr
    = gt_fa_mmap_read_with_suffix(tyrindexname,COUNTSSUFFIX,&numofbytes,err);
  if (tyrcountinfo->mappedmctfileptr == NULL)
  {
    tyrcountinfo->smallcounts = NULL;
    haserr = true;
  } else
  {
    tyrcountinfo->smallcounts
      = (GtUchar *) tyrcountinfo->mappedmctfileptr;
    tmp = &tyrcountinfo->smallcounts[tyrindex->numofmers];
    tyrcountinfo->largecounts = (Largecount *) tmp;
    if (numofbytes < tyrindex->numofmers)
    {
      gt_error_set(err,"size of file \"%s.%s\" is smaller than minimum size "
                       ""GT_WU"",tyrindexname,COUNTSSUFFIX,
                       (GtUword) tyrindex->numofmers);
      haserr = true;
    }
  }
  if (!haserr && (numofbytes - tyrindex->numofmers) % sizeof (Largecount) != 0)
  {
    gt_error_set(err,"(numofbytes - numofmers) = "GT_WU
                 " must be a multiple of "GT_WU,
           (GtUword) (numofbytes - tyrindex->numofmers),
           (GtUword) sizeof (Largecount));
    haserr = true;
  }
  if (!haserr)
  {
    tyrcountinfo->numoflargecounts
      = (GtUword) (numofbytes - tyrindex->numofmers)/
        (GtUword) sizeof (Largecount);
  }
  if (haserr)
  {
    if (tyrcountinfo->mappedmctfileptr != NULL)
    {
      gt_fa_xmunmap(tyrcountinfo->mappedmctfileptr);
      tyrcountinfo->mappedmctfileptr = NULL;
    }
    gt_free(tyrcountinfo);
  }
  return haserr ? NULL : tyrcountinfo;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
testq %rdx, %rdx
je 0x33672b
movq %r15, %rdi
callq 0x101a9a
testb %al, %al
jne 0x336830
leaq 0xb8c7a(%rip), %r13     # 0x3ef3ac
movl $0x28, %edi
movq %r13, %rsi
movl $0xc4, %edx
callq 0x1092b2
movq %rax, %rbx
movq %r12, 0x8(%rax)
leaq 0x8f974(%rip), %rsi     # 0x3c60c6
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %r13, %rcx
movl $0xc7, %r8d
movq %r15, %r9
callq 0x102bc0
movq %rax, (%rbx)
testq %rax, %rax
je 0x3367a6
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %r8
addq %r8, %rax
movq %rax, 0x18(%rbx)
cmpq %r8, 0x8(%rsp)
jae 0x3367b2
leaq 0xb8d17(%rip), %rsi     # 0x3ef4a7
leaq 0x8f92f(%rip), %rcx     # 0x3c60c6
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
jmp 0x3367ae
movq $0x0, 0x10(%rbx)
movb $0x1, %al
jmp 0x3367b4
xorl %eax, %eax
testb %al, %al
jne 0x3367de
movq 0x8(%rsp), %rdx
subq 0x18(%r14), %rdx
testb $0xf, %dl
je 0x3367de
leaq 0xb8d10(%rip), %rsi     # 0x3ef4dd
movl $0x10, %ecx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %al
testb %al, %al
je 0x33680e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3367f6
callq 0x102b12
movq $0x0, (%rbx)
leaq 0xb8baf(%rip), %rsi     # 0x3ef3ac
movq %rbx, %rdi
movl $0xef, %edx
callq 0x109670
xorl %ebx, %ebx
jmp 0x33681f
movq 0x8(%rsp), %rax
subq 0x18(%r14), %rax
shrq $0x4, %rax
movq %rax, 0x20(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x97a3c