// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::LoadObjWithCallback(std::istream&, tinyobj::callback_t_ const&, void*, tinyobj::MaterialReader*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback,
                         void *user_data /*= NULL*/,
                         MaterialReader *readMatFn /*= NULL*/,
                         std::string *warn, /* = NULL*/
                         std::string *err /*= NULL*/) {
  std::stringstream errss;

  // material
  std::map<std::string, int> material_map;
  int material_id = -1;  // -1 = invalid

  std::vector<index_t> indices;
  std::vector<material_t> materials;
  std::vector<std::string> names;
  names.reserve(2);
  std::vector<const char *> names_out;

  std::string linebuf;
  while (inStream.peek() != -1) {
    safeGetline(inStream, linebuf);

    // Trim newline '\r\n' or '\n'
    if (linebuf.size() > 0) {
      if (linebuf[linebuf.size() - 1] == '\n')
        linebuf.erase(linebuf.size() - 1);
    }
    if (linebuf.size() > 0) {
      if (linebuf[linebuf.size() - 1] == '\r')
        linebuf.erase(linebuf.size() - 1);
    }

    // Skip if empty line.
    if (linebuf.empty()) {
      continue;
    }

    // Skip leading space.
    const char *token = linebuf.c_str();
    token += strspn(token, " \t");

    assert(token);
    if (token[0] == '\0') continue;  // empty line

    if (token[0] == '#') continue;  // comment line

    // vertex
    if (token[0] == 'v' && IS_SPACE((token[1]))) {
      token += 2;
      // TODO(syoyo): Support parsing vertex color extension.
      real_t x, y, z, w;  // w is optional. default = 1.0
      parseV(&x, &y, &z, &w, &token);
      if (callback.vertex_cb) {
        callback.vertex_cb(user_data, x, y, z, w);
      }
      continue;
    }

    // normal
    if (token[0] == 'v' && token[1] == 'n' && IS_SPACE((token[2]))) {
      token += 3;
      real_t x, y, z;
      parseReal3(&x, &y, &z, &token);
      if (callback.normal_cb) {
        callback.normal_cb(user_data, x, y, z);
      }
      continue;
    }

    // texcoord
    if (token[0] == 'v' && token[1] == 't' && IS_SPACE((token[2]))) {
      token += 3;
      real_t x, y, z;  // y and z are optional. default = 0.0
      parseReal3(&x, &y, &z, &token);
      if (callback.texcoord_cb) {
        callback.texcoord_cb(user_data, x, y, z);
      }
      continue;
    }

    // face
    if (token[0] == 'f' && IS_SPACE((token[1]))) {
      token += 2;
      token += strspn(token, " \t");

      indices.clear();
      while (!IS_NEW_LINE(token[0])) {
        vertex_index_t vi = parseRawTriple(&token);

        index_t idx;
        idx.vertex_index = vi.v_idx;
        idx.normal_index = vi.vn_idx;
        idx.texcoord_index = vi.vt_idx;

        indices.push_back(idx);
        size_t n = strspn(token, " \t\r");
        token += n;
      }

      if (callback.index_cb && indices.size() > 0) {
        callback.index_cb(user_data, &indices.at(0),
                          static_cast<int>(indices.size()));
      }

      continue;
    }

    // use mtl
    if ((0 == strncmp(token, "usemtl", 6)) && IS_SPACE((token[6]))) {
      token += 7;
      std::stringstream ss;
      ss << token;
      std::string namebuf = ss.str();

      int newMaterialId = -1;
      if (material_map.find(namebuf) != material_map.end()) {
        newMaterialId = material_map[namebuf];
      } else {
        // { error!! material not found }
      }

      if (newMaterialId != material_id) {
        material_id = newMaterialId;
      }

      if (callback.usemtl_cb) {
        callback.usemtl_cb(user_data, namebuf.c_str(), material_id);
      }

      continue;
    }

    // load mtl
    if ((0 == strncmp(token, "mtllib", 6)) && IS_SPACE((token[6]))) {
      if (readMatFn) {
        token += 7;

        std::vector<std::string> filenames;
        SplitString(std::string(token), ' ', filenames);

        if (filenames.empty()) {
          if (warn) {
            (*warn) +=
                "Looks like empty filename for mtllib. Use default "
                "material. \n";
          }
        } else {
          bool found = false;
          for (size_t s = 0; s < filenames.size(); s++) {
            std::string warn_mtl;
            std::string err_mtl;
            bool ok = (*readMatFn)(filenames[s].c_str(), &materials,
                                   &material_map, &warn_mtl, &err_mtl);

            if (warn && (!warn_mtl.empty())) {
              (*warn) += warn_mtl;  // This should be warn message.
            }

            if (err && (!err_mtl.empty())) {
              (*err) += err_mtl;
            }

            if (ok) {
              found = true;
              break;
            }
          }

          if (!found) {
            if (warn) {
              (*warn) +=
                  "Failed to load material file(s). Use default "
                  "material.\n";
            }
          } else {
            if (callback.mtllib_cb) {
              callback.mtllib_cb(user_data, &materials.at(0),
                                 static_cast<int>(materials.size()));
            }
          }
        }
      }

      continue;
    }

    // group name
    if (token[0] == 'g' && IS_SPACE((token[1]))) {
      names.clear();

      while (!IS_NEW_LINE(token[0])) {
        std::string str = parseString(&token);
        names.push_back(str);
        token += strspn(token, " \t\r");  // skip tag
      }

      assert(names.size() > 0);

      if (callback.group_cb) {
        if (names.size() > 1) {
          // create const char* array.
          names_out.resize(names.size() - 1);
          for (size_t j = 0; j < names_out.size(); j++) {
            names_out[j] = names[j + 1].c_str();
          }
          callback.group_cb(user_data, &names_out.at(0),
                            static_cast<int>(names_out.size()));

        } else {
          callback.group_cb(user_data, NULL, 0);
        }
      }

      continue;
    }

    // object name
    if (token[0] == 'o' && IS_SPACE((token[1]))) {
      // @todo { multiple object name? }
      token += 2;

      std::stringstream ss;
      ss << token;
      std::string object_name = ss.str();

      if (callback.object_cb) {
        callback.object_cb(user_data, object_name.c_str());
      }

      continue;
    }

#if 0  // @todo
    if (token[0] == 't' && IS_SPACE(token[1])) {
      tag_t tag;

      token += 2;
      std::stringstream ss;
      ss << token;
      tag.name = ss.str();

      token += tag.name.size() + 1;

      tag_sizes ts = parseTagTriple(&token);

      tag.intValues.resize(static_cast<size_t>(ts.num_ints));

      for (size_t i = 0; i < static_cast<size_t>(ts.num_ints); ++i) {
        tag.intValues[i] = atoi(token);
        token += strcspn(token, "/ \t\r") + 1;
      }

      tag.floatValues.resize(static_cast<size_t>(ts.num_reals));
      for (size_t i = 0; i < static_cast<size_t>(ts.num_reals); ++i) {
        tag.floatValues[i] = parseReal(&token);
        token += strcspn(token, "/ \t\r") + 1;
      }

      tag.stringValues.resize(static_cast<size_t>(ts.num_strings));
      for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) {
        std::stringstream ss;
        ss << token;
        tag.stringValues[i] = ss.str();
        token += tag.stringValues[i].size() + 1;
      }

      tags.push_back(tag);
    }
#endif

    // Ignore unknown command.
  }

  if (err) {
    (*err) += errss.str();
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %r9, 0x78(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, 0xf8(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, %rbp
leaq 0x300(%rsp), %rdi
callq 0x62a0
leaq 0x2d8(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rax, 0x10(%rdi)
movaps %xmm0, (%rdi)
movl $0x2, %esi
callq 0x1b0b6
leaq 0xa0(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x148(%rsp), %r14
leaq 0x80(%r14), %rax
movq %rax, 0x70(%rsp)
leaq 0x80(%rsp), %r13
movq %rsp, %r15
movq %rbp, %rdi
callq 0x6140
cmpl $-0x1, %eax
je 0x142a4
movq %rbp, %rdi
movq %r13, %rsi
callq 0xebdc
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x135cb
movq 0x80(%rsp), %rcx
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x1361f
decq %rax
movq %rax, 0x88(%rsp)
movb $0x0, (%rcx,%rax)
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x135cb
movq 0x80(%rsp), %rbx
cmpb $0xd, -0x1(%rbx,%rax)
jne 0x1366d
decq %rax
movq %rax, 0x88(%rsp)
movb $0x0, (%rbx,%rax)
cmpq $0x0, 0x88(%rsp)
je 0x135cb
movq 0x80(%rsp), %r12
movq %r12, %rdi
leaq 0x2918e(%rip), %rsi     # 0x3c7e8
callq 0x6190
testq %r12, %r12
je 0x143b5
addq %rax, %r12
jmp 0x13682
movq %rbx, %rdi
leaq 0x29171(%rip), %rsi     # 0x3c7e8
callq 0x6190
movq %rax, %r12
addq %rbx, %r12
movzbl (%r12), %ebx
cmpl $0x65, %ebx
jg 0x136a2
testl %ebx, %ebx
je 0x135cb
cmpl $0x23, %ebx
je 0x135cb
jmp 0x13c51
cmpl $0x66, %ebx
je 0x1384f
cmpl $0x76, %ebx
jne 0x13c51
movzbl 0x1(%r12), %eax
cmpl $0x6d, %eax
jg 0x139ed
cmpl $0x9, %eax
je 0x136d1
cmpl $0x20, %eax
jne 0x13c51
leaq 0x2(%r12), %rdi
leaq 0x2910b(%rip), %rsi     # 0x3c7e8
callq 0x6190
leaq (%r12,%rax), %rbx
addq $0x2, %rbx
movq %rbx, %rdi
leaq 0x296e9(%rip), %r15     # 0x3cddd
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
leaq 0x290b2(%rip), %r12     # 0x3c7e8
movq %r12, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x148(%rsp), %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %rsp, %r15
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
leaq 0x295fa(%rip), %rsi     # 0x3cddd
callq 0x6060
leaq (%rax,%r14), %rsi
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x148(%rsp)
movq %r14, %rdi
leaq 0x148(%rsp), %r14
movq %r14, %rdx
callq 0x1a505
movq 0x20(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x135cb
cvtsd2ss 0x148(%rsp), %xmm3
cvtsd2ss 0x120(%rsp), %xmm2
cvtsd2ss 0x40(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x48(%rsp), %xmm0
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x135cb
movzbl 0x1(%r12), %eax
cmpl $0x20, %eax
je 0x13863
cmpl $0x9, %eax
jne 0x13c51
leaq 0x2(%r12), %rdi
leaq 0x28f79(%rip), %rsi     # 0x3c7e8
callq 0x6190
movq 0x50(%rsp), %rcx
cmpq %rcx, 0x58(%rsp)
je 0x13885
movq %rcx, 0x58(%rsp)
leaq (%r12,%rax), %r15
addq $0x2, %r15
movzbl (%r15), %eax
cmpl $0xd, %eax
ja 0x138a4
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jb 0x1399f
movq %r15, %rdi
callq 0x65e0
movl %eax, %r12d
movq %r15, %rdi
leaq 0x29523(%rip), %rsi     # 0x3cddc
callq 0x6060
leaq (%r15,%rax), %r13
xorl %ebx, %ebx
cmpb $0x2f, (%r15,%rax)
jne 0x138db
cmpb $0x2f, 0x1(%r13)
jne 0x138e0
addq $0x2, %r13
xorl %r15d, %r15d
jmp 0x1390e
xorl %r15d, %r15d
jmp 0x13938
movq %r13, %r14
incq %r14
movq %r14, %rdi
callq 0x65e0
movl %eax, %r15d
movq %r14, %rdi
leaq 0x294e1(%rip), %rsi     # 0x3cddc
callq 0x6060
leaq (%r14,%rax), %r13
cmpb $0x2f, (%r14,%rax)
jne 0x13930
incq %r13
movq %r13, %r14
movq %r13, %rdi
callq 0x65e0
movl %eax, %ebx
movq %r13, %rdi
leaq 0x294b7(%rip), %rsi     # 0x3cddc
callq 0x6060
movq %rax, %r13
addq %r14, %r13
leaq 0x148(%rsp), %r14
movl %r12d, 0x148(%rsp)
movl %ebx, 0x14c(%rsp)
movl %r15d, 0x150(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x13978
movl 0x150(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x148(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x58(%rsp)
jmp 0x13985
leaq 0x50(%rsp), %rdi
movq %r14, %rdx
callq 0x1c7be
movq %r13, %rdi
leaq 0x2944e(%rip), %rsi     # 0x3cddd
callq 0x6190
movq %rax, %r15
addq %r13, %r15
jmp 0x1388d
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
leaq 0x80(%rsp), %r13
movq %rsp, %r15
je 0x135cb
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
subq %rsi, %rdx
je 0x135cb
sarq $0x2, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x135cb
cmpl $0x6e, %eax
je 0x13b28
cmpl $0x74, %eax
jne 0x13c51
movzbl 0x2(%r12), %eax
cmpl $0x20, %eax
je 0x13a13
cmpl $0x9, %eax
jne 0x13c51
leaq 0x3(%r12), %rdi
leaq 0x28dc9(%rip), %r15     # 0x3c7e8
movq %r15, %rsi
callq 0x6190
leaq (%r12,%rax), %rbx
addq $0x3, %rbx
movq %rbx, %rdi
leaq 0x293a4(%rip), %r12     # 0x3cddd
movq %r12, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %r14, %rdi
leaq 0x148(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %rsp, %r15
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6060
leaq (%rax,%rbx), %rsi
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1a505
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x135cb
cvtsd2ss 0x148(%rsp), %xmm2
cvtsd2ss 0x40(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x48(%rsp), %xmm0
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x135cb
movzbl 0x2(%r12), %eax
cmpl $0x20, %eax
je 0x13b3c
cmpl $0x9, %eax
jne 0x13c51
leaq 0x3(%r12), %rdi
leaq 0x28ca0(%rip), %r15     # 0x3c7e8
movq %r15, %rsi
callq 0x6190
leaq (%r12,%rax), %rbx
addq $0x3, %rbx
movq %rbx, %rdi
leaq 0x2927b(%rip), %r12     # 0x3cddd
movq %r12, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %r14, %rdi
leaq 0x148(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1a505
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %rsp, %r15
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6060
leaq (%rax,%rbx), %rsi
xorl %eax, %eax
movq %rax, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1a505
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x135cb
cvtsd2ss 0x148(%rsp), %xmm2
cvtsd2ss 0x40(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x48(%rsp), %xmm0
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x135cb
movl $0x6, %edx
movq %r12, %rdi
leaq 0x28eec(%rip), %rsi     # 0x3cb4c
callq 0x61c0
testl %eax, %eax
je 0x13df3
movl $0x6, %edx
movq %r12, %rdi
leaq 0x28ed7(%rip), %rsi     # 0x3cb53
callq 0x61c0
testl %eax, %eax
je 0x13e76
cmpl $0x6f, %ebx
je 0x14093
cmpl $0x67, %ebx
jne 0x135cb
movzbl 0x1(%r12), %eax
cmpl $0x20, %eax
je 0x13caf
cmpl $0x9, %eax
jne 0x135cb
movq 0xc0(%rsp), %rbx
movq 0xc8(%rsp), %r14
cmpq %rbx, %r14
je 0x13cff
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x13cdc
movq (%r15), %rsi
incq %rsi
callq 0x6400
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x13cc8
movq %rbx, 0xc8(%rsp)
leaq 0x80(%rsp), %r13
movq %rsp, %r15
leaq 0x148(%rsp), %r14
movzbl (%r12), %eax
cmpl $0xd, %eax
leaq 0x158(%rsp), %rbx
ja 0x13d27
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jb 0x14100
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r12, %rdi
leaq 0x28aa0(%rip), %rsi     # 0x3c7e8
callq 0x6190
addq %rax, %r12
movq %r12, %rdi
leaq 0x29083(%rip), %rsi     # 0x3cddd
callq 0x6060
movq %rax, %r13
addq %r12, %r13
movq %rbx, 0x148(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1b32e
movq %r15, %rdi
movq %r14, %rsi
callq 0x64a0
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x13da3
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x1af16
movq %r13, %rdi
leaq 0x29020(%rip), %rsi     # 0x3cddd
callq 0x6190
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x13de0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
addq %rbx, %r13
movq %r13, %r12
leaq 0x80(%rsp), %r13
jmp 0x13d07
movzbl 0x6(%r12), %eax
cmpl $0x20, %eax
je 0x13e07
cmpl $0x9, %eax
jne 0x13c6d
movq %r14, %rdi
callq 0x62a0
addq $0x7, %r12
movq %r12, %rdi
callq 0x61a0
leaq 0x158(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x6470
movq %r15, %rdi
leaq 0x160(%rsp), %rsi
callq 0x6620
leaq 0x2d0(%rsp), %rdi
movq %r15, %rsi
callq 0x1f666
leaq 0x2d8(%rsp), %rcx
cmpq %rcx, %rax
je 0x141a7
leaq 0x2d0(%rsp), %rdi
movq %r15, %rsi
callq 0x1ad12
movl (%rax), %edx
jmp 0x141ac
movzbl 0x6(%r12), %eax
cmpl $0x20, %eax
je 0x13e8a
cmpl $0x9, %eax
jne 0x13c89
cmpq $0x0, 0xf8(%rsp)
je 0x135cb
addq $0x7, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1a75c
movq %r14, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x133f5
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x13ef7
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0xe0(%rsp), %rax
cmpq 0xe8(%rsp), %rax
je 0x141fe
xorl %ebx, %ebx
xorl %r14d, %r14d
leaq 0x158(%rsp), %rcx
movq %rcx, 0x148(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x150(%rsp)
movb %cl, 0x158(%rsp)
leaq 0x10(%rsp), %rdx
movq %rdx, (%rsp)
movq %rcx, 0x8(%rsp)
movb %cl, 0x10(%rsp)
movq (%rax,%rbx), %rsi
leaq 0x128(%rsp), %r12
movq %r12, %rdi
leaq 0x37(%rsp), %rdx
callq 0x1a75c
movq 0xf8(%rsp), %rdi
movq (%rdi), %rax
movq %r12, %rsi
leaq 0x100(%rsp), %rdx
leaq 0x2d0(%rsp), %rcx
leaq 0x148(%rsp), %r8
movq %r15, %r9
callq *0x10(%rax)
movl %eax, %r12d
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x13fb2
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x6400
cmpq $0x0, 0x38(%rsp)
je 0x13fd9
movq 0x150(%rsp), %rdx
testq %rdx, %rdx
je 0x13fd9
movq 0x148(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x60f0
cmpq $0x0, 0x78(%rsp)
je 0x13ff9
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x13ff9
movq (%rsp), %rsi
movq 0x78(%rsp), %rdi
callq 0x60f0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14014
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x14039
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
testb %r12b, %r12b
jne 0x14229
incq %r14
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %rbx
cmpq %rcx, %r14
jb 0x13f12
cmpq $0x0, 0x38(%rsp)
leaq 0x148(%rsp), %r14
je 0x14277
movq 0x38(%rsp), %rdi
leaq 0x28b13(%rip), %rsi     # 0x3cb9c
callq 0x6750
jmp 0x14277
movzbl 0x1(%r12), %eax
cmpl $0x20, %eax
je 0x140a7
cmpl $0x9, %eax
jne 0x135cb
movq %r14, %rdi
callq 0x62a0
addq $0x2, %r12
movq %r12, %rdi
callq 0x61a0
leaq 0x158(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x6470
movq %r15, %rdi
leaq 0x160(%rsp), %rsi
callq 0x6620
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x141c5
movq (%rsp), %rsi
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x141c5
movq 0xc8(%rsp), %rsi
movq 0xc0(%rsp), %rax
subq %rax, %rsi
je 0x143d4
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x135cb
sarq $0x5, %rsi
cmpq $0x2, %rsi
jb 0x14219
decq %rsi
leaq 0xa0(%rsp), %rdi
callq 0x1b19e
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rcx
movq %rcx, %rdx
subq %rsi, %rdx
je 0x14289
movl $0x20, %eax
xorl %edi, %edi
movq 0xc0(%rsp), %rcx
movq (%rcx,%rax), %rcx
movq %rcx, (%rsi,%rdi,8)
incq %rdi
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rcx
movq %rcx, %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
addq $0x20, %rax
cmpq %rdx, %rdi
jb 0x1416c
jmp 0x1428d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x141c5
movq (%rsp), %rsi
movq 0x28(%rsp), %rdi
callq *%rax
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x141e0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq %r14, %rdi
movq 0x3ad76(%rip), %rsi     # 0x4ef60
callq 0x62e0
movq 0x70(%rsp), %rdi
callq 0x6100
jmp 0x135cb
cmpq $0x0, 0x38(%rsp)
je 0x14277
movq 0x38(%rsp), %rdi
leaq 0x28ad5(%rip), %rsi     # 0x3cce7
callq 0x6750
jmp 0x14277
movq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq *%rax
jmp 0x135cb
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
leaq 0x148(%rsp), %r14
je 0x14277
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rcx
movq %rcx, %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $0x63fb9aeb1fdcd759, %rdi # imm = 0x63FB9AEB1FDCD759
imulq %rdi, %rdx
cmpq %rsi, %rcx
je 0x14403
movq 0x28(%rsp), %rdi
callq *%rax
leaq 0xe0(%rsp), %rdi
callq 0x1ad8e
jmp 0x135cb
sarq $0x3, %rdx
cmpq %rsi, %rcx
je 0x143f3
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
jmp 0x139e1
cmpq $0x0, 0x78(%rsp)
je 0x14300
leaq 0x318(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x6620
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
movq 0x78(%rsp), %rdi
leaq 0x158(%rsp), %rbx
callq 0x60f0
movq 0x148(%rsp), %rdi
cmpq %rbx, %rdi
je 0x14300
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x14325
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x14342
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0xc0(%rsp), %rdi
callq 0x1ad8e
leaq 0x100(%rsp), %rdi
callq 0x1b1d0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14373
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0x2d0(%rsp), %rdi
callq 0x1c56a
movq 0x3abd9(%rip), %rsi     # 0x4ef60
leaq 0x300(%rsp), %rdi
callq 0x62e0
leaq 0x380(%rsp), %rdi
callq 0x6100
movb $0x1, %al
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28468(%rip), %rdi     # 0x3c824
leaq 0x28467(%rip), %rsi     # 0x3c82a
leaq 0x2889f(%rip), %rcx     # 0x3cc69
movl $0xa55, %edx            # imm = 0xA55
callq 0x6250
leaq 0x2894a(%rip), %rdi     # 0x3cd25
leaq 0x28448(%rip), %rsi     # 0x3c82a
leaq 0x28880(%rip), %rcx     # 0x3cc69
movl $0xaf0, %edx            # imm = 0xAF0
callq 0x6250
leaq 0x28a01(%rip), %rdi     # 0x3cdfb
xorl %esi, %esi
xorl %eax, %eax
callq 0x6590
leaq 0x289f1(%rip), %rdi     # 0x3cdfb
xorl %esi, %esi
xorl %eax, %eax
callq 0x6590
jmp 0x14446
jmp 0x14446
jmp 0x14588
jmp 0x14446
jmp 0x14588
jmp 0x14588
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x144b1
jmp 0x144be
movq %rax, %rbx
jmp 0x14530
movq %rax, %rbx
jmp 0x14555
jmp 0x14491
jmp 0x14491
jmp 0x14588
movq %rbx, %rcx
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %rcx, %rdi
je 0x1458b
movq 0x158(%rsp), %rsi
jmp 0x1457c
jmp 0x14588
jmp 0x14588
movq %rax, %rbx
jmp 0x145cd
jmp 0x144a0
jmp 0x14491
movq %rax, %rbx
jmp 0x144be
jmp 0x14588
jmp 0x14588
leaq 0x10(%rsp), %r15
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x144be
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x3aa9b(%rip), %rsi     # 0x4ef60
leaq 0x148(%rsp), %rdi
callq 0x62e0
movq 0x70(%rsp), %rdi
callq 0x6100
jmp 0x1458b
jmp 0x14512
leaq 0x10(%rsp), %r15
movq %rax, %rbx
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x1451a
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0x1451a
leaq 0x10(%rsp), %r15
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x14530
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x14555
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0xe0(%rsp), %rdi
callq 0x1ad8e
jmp 0x1458b
jmp 0x14566
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1458b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0x1458b
jmp 0x14588
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x145b0
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x145cd
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0xc0(%rsp), %rdi
callq 0x1ad8e
leaq 0x100(%rsp), %rdi
callq 0x1b1d0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x145fe
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0x2d0(%rsp), %rdi
callq 0x1c56a
movq 0x3a94e(%rip), %rsi     # 0x4ef60
leaq 0x300(%rsp), %rdi
callq 0x62e0
leaq 0x380(%rsp), %rdi
callq 0x6100
movq %rbx, %rdi
callq 0x66e0