// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/eis-mrangealphabet.c
// Function: gt_MRAEncCopy
MRAEnc *
gt_MRAEncCopy(const MRAEnc *alpha)
{
  gt_assert(alpha);
  switch (alpha->encType)
  {
  case sourceUInt8:
    {
      MRAEncUInt8 *newAlpha = NULL;
      const MRAEncUInt8 *srcAlpha = constMRAEnc2MRAEncUInt8(alpha);
      int numRanges = alpha->numRanges;
      gt_assert(numRanges > 0);
      if ((newAlpha = gt_calloc(sizeof (MRAEncUInt8), 1))
          && (newAlpha->baseClass.rangeEndIndices =
              gt_malloc(sizeof (newAlpha->baseClass.rangeEndIndices[0])
                        * numRanges))
          && (newAlpha->baseClass.symbolsPerRange =
              gt_malloc(sizeof (newAlpha->baseClass.rangeEndIndices[0])
                        * numRanges)))
      {
        newAlpha->baseClass.encType = sourceUInt8;
        newAlpha->baseClass.numRanges = srcAlpha->baseClass.numRanges;
        memcpy(newAlpha->mappings, srcAlpha->mappings, UINT8_MAX+1);
        memcpy(newAlpha->revMappings, srcAlpha->revMappings, UINT8_MAX+1);
        memcpy(newAlpha->baseClass.rangeEndIndices,
               srcAlpha->baseClass.rangeEndIndices,
               sizeof (newAlpha->baseClass.rangeEndIndices[0]) * numRanges);
        memcpy(newAlpha->baseClass.symbolsPerRange,
               srcAlpha->baseClass.symbolsPerRange,
               sizeof (newAlpha->baseClass.symbolsPerRange[0]) * numRanges);
        return &(newAlpha->baseClass);
      }
      else
      {
        if (newAlpha)
        {
          if (newAlpha->baseClass.symbolsPerRange)
            gt_free(newAlpha->baseClass.symbolsPerRange);
          if (newAlpha->baseClass.rangeEndIndices)
            gt_free(newAlpha->baseClass.rangeEndIndices);
          gt_free(newAlpha);
        }
        return NULL;
      }
    }
    break;
  default:
    return NULL;
    break;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1a679d
movq %rdi, %r14
cmpl $0x1, (%rdi)
jne 0x1a6792
movl 0x4(%r14), %r15d
testl %r15d, %r15d
jle 0x1a67a2
leaq 0x206674(%rip), %rdx    # 0x3acd08
movl $0x218, %edi            # imm = 0x218
movl $0x1, %esi
movl $0x7c, %ecx
callq 0x1093ef
testq %rax, %rax
je 0x1a6792
movq %rax, %rbx
addq %r15, %r15
leaq 0x20664a(%rip), %rsi    # 0x3acd08
movq %r15, %rdi
movl $0x7f, %edx
callq 0x1092b2
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x1a674a
leaq 0x20662d(%rip), %rsi    # 0x3acd08
movq %r15, %rdi
movl $0x82, %edx
callq 0x1092b2
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1a674a
movl $0x1, (%rbx)
movl 0x4(%r14), %eax
movl %eax, 0x4(%rbx)
leaq 0x18(%rbx), %rdi
leaq 0x18(%r14), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x17660
movl $0x118, %esi            # imm = 0x118
movq %rbx, %rdi
addq %rsi, %rdi
addq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x17660
movq 0x8(%rbx), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
callq 0x17660
movq 0x10(%rbx), %rdi
movq 0x10(%r14), %rsi
movq %r15, %rdx
callq 0x17660
jmp 0x1a6794
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1a6764
leaq 0x2065ae(%rip), %rsi    # 0x3acd08
movl $0x95, %edx
callq 0x109670
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1a677e
leaq 0x206594(%rip), %rsi    # 0x3acd08
movl $0x97, %edx
callq 0x109670
leaq 0x206583(%rip), %rsi    # 0x3acd08
movq %rbx, %rdi
movl $0x98, %edx
callq 0x109670
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x61790
callq 0x61759