// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-seqblocktranslate.c
// Function: gt_initCompositionList
int
gt_initCompositionList(struct compList *newList, unsigned blockSize,
                    unsigned alphabetSize)
{
  unsigned *composition = NULL;
  Symbol maxSym = alphabetSize - 1;
  BitOffset bitsPerComp, bitsPerCount, bitsPerPerm;
  size_t numCompositions, cmpIdx = 0;
  size_t maxNumPermutations = 0, numTotalPermutations;
  gt_assert(newList);
  newList->permutations = NULL;
  newList->catCompsPerms = NULL;
  if (!(composition = gt_malloc(sizeof (composition[0]) * alphabetSize)))
    gt_initCompositionListErrRet();
  bitsPerComp = alphabetSize * (bitsPerCount = gt_requiredUIntBits(blockSize));
  newList->bitsPerCount = bitsPerCount;
  numCompositions = newList->numCompositions =
    gt_combinatorics_binomial_simple(blockSize + maxSym, maxSym);
  numTotalPermutations = gt_combinatorics_i_pow(alphabetSize, blockSize);
  newList->compositionIdxBits = gt_requiredUInt64Bits(numCompositions - 1);
  newList->bitsPerSymbol = gt_requiredUIntBits(maxSym);
  bitsPerPerm = newList->bitsPerSymbol * blockSize;
  {
    size_t size = bitElemsAllocSize(numCompositions * bitsPerComp
                                    + numTotalPermutations * bitsPerPerm)
      * sizeof (BitElem);
    if (size == SIZE_MAX)
      gt_initCompositionListErrRet();
    newList->catCompsPerms = gt_malloc(size);
  }
  newList->permutations = gt_calloc(sizeof (struct permList), numCompositions);
  {
    unsigned symRMNZ;
    BitOffset offset = 0, permOffset =
      compListPermStartOffset(newList, alphabetSize);
#ifndef NDEBUG
    size_t permSum = 0;
#endif
    initComposition(maxSym, blockSize, composition, &symRMNZ);
    do
    {
#ifdef EIS_DEBUG
      printComposition(stderr, composition, alphabetSize, blockSize);
#endif /* EIS_DEBUG */
      gt_bsStoreUniformUIntArray(newList->catCompsPerms, offset,
                              bitsPerCount, alphabetSize, composition);
      gt_assert(cmpIdx > 1?(gt_bsCompare(newList->catCompsPerms, offset,
                                      bitsPerComp,
                              newList->catCompsPerms, offset - bitsPerComp,
                              bitsPerComp)>0):1);
      if (initPermutationsList(composition, newList->permutations + cmpIdx,
                               newList->catCompsPerms, permOffset, blockSize,
                               alphabetSize, newList->bitsPerSymbol))
        gt_initCompositionListErrRet();
#if defined(EIS_DEBUG) && !defined(NDEBUG)
      gt_log_log(""GT_WU"",
              (GtUword)newList->permutations[cmpIdx].numPermutations);
#endif
#ifndef NDEBUG
      permSum += newList->permutations[cmpIdx].numPermutations;
#endif
      permOffset += newList->permutations[cmpIdx].numPermutations * bitsPerPerm;
      if (newList->permutations[cmpIdx].numPermutations > maxNumPermutations)
        maxNumPermutations = newList->permutations[cmpIdx].numPermutations;
      if (++cmpIdx < numCompositions)
        ;
      else
        break;
      offset += bitsPerComp;
      nextComposition(composition, maxSym, &symRMNZ);
    } while (1);
    /* verify that the last composition is indeed the lexically maximally */
    gt_assert(composition[0] == blockSize);
#if defined(EIS_DEBUG) && !defined(NDEBUG)
    gt_log_log("permSum="GT_WU", alphabetSize="GT_WU", blockSize=%d, "
            "pow(alphabetSize, blockSize)=%f",
            (GtUword)permSum, (GtUword)alphabetSize, blockSize,
            gt_power_for_small_exponents(alphabetSize, blockSize));
#endif
    gt_assert(permSum == gt_power_for_small_exponents(alphabetSize, blockSize));
  }
  newList->maxPermIdxBits = gt_requiredUInt64Bits(maxNumPermutations - 1);
  gt_free(composition);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
testq %rdi, %rdi
je 0x2ad1af
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r15
leaq 0x8(%rdi), %rbx
movl %edx, %r13d
leaq (,%r13,4), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
leaq 0xd522e(%rip), %rsi     # 0x381cfe
movl $0xa6, %edx
callq 0x93160
testq %rax, %rax
je 0x2acb42
movq %rax, %r14
movq %rbx, 0x60(%rsp)
leal -0x1(%r12), %ebx
movl %ebp, %edi
callq 0x28a8fc
movslq %eax, %rcx
imulq %r13, %rcx
movq %rcx, 0x28(%rsp)
movl %eax, 0x44(%rsp)
movl %eax, 0x18(%r15)
movzbl %bl, %esi
leal (%rsi,%rbp), %edi
movq %rsi, 0x10(%rsp)
callq 0x6b7df
movq %rax, 0x70(%rsp)
movq %rax, (%r15)
movq %rbp, %rdx
movl %ebp, %ebp
cmpl $0x2, %r12d
movq %r13, 0x18(%rsp)
movq %r12, 0x48(%rsp)
jne 0x2acb80
pushq $0x1
popq %rbx
movq %rdx, %r13
movl %r13d, %ecx
shlq %cl, %rbx
jmp 0x2acba6
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2acb5b
leaq 0xd51ad(%rip), %rsi     # 0x381cfe
movl $0xa7, %edx
callq 0x936f9
movq 0x10(%r15), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x2ad0dc
leaq 0xd518d(%rip), %rsi     # 0x381cfe
movl $0xa7, %edx
callq 0x936f9
jmp 0x2ad0dc
pushq $0x1
popq %rax
movq %rdx, %rdi
movq %rax, %rbx
testl %edx, %edx
je 0x2acba3
testb $0x1, %dl
movq %r13, %rsi
cmoveq %rax, %rsi
imulq %rsi, %rbx
imulq %r13, %r13
shrl %edx
jmp 0x2acb89
movq %rdi, %r13
movq 0x70(%rsp), %r12
leaq -0x1(%r12), %rdi
callq 0x28a939
movl %eax, 0x20(%r15)
movq 0x10(%rsp), %rdi
callq 0x28a8fc
movl %eax, 0x1c(%r15)
imull %r13d, %eax
movq %r12, %rcx
imulq 0x28(%rsp), %rcx
movq %rax, 0xa0(%rsp)
imulq %rax, %rbx
addq %rcx, %rbx
movq %rbx, %rdi
shrq $0x3, %rdi
andl $0x7, %ebx
cmpq $0x1, %rbx
sbbq $-0x1, %rdi
leaq 0xd5102(%rip), %rbx     # 0x381cfe
movq %rbx, %rsi
movl $0xb6, %edx
callq 0x93160
movq %rax, 0x10(%r15)
pushq $0x18
popq %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl $0xb8, %ecx
callq 0x9334a
movq %rax, 0x8(%r15)
movl 0x18(%r15), %eax
movq (%r15), %rcx
movq 0x18(%rsp), %r12
imulq %r12, %rcx
imulq %rax, %rcx
movq %rcx, 0x30(%rsp)
movq 0x10(%rsp), %rax
leal (,%rax,4), %ebx
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x17380
movq %r12, %rcx
xorl %r12d, %r12d
movl %r13d, (%r14,%rbx)
movq %r13, 0x58(%rsp)
addl $-0x1, %r13d
setb %al
cmpl $0x0, 0x48(%rsp)
setne %dl
andb %al, %dl
movb %dl, 0xf(%rsp)
movq 0x10(%rsp), %rdx
movq $0x0, 0x78(%rsp)
xorl %esi, %esi
xorl %ebx, %ebx
movq %r15, 0x50(%rsp)
movl %edx, %eax
movl %edx, %edx
movq %rdx, 0x68(%rsp)
leal -0x1(%rax), %edx
movq %rdx, 0xa8(%rsp)
movq 0x10(%r15), %rdi
movq %rsi, 0x80(%rsp)
movl 0x44(%rsp), %edx
movq %r14, %r8
callq 0x28d138
cmpq $0x2, %r12
jb 0x2acced
movq 0x10(%r15), %rcx
movq 0x80(%rsp), %rsi
movq %rsi, %r8
movq 0x28(%rsp), %rdx
subq %rdx, %r8
movq %rcx, %rdi
movq %rdx, %r9
callq 0x28a997
testl %eax, %eax
jle 0x2ad17e
movq %rbx, 0xc0(%rsp)
cmpb $0x0, 0xf(%rsp)
je 0x2ad152
imulq $0x18, %r12, %r10
movq 0x8(%r15), %rbx
addq %r10, %rbx
movq 0x10(%r15), %rax
movq %rax, 0x88(%rsp)
movl 0x1c(%r15), %eax
movl %eax, 0x24(%rsp)
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
xorl %esi, %esi
movq 0x18(%rsp), %r8
pushq $0x1
popq %r9
cmpq %rdx, %r8
je 0x2acd4c
movl (%r14,%rdx,4), %edi
addq %rdi, %rsi
cmpq %rdi, %rax
cmovbq %rdx, %rcx
cmovbeq %rdi, %rax
incq %rdx
jmp 0x2acd30
cmpq %rbp, %rsi
ja 0x2ad128
movq %r9, %rdx
cmpq %rbp, %rax
jae 0x2acd66
incq %rax
imulq %rax, %rdx
jmp 0x2acd58
xorl %esi, %esi
cmpq %r8, %rsi
je 0x2acd98
cmpq %rcx, %rsi
je 0x2acd93
movl (%r14,%rsi,4), %eax
movq %r9, %rdi
cmpq $0x2, %rax
jb 0x2acd88
imulq %rax, %rdi
decq %rax
jmp 0x2acd79
movq %rdx, %rax
xorl %edx, %edx
divq %rdi
movq %rax, %rdx
incq %rsi
jmp 0x2acd68
movq %r10, 0xb0(%rsp)
movq %r12, 0xb8(%rsp)
movq %rdx, (%rbx)
xorl %eax, %eax
movq %rdx, 0x90(%rsp)
cmpq $0x2, %rdx
jb 0x2acdcc
movq 0x90(%rsp), %rax
leaq -0x1(%rax), %rdi
callq 0x28a939
movl %eax, 0x8(%rbx)
movq %rbp, %rdi
leaq 0xd4f25(%rip), %rsi     # 0x381cfe
movl $0x149, %edx            # imm = 0x149
callq 0x93160
testq %rax, %rax
je 0x2ad03e
movq %rax, %r12
movl 0x24(%rsp), %eax
imull 0x58(%rsp), %eax
movq %rax, 0x98(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
xorl %eax, %eax
movq %r12, %rcx
movq 0x18(%rsp), %rsi
movq 0x88(%rsp), %rbx
cmpq %rsi, %rax
je 0x2ace38
xorl %edx, %edx
cmpl (%r14,%rax,4), %edx
jae 0x2ace30
movb %al, (%rcx,%rdx)
incq %rdx
jmp 0x2ace22
incq %rax
addq %rdx, %rcx
jmp 0x2ace1b
movq $0x0, 0x38(%rsp)
movq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl 0x24(%rsp), %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x28fb3b
cmpq $0x0, 0x38(%rsp)
je 0x2ace8a
movq %r15, %r8
movq 0x98(%rsp), %rdx
subq %rdx, %r8
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rcx
movq %rdx, %r9
callq 0x28a997
testl %eax, %eax
jle 0x2ad0f0
movq 0x38(%rsp), %rcx
incq %rcx
movq %rcx, 0x38(%rsp)
cmpq 0x90(%rsp), %rcx
jae 0x2acf70
addq 0x98(%rsp), %r15
movb (%r12,%r13), %dil
movl %r13d, %eax
movq %r13, %rcx
subq $0x1, %rcx
jb 0x2acecc
decl %eax
movb (%r12,%rax), %dl
cmpb %dl, %dil
movl %edx, %edi
jbe 0x2aceb7
jmp 0x2aced2
movb (%r12), %dl
xorl %eax, %eax
movl %eax, %ecx
movb 0x1(%r12,%rcx), %dil
leaq 0x1(%rcx), %rbx
addl $0x2, %eax
movq %rax, %r8
cmpq %rbp, %r8
jae 0x2acf12
movb (%r12,%r8), %r9b
cmpb %dl, %r9b
seta %r10b
cmpb %dil, %r9b
setb %r11b
movzbl %r9b, %r9d
movzbl %dil, %edi
testb %r11b, %r10b
cmovnel %r9d, %edi
cmovnel %r8d, %ebx
incq %r8
jmp 0x2acee3
movb %dil, (%r12,%rcx)
movl %ebx, %edi
movb %dl, (%r12,%rdi)
incq %rcx
cmpq %r13, %rcx
jae 0x2acf63
movl %eax, %r11d
movb (%r12,%rcx), %dl
movl %eax, %r8d
movl %ecx, %r9d
movl %edx, %edi
cmpq %rbp, %r11
jae 0x2acf54
movzbl (%r12,%r11), %r10d
cmpb %dil, %r10b
cmovbl %r8d, %r9d
movzbl %dil, %edi
cmovbl %r10d, %edi
incq %r11
incl %r8d
jmp 0x2acf33
movl %r9d, %r8d
movb %dl, (%r12,%r8)
movb %dil, (%r12,%rcx)
incl %eax
jmp 0x2acf1c
movq 0x88(%rsp), %rbx
jmp 0x2ace46
movq %r12, %rdi
leaq 0xd4d84(%rip), %rsi     # 0x381cfe
movl $0x163, %edx            # imm = 0x163
callq 0x936f9
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq 0xb0(%rsp), %rcx
movq (%rax,%rcx), %rax
movq 0xc0(%rsp), %rbx
addq %rax, %rbx
movq 0x78(%rsp), %r15
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0xb8(%rsp), %r12
incq %r12
cmpq 0x70(%rsp), %r12
jae 0x2ad08e
movq %r15, 0x78(%rsp)
imulq 0xa0(%rsp), %rax
addq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rdx
incl (%r14,%rdx,4)
movq 0x80(%rsp), %rsi
addq 0x28(%rsp), %rsi
movq 0x68(%rsp), %rcx
movl (%r14,%rcx,4), %eax
decl %eax
movl %eax, (%r14,%rcx,4)
movq 0x50(%rsp), %r15
je 0x2ad034
movq 0x10(%rsp), %rcx
cmpl $0x0, (%r14,%rcx,4)
movq 0x18(%rsp), %rcx
jne 0x2acca5
movq 0x10(%rsp), %rdx
movl %eax, (%r14,%rdx,4)
movq 0x68(%rsp), %rax
andl $0x0, (%r14,%rax,4)
jmp 0x2acc91
movq 0x18(%rsp), %rcx
jmp 0x2acc91
movq 0x60(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2ad05c
leaq 0xd4cac(%rip), %rsi     # 0x381cfe
movl $0xcf, %edx
callq 0x936f9
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x2ad076
leaq 0xd4c92(%rip), %rsi     # 0x381cfe
movl $0xcf, %edx
callq 0x936f9
leaq 0xd4c81(%rip), %rsi     # 0x381cfe
movq %r14, %rdi
movl $0xcf, %edx
callq 0x936f9
xorl %ebx, %ebx
jmp 0x2ad0dc
movq %rbx, %r12
movq 0x58(%rsp), %rsi
cmpl %esi, (%r14)
movq 0x50(%rsp), %rbx
jne 0x2ad1e0
movq 0x48(%rsp), %rdi
callq 0x95871
cmpq %rax, %r12
jne 0x2ad211
decq %r15
movq %r15, %rdi
callq 0x28a939
movl %eax, 0x24(%rbx)
leaq 0xd4c32(%rip), %rsi     # 0x381cfe
movq %r14, %rdi
movl $0xec, %edx
callq 0x936f9
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18ae71(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37f12(%rip), %rsi     # 0x2e5013
leaq 0xd4d35(%rip), %rdx     # 0x381e3d
leaq 0xd4daa(%rip), %rcx     # 0x381eb9
leaq 0xd4be8(%rip), %r8      # 0x381cfe
movl $0x15a, %r9d            # imm = 0x15A
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x18ae39(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37eda(%rip), %rsi     # 0x2e5013
leaq 0xd4e2a(%rip), %rdx     # 0x381f6a
leaq 0xd4da8(%rip), %rcx     # 0x381eef
leaq 0xd4dbe(%rip), %r8      # 0x381f0c
pushq $0x51
jmp 0x2ad17a
movq 0x18ae0f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37eb0(%rip), %rsi     # 0x2e5013
leaq 0xd4d64(%rip), %rdx     # 0x381ece
leaq 0xd4d7e(%rip), %rcx     # 0x381eef
leaq 0xd4d94(%rip), %r8      # 0x381f0c
pushq $0x47
popq %r9
jmp 0x2ad11c
movq 0x18ade3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37e84(%rip), %rsi     # 0x2e5013
leaq 0xd4b8a(%rip), %rdx     # 0x381d20
leaq 0xd4b4a(%rip), %rcx     # 0x381ce7
leaq 0xd4b5a(%rip), %r8      # 0x381cfe
movl $0xcb, %r9d
jmp 0x2ad11c
movq 0x18adb2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37e53(%rip), %rsi     # 0x2e5013
leaq 0xd4b18(%rip), %rdx     # 0x381cdf
leaq 0xd4b19(%rip), %rcx     # 0x381ce7
leaq 0xd4b29(%rip), %r8      # 0x381cfe
movl $0xa3, %r9d
jmp 0x2ad11c
movq 0x18ad81(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37e22(%rip), %rsi     # 0x2e5013
leaq 0xd4bae(%rip), %rdx     # 0x381da6
leaq 0xd4ae8(%rip), %rcx     # 0x381ce7
leaq 0xd4af8(%rip), %r8      # 0x381cfe
movl $0xe2, %r9d
jmp 0x2ad11c
movq 0x18ad50(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x37df1(%rip), %rsi     # 0x2e5013
leaq 0xd4b99(%rip), %rdx     # 0x381dc2
leaq 0xd4ab7(%rip), %rcx     # 0x381ce7
leaq 0xd4ac7(%rip), %r8      # 0x381cfe
movl $0xe9, %r9d
jmp 0x2ad11c