// File: /workspace/github_c_makefile_star2_O3/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 0x19e06d
movq %rdi, %r14
cmpl $0x1, (%rdi)
jne 0x19e062
movl 0x4(%r14), %r15d
testl %r15d, %r15d
jle 0x19e072
leaq 0x205833(%rip), %rdx    # 0x3a3797
movl $0x218, %edi            # imm = 0x218
movl $0x1, %esi
movl $0x7c, %ecx
callq 0x10436a
testq %rax, %rax
je 0x19e062
movq %rax, %rbx
addq %r15, %r15
leaq 0x205809(%rip), %rsi    # 0x3a3797
movq %r15, %rdi
movl $0x7f, %edx
callq 0x104226
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x19e01a
leaq 0x2057ec(%rip), %rsi    # 0x3a3797
movq %r15, %rdi
movl $0x82, %edx
callq 0x104226
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x19e034
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 0x19e064
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x19e034
leaq 0x20576d(%rip), %rsi    # 0x3a3797
movl $0x95, %edx
callq 0x1045eb
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x19e04e
leaq 0x205753(%rip), %rsi    # 0x3a3797
movl $0x97, %edx
callq 0x1045eb
leaq 0x205742(%rip), %rsi    # 0x3a3797
movq %rbx, %rdi
movl $0x98, %edx
callq 0x1045eb
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x602ae
callq 0x60277