// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-copysort.c
// Function: leftcontextofspecialchardist
static GtUword *leftcontextofspecialchardist(unsigned int numofchars,
                                                   const GtEncseq *encseq,
                                                   GtReadmode readmode)
{
  GtUchar cc;
  unsigned int idx;
  GtUword *specialchardist,
                totallength = gt_encseq_total_length(encseq);
  GtReadmode convertedreadmode = (readmode == GT_READMODE_REVERSE)
                                      ? GT_READMODE_FORWARD
                                      : GT_READMODE_COMPL;

  specialchardist = gt_malloc(sizeof (*specialchardist) * numofchars);
  for (idx = 0; idx<numofchars; idx++)
  {
    specialchardist[idx] = 0;
  }
  if (gt_encseq_has_specialranges(encseq))
  {
    GtSpecialrangeiterator *sri;
    GtRange range;
    sri = gt_specialrangeiterator_new(encseq,true);
    if (GT_ISDIRREVERSE(readmode))
    {
      while (gt_specialrangeiterator_next(sri,&range))
      {
        if (range.end < totallength)
        {
          cc = gt_encseq_get_encoded_char(encseq,range.end,convertedreadmode);
          if (GT_ISNOTSPECIAL(cc))
          {
            specialchardist[cc]++;
          }
        }
      }
    } else
    {
      while (gt_specialrangeiterator_next(sri,&range))
      {
        if (range.start > 0)
        {
          cc = gt_encseq_get_encoded_char(encseq,range.start-1,readmode);
          if (GT_ISNOTSPECIAL(cc))
          {
            specialchardist[cc]++;
          }
        }
      }
    }
    gt_specialrangeiterator_delete(sri);
  }
  if (GT_ISDIRREVERSE(readmode))
  {
    if (gt_encseq_lengthofspecialprefix(encseq) == 0)
    {
      cc = gt_encseq_get_encoded_char(encseq,0,convertedreadmode);
      gt_assert(GT_ISNOTSPECIAL(cc));
      specialchardist[cc]++;
    }
  } else
  {
    if (gt_encseq_lengthofspecialsuffix(encseq) == 0)
    {
      cc = gt_encseq_get_encoded_char(encseq,totallength-1,readmode);
      gt_assert(GT_ISNOTSPECIAL(cc));
      specialchardist[cc]++;
    }
  }
  return specialchardist;
}

// Assembly:
subq $0x58, %rsp
movl %edi, 0x54(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq 0x48(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x28(%rsp)
movl 0x44(%rsp), %edx
movl $0x2, %eax
xorl %ecx, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x24(%rsp)
movl 0x54(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x2cc6e0(%rip), %rsi    # 0x589406
movl $0xa4, %edx
callq 0xe80f0
movq %rax, 0x30(%rsp)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0x54(%rsp), %eax
jae 0x2bcd65
movq 0x30(%rsp), %rax
movl 0x3c(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x2bcd3d
movq 0x48(%rsp), %rdi
callq 0xaf360
testb $0x1, %al
jne 0x2bcd78
jmp 0x2bce68
movq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0xaf650
movq %rax, 0x18(%rsp)
cmpl $0x1, 0x44(%rsp)
je 0x2bcd9a
cmpl $0x3, 0x44(%rsp)
jne 0x2bcdfc
jmp 0x2bcd9c
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xaf770
testb $0x1, %al
jne 0x2bcdb1
jmp 0x2bcdfa
movq 0x10(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2bcdf8
movq 0x48(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x24(%rsp), %edx
callq 0xa9da0
movb %al, 0x43(%rsp)
movzbl 0x43(%rsp), %eax
cmpl $0xfe, %eax
jge 0x2bcdf6
movq 0x30(%rsp), %rax
movzbl 0x43(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x2bcdf8
jmp 0x2bcd9c
jmp 0x2bce5e
jmp 0x2bcdfe
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xaf770
testb $0x1, %al
jne 0x2bce13
jmp 0x2bce5c
cmpq $0x0, 0x8(%rsp)
jbe 0x2bce5a
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rsi
subq $0x1, %rsi
movl 0x44(%rsp), %edx
callq 0xa9da0
movb %al, 0x43(%rsp)
movzbl 0x43(%rsp), %eax
cmpl $0xfe, %eax
jge 0x2bce58
movq 0x30(%rsp), %rax
movzbl 0x43(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x2bce5a
jmp 0x2bcdfe
jmp 0x2bce5e
movq 0x18(%rsp), %rdi
callq 0xafc80
cmpl $0x1, 0x44(%rsp)
je 0x2bce7a
cmpl $0x3, 0x44(%rsp)
jne 0x2bcf01
movq 0x48(%rsp), %rdi
callq 0xb2840
cmpq $0x0, %rax
jne 0x2bcefc
movq 0x48(%rsp), %rdi
movl 0x24(%rsp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0xa9da0
movb %al, 0x43(%rsp)
movzbl 0x43(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2bcee4
movq 0x37f0ed(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x259156(%rip), %rsi    # 0x516013
leaq 0x278097(%rip), %rdx    # 0x534f5b
leaq 0x2cc790(%rip), %rcx    # 0x58965b
leaq 0x2cc534(%rip), %r8     # 0x589406
movl $0xd0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2bcee6
movq 0x30(%rsp), %rax
movzbl 0x43(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x2bcf8a
movq 0x48(%rsp), %rdi
callq 0xb2860
cmpq $0x0, %rax
jne 0x2bcf88
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
subq $0x1, %rsi
movl 0x44(%rsp), %edx
callq 0xa9da0
movb %al, 0x43(%rsp)
movzbl 0x43(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2bcf70
movq 0x37f061(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2590ca(%rip), %rsi    # 0x516013
leaq 0x27800b(%rip), %rdx    # 0x534f5b
leaq 0x2cc704(%rip), %rcx    # 0x58965b
leaq 0x2cc4a8(%rip), %r8     # 0x589406
movl $0xd8, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2bcf72
movq 0x30(%rsp), %rax
movzbl 0x43(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x2bcf8a
movq 0x30(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)