// File: /workspace/github_cpp_makefile_star2_O2/cpearce[P]OggIndex/src/Validate.cpp
// Function: ValidateIndexedOgg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool ValidateIndexedOgg(const string& filename) {
  ifstream input(filename.c_str(), ios::in | ios::binary);
  ogg_sync_state state;
  ogg_int32_t ret = ogg_sync_init(&state);
  assert(ret==0);

  VerifyDecoderMap decoders;
  ogg_page page;
  memset(&page, 0, sizeof(ogg_page));
  ogg_uint64_t bytesRead = 0;
  Theora* theora = 0;
  Vorbis* vorbis = 0;
  Kate* kate = 0;
  Skeleton* skeleton = 0;
  bool index_valid = true;
  ogg_uint64_t contentOffset = 0;
  
  while (!ReadAllHeaders(theora, vorbis, kate, skeleton) && 
         ReadPage(&state, &page, input, bytesRead))
  {
    contentOffset += page.header_len + page.body_len;
    int serialno = ogg_page_serialno(&page);
    VerifyDecoder* decoder = 0;
    if (ogg_page_bos(&page)) {
      if (page.body_len > 8 &&
          strncmp("theora", (const char*)page.body+1, 6) == 0)
      {
        theora = new Theora(serialno);
        decoders[serialno] = theora;
      } else if (page.body_len > 8 &&
                 strncmp("vorbis", (const char*)page.body+1, 6) == 0)
      {
        vorbis = new Vorbis(serialno);
        decoders[serialno] = vorbis;
#ifdef HAVE_KATE
      } else if (page.body_len > 8 &&
                 memcmp("kate\0\0\0", (const char*)page.body+1, 7) == 0)
      {
        kate = new Kate(serialno);
        decoders[serialno] = kate;
#endif
      } else if (page.body_len > 8 &&
                 strncmp("fishead", (const char*)page.body, 8) == 0)
      {
        skeleton = new Skeleton(serialno);
        decoders[serialno] = skeleton;
      }
    }
    decoder = decoders[serialno];
    if (!decoder) {
      cout << "WARNING: Unknown stream type, serialno=" << serialno << endl;
      continue;
    }
    ogg_int64_t ignore;
    if (!decoder->Decode(&page, ignore)) {
      index_valid = false;
    }
  }

  if (!skeleton) {
    cerr << "FAIL: No skeleton track so therefore no keyframe indexes!" << endl;
    return false;
  }

  if (skeleton->mContentOffset != contentOffset) {
    cerr << "FAIL: skeleton header's reported content offset (" << skeleton->mContentOffset
         << ") does not match actual content offset (" << contentOffset << ")" << endl;
    index_valid = false;
  }

  ogg_int64_t fileLength = FileLength(filename.c_str());
  if (skeleton->mFileLength != fileLength) {
    cerr << "FAIL: index's reported file length (" << skeleton->mFileLength
         << ") doesn't match file's actual length (" << fileLength << ")" << endl;
    index_valid = false;
  }

  KeyFrameIndex::iterator itr = skeleton->mIndex.begin();
  if (itr == skeleton->mIndex.end()) {
    cerr << "WARNING: No tracks in skeleton index." << endl;
  }

  while (itr != skeleton->mIndex.end()) {
    vector<KeyFrameInfo>* v = itr->second;
    ogg_uint32_t serialno = itr->first;
    itr++;
    VerifyDecoder* decoder = decoders[serialno];

    if (!decoder) {
      cerr << "WARNING: No decoder for track s="
           << serialno << endl;
      continue;
    }

    if (v->size() == 0) {
      cerr << "WARNING: " << decoder->Type() << "/" <<  serialno
           << " index has no keyframes" << endl;
      continue;
    }

    cout << decoder->Type() << "/" << serialno
         << " index has " << v->size() << " keypoints." << endl;

    bool valid = true;
    for (ogg_uint32_t i=0; i<v->size(); i++) {
    
      KeyFrameInfo& keypoint = v->at(i);
      if (keypoint.mOffset > INT_MAX) {
        cerr << "WARNING: Only verified up to 2^31 bytes into the file." << endl;
        break;
      }
      
      if (keypoint.mOffset > fileLength) {
        valid = false;
        cerr << "FAIL: Keypoint " << i << " offset of " << keypoint.mOffset
             << " out of file range." << endl;
        break;
      }

      // Check that the checksum of the page here matches, and that the
      // presentation time of the stream matches what's reported in the index.
      ogg_sync_reset(&state);
      if (input.eof()) {
        // Probably hit eof while reading pages for previous keypoint.
        input.close();
        input.clear();        
        input.open(filename.c_str(), ios::in | ios::binary);
      }
      input.seekg(keypoint.mOffset);
      if (!input.good()) {
        cerr << "FAIL: Can't seek to keypoint at byte offset " << keypoint.mOffset << endl;
        return false;
      }
      decoder->Reset();
      ogg_int64_t pres_time = -1;
      ogg_int64_t page_offset = keypoint.mOffset;
      ogg_int64_t end_time = -1;
      while (pres_time  == -1) {
        int skip = 0;
        if ((skip = PageSeek(&state, &page, input, bytesRead)) != 0) {
          if (skip == -1) {
            cerr << "FAIL: Can't read page at offset " << page_offset << endl;
            return false;
          }
          assert(skip > 0);
          cerr << "FAIL: There's no page at offset " << page_offset
               << " as reported by keypoint. Next page is at offset "
               << (page_offset + skip) << endl;
          return false;
        }
        page_offset += page.header_len + page.body_len;
        // Extract the presentation time. Decode() returns -1 if it needs
        // another page.
        if ((ogg_uint32_t)ogg_page_serialno(&page) != decoder->mSerial) {
          // Skip until we read another page on this stream.
          continue;
        }
        pres_time = decoder->Decode(&page, end_time);
        // Vorbis decoders should never return -1 for prestime, it should be
        // calculable from only one page.
        assert(decoder != vorbis || pres_time != -1);
      }

      // We consider a theora the key point is invalid if it's reported time
      // doesn't match the presentation time of the first keyframe which
      // can be decoded from this page.
      if (decoder == theora && keypoint.mTime != pres_time) {
        cerr << "FAIL: theora keypoint " << i << " for page at offset "
             << keypoint.mOffset << " reports start time of "
             << keypoint.mTime << " but should be " << pres_time << endl;
        valid = false;
      }

      // A vorbis keypoint is considered invalid if lies before the start time
      // of this page, or after the end time.
      if (decoder == vorbis &&
          (keypoint.mTime < pres_time || keypoint.mTime > end_time))
      {
        cerr << "FAIL: vorbis keypoint " << i << " for page at offset "
             << keypoint.mOffset << " reports start time of "
             << keypoint.mTime << " but should lie in the range ["
             << pres_time << "," << end_time << "]" << endl;
        valid = false;
      }

#ifdef HAVE_KATE
      if (decoder == kate) {
        // We get the granpos of the page linked to, and check that the base part of the granpos
        // is higher or equal to the time of the keypoint
        ogg_int64_t base_time = kate->GetBaseTime(&page);
        if (base_time > pres_time) {
          cerr << "FAIL: kate keypoint " << i << " for page at offset "
               << keypoint.mOffset << " reports start time of "
               << keypoint.mTime << " but should be greater of equal to "
               << base_time << endl;
          valid = false;
        }
      }
#endif
    }
    if (valid) {
      cout << decoder->Type() << "/" << serialno
           << " index is accurate." << endl;
    } else {
      cout << "FAIL: " << decoder->Type() << "/" << serialno
           << " index is NOT accurate." << endl;
      index_valid = false;
    }
  }

  ogg_sync_clear(&state);
  
  return index_valid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, 0x78(%rsp)
