// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-seqblocktranslate.c
// Function: initPermutationsList
static int
initPermutationsList(const unsigned *composition, struct permList *permutation,
                     BitString permStore, BitOffset permOffset,
                     unsigned blockSize, unsigned alphabetSize,
                     unsigned bitsPerSymbol)
{
  size_t numPermutations = permutation->numPermutations =
    gt_combinatorics_multinomial(blockSize, alphabetSize, composition);
  if (numPermutations > 1)
    permutation->permIdxBits = gt_requiredUInt64Bits(numPermutations - 1);
  else
    permutation->permIdxBits = 0;
  Symbol *currentPermutation;
  BitOffset bitsPerPermutation = bitsPerSymbol * blockSize;
  if (!(currentPermutation = gt_malloc(sizeof (Symbol) * blockSize)))
    return -1;
  permutation->catPermsOffset = permOffset;
  initPermutation(currentPermutation, composition, alphabetSize);
  {
    size_t i = 0;
    BitOffset offset = permOffset;
    do
    {
      gt_bsStoreUniformSymbolArray(permStore, offset,
                                bitsPerSymbol, blockSize, currentPermutation);
#ifdef EIS_DEBUG
      printPermutation(stderr, currentPermutation, blockSize);
#endif /* EIS_DEBUG */
      gt_assert(i > 0?(gt_bsCompare(permStore, offset, bitsPerPermutation,
                              permStore,
                              offset - bitsPerPermutation,
                              bitsPerPermutation)>0):1);
      if (++i < numPermutations)
        ;
      else
        break;
      offset += bitsPerPermutation;
      nextPermutation(currentPermutation, blockSize);
    } while (1);
  }
  gt_free(currentPermutation);
  return 0;
}

// Assembly:
subq $0x58, %rsp
movl 0x60(%rsp), %eax
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movl %r8d, 0x2c(%rsp)
movl %r9d, 0x28(%rsp)
movl 0x2c(%rsp), %edi
movl 0x28(%rsp), %eax
movl %eax, %esi
movq 0x48(%rsp), %rdx
callq 0x4af7a0
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, 0x20(%rsp)
cmpq $0x1, 0x20(%rsp)
jbe 0x4aefe9
movq 0x20(%rsp), %rdi
subq $0x1, %rdi
callq 0x46ec80
movl %eax, %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0x4aeff5
movq 0x40(%rsp), %rax
movl $0x0, 0x8(%rax)
movl 0x60(%rsp), %eax
imull 0x2c(%rsp), %eax
movl %eax, %eax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, %edi
shlq $0x0, %rdi
leaq 0x107f14(%rip), %rsi    # 0x5b6f2a
movl $0x149, %edx            # imm = 0x149
callq 0xe80f0
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
jne 0x4af038
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x4af15d
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x28(%rsp), %edx
callq 0x4af980
movq $0x0, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq (%rsp), %rsi
movl 0x60(%rsp), %edx
movl 0x2c(%rsp), %eax
movl %eax, %ecx
movq 0x18(%rsp), %r8
callq 0x47b210
cmpq $0x0, 0x8(%rsp)
jbe 0x4af0bd
movq 0x38(%rsp), %rdi
movq (%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq (%rsp), %r8
subq 0x10(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0x46ed30
cmpl $0x0, %eax
jg 0x4af0fd
jmp 0x4af0c5
movb $0x1, %al
testb $0x1, %al
jne 0x4af0fd
jmp 0x4af0c5
movq 0x18ced4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x66f3d(%rip), %rsi     # 0x516013
leaq 0x107f8c(%rip), %rdx    # 0x5b7069
leaq 0x108001(%rip), %rcx    # 0x5b70e5
leaq 0x107e3f(%rip), %r8     # 0x5b6f2a
movl $0x15a, %r9d            # imm = 0x15A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4af0ff
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
cmpq 0x20(%rsp), %rax
jae 0x4af116
jmp 0x4af118
jmp 0x4af13f
movq 0x10(%rsp), %rax
addq (%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x4afa00
movb $0x1, %al
testb $0x1, %al
jne 0x4af06b
jmp 0x4af13f
movq 0x18(%rsp), %rdi
leaq 0x107ddf(%rip), %rsi    # 0x5b6f2a
movl $0x163, %edx            # imm = 0x163
callq 0xe88c0
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)