// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/eis-blockcomp.c
// Function: gt_loadBlockEncIdxSeqGen
struct encIdxSeq *
gt_loadBlockEncIdxSeqGen(MRAEnc *alphabet,
                         const char *projectName, int features, GtError *err)
{
  struct blockCompositionSeq *newSeqIdx = NULL;
  Symbol blockMapAlphabetSize, GT_UNUSED totalAlphabetSize;
  MRAEnc *blockMapAlphabet = NULL, *rangeMapAlphabet = NULL;
  size_t headerLen;
  int *modesCopy = NULL;
  char *buf = NULL;
  gt_assert(projectName && err);
  newSeqIdx = gt_calloc(sizeof (struct blockCompositionSeq), 1);
  newSeqIdx->baseClass.alphabet = alphabet;
  newSeqIdx->baseClass.classInfo = &blockCompositionSeqClass;

  if (!openOnDiskData(projectName, &newSeqIdx->externalData, "rb",err)) {
    gt_error_set(err, "error reading data from disk");
    loadBlockEncIdxSeqErrRet();
  }
  {
    size_t offset = HEADER_ID_BLOCK_LEN;
    buf = gt_malloc(HEADER_ID_BLOCK_LEN);
    if (fread(buf, HEADER_ID_BLOCK_LEN, 1,
          newSeqIdx->externalData.idxFP) != 1) {
      gt_error_set(err, "error reading header id");
      loadBlockEncIdxSeqErrRet();
    }
    if (strcmp(buf, bdxHeader)!= 0) {
      gt_error_set(err, "header is not BDX found %s instead", buf);
      loadBlockEncIdxSeqErrRet();
    }
    newSeqIdx->externalData.cwDataPos = headerLen = *(uint32_t *)(buf + 4);
    buf = gt_realloc(buf, headerLen);
    if (fread(buf + HEADER_ID_BLOCK_LEN, headerLen - HEADER_ID_BLOCK_LEN,
             1, newSeqIdx->externalData.idxFP) != 1) {
      gt_error_set(err, "error reading header");
      loadBlockEncIdxSeqErrRet();
    }
    while (offset < headerLen)
    {
      uint32_t currentHeader;
      switch (currentHeader = *(uint32_t *)(buf + offset))
      {
      case SELE_HEADER_FIELD:
        newSeqIdx->baseClass.seqLen = *(uint64_t *)(buf + offset + 4);
        offset += 12;
        break;
      case BKSZ_HEADER_FIELD:
        newSeqIdx->blockSize = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case BBLK_HEADER_FIELD:
        newSeqIdx->bucketBlocks = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case VOFF_HEADER_FIELD:
        newSeqIdx->externalData.varDataPos
          = *(uint64_t *)(buf + offset + 4);
        offset += 12;
        break;
      case ROFF_HEADER_FIELD:
        newSeqIdx->externalData.rangeEncPos = *(uint64_t *)(buf + offset + 4);
        offset += 12;
        break;
      case NMRN_HEADER_FIELD:
        {
          size_t numModes = newSeqIdx->numModes
            = *(uint32_t *)(buf + (offset += 4));
          offset += 4;
          modesCopy = newSeqIdx->modes = gt_malloc(sizeof (int) * numModes);
          size_t j;
          for (j = 0; j < numModes; ++j)
          {
            modesCopy[j] = *(uint32_t *)(buf + offset);
            offset += 4;
          }
        }
        break;
      case CBMB_HEADER_FIELD:
        newSeqIdx->callBackDataOffsetBits = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case SPBT_HEADER_FIELD:
        newSeqIdx->bitsPerUlong = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case VDOB_HEADER_FIELD:
        newSeqIdx->bitsPerVarDiskOffset = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case SSBT_HEADER_FIELD:
        {
          size_t i;
          Symbol blockMapAlphabetSize = *(uint32_t *)(buf + offset + 4);
          newSeqIdx->partialSymSumBits
            = gt_malloc(sizeof (newSeqIdx->partialSymSumBits[0])
                        * blockMapAlphabetSize * 2);
          newSeqIdx->partialSymSumBitsSums
            = newSeqIdx->partialSymSumBits + blockMapAlphabetSize;
          if (blockMapAlphabetSize)
          {
            newSeqIdx->partialSymSumBits[0]= *(uint32_t *)(buf + offset + 8);
            newSeqIdx->partialSymSumBitsSums[0] = 0;
#ifdef EIS_DEBUG
            gt_log_log("partialSymSumBits[0]=%u\n",
                    newSeqIdx->partialSymSumBits[0]);
#endif
            for (i = 1; i < blockMapAlphabetSize; ++i)
            {
              newSeqIdx->partialSymSumBits[i]
                = *(uint32_t *)(buf + offset + 8 + 4*i);
#ifdef EIS_DEBUG
              gt_log_log("partialSymSumBits[%"PRIuSymbol"]=%u\n",
                      (Symbol)i, newSeqIdx->partialSymSumBits[i]);
#endif
              newSeqIdx->partialSymSumBitsSums[i] =
                newSeqIdx->partialSymSumBitsSums[i - 1]
                + newSeqIdx->partialSymSumBits[i - 1];
            }
            newSeqIdx->symSumBits
              = newSeqIdx->partialSymSumBitsSums[blockMapAlphabetSize - 1]
              + newSeqIdx->partialSymSumBits[blockMapAlphabetSize - 1];
          }
          offset += 8 + 4 * blockMapAlphabetSize;
        }
      case BEFB_HEADER_FIELD:
        newSeqIdx->blockEncFallback = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case REFB_HEADER_FIELD:
        newSeqIdx->rangeEncFallback = *(uint32_t *)(buf + offset + 4);
        offset += 8;
        break;
      case MEXB_HEADER_FIELD:
        newSeqIdx->maxVarExtBitsPerBucket = *(uint64_t *)(buf + offset + 4);
        offset += 12;
        break;
      case CEXB_HEADER_FIELD:
        newSeqIdx->cwExtBitsPerBucket = *(uint64_t *)(buf + offset + 4);
        offset += 12;
        break;
      case 0:
        /* empty header skip to next portion */
        offset = headerLen;
        break;
      default:
        if ((currentHeader & 0xffff0000L) == EH_HEADER_PREFIX)
        {
          uint32_t extHeaderLen = *(uint32_t *)(buf + offset + 4);
          offset += EXT_HEADER_PREFIX_SIZE;
          appendExtHeaderPos(&newSeqIdx->extHeaderPos,
                             newSeqIdx->numExtHeaders++,
                             offset, currentHeader);
          offset += extHeaderLen;
        }
        else
        {
          gt_error_set(err, "Unknown header field: %4s", buf + offset);
          loadBlockEncIdxSeqErrRet();
        }
      }
    }
    gt_assert(newSeqIdx->modes
           && newSeqIdx->bucketBlocks
           && newSeqIdx->numModes
           && offset == headerLen);
    /* compute values not read from header */
    if (!newSeqIdx->bitsPerUlong)
      newSeqIdx->bitsPerUlong =
        requiredUlongBits(newSeqIdx->baseClass.seqLen - 1);
    else if (newSeqIdx->bitsPerUlong !=
            requiredUlongBits(newSeqIdx->baseClass.seqLen - 1)) {
      gt_error_set(err, "bits per ulong wrong in header found %u, expected %u",
                   newSeqIdx->bitsPerUlong,
                   requiredUlongBits(newSeqIdx->baseClass.seqLen - 1));
      loadBlockEncIdxSeqErrRet();
    }
  }
  {
    AlphabetRangeID range, numAlphabetRanges = newSeqIdx->numModes =
      MRAEncGetNumRanges(alphabet);
    totalAlphabetSize = gt_MRAEncGetSize(alphabet);
    blockMapAlphabetSize = 0;
    for (range = 0; range < numAlphabetRanges; ++range)
    {
      switch (modesCopy[range])
      {
      case BLOCK_COMPOSITION_INCLUDE:
        blockMapAlphabetSize += MRAEncGetRangeSize(alphabet, range);
        break;
      case DIRECT_SYM_ENCODE:
        /*< FIXME: insert proper code to process direct encoding regions */
        break;
      case REGIONS_LIST:
        /*< FIXME: insert proper code to process ranges */
        break;
      default:
        gt_error_set(err, "Invalid encoding request.");
        loadBlockEncIdxSeqErrRet();
        break;
      }
    }
    newSeqIdx->blockMapAlphabet = blockMapAlphabet =
      gt_MRAEncSecondaryMapping(alphabet, BLOCK_COMPOSITION_INCLUDE, modesCopy,
                             newSeqIdx->blockEncFallback);
    newSeqIdx->rangeMapAlphabet = rangeMapAlphabet =
      gt_MRAEncSecondaryMapping(alphabet, REGIONS_LIST, modesCopy,
                             newSeqIdx->rangeEncFallback);
    newSeqIdx->blockMapAlphabetSize = blockMapAlphabetSize;
    gt_assert(gt_MRAEncGetSize(blockMapAlphabet) == blockMapAlphabetSize);
  }
  if (!newSeqIdx->partialSymSumBits && blockMapAlphabetSize)
  {
    newSeqIdx->partialSymSumBits
      = gt_malloc(sizeof (newSeqIdx->partialSymSumBits[0])
                  * blockMapAlphabetSize * 2);
    newSeqIdx->partialSymSumBitsSums
      = newSeqIdx->partialSymSumBits + blockMapAlphabetSize;
    symSumBitsDefaultSetup(newSeqIdx);
  }
  if (!gt_initCompositionList(&newSeqIdx->compositionTable,
                              newSeqIdx->blockSize,
                              blockMapAlphabetSize)) {
    gt_error_set(err, "error initialising composition list");
    loadBlockEncIdxSeqErrRet();
  }
  if (newSeqIdx->bitsPerVarDiskOffset == 0)
    newSeqIdx->bitsPerVarDiskOffset =
      gt_requiredUInt64Bits(
        vwBitsSimple(newSeqIdx->baseClass.seqLen, newSeqIdx->blockSize,
                     newSeqIdx->bucketBlocks,
                     newSeqIdx->compositionTable.maxPermIdxBits,
                     newSeqIdx->maxVarExtBitsPerBucket));

  if (fseeko(newSeqIdx->externalData.idxFP,
             newSeqIdx->externalData.rangeEncPos, SEEK_SET)) {
    gt_error_set(err, "error in fseeko");
    loadBlockEncIdxSeqErrRet();
  }
  {
    int regionFeatures = SRL_NO_FEATURES;
    if (features & EIS_FEATURE_REGION_SUMS)
      regionFeatures |= SRL_PARTIAL_SYMBOL_SUMS;
    if (!(newSeqIdx->rangeEncs =
          gt_SRLReadFromStream(newSeqIdx->externalData.idxFP, rangeMapAlphabet,
                            regionFeatures, err))) {
      gt_error_set(err, "error creating rangeEncs");
      loadBlockEncIdxSeqErrRet();
    }
  }
  tryMMapOfIndex(&newSeqIdx->externalData);
  gt_free(buf);
  return &newSeqIdx->baseClass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, 0x8(%rsp)
testq %rsi, %rsi
je 0x315820
movq %rcx, %rbp
testq %rcx, %rcx
je 0x315820
movl %edx, %r12d
movq %rsi, %r15
leaq 0xd5917(%rip), %rdx     # 0x3ea0c0
movl $0xe8, %edi
movl $0x1, %esi
movl $0x84d, %ecx            # imm = 0x84D
callq 0x1093ef
movq %rax, %r13
movq %rax, %rbx
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r13)
leaq 0x1af3ed(%rip), %rax    # 0x4c3bc0
movq %rax, (%r13)
leaq 0x18(%r13), %rax
leaq 0x9a4dd(%rip), %rdx     # 0x3aecbf
movq %r15, %rdi
movq %rax, %r15
movq %rax, %rsi
movq %rbp, %rcx
callq 0x314272
testl %eax, %eax
je 0x31492b
movl %r12d, 0x3c(%rsp)
leaq 0xd58b9(%rip), %rsi     # 0x3ea0c0
movl $0x8, %edi
movl $0x857, %edx            # imm = 0x857
callq 0x1092b2
movq %rax, %r12
movq (%r15), %rcx
movl $0x8, %esi
movl $0x1, %edx
movq %rax, %rdi
callq 0x17b40
cmpq $0x1, %rax
movq %r13, 0x48(%rsp)
movq %rbp, 0x30(%rsp)
movq %r15, 0x28(%rsp)
jne 0x3149fa
leaq 0xd679e(%rip), %rsi     # 0x3eafec
movq %r12, %rdi
callq 0x17a40
testl %eax, %eax
je 0x314b4d
leaq 0xd5ada(%rip), %rsi     # 0x3ea33f
movq %rbp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
movq %r15, %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x314889
leaq 0x48(%r13), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x314897
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd581e(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
movq %r12, %rdi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x3148e5
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd57d4(%rip), %r13     # 0x3ea0c0
xorl %ebp, %ebp
xorl %edi, %edi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x85f, %edx            # imm = 0x85F
jmp 0x314abf
leaq 0xd59d8(%rip), %rsi     # 0x3ea30a
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r15, %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x314956
addq $0x48, %r13
movq %r13, %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x314964
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd5751(%rip), %r15     # 0x3ea0c0
movq %r15, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r15, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
xorl %edi, %edi
movq %r15, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x3149b1
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd5708(%rip), %r14     # 0x3ea0c0
xorl %edi, %edi
movq %r14, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
xorl %edi, %edi
movq %r14, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
xorl %edi, %edi
movq %r14, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x853, %edx            # imm = 0x853
callq 0x109670
jmp 0x315088
leaq 0xd5926(%rip), %rsi     # 0x3ea327
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r15, %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x314a22
leaq 0x48(%r13), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x314a30
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd5685(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
movq %r12, %rdi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x314a7e
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd563b(%rip), %r13     # 0x3ea0c0
xorl %ebp, %ebp
xorl %edi, %edi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x85b, %edx            # imm = 0x85B
callq 0x109670
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x315088
movq %r12, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movl 0x4(%rdi), %r13d
movl %r13d, 0xc8(%rbx)
callq 0x1a67a7
testq %r13, %r13
setne %r12b
je 0x31500d
xorl %eax, %eax
xorl %r15d, %r15d
movl (%rbp,%rax,4), %ecx
testl %ecx, %ecx
je 0x314b3c
cmpl $0x2, %ecx
je 0x314b3c
cmpl $0x1, %ecx
jne 0x31520d
cmpq $0x0, 0x8(%rsp)
je 0x31581b
movq 0x8(%rsp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jae 0x315816
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
addb (%rcx,%rax,2), %r15b
incq %rax
cmpq %r13, %rax
setb %r12b
jne 0x314afc
jmp 0x315010
movl 0x4(%r12), %r14d
movq %r14, 0x30(%rbx)
leaq 0xd5563(%rip), %rdx     # 0x3ea0c0
movq %r12, %rdi
movq %r14, %rsi
movl $0x862, %ecx            # imm = 0x862
callq 0x1094e6
movq %rax, %r12
leaq 0x8(%rax), %rdi
movq %r14, 0x18(%rsp)
leaq -0x8(%r14), %rsi
movq 0x18(%rbx), %rcx
movl $0x1, %edx
movq %rdi, 0x20(%rsp)
callq 0x17b40
cmpq $0x1, %rax
jne 0x315143
leaq 0x48(%r13), %rax
movq %rax, 0x40(%rsp)
leaq 0xc(%r12), %rax
movq %rax, 0x60(%rsp)
movl $0x8, %r15d
xorl %ebp, %ebp
movq 0x18(%rsp), %rsi
movq %r12, 0x10(%rsp)
cmpq %rsi, %r15
jae 0x3155e3
leaq (%r12,%r15), %r13
movl (%r12,%r15), %r12d
movb $0x1, %r14b
cmpl $0x4e4d524d, %r12d      # imm = 0x4E4D524D
jle 0x314c1b
cmpl $0x53504253, %r12d      # imm = 0x53504253
jg 0x314c5e
cmpl $0x524f4645, %r12d      # imm = 0x524F4645
jg 0x314d8e
cmpl $0x4e4d524e, %r12d      # imm = 0x4E4D524E
je 0x314e0a
cmpl $0x52454642, %r12d      # imm = 0x52454642
jne 0x314ea4
movb 0x4(%r13), %al
movb %al, 0xc7(%rbx)
jmp 0x314e8d
cmpl $0x424b5359, %r12d      # imm = 0x424B5359
jle 0x314d2c
cmpl $0x43455841, %r12d      # imm = 0x43455841
jg 0x314d68
cmpl $0x424b535a, %r12d      # imm = 0x424B535A
je 0x314ddc
cmpl $0x43424d42, %r12d      # imm = 0x43424D42
jne 0x314ea4
movl 0x4(%r13), %eax
movl %eax, 0xb8(%rbx)
jmp 0x314e8d
cmpl $0x56444f41, %r12d      # imm = 0x56444F41
jg 0x314db5
cmpl $0x53504254, %r12d      # imm = 0x53504254
je 0x314e69
cmpl $0x53534254, %r12d      # imm = 0x53534254
jne 0x314ea4
movzbl 0x4(%r13), %r12d
leal (,%r12,8), %edi
leaq 0xd5427(%rip), %rsi     # 0x3ea0c0
movl $0x8a2, %edx            # imm = 0x8A2
callq 0x1092b2
movq %rax, 0xd0(%rbx)
leaq (%rax,%r12,4), %rdx
movq %rdx, 0xd8(%rbx)
movl %r12d, %ecx
testq %r12, %r12
je 0x314d1d
movl 0x8(%r13), %esi
movl %esi, (%rax)
movl $0x0, (%rdx)
cmpl $0x1, %r12d
je 0x314d0f
leal (,%r12,4), %r8d
movl (%rax,%r8), %esi
movl (%rax), %edi
decq %r12
addq %rax, %r8
addq $0x4, %r8
movq %rax, %r9
addq $0x4, %r9
movq 0x60(%rsp), %r10
addq %r15, %r10
xorl %r11d, %r11d
addl %edi, %esi
movl (%r10,%r11,4), %edi
movl %edi, (%r9,%r11,4)
movl %esi, (%r8,%r11,4)
incq %r11
cmpq %r11, %r12
jne 0x314cf9
movl -0x4(%rax,%rcx,4), %eax
addl -0x4(%rdx,%rcx,4), %eax
movl %eax, 0xe0(%rbx)
leaq (%r15,%rcx,4), %r15
addq $0x8, %r15
movq 0x18(%rsp), %rsi
jmp 0x314d4f
testl %r12d, %r12d
je 0x314f17
cmpl $0x42424c4b, %r12d      # imm = 0x42424C4B
je 0x314dfb
cmpl $0x42454642, %r12d      # imm = 0x42454642
jne 0x314ea4
movq 0x10(%rsp), %r12
movb 0x4(%r12,%r15), %al
movb %al, 0xc6(%rbx)
addq $0x8, %r15
jmp 0x314e96
cmpl $0x43455842, %r12d      # imm = 0x43455842
je 0x314deb
cmpl $0x4d455842, %r12d      # imm = 0x4D455842
jne 0x314ea4
movq 0x4(%r13), %rax
movq %rax, 0x88(%rbx)
jmp 0x314e7d
cmpl $0x524f4646, %r12d      # imm = 0x524F4646
je 0x314e75
cmpl $0x53454c45, %r12d      # imm = 0x53454C45
jne 0x314ea4
movq 0x4(%r13), %rax
movq %rax, 0x10(%rbx)
jmp 0x314e7d
cmpl $0x56444f42, %r12d      # imm = 0x56444F42
je 0x314e83
cmpl $0x564f4646, %r12d      # imm = 0x564F4646
jne 0x314ea4
movq 0x4(%r13), %rax
movq %rax, 0x38(%rbx)
jmp 0x314e7d
movl 0x4(%r13), %eax
movl %eax, 0xb4(%rbx)
jmp 0x314e8d
movq 0x4(%r13), %rax
movq %rax, 0x90(%rbx)
jmp 0x314e7d
movl 0x4(%r13), %eax
movl %eax, 0xb0(%rbx)
jmp 0x314e8d
movslq 0x4(%r13), %r12
movl %r12d, 0xc8(%rbx)
leaq (,%r12,4), %rdi
leaq 0xd529c(%rip), %rsi     # 0x3ea0c0
movl $0x887, %edx            # imm = 0x887
callq 0x1092b2
movq %rax, %rbp
movq %rax, 0xa8(%rbx)
testq %r12, %r12
je 0x314ffa
movq 0x20(%rsp), %rax
addq %r15, %rax
leaq (%r15,%r12,4), %r15
addq $0x8, %r15
xorl %ecx, %ecx
movq 0x18(%rsp), %rsi
movl (%rax,%rcx,4), %edx
movl %edx, (%rbp,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x314e58
jmp 0x314e91
movl 0x4(%r13), %eax
movl %eax, 0xbc(%rbx)
jmp 0x314e8d
movq 0x4(%r13), %rax
movq %rax, 0x40(%rbx)
addq $0xc, %r15
jmp 0x314e91
movl 0x4(%r13), %eax
movl %eax, 0xc0(%rbx)
addq $0x8, %r15
movq 0x10(%rsp), %r12
testb %r14b, %r14b
jne 0x314bbf
jmp 0x314ac4
movl %r12d, %eax
andl $0xffff0000, %eax       # imm = 0xFFFF0000
cmpl $0x45480000, %eax       # imm = 0x45480000
jne 0x314f1f
movl 0x4(%r13), %eax
movq %rax, 0x58(%rsp)
leaq 0x8(%r15), %rax
movq %rax, 0x50(%rsp)
movq 0x78(%rbx), %rdi
movq 0x80(%rbx), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x80(%rbx)
shlq $0x4, %r13
leaq 0x10(%r13), %rsi
leaq 0xd51d6(%rip), %rdx     # 0x3ea0c0
movl $0x7a7, %ecx            # imm = 0x7A7
callq 0x1094e6
movq %rax, 0x78(%rbx)
movq 0x50(%rsp), %rcx
movq %rcx, (%rax,%r13)
movl %r12d, 0x8(%rax,%r13)
movq 0x58(%rsp), %rax
addq %rax, %r15
addq $0x8, %r15
jmp 0x314ffe
movq %rsi, %r15
jmp 0x314e91
movq 0x30(%rsp), %rdi
leaq 0xd544c(%rip), %rsi     # 0x3ea377
movq %r13, %rdx
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x314f4f
movq 0x40(%rsp), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
movq 0x10(%rsp), %r12
je 0x314f62
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd5153(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
movq %r12, %rdi
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x314fb0
movq 0x8(%rsp), %rdi
callq 0x1a6aec
movq %rbp, %rdi
leaq 0xd5106(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
xorl %r14d, %r14d
xorl %edi, %edi
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x8e0, %edx            # imm = 0x8E0
callq 0x109670
jmp 0x315003
addq $0x8, %r15
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rsi
jmp 0x314e96
xorl %r15d, %r15d
movzbl 0xc6(%rbx), %ecx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
movq %rbp, %rdx
callq 0x1a67c6
movq %rbp, %rdx
movq %rax, %rbp
movq %rax, 0x98(%rbx)
movzbl 0xc7(%rbx), %ecx
movq %r14, %rdi
movl $0x2, %esi
movq %rdx, %r14
callq 0x1a67c6
movq %rax, 0x18(%rsp)
movq %rax, 0xa0(%rbx)
movzbl %r15b, %r13d
movw %r13w, 0xc4(%rbx)
movq %rbp, 0x20(%rsp)
movq %rbp, %rdi
callq 0x1a67a7
cmpw %r13w, %ax
jne 0x315825
movq %r14, %rbp
testb $0x1, %r12b
je 0x31509c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0xd0(%rbx)
movzbl %r15b, %r13d
movq 0x10(%rsp), %r12
jne 0x315314
testb %r15b, %r15b
je 0x315314
leal (,%r13,8), %edi
leaq 0xd4ff5(%rip), %rsi     # 0x3ea0c0
movl $0x919, %edx            # imm = 0x919
callq 0x1092b2
movq %rax, 0xd0(%rbx)
leaq (%rax,%r13,4), %rcx
movq %rcx, 0xd8(%rbx)
movzwl 0xc4(%rbx), %edx
movl $0x0, (%rcx)
movl 0xbc(%rbx), %esi
movl %esi, (%rax)
cmpl $0x2, %edx
jb 0x3152f8
movl %edx, %esi
leal (,%r13,4), %edi
movl (%rax,%rdi), %r8d
decq %rsi
leaq (%rax,%rdi), %r9
addq $0x4, %r9
addq $0x4, %rax
xorl %edi, %edi
movl 0xbc(%rbx), %r10d
movl %r10d, (%rax,%rdi,4)
addl %r10d, %r8d
movl %r8d, (%r9,%rdi,4)
incq %rdi
cmpq %rdi, %rsi
jne 0x315124
jmp 0x3152fa
leaq 0xd5218(%rip), %rsi     # 0x3ea362
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r15, %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x31516b
leaq 0x48(%r13), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x315179
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd4f3c(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
movq %r12, %rdi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x3151c7
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd4ef2(%rip), %r13     # 0x3ea0c0
xorl %ebp, %ebp
xorl %edi, %edi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x866, %edx            # imm = 0x866
jmp 0x314abf
leaq 0xd520c(%rip), %rsi     # 0x3ea420
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x31523e
movq 0x48(%rsp), %rax
leaq 0x48(%rax), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x31524c
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd4e69(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x31529c
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd4e1d(%rip), %r13     # 0x3ea0c0
movq %rbp, %rdi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
movq $0x0, 0x18(%rsp)
xorl %edi, %edi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x908, %edx            # imm = 0x908
callq 0x109670
movq $0x0, 0x20(%rsp)
jmp 0x315082
xorl %edi, %edi
movl 0xbc(%rbx), %eax
imull %eax, %edx
movl %edx, 0xe0(%rbx)
addl (%rcx,%rdi,4), %eax
cmpl %edx, %eax
jne 0x31582f
movq 0x48(%rsp), %rdi
addq $0x48, %rdi
movl 0xb4(%rbx), %esi
movq %rdi, %r15
movl %r13d, %edx
callq 0x317c14
testl %eax, %eax
je 0x31546a
cmpl $0x0, 0xc0(%rbx)
jne 0x31537c
movq 0x10(%rbx), %rax
movl 0xb0(%rbx), %edi
movl 0xb4(%rbx), %ecx
imull %edi, %ecx
incq %rax
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
sbbq $-0x1, %rax
imull 0x6c(%rbx), %edi
addq 0x88(%rbx), %rdi
imulq %rax, %rdi
callq 0x2f9d41
movl %eax, 0xc0(%rbx)
movq 0x18(%rbx), %rdi
movq 0x40(%rbx), %rsi
xorl %edx, %edx
callq 0x17cf0
testl %eax, %eax
je 0x315541
leaq 0xd50c4(%rip), %rsi     # 0x3ea45e
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x3153be
movq %r15, %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x3153cc
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd4ce9(%rip), %r12     # 0x3ea0c0
movq %r12, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r12, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
cmpq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %r15
je 0x315421
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd4c98(%rip), %r14     # 0x3ea0c0
movq %rbp, %rdi
movq %r14, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
movq %r15, %rdi
movq %r14, %rsi
movl $0x92f, %edx            # imm = 0x92F
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x92f, %edx            # imm = 0x92F
jmp 0x3149f0
leaq 0xd4fc9(%rip), %rsi     # 0x3ea43a
movq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x315495
movq %r15, %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x3154a3
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd4c12(%rip), %r12     # 0x3ea0c0
movq %r12, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r12, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
cmpq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %r15
je 0x3154f8
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd4bc1(%rip), %r14     # 0x3ea0c0
movq %rbp, %rdi
movq %r14, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
movq %r15, %rdi
movq %r14, %rsi
movl $0x922, %edx            # imm = 0x922
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x922, %edx            # imm = 0x922
jmp 0x3149f0
movl 0x3c(%rsp), %edx
andl $0x1, %edx
movq 0x18(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %r13
movq %r13, %rcx
callq 0x319310
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x315730
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x315834
cmpq $0x0, 0x28(%rbx)
jne 0x315834
movq 0x40(%rbx), %r14
subq 0x30(%rbx), %r14
callq 0x17850
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x120d23
movq 0x30(%rbx), %rcx
subq $0x8, %rsp
movl %ebp, %edi
movq %rax, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x949                  # imm = 0x949
leaq 0xd4b01(%rip), %r14     # 0x3ea0c0
pushq %r14
callq 0x102407
addq $0x20, %rsp
movq %rax, 0x28(%rbx)
movq %r12, %rdi
movq %r14, %rsi
movl $0x93d, %edx            # imm = 0x93D
callq 0x109670
jmp 0x31508a
cmpq $0x0, 0xa8(%rbx)
je 0x31582a
cmpl $0x0, 0xb0(%rbx)
je 0x31582a
cmpq %rsi, %r15
jne 0x31582a
cmpl $0x0, 0xc8(%rbx)
je 0x31582a
movq %r12, %r13
movl 0xbc(%rbx), %r12d
movq 0x10(%rbx), %rdi
decq %rdi
callq 0x2f9d41
testl %r12d, %r12d
je 0x315805
movb $0x1, %r15b
cmpl %eax, %r12d
je 0x31580e
movl 0xbc(%rbx), %r15d
movq 0x10(%rbx), %rdi
decq %rdi
callq 0x2f9d41
leaq 0xd4d92(%rip), %rsi     # 0x3ea3eb
movq 0x30(%rsp), %rdi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
movq %r13, %r12
je 0x315687
movq 0x40(%rsp), %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x315695
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd4a20(%rip), %r13     # 0x3ea0c0
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
movq %r12, %rdi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
cmpq $0x0, 0x8(%rsp)
je 0x3156e3
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd49d6(%rip), %r13     # 0x3ea0c0
movq %rbp, %rdi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
xorl %r15d, %r15d
xorl %edi, %edi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
xorl %edi, %edi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
movq %rbx, %rdi
movq %r13, %rsi
movl $0x8f1, %edx            # imm = 0x8F1
callq 0x109670
jmp 0x314ac7
leaq 0xd4d37(%rip), %rsi     # 0x3ea46e
movq %r13, %rdi
xorl %eax, %eax
callq 0x1019cf
movq 0x28(%rsp), %rdi
callq 0x314242
cmpl $0x0, 0x60(%rbx)
je 0x315759
movq %r15, %rdi
callq 0x3183a2
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x315767
callq 0x318854
movq 0x78(%rbx), %rdi
leaq 0xd494e(%rip), %r12     # 0x3ea0c0
movq %r12, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
movq 0xd0(%rbx), %rdi
movq %r12, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
cmpq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %r15
je 0x3157bc
movq 0x8(%rsp), %rdi
callq 0x1a6aec
leaq 0xd48fd(%rip), %r14     # 0x3ea0c0
movq %rbp, %rdi
movq %r14, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
movq %r15, %rdi
movq %r14, %rsi
movl $0x939, %edx            # imm = 0x939
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x939, %edx            # imm = 0x939
jmp 0x3149f0
movl %eax, 0xbc(%rbx)
movb $0x1, %r15b
movq %r13, %r12
jmp 0x314ac7
callq 0x91711
callq 0x91781
callq 0x9169f
callq 0x91748
callq 0x916d8
callq 0x917b8
callq 0x917f1