movq (%rdi), %rsi
leaq 0xe0(%rsp), %rdi
pushq $0xc
popq %rdx
callq 0x46d0
leaq 0x80(%rsp), %rdi
callq 0x4160
testl %eax, %eax
jne 0xbf06
leaq 0xb8(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0xa8(%rsp), %r12
andq $0x0, (%r12)
movb $0x1, %al
movl %eax, 0xc(%rsp)
xorl %ebx, %ebx
leaq 0x80(%rsp), %r13
leaq 0xb0(%rsp), %rbp
movq $0x0, 0x10(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xb4f4
cmpq $0x0, 0x28(%rsp)
jne 0xb4f4
cmpq $0x0, 0x30(%rsp)
je 0xb544
cmpq $0x0, 0x30(%rsp)
je 0xb507
movq 0x30(%rsp), %rax
cmpb $0x1, 0xc(%rax)
jne 0xb544
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0xb529
movb 0xc(%rax), %al
cmpq $0x0, 0x10(%rsp)
je 0xb520
testb %al, %al
jne 0xb535
testb %al, %al
je 0xb544
jmp 0xb751
cmpq $0x0, 0x10(%rsp)
je 0xbe09
movq 0x10(%rsp), %rax
cmpb $0x0, 0xc(%rax)
jne 0xb75d
movq %r13, %rdi
movq %r14, %rsi
leaq 0xe0(%rsp), %rdx
movq %r12, %rcx
callq 0xa9bc
testb %al, %al
je 0xb751
addq 0x58(%rsp), %rbx
addq 0x68(%rsp), %rbx
movq %r14, %rdi
callq 0x42c0
movl %eax, %r15d
movq %r14, %rdi
callq 0x4690
testl %eax, %eax
je 0xb6e9
cmpq $0x9, 0x68(%rsp)
jl 0xb6e9
movq %r12, %r14
movq 0x60(%rsp), %r13
leaq 0x1(%r13), %r12
leaq 0x3131(%rip), %rdi      # 0xe6d7
movq %r12, %rsi
pushq $0x6
popq %rbp
movq %rbp, %rdx
callq 0x4190
testl %eax, %eax
je 0xb609
leaq 0x325c(%rip), %rdi      # 0xe81b
movq %r12, %rsi
movq %rbp, %rdx
callq 0x4190
testl %eax, %eax
je 0xb659
leaq 0x2bf3(%rip), %rdi      # 0xe1cc
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x4190
testl %eax, %eax
movq %r14, %r12
leaq 0xb0(%rsp), %rbp
je 0xb6a6
leaq 0x50(%rsp), %r14
leaq 0x80(%rsp), %r13
jmp 0xb6e9
movl $0x240, %edi            # imm = 0x240
callq 0x4350
movq %rax, 0x30(%rsp)
movq %r14, %r12
leaq 0x50(%rsp), %r14
leaq 0x80(%rsp), %r13
leaq 0xb0(%rsp), %rbp
movq 0x30(%rsp), %rdi
movl %r15d, %esi
callq 0xbfc4
movl %r15d, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xc040
movq 0x30(%rsp), %rcx
jmp 0xb6e6
movl $0x358, %edi            # imm = 0x358
callq 0x4350
movq %rax, 0x28(%rsp)
movq %r14, %r12
leaq 0x50(%rsp), %r14
leaq 0x80(%rsp), %r13
leaq 0xb0(%rsp), %rbp
movq 0x28(%rsp), %rdi
movl %r15d, %esi
callq 0xc08e
movl %r15d, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xc040
movq 0x28(%rsp), %rcx
jmp 0xb6e6
movl $0x1e8, %edi            # imm = 0x1E8
callq 0x4350
movq %rax, 0x10(%rsp)
leaq 0x50(%rsp), %r14
leaq 0x80(%rsp), %r13
movq 0x10(%rsp), %rdi
movl %r15d, %esi
callq 0xc0de
movl %r15d, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xc040
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movl %r15d, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xc040
movq (%rax), %rdi
testq %rdi, %rdi
jne 0xb72e
movq 0x98c6(%rip), %rdi      # 0x14fd0
leaq 0x4267(%rip), %rsi      # 0xf978
callq 0x4340
movq %rax, %rdi
movl %r15d, %esi
callq 0x4650
movq %rax, %rdi
callq 0x41b0
jmp 0xb4dc
movq (%rdi), %rax
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
callq *0x10(%rax)
testq %rax, %rax
setne %al
movl 0xc(%rsp), %ecx
andb %al, %cl
movl %ecx, 0xc(%rsp)
jmp 0xb4dc
cmpq $0x0, 0x10(%rsp)
je 0xbe09
movq 0x10(%rsp), %rax
cmpq %rbx, 0x1e0(%rax)
je 0xb7cb
movq 0x987e(%rip), %rdi      # 0x14ff0
leaq 0x4261(%rip), %rsi      # 0xf9da
callq 0x4340
movq 0x10(%rsp), %rcx
movq 0x1e0(%rcx), %rsi
movq %rax, %rdi
callq 0x4240
leaq 0x4273(%rip), %rsi      # 0xfa0c
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4240
leaq 0x41c3(%rip), %rsi      # 0xf976
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0xc(%rsp)
movq 0x78(%rsp), %rax
movq (%rax), %rdi
callq 0xa8c4
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rax, 0x1d8(%rcx)
je 0xb852
movq 0x97f9(%rip), %rdi      # 0x14ff0
leaq 0x4237(%rip), %rsi      # 0xfa35
callq 0x4340
movq 0x10(%rsp), %rcx
movq 0x1d8(%rcx), %rsi
movq %rax, %rdi
callq 0x4320
leaq 0x423c(%rip), %rsi      # 0xfa5a
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x4320
leaq 0x413c(%rip), %rsi      # 0xf976
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rbp
movq 0x1c0(%rbp), %rbx
addq $0x1b0, %rbp            # imm = 0x1B0
movq %rbp, 0x10(%rsp)
cmpq %rbp, %rbx
jne 0xb88a
movq 0x977a(%rip), %rdi      # 0x14ff0
leaq 0x4204(%rip), %rsi      # 0xfa81
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movq 0x975f(%rip), %r15      # 0x14ff0
cmpq 0x10(%rsp), %rbx
je 0xbeaf
movq %rbx, %rdi
movq 0x28(%rbx), %rbp
movl 0x20(%rbx), %eax
movl %eax, 0x1c(%rsp)
callq 0x4250
movq %rax, 0xa0(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0xc128
movq (%rax), %r14
testq %r14, %r14
je 0xbc49
movq 0x8(%rbp), %rax
cmpq (%rbp), %rax
je 0xbc66
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq 0x96dd(%rip), %rdi      # 0x14fd0
movq %rax, %rsi
callq 0x4340
movq %rax, %rdi
leaq 0x37b1(%rip), %rsi      # 0xf0b6
callq 0x4340
movl 0x1c(%rsp), %esi
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
leaq 0x41ca(%rip), %rsi      # 0xfaea
callq 0x4340
movq 0x8(%rbp), %rsi
subq (%rbp), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
leaq 0x41b3(%rip), %rsi      # 0xfaf6
callq 0x4340
movq %rax, %rdi
callq 0x41b0
xorl %ebx, %ebx
movb $0x1, %al
movl %eax, 0x3c(%rsp)
movq %r14, %r13
xorq 0x28(%rsp), %r13
movl %ebx, %ebx
movq 0x8(%rbp), %rax
subq (%rbp), %rax
sarq $0x4, %rax
cmpq %rbx, %rax
jbe 0xbce2
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xc176
movq %rax, %r12
movq (%rax), %rax
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jge 0xbccb
cmpq 0x48(%rsp), %rax
jg 0xbd39
leaq 0x80(%rsp), %rdi
callq 0x4180
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x100(%rsp,%rax)
je 0xba07
leaq 0xe0(%rsp), %rdi
callq 0x4090
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0xe0(%rsp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x4640
movq 0x78(%rsp), %rax
movq (%rax), %rsi
leaq 0xe0(%rsp), %rdi
pushq $0xc
popq %rdx
callq 0x4200
movq (%r12), %rsi
leaq 0xe0(%rsp), %rdi
xorl %edx, %edx
callq 0x4430
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x100(%rsp,%rax)
jne 0xbebe
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r12, 0x40(%rsp)
movq (%r12), %r15
orq $-0x1, 0x20(%rsp)
pushq $-0x1
popq %r12
cmpq $-0x1, %r12
jne 0xbac4
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
callq 0xaae1
movl %eax, %r12d
testl %eax, %eax
jne 0xbdee
addq 0x58(%rsp), %r15
addq 0x68(%rsp), %r15
leaq 0x50(%rsp), %rdi
callq 0x42c0
pushq $-0x1
popq %r12
cmpl 0x8(%r14), %eax
jne 0xba50
movq (%r14), %rax
movq %r14, %rdi
leaq 0x50(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq *0x10(%rax)
movq %rax, %r12
notq %rax
orq %r13, %rax
jne 0xba50
jmp 0xbee7
cmpq 0x30(%rsp), %r14
jne 0xbb65
movq 0x40(%rsp), %rax
cmpq %r12, 0x8(%rax)
je 0xbb65
movq 0x950b(%rip), %rdi      # 0x14ff0
leaq 0x414c(%rip), %rsi      # 0xfc38
callq 0x4340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4240
movq %rax, %rdi
leaq 0x3ba2(%rip), %rsi      # 0xf6a8
callq 0x4340
movq 0x40(%rsp), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x412a(%rip), %rsi      # 0xfc4f
callq 0x4340
movq 0x40(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x4122(%rip), %rsi      # 0xfc67
callq 0x4340
movq %rax, %rdi
movq %r12, %rsi
callq 0x4320
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0x3c(%rsp)
cmpq 0x28(%rsp), %r14
jne 0xbc3b
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
cmpq %r12, %rax
jl 0xbb89
cmpq 0x20(%rsp), %rax
jle 0xbc3b
movq 0x9460(%rip), %rdi      # 0x14ff0
leaq 0x40e0(%rip), %rsi      # 0xfc77
callq 0x4340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4240
movq %rax, %rdi
leaq 0x3af7(%rip), %rsi      # 0xf6a8
callq 0x4340
movq 0x40(%rsp), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x407f(%rip), %rsi      # 0xfc4f
callq 0x4340
movq 0x40(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x409e(%rip), %rsi      # 0xfc8e
callq 0x4340
movq %rax, %rdi
movq %r12, %rsi
callq 0x4320
movq %rax, %rdi
leaq 0x34d4(%rip), %rsi      # 0xf0de
callq 0x4340
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x2565(%rip), %rsi      # 0xe18b
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0x3c(%rsp)
incl %ebx
movq 0x93ac(%rip), %r15      # 0x14ff0
jmp 0xb960
movq %r15, %rdi
leaq 0x3e54(%rip), %rsi      # 0xfaa7
callq 0x4340
movl 0x1c(%rsp), %esi
movq %rax, %rdi
callq 0x4240
jmp 0xbcb6
movq %r15, %rdi
leaq 0x3e58(%rip), %rsi      # 0xfac8
callq 0x4340
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4340
movq %rax, %rdi
leaq 0x3420(%rip), %rsi      # 0xf0b6
callq 0x4340
movl 0x1c(%rsp), %esi
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
leaq 0x3e21(%rip), %rsi      # 0xfad2
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movq 0xa0(%rsp), %rbx
jmp 0xb891
movq %r15, %rdi
leaq 0x3e2d(%rip), %rsi      # 0xfb02
callq 0x4340
movq %rax, %rdi
callq 0x41b0
testb $0x1, 0x3c(%rsp)
je 0xbd85
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq 0x92d3(%rip), %rdi      # 0x14fd0
movq %rax, %rsi
callq 0x4340
movq %rax, %rdi
leaq 0x33a7(%rip), %rsi      # 0xf0b6
callq 0x4340
movl 0x1c(%rsp), %esi
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
leaq 0x3f83(%rip), %rsi      # 0xfcad
callq 0x4340
movq %rax, %rdi
callq 0x41b0
jmp 0xbcbe
movq %r15, %rdi
leaq 0x3df6(%rip), %rsi      # 0xfb39
callq 0x4340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4240
movq %rax, %rdi
leaq 0x3dec(%rip), %rsi      # 0xfb49
callq 0x4340
movq (%r12), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
leaq 0x3ddd(%rip), %rsi      # 0xfb55
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movq 0x9244(%rip), %rdi      # 0x14fd0
leaq 0x3f2e(%rip), %rsi      # 0xfcc1
callq 0x4340
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4340
movq %rax, %rdi
leaq 0x32fd(%rip), %rsi      # 0xf0b6
callq 0x4340
movl 0x1c(%rsp), %esi
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
leaq 0x3ef4(%rip), %rsi      # 0xfcc8
callq 0x4340
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0xc(%rsp)
jmp 0xbcbe
cmpl $-0x1, %r12d
jne 0xbe26
movq 0x91f5(%rip), %rdi      # 0x14ff0
leaq 0x3d94(%rip), %rsi      # 0xfb96
callq 0x4340
jmp 0xbe62
movq 0x91e0(%rip), %rdi      # 0x14ff0
leaq 0x3b89(%rip), %rsi      # 0xf9a0
callq 0x4340
movq %rax, %rdi
callq 0x41b0
jmp 0xbe75
testl %r12d, %r12d
jle 0xbf25
movq 0x91ba(%rip), %rdi      # 0x14ff0
leaq 0x3d83(%rip), %rsi      # 0xfbc0
callq 0x4340
movq %rax, %rdi
movq %r15, %rsi
callq 0x4320
leaq 0x3d8d(%rip), %rsi      # 0xfbe1
movq %rax, %rdi
callq 0x4340
movl %r12d, %ecx
addq %rcx, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x4320
movq %rax, %rdi
callq 0x41b0
movl $0x0, 0xc(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xd062
leaq 0xe0(%rsp), %rdi
callq 0x40c0
movl 0xc(%rsp), %eax
andb $0x1, %al
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x80(%rsp), %rdi
callq 0x4720
jmp 0xbe7d
movq 0x912b(%rip), %rdi      # 0x14ff0
leaq 0x3c9d(%rip), %rsi      # 0xfb69
callq 0x4340
movq (%r12), %rsi
movq %rax, %rdi
callq 0x4320
movq %rax, %rdi
callq 0x41b0
jmp 0xbe75
leaq 0x3d25(%rip), %rdi      # 0xfc13
leaq 0x3a4a(%rip), %rsi      # 0xf93f
leaq 0x3a54(%rip), %rcx      # 0xf950
movl $0x2bb, %edx            # imm = 0x2BB
callq 0x4210
leaq 0x29a3(%rip), %rdi      # 0xe8b0
leaq 0x3a2b(%rip), %rsi      # 0xf93f
leaq 0x3a35(%rip), %rcx      # 0xf950
movl $0x21f, %edx            # imm = 0x21F
callq 0x4210
leaq 0x3c8b(%rip), %rdi      # 0xfbb7
leaq 0x3a0c(%rip), %rsi      # 0xf93f
leaq 0x3a16(%rip), %rcx      # 0xf950
movl $0x2ab, %edx            # imm = 0x2AB
callq 0x4210
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
movq %rax, %rbx
jmp 0xbfaf
jmp 0xbf9f
jmp 0xbf9f
movq %rax, %rbx
movl $0x1e8, %esi            # imm = 0x1E8
movq 0x10(%rsp), %rdi
jmp 0xbf8c
jmp 0xbf9f
movq %rax, %rbx
movl $0x358, %esi            # imm = 0x358
movq 0x28(%rsp), %rdi
jmp 0xbf8c
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
movq %rax, %rbx
movl $0x240, %esi            # imm = 0x240
movq 0x30(%rsp), %rdi
callq 0x4370
jmp 0xbfa2
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
jmp 0xbf9f
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xd062
leaq 0xe0(%rsp), %rdi
callq 0x40c0
movq %rbx, %rdi
callq 0x4680