// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_determine_size
uint64_t gt_encseq_determine_size(GtEncseqAccessType sat,
                                  GtUword totallength,
                                  GtUword numofsequences,
                                  GtUword numofdbfiles,
                                  GtUword lengthofdbfilenames,
                                  GtUword wildcardranges,
                                  unsigned int numofchars,
                                  unsigned int bitspersymbol,
                                  GtUword lengthofalphadef)
{
  uint64_t sum,
           sizeoftwobitencoding
             = (uint64_t) gt_unitsoftwobitencoding(totallength) *
               (uint64_t) sizeof (GtTwobitencoding);

  switch (sat) {
    case GT_ACCESS_TYPE_DIRECTACCESS:
         sum = (uint64_t) totallength * (uint64_t) sizeof (GtUchar);
         break;
    case GT_ACCESS_TYPE_BYTECOMPRESS:
         gt_assert(bitspersymbol > 0);
         sum = (uint64_t) sizeofbitarray(bitspersymbol,
                                         (BitOffset) totallength);
         break;
    case GT_ACCESS_TYPE_EQUALLENGTH:
         sum = sizeoftwobitencoding;
         break;
    case GT_ACCESS_TYPE_BITACCESS:
         sum = sizeoftwobitencoding;
         if (wildcardranges > 0 || numofsequences > 1UL) {
           sum += (uint64_t) sizeof (GtBitsequence) *
                  (uint64_t) GT_NUMOFINTSFORBITS(totallength+GT_INTWORDSIZE);
         }
         break;
    case GT_ACCESS_TYPE_UCHARTABLES:
    case GT_ACCESS_TYPE_USHORTTABLES:
    case GT_ACCESS_TYPE_UINT32TABLES:
         sum = sizeoftwobitencoding +
               gt_encseq_sizeofSWtable(sat, true, false, totallength,
                                       wildcardranges);
         break;
    default:
         fprintf(stderr, "gt_encseq_determine_size(%d) undefined\n", (int) sat);
         exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  sum += sizeof (GtUchar); /* for is64bit type */
  sum += sizeof (GtUword); /* for version type */
  sum += sizeof (GtUword); /* for sat type */
  sum += sizeof (totallength);   /* for totallength */
  sum += sizeof (GtUword); /* for numofdbsequences type */
  sum += sizeof (GtUword); /* for numofdbfilenames type */
  sum += sizeof (GtUword); /* for lengthofdbfilenames type */
  sum += sizeof (GtSpecialcharinfo); /* for specialcharinfo */
  sum += sizeof (GtUword); /* for minseqlen type */
  sum += sizeof (GtUword); /* for maxseqlen type */
  sum += sizeof (GtUword); /* for numofallchars type */
  sum += sizeof (unsigned char); /* for maxsubalphasize type */
  sum += sizeof (GtFilelengthvalues) * numofdbfiles; /* for filelengthtab */
  sum += sizeof (GtUword) * numofchars; /* for characterdistribution */
  sum += sizeof (char) * lengthofdbfilenames; /* for firstfilename */
  sum += sizeof (GtUword); /* for alphatype */
  sum += sizeof (GtUword); /* for lengthofalphadef */
  sum += sizeof (char) * lengthofalphadef; /* for alphadef */
  return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq -0x1(%rsi), %rax
shrq $0x5, %rax
cmpq $0x20, %rsi
leaq 0x10(,%rax,8), %rax
movl $0x10, %r15d
cmovaeq %rax, %r15
cmpl $0x6, %edi
ja 0xc4b77
movq %r8, %r14
movq %rcx, %rbx
movq %rsi, %rcx
movl %edi, %eax
leaq 0x3dcad(%rip), %rsi     # 0x10278c
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movl $0x1, %esi
xorl %edx, %edx
movq %r9, %r8
callq 0xc4b81
addq %rax, %r15
jmp 0xc4b54
movl 0x28(%rsp), %eax
testl %eax, %eax
je 0xc4b7c
movl %eax, %eax
imulq %rcx, %rax
movq %rax, %r15
shrq $0x3, %r15
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %r15
jmp 0xc4b54
testq %r9, %r9
sete %al
cmpq $0x2, %rdx
setb %dl
testb %al, %dl
jne 0xc4b54
leaq 0x3f(%rcx), %rax
shrq $0x6, %rax
cmpq $-0x40, %rcx
leaq 0x8(,%rax,8), %rax
movl $0x8, %ecx
cmovbq %rax, %rcx
addq %rcx, %r15
jmp 0xc4b54
movq %rcx, %r15
shlq $0x4, %rbx
movl 0x20(%rsp), %eax
addq %r14, %rbx
leaq (%rbx,%rax,8), %rax
addq 0x30(%rsp), %rax
addq %r15, %rax
addq $0xca, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x2ba68
callq 0x2ba2f