// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movb $0x0, 0x1f(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x4e8278
movq 0x30(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x4e8240
jmp 0x4e8278
movq 0x153d59(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ddc2(%rip), %rsi     # 0x516013
leaq 0x2df67(%rip), %rdx     # 0x5161bf
leaq 0xd3469(%rip), %rcx     # 0x5bb6c8
leaq 0xd337b(%rip), %r8      # 0x5bb5e1
movl $0xc3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e827a
movl $0x28, %edi
leaq 0xd335b(%rip), %rsi     # 0x5bb5e1
movl $0xc4, %edx
callq 0xe80f0
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %r9
leaq 0xa78e7(%rip), %rsi     # 0x58fb9b
leaq 0x28(%rsp), %rdx
leaq 0xd3321(%rip), %rcx     # 0x5bb5e1
movl $0xc7, %r8d
callq 0xdb430
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x4e82f5
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
movb $0x1, 0x1f(%rsp)
jmp 0x4e836a
movq 0x10(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rcx
addq 0x18(%rcx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x4e8368
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rax
movq 0x18(%rax), %r8
leaq 0xd3387(%rip), %rsi     # 0x5bb6dc
leaq 0xa783f(%rip), %rcx     # 0x58fb9b
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x1f(%rsp)
jmp 0x4e836a
testb $0x1, 0x1f(%rsp)
jne 0x4e83b4
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
subq 0x18(%rcx), %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4e83b4
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rdx
movq 0x40(%rsp), %rax
subq 0x18(%rax), %rdx
leaq 0xd336f(%rip), %rsi     # 0x5bb712
movl $0x10, %ecx
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x1f(%rsp)
testb $0x1, 0x1f(%rsp)
jne 0x4e83d6
movq 0x28(%rsp), %rcx
movq 0x40(%rsp), %rax
subq 0x18(%rax), %rcx
shrq $0x4, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
testb $0x1, 0x1f(%rsp)
je 0x4e8417
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x4e8401
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0xdb2a0
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rdi
leaq 0xd31d4(%rip), %rsi     # 0x5bb5e1
movl $0xef, %edx
callq 0xe88c0
testb $0x1, 0x1f(%rsp)
je 0x4e8427
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x4e8431
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax,%rax)