// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-mrangealphabet.c
// Function: gt_MRAEncAddSymbolToRange
MRAEnc *
gt_MRAEncAddSymbolToRange(MRAEnc *mralpha, Symbol sym, AlphabetRangeID range)
{
  Symbol insertPos, numSyms;
  gt_assert(mralpha && range < mralpha->numRanges);
  insertPos = mralpha->rangeEndIndices[range];
  numSyms = mralpha->rangeEndIndices[mralpha->numRanges - 1];
  switch (mralpha->encType)
  {
  case sourceUInt8:
    {
      MRAEncUInt8 *ui8alpha;
      ui8alpha = MRAEnc2MRAEncUInt8(mralpha);
      gt_assert(ui8alpha->mappings[sym] == UNDEF_UCHAR);
      /* first move all old mappings accordingly */
      {
        Symbol i;
        for (i = numSyms; i > insertPos; --i)
        {
          Symbol origSym = ui8alpha->revMappings[i - 1];
          ui8alpha->revMappings[i] = origSym;
          ui8alpha->mappings[origSym] += 1;
        }
      }
      /* do actual insertion */
      ui8alpha->mappings[sym] = insertPos;
      ui8alpha->revMappings[insertPos] = sym;
      /* adjust ranges */
      mralpha->symbolsPerRange[range] += 1;
      {
        AlphabetRangeID i;
        for (i = range; i < mralpha->numRanges; ++i)
        {
          mralpha->rangeEndIndices[i] += 1;
        }
      }
    }
    break;
  default:
    abort();
    break;
  }
  return mralpha;
}

// Assembly:
subq $0x28, %rsp
movb %sil, %al
movq %rdi, 0x20(%rsp)
movb %al, 0x1f(%rsp)
movl %edx, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x22b13a
movl 0x18(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jb 0x22b172
movq 0x410e5f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2eaec8(%rip), %rsi    # 0x516013
leaq 0x34ad67(%rip), %rdx    # 0x575eb9
leaq 0x34ad86(%rip), %rcx    # 0x575edf
leaq 0x34ad1e(%rip), %r8     # 0x575e7e
movl $0xe2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22b174
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x18(%rsp), %ecx
movb (%rax,%rcx,2), %al
movb %al, 0x17(%rsp)
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
movl 0x4(%rcx), %ecx
decl %ecx
movb (%rax,%rcx,2), %al
movb %al, 0x16(%rsp)
movq 0x20(%rsp), %rax
movl (%rax), %eax
subl $0x1, %eax
jne 0x22b2ed
jmp 0x22b1af
movq 0x20(%rsp), %rdi
callq 0x22b300
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movzbl 0x1f(%rsp), %ecx
movzbl 0x18(%rax,%rcx), %eax
cmpl $0xff, %eax
je 0x22b20c
movq 0x410dc5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2eae2e(%rip), %rsi    # 0x516013
leaq 0x34ad0d(%rip), %rdx    # 0x575ef9
leaq 0x34acec(%rip), %rcx    # 0x575edf
leaq 0x34ac84(%rip), %r8     # 0x575e7e
movl $0xeb, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22b20e
movb 0x16(%rsp), %al
movb %al, 0x7(%rsp)
movzbl 0x7(%rsp), %eax
movzbl 0x17(%rsp), %ecx
cmpl %ecx, %eax
jle 0x22b276
movq 0x8(%rsp), %rax
movzbl 0x7(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb 0x118(%rax,%rcx), %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %dl
movq 0x8(%rsp), %rax
movzbl 0x7(%rsp), %ecx
movb %dl, 0x118(%rax,%rcx)
movq 0x8(%rsp), %rax
movzbl 0x6(%rsp), %ecx
movzbl 0x18(%rax,%rcx), %edx
addl $0x1, %edx
movb %dl, 0x18(%rax,%rcx)
movb 0x7(%rsp), %al
addb $-0x1, %al
movb %al, 0x7(%rsp)
jmp 0x22b216
movb 0x17(%rsp), %dl
movq 0x8(%rsp), %rax
movzbl 0x1f(%rsp), %ecx
movb %dl, 0x18(%rax,%rcx)
movb 0x1f(%rsp), %dl
movq 0x8(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movb %dl, 0x118(%rax,%rcx)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x18(%rsp), %ecx
movzwl (%rax,%rcx,2), %edx
addl $0x1, %edx
movw %dx, (%rax,%rcx,2)
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
movl (%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x22b2eb
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movl (%rsp), %ecx
movzwl (%rax,%rcx,2), %edx
addl $0x1, %edx
movw %dx, (%rax,%rcx,2)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x22b2bc
jmp 0x22b2f2
callq 0x19370
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)