// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/enum-patt.c
// Function: gt_nextEnumpatterniterator
const GtUchar *gt_nextEnumpatterniterator(GtUword *patternlen,
                                       Enumpatterniterator *epi)
{
  GtUword start;
  GtUword j;
  GtUchar cc;

  if (epi->minpatternlen == epi->maxpatternlen)
  {
    *patternlen = epi->minpatternlen;
  } else
  {
    *patternlen = (GtUword) (epi->minpatternlen +
                                   (random() %
                                      (epi->maxpatternlen -
                                       epi->minpatternlen+1)));
  }
  start =
        (GtUword) (random() % (epi->totallength - *patternlen));
  gt_assert(start < (GtUword) (epi->totallength - *patternlen));
  if (epi->esr == NULL) {
    epi->esr = gt_encseq_create_reader_with_readmode(epi->sampleencseq,
                                          GT_READMODE_FORWARD,
                                          start);
  } else {
    gt_encseq_reader_reinit_with_readmode(epi->esr, epi->sampleencseq,
                                          GT_READMODE_FORWARD,
                                          start);
  }

  for (j=0; j<*patternlen; j++)
  {
    cc = gt_encseq_reader_next_encoded_char(epi->esr);
    if (GT_ISSPECIAL(cc))
    {
      cc = (GtUchar) (random() % epi->alphasize);
    }
    epi->patternspace[j] = cc;
  }
  if (epi->samplecount & 1)
  {
    reversesequenceinplace(epi->patternspace,*patternlen);
  }
  epi->samplecount++;
  epi->patternstat[*patternlen]++;
  return epi->patternspace;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x231f63
movq 0x28(%rsp), %rax
movq (%rax), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
jmp 0x231fa6
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x127e80
movq 0x8(%rsp), %rcx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq 0x28(%rsp), %rdx
movq 0x8(%rdx), %rsi
movq 0x28(%rsp), %rdx
subq (%rdx), %rsi
addq $0x1, %rsi
xorl %edx, %edx
divq %rsi
addq %rdx, %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
callq 0x127e80
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq 0x28(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x30(%rsp), %rdx
subq (%rdx), %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x30(%rsp), %rdx
subq (%rdx), %rcx
cmpq %rcx, %rax
jb 0x232020
movq 0x409fb1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e401a(%rip), %rsi    # 0x516013
leaq 0x3447ef(%rip), %rdx    # 0x5767ef
leaq 0x34481b(%rip), %rcx    # 0x576822
leaq 0x3447a4(%rip), %r8     # 0x5767b2
movl $0x6e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x232022
movq 0x28(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x232051
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rsp), %rdx
xorl %esi, %esi
callq 0xac380
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x40(%rax)
jmp 0x23206f
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x20(%rsp), %rcx
xorl %edx, %edx
callq 0xabdb0
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x2320e9
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0xaae30
movb %al, 0x17(%rsp)
movzbl 0x17(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2320c4
callq 0x127e80
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq 0x28(%rsp), %rcx
movl 0x30(%rcx), %ecx
cqto
idivq %rcx
movb %dl, %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %dl
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rsp), %rcx
movb %dl, (%rax,%rcx)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x232078
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x232112
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x30(%rsp), %rax
movq (%rax), %rsi
callq 0x232150
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
addq $0x38, %rsp
retq
nop