// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: determineencseqkeyvalues
static GtEncseq *determineencseqkeyvalues(GtEncseqAccessType sat,
                                          GtUword totallength,
                                          GtUword numofsequences,
                                          GtUword numofdbfiles,
                                          GtUword lengthofdbfilenames,
                                          GtUword wildcardranges,
                                          GtUword exceptionranges,
                                          GtUword minseqlen,
                                          GtUword maxseqlen,
                                          bool oistab,
                                          bool no_esq_header,
                                          const Definedunsignedlong
                                             *equallength,
                                          GtAlphabet *alpha,
                                          bool customalphabet,
                                          GtLogger *logger)
{
  double spaceinbitsperchar;
  GtEncseq *encseq;

  encseq = gt_malloc(sizeof (*encseq));
  encseq->sat = sat;
  encseq->exceptions = NULL;
  encseq->indexname = NULL;
  encseq->oissat = GT_ACCESS_TYPE_UINT32TABLES;
  encseq->accesstype_via_utables = gt_encseq_access_type_isviautables(sat);
  if (sat == GT_ACCESS_TYPE_EQUALLENGTH || numofsequences == 1UL)
    encseq->satsep = GT_ACCESS_TYPE_UNDEFINED;
  else {
    encseq->satsep = determineoptimalsssptablerep(totallength,
                                                  numofsequences-1);
  }
  encseq->has_exceptiontable = oistab;
  if (encseq->accesstype_via_utables)
    initSWtable(&encseq->wildcardrangetable, totallength, sat, wildcardranges);
  if (encseq->satsep != GT_ACCESS_TYPE_UNDEFINED)
    initSWtable(&encseq->ssptab, totallength, encseq->satsep, numofsequences-1);
  if (encseq->has_exceptiontable) {
    initSWtable(&encseq->exceptiontable, totallength, encseq->oissat,
                exceptionranges);
  }
  encseq->has_wildcardranges = (wildcardranges > 0) ? true : false;
  encseq->has_specialranges
    = (wildcardranges > 0 || numofsequences > 1UL) ? true : false;
  encseq->has_ssptab = false;
  encseq->headerptr.filelengthtab = NULL;
  encseq->filenametab = NULL;
  encseq->mappedptr = NULL;
  encseq->ssptabmappedptr = NULL;
  encseq->oistabmappedptr = NULL;
  encseq->headerptr.satcharptr = NULL;
  encseq->headerptr.numofdbsequencesptr = NULL;
  encseq->headerptr.numofdbfilesptr = NULL;
  encseq->headerptr.lengthofdbfilenamesptr = NULL;
  encseq->headerptr.firstfilename = NULL;
  encseq->headerptr.specialcharinfoptr = NULL;
  encseq->headerptr.minseqlenptr = NULL;
  encseq->headerptr.maxseqlenptr = NULL;
  encseq->reference_count = 0;
  encseq->refcount_lock = gt_mutex_new();
  encseq->destab = NULL;
  encseq->hasmirror = false;
  encseq->hasallocateddestab = false;
  encseq->sdstab = NULL;
  encseq->hasallocatedsdstab = false;
  encseq->destablength = 0;
  encseq->fsptab = NULL;
  encseq->md5_tab = NULL;
  encseq->hasallocatedssptab = false;
  if (equallength == NULL) {
    encseq->equallength.defined = false;
    encseq->equallength.valueunsignedlong = 0;
  }
  else {
    encseq->equallength = *equallength;
  }
  encseq->alpha = alpha;
  alphabet_to_key_values(alpha, &encseq->alphatype, &encseq->lengthofalphadef,
                         &encseq->alphadef, customalphabet);
  encseq->totallength = totallength;
  encseq->logicaltotallength = totallength;
  encseq->numofdbsequences = numofsequences;
  encseq->logicalnumofdbsequences = numofsequences;
  encseq->numofdbfiles = numofdbfiles;
  encseq->lengthofdbfilenames = lengthofdbfilenames;
  encseq->numofchars = gt_alphabet_num_of_chars(alpha);
  encseq->minseqlen = minseqlen;
  encseq->maxseqlen = maxseqlen;
  if (no_esq_header)
    encseq->sizeofrep = totallength;
  else {
    uint64_t sizeofrep_uint64
      = gt_encseq_determine_size(sat,
                                 totallength,
                                 numofsequences,
                                 numofdbfiles,
                                 lengthofdbfilenames,
                                 wildcardranges,
                                 encseq->numofchars,
                                 gt_alphabet_bits_per_symbol(alpha),
                                 encseq->lengthofalphadef);
    encseq->sizeofrep = CALLCASTFUNC(uint64_t, unsigned_long, sizeofrep_uint64);
  }
  encseq->satname = gt_encseq_access_type_str(sat);
  encseq->twobitencoding = NULL;
  if (sat == GT_ACCESS_TYPE_DIRECTACCESS || sat == GT_ACCESS_TYPE_BYTECOMPRESS)
    encseq->unitsoftwobitencoding = 0;
  else
    encseq->unitsoftwobitencoding = gt_unitsoftwobitencoding(totallength);

  encseq->plainseq = NULL;
  encseq->bitpackarray = NULL;
  encseq->exceptions = NULL;
  encseq->hasplainseqptr = false;
  encseq->specialbits = NULL;
  setencsequtablesNULL(encseq->sat, &encseq->wildcardrangetable);
  setencsequtablesNULL(encseq->satsep, &encseq->ssptab);
  encseq->headerptr.characterdistribution = NULL;

  encseq->leastprobablecharacter = encseq->numofchars; /* undefined */

  spaceinbitsperchar = determine_spaceinbitsperchar(encseq->sizeofrep,
                                                    totallength);
  if (encseq->sat == GT_ACCESS_TYPE_EQUALLENGTH) {
    gt_assert(encseq->equallength.defined);
    gt_logger_log(logger,
                  "init character encoding (%s "GT_WU", "GT_WU" bytes, %.2f "
                  "bits/symbol)",
                  encseq->satname, encseq->equallength.valueunsignedlong,
                  encseq->sizeofrep, spaceinbitsperchar);
  }
  else {
    gt_logger_log(logger,
                  "init character encoding (%s, "GT_WU" bytes, %.2f "
                  "bits/symbol)",
                  encseq->satname, encseq->sizeofrep, spaceinbitsperchar);
    if (encseq->numofdbsequences > 1UL) {
      GtUword sizessptab = CALLCASTFUNC(uint64_t, unsigned_long,
                                     gt_encseq_sizeofSWtable(encseq->satsep,
                                              false,
                                              false,
                                              totallength,
                                              numofsequences-1));
      spaceinbitsperchar = determine_spaceinbitsperchar(sizessptab,
                                                        totallength);
      gt_logger_log(logger,
                    "init ssptab encoding (%s, "GT_WU" bytes, %.2f "
                    "bits/symbol)",
                    gt_encseq_access_type_str(encseq->satsep),
                    sizessptab,
                    spaceinbitsperchar);
    }
  }
  return encseq;
}

