// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x22ac29
movq 0x4113a8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2eb411(%rip), %rsi    # 0x516013
leaq 0x389d2d(%rip), %rdx    # 0x5b4936
leaq 0x34b28d(%rip), %rcx    # 0x575e9d
leaq 0x34b267(%rip), %r8     # 0x575e7e
movl $0x73, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22ac2b
movq 0x18(%rsp), %rax
movl (%rax), %eax
subl $0x1, %eax
jne 0x22ae3c
jmp 0x22ac3d
movq $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x22ae50
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jg 0x22aca0
movq 0x411331(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2eb39a(%rip), %rsi    # 0x516013
leaq 0x34b22b(%rip), %rdx    # 0x575eab
leaq 0x34b216(%rip), %rcx    # 0x575e9d
leaq 0x34b1f0(%rip), %r8     # 0x575e7e
movl $0x7b, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22aca2
movl $0x218, %edi            # imm = 0x218
movl $0x1, %esi
leaq 0x34b1cb(%rip), %rdx    # 0x575e7e
movl $0x7c, %ecx
callq 0xe83c0
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x22adc7
movslq 0x4(%rsp), %rdi
shlq %rdi
leaq 0x34b1a3(%rip), %rsi    # 0x575e7e
movl $0x7f, %edx
callq 0xe80f0
movq 0x10(%rsp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
je 0x22adc7
movslq 0x4(%rsp), %rdi
shlq %rdi
leaq 0x34b177(%rip), %rsi    # 0x575e7e
movl $0x82, %edx
callq 0xe80f0
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
je 0x22adc7
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
movq 0x8(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movq 0x8(%rsp), %rsi
addq $0x18, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x19610
movq 0x10(%rsp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq 0x8(%rsp), %rsi
addq $0x118, %rsi            # imm = 0x118
movl $0x100, %edx            # imm = 0x100
callq 0x19610
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x4(%rsp), %rdx
shlq %rdx
callq 0x19610
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movslq 0x4(%rsp), %rdx
shlq %rdx
callq 0x19610
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x22ae45
cmpq $0x0, 0x10(%rsp)
je 0x22ae31
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x22adf5
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x34b093(%rip), %rsi    # 0x575e7e
movl $0x95, %edx
callq 0xe88c0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x22ae1b
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x34b06d(%rip), %rsi    # 0x575e7e
movl $0x97, %edx
callq 0xe88c0
movq 0x10(%rsp), %rdi
leaq 0x34b057(%rip), %rsi    # 0x575e7e
movl $0x98, %edx
callq 0xe88c0
movq $0x0, 0x20(%rsp)
jmp 0x22ae45
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop