// File: /workspace/github_c_makefile_star2_O2/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 0x148fc5
movq %rdi, %r14
cmpl $0x1, (%rdi)
jne 0x148fba
movq %r14, %rdi
callq 0x149025
movl 0x4(%r14), %r15d
testl %r15d, %r15d
jle 0x148fef
leaq 0x1fac4c(%rip), %rdx    # 0x343b0e
pushq $0x1
popq %rsi
pushq $0x7c
popq %rcx
movl $0x218, %edi            # imm = 0x218
callq 0x9334a
testq %rax, %rax
je 0x148fba
movq %rax, %rbx
addq %r15, %r15
leaq 0x1fac26(%rip), %rsi    # 0x343b0e
pushq $0x7f
popq %rdx
movq %r15, %rdi
callq 0x93160
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x148f72
leaq 0x1fac0b(%rip), %rsi    # 0x343b0e
movq %r15, %rdi
movl $0x82, %edx
callq 0x93160
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x148f8c
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 0x17630
movl $0x118, %esi            # imm = 0x118
movq %rbx, %rdi
addq %rsi, %rdi
addq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x17630
movq 0x8(%rbx), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
callq 0x17630
movq 0x10(%rbx), %rdi
movq 0x10(%r14), %rsi
movq %r15, %rdx
callq 0x17630
jmp 0x148fbc
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x148f8c
leaq 0x1fab8c(%rip), %rsi    # 0x343b0e
movl $0x95, %edx
callq 0x936f9
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x148fa6
leaq 0x1fab72(%rip), %rsi    # 0x343b0e
movl $0x97, %edx
callq 0x936f9
leaq 0x1fab61(%rip), %rsi    # 0x343b0e
movq %rbx, %rdi
movl $0x98, %edx
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2eef9c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19c03d(%rip), %rsi    # 0x2e5013
leaq 0x236847(%rip), %rdx    # 0x37f824
leaq 0x1fab49(%rip), %rcx    # 0x343b2d
leaq 0x1fab23(%rip), %r8     # 0x343b0e
pushq $0x73
jmp 0x149017
movq 0x2eef72(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x19c013(%rip), %rsi    # 0x2e5013
leaq 0x1fab34(%rip), %rdx    # 0x343b3b
leaq 0x1fab1f(%rip), %rcx    # 0x343b2d
leaq 0x1faaf9(%rip), %r8     # 0x343b0e
pushq $0x7b
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390