// Assembly:
pushq %rbx
subq $0xc0, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
movq %rsi, %r10
movq 0x58(%rsp), %rsi
movl %edi, %r11d
movq 0x60(%rsp), %rdi
movq 0x110(%rsp), %rax
movb 0x108(%rsp), %al
movq 0x100(%rsp), %rcx
movq 0xf8(%rsp), %rcx
movb 0xf0(%rsp), %cl
movb 0xe8(%rsp), %dl
movq 0xe0(%rsp), %rbx
movq 0xd8(%rsp), %rbx
movq 0xd0(%rsp), %rbx
movl %r11d, 0xbc(%rsp)
movq %r10, 0xb0(%rsp)
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %r9, 0x90(%rsp)
andb $0x1, %dl
movb %dl, 0x8f(%rsp)
andb $0x1, %cl
movb %cl, 0x8e(%rsp)
andb $0x1, %al
movb %al, 0x8d(%rsp)
movl $0x3c0, %edi            # imm = 0x3C0
leaq 0x6e32e(%rip), %rsi     # 0x18565e
movl $0xffc, %edx            # imm = 0xFFC
callq 0xd2e0
movq %rax, 0x78(%rsp)
movl 0xbc(%rsp), %ecx
movq 0x78(%rsp), %rax
movl %ecx, (%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x330(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x68(%rax)
movq 0x78(%rsp), %rax
movl $0x6, 0x388(%rax)
movl 0xbc(%rsp), %edi
callq 0x13e930
movb %al, %cl
movq 0x78(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x3a9(%rax)
cmpl $0x2, 0xbc(%rsp)
je 0x1173aa
cmpq $0x1, 0xa8(%rsp)
jne 0x1173b8
movq 0x78(%rsp), %rax
movl $0x7, 0x4(%rax)
jmp 0x1173db
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
subq $0x1, %rsi
callq 0x11b530
movl %eax, %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x4(%rax)
movb 0x8f(%rsp), %cl
movq 0x78(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x2f0(%rax)
movq 0x78(%rsp), %rax
testb $0x1, 0x3a9(%rax)
je 0x117426
movq 0x78(%rsp), %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
movq 0xb0(%rsp), %rsi
movl 0xbc(%rsp), %edx
movq 0x90(%rsp), %rcx
callq 0x11b620
movq 0x78(%rsp), %rax
cmpl $0x7, 0x4(%rax)
je 0x11745e
movq 0x78(%rsp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq 0xb0(%rsp), %rsi
movq 0x78(%rsp), %rax
movl 0x4(%rax), %edx
movq 0xa8(%rsp), %rcx
subq $0x1, %rcx
callq 0x11b620
movq 0x78(%rsp), %rax
testb $0x1, 0x2f0(%rax)
je 0x117498
movq 0x78(%rsp), %rdi
addq $0x2f8, %rdi            # imm = 0x2F8
movq 0xb0(%rsp), %rsi
movq 0x78(%rsp), %rax
movl 0x388(%rax), %edx
movq 0xd0(%rsp), %rcx
callq 0x11b620
movq 0x90(%rsp), %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmoval %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq 0x78(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x29(%rax)
movb $0x1, %al
cmpq $0x0, 0x90(%rsp)
movb %al, 0x57(%rsp)
ja 0x1174e0
cmpq $0x1, 0xa8(%rsp)
seta %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq 0x78(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x28(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x2a(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xf0(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x1f8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x80(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x98(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xa0(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xe0(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xd8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0xb0(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x390(%rax)
callq 0x1c240
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x398(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x200(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x3a8(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x208(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x218(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x20a(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x210(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x278(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x3a0(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x209(%rax)
cmpq $0x0, 0xf8(%rsp)
jne 0x11769f
movq 0x78(%rsp), %rax
movb $0x0, 0x1e8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x1f0(%rax)
jmp 0x1176c1
movq 0x78(%rsp), %rax
movq 0xf8(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x1e8(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x1f0(%rax)
movq 0x100(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x220(%rax)
movq 0x100(%rsp), %rdi
movq 0x78(%rsp), %rsi
addq $0x238, %rsi            # imm = 0x238
movq 0x78(%rsp), %rdx
addq $0x230, %rdx            # imm = 0x230
movq 0x78(%rsp), %rcx
addq $0x228, %rcx            # imm = 0x228
movb 0x8d(%rsp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x117c40
movq 0xb0(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0xb0(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0xa8(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0xa8(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0xa0(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x98(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x100(%rsp), %rdi
callq 0x109da0
movl %eax, %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x2a8(%rax)
movq 0xd8(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x3b0(%rax)
movq 0xe0(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x3b8(%rax)
testb $0x1, 0x8e(%rsp)
je 0x1177db
movq 0xb0(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x60(%rax)
jmp 0x1178ae
movl 0xbc(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rax
movl 0x2a8(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x100(%rsp), %rdi
callq 0x109f00
movl 0x24(%rsp), %edi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r8
movq 0x48(%rsp), %r9
movl 0x50(%rsp), %r11d
movl %eax, %r10d
movq 0x78(%rsp), %rax
movq 0x230(%rax), %rax
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x11cb80
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rdx
leaq 0x6ddc6(%rip), %rdi     # 0x18565e
movl $0x104d, %esi           # imm = 0x104D
callq 0x12d160
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x60(%rax)
movl 0xbc(%rsp), %edi
callq 0x13e7e0
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x280(%rax)
cmpl $0x0, 0xbc(%rsp)
je 0x1178ea
cmpl $0x1, 0xbc(%rsp)
jne 0x1178fc
movq 0x78(%rsp), %rax
movq $0x0, 0x288(%rax)
jmp 0x117918
movq 0xb0(%rsp), %rdi
callq 0x117be0
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x288(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x290(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x2a0(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x330(%rax)
movq 0x78(%rsp), %rax
movb $0x0, 0x298(%rax)
movq 0x78(%rsp), %rax
movq $0x0, 0x2b0(%rax)
movq 0x78(%rsp), %rax
movl (%rax), %edi
movq 0x78(%rsp), %rsi
addq $0x2b8, %rsi            # imm = 0x2B8
callq 0x118cc0
movq 0x78(%rsp), %rax
movl 0x4(%rax), %edi
movq 0x78(%rsp), %rsi
addq $0x240, %rsi            # imm = 0x240
callq 0x118cc0
movq 0x78(%rsp), %rax
movq $0x0, 0xf8(%rax)
movq 0x78(%rsp), %rax
movl 0x2a8(%rax), %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x170(%rax)
movq 0x78(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xb0(%rsp), %rsi
callq 0x1318f0
movsd %xmm0, 0x80(%rsp)
movq 0x78(%rsp), %rax
cmpl $0x2, (%rax)
jne 0x117a74
jmp 0x1179ea
movq 0x78(%rsp), %rax
testb $0x1, 0x1e8(%rax)
jne 0x117a30
movq 0x9c5d9(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4665d(%rip), %rsi     # 0x15e066
leaq 0x6f380(%rip), %rdx     # 0x186d90
leaq 0x719ad(%rip), %rcx     # 0x1893c4
leaq 0x6dc40(%rip), %r8      # 0x18565e
movl $0x1064, %r9d           # imm = 0x1064
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x117a32
movq 0x110(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x78(%rsp), %rax
movq 0x1f0(%rax), %rcx
movq 0x78(%rsp), %rax
movq 0x60(%rax), %r8
movsd 0x80(%rsp), %xmm0
leaq 0x71975(%rip), %rsi     # 0x1893dd
movb $0x1, %al
callq 0xcec0
jmp 0x117b4e
movq 0x110(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x78(%rsp), %rax
movq 0x60(%rax), %rcx
movsd 0x80(%rsp), %xmm0
leaq 0x7197d(%rip), %rsi     # 0x18941b
movb $0x1, %al
callq 0xcec0
movq 0x78(%rsp), %rax
cmpq $0x1, 0x40(%rax)
jbe 0x117b4c
movq 0x78(%rsp), %rax
movl 0x4(%rax), %edi
movq 0xb0(%rsp), %rcx
movq 0xa8(%rsp), %r8
subq $0x1, %r8
xorl %edx, %edx
movl %edx, %esi
callq 0x11ce80
movq %rax, %rdx
leaq 0x6db7a(%rip), %rdi     # 0x18565e
movl $0x1076, %esi           # imm = 0x1076
callq 0x12d160
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x1318f0
movsd %xmm0, 0x80(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x78(%rsp), %rax
movl 0x4(%rax), %edi
callq 0x13e7e0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
movq 0x68(%rsp), %rcx
movsd 0x80(%rsp), %xmm0
leaq 0x71910(%rip), %rsi     # 0x189455
movb $0x1, %al
callq 0xcec0
jmp 0x117b4e
movq 0x78(%rsp), %rax
addq $0xc0, %rsp
popq %rbx
retq
nopl (%rax)