// File: /workspace/github_cpp_makefile_star2_O1/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, 0x88(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, 0xf0(%rsp)
movq %rdx, %rbx
movq %rsi, 0x20(%rsp)
movq %rdi, 0xf8(%rsp)
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, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq %rax, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rax, 0x10(%rdi)
movaps %xmm0, (%rdi)
movl $0x2, %esi
callq 0x1ba24
leaq 0xb0(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x148(%rsp), %rax
addq $0x80, %rax
movq %rax, 0xe8(%rsp)
leaq 0x50(%rsp), %r15
movq %rbx, 0x28(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x6140
cmpl $-0x1, %eax
je 0x1497a
movq 0xf8(%rsp), %rdi
movq %r15, %rsi
callq 0xef42
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x13cfc
movq 0x50(%rsp), %rcx
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x13cfc
decq %rax
movq %rax, 0x58(%rsp)
movb $0x0, (%rcx,%rax)
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x13d1e
movq 0x50(%rsp), %rcx
cmpb $0xd, -0x1(%rcx,%rax)
jne 0x13d1e
decq %rax
movq %rax, 0x58(%rsp)
movb $0x0, (%rcx,%rax)
cmpq $0x0, 0x58(%rsp)
je 0x13cb4
movq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0x28913(%rip), %rsi     # 0x3c648
callq 0x6190
testq %rbp, %rbp
je 0x14a8b
addq %rax, %rbp
movzbl (%rbp), %ebx
testl %ebx, %ebx
je 0x13cb4
cmpl $0x23, %ebx
je 0x13cb4
cmpl $0x76, %ebx
jne 0x13eda
movzbl 0x1(%rbp), %eax
cmpl $0x20, %eax
je 0x13d76
cmpl $0x9, %eax
jne 0x13eda
leaq 0x2(%rbp), %rdi
leaq 0x288c7(%rip), %r13     # 0x3c648
movq %r13, %rsi
callq 0x6190
leaq (%rax,%rbp), %rbx
addq $0x2, %rbx
movq %rbx, %rdi
leaq 0x28ebb(%rip), %r15     # 0x3cc56
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %ebp, %ebp
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %r12
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
movq %rbp, 0x148(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%r14), %rsi
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x148(%rsp)
movq %r14, %rdi
movq %r12, %rdx
leaq 0x50(%rsp), %r15
callq 0x1ae28
movq 0x20(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x13cb4
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 0x13cb4
cmpl $0x76, %ebx
jne 0x1413e
cmpb $0x6e, 0x1(%rbp)
jne 0x1400c
movzbl 0x2(%rbp), %eax
cmpl $0x20, %eax
je 0x13eff
cmpl $0x9, %eax
jne 0x1400c
leaq 0x3(%rbp), %rdi
leaq 0x2873e(%rip), %r13     # 0x3c648
movq %r13, %rsi
callq 0x6190
leaq (%rax,%rbp), %rbx
addq $0x3, %rbx
movq %rbx, %rdi
leaq 0x28d32(%rip), %r15     # 0x3cc56
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %ebp, %ebp
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %r12
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
movq %rbp, 0x148(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %rsi
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r12, %rdx
leaq 0x50(%rsp), %r15
callq 0x1ae28
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x13cb4
cvtsd2ss 0x148(%rsp), %xmm2
cvtsd2ss 0x40(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x48(%rsp), %xmm0
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x13cb4
cmpl $0x76, %ebx
jne 0x1413e
cmpb $0x74, 0x1(%rbp)
jne 0x1413e
movzbl 0x2(%rbp), %eax
cmpl $0x20, %eax
je 0x14031
cmpl $0x9, %eax
jne 0x1413e
leaq 0x3(%rbp), %rdi
leaq 0x2860c(%rip), %r13     # 0x3c648
movq %r13, %rsi
callq 0x6190
leaq (%rax,%rbp), %rbx
addq $0x3, %rbx
movq %rbx, %rdi
leaq 0x28c00(%rip), %r15     # 0x3cc56
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %r14
xorl %ebp, %ebp
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x148(%rsp), %r12
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%r14), %rbx
movq %rbp, 0x148(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1ae28
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6190
addq %rax, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6060
leaq (%rax,%rbx), %rsi
movq %rbp, 0x148(%rsp)
movq %rbx, %rdi
movq %r12, %rdx
leaq 0x50(%rsp), %r15
callq 0x1ae28
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x13cb4
cvtsd2ss 0x148(%rsp), %xmm2
cvtsd2ss 0x40(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x48(%rsp), %xmm0
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x13cb4
cmpl $0x66, %ebx
jne 0x14295
movzbl 0x1(%rbp), %eax
cmpl $0x20, %eax
je 0x14159
cmpl $0x9, %eax
jne 0x14295
leaq 0x2(%rbp), %rdi
leaq 0x284e4(%rip), %rsi     # 0x3c648
callq 0x6190
movq 0x70(%rsp), %rcx
cmpq %rcx, 0x78(%rsp)
je 0x1417a
movq %rcx, 0x78(%rsp)
leaq (%rax,%rbp), %r12
addq $0x2, %r12
movzbl (%r12), %eax
cmpl $0xd, %eax
ja 0x1419a
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jb 0x144db
movq %r12, %rdi
callq 0x65e0
movl %eax, %ebp
movq %r12, %rdi
leaq 0x28aa7(%rip), %rsi     # 0x3cc55
callq 0x6060
leaq (%r12,%rax), %rbx
xorl %r13d, %r13d
cmpb $0x2f, (%r12,%rax)
jne 0x141d0
cmpb $0x2f, 0x1(%rbx)
jne 0x141d5
addq $0x2, %rbx
xorl %r12d, %r12d
jmp 0x14203
xorl %r12d, %r12d
jmp 0x14226
movq %rbx, %r14
incq %r14
movq %r14, %rdi
callq 0x65e0
movl %eax, %r12d
movq %r14, %rdi
leaq 0x28a65(%rip), %rsi     # 0x3cc55
callq 0x6060
leaq (%r14,%rax), %rbx
cmpb $0x2f, (%r14,%rax)
jne 0x14226
incq %rbx
movq %rbx, %r14
movq %rbx, %rdi
callq 0x65e0
movl %eax, %r13d
movq %rbx, %rdi
leaq 0x28a3a(%rip), %rsi     # 0x3cc55
callq 0x6060
movq %rax, %rbx
addq %r14, %rbx
movl %ebp, 0x148(%rsp)
movl %r13d, 0x14c(%rsp)
movl %r12d, 0x150(%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x14269
movl 0x150(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x148(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x78(%rsp)
jmp 0x1427b
leaq 0x70(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x1d0be
movq %rbx, %rdi
leaq 0x289d1(%rip), %rsi     # 0x3cc56
callq 0x6190
movq %rax, %r12
addq %rbx, %r12
jmp 0x14182
movl $0x6, %edx
movq %rbp, %rdi
leaq 0x2871d(%rip), %rsi     # 0x3c9c1
callq 0x61c0
testl %eax, %eax
je 0x14523
movl $0x6, %edx
movq %rbp, %rdi
leaq 0x28708(%rip), %rsi     # 0x3c9c8
callq 0x61c0
testl %eax, %eax
je 0x145af
cmpl $0x6f, %ebx
je 0x14863
cmpl $0x67, %ebx
jne 0x13cb4
movzbl 0x1(%rbp), %eax
cmpl $0x20, %eax
je 0x142f1
cmpl $0x9, %eax
jne 0x1485a
movq 0xd0(%rsp), %rbx
movq 0xd8(%rsp), %r14
cmpq %rbx, %r14
je 0x14419
leaq 0x10(%rbx), %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x14324
movq (%r12), %rsi
incq %rsi
callq 0x6400
leaq 0x20(%r12), %rax
addq $0x10, %r12
cmpq %r14, %r12
movq %rax, %r12
jne 0x1430e
movq %rbx, 0xd8(%rsp)
leaq 0x50(%rsp), %r15
jmp 0x14419
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x282e0(%rip), %rsi     # 0x3c648
callq 0x6190
addq %rax, %rbp
movq %rbp, %rdi
leaq 0x288dc(%rip), %rsi     # 0x3cc56
callq 0x6060
movq %rax, %rbx
addq %rbp, %rbx
leaq 0x158(%rsp), %r12
movq %r12, 0x148(%rsp)
leaq 0x148(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1bc8a
movq %rsp, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x64a0
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x143d6
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
callq 0x1b884
movq %rbx, %rdi
leaq 0x28866(%rip), %rsi     # 0x3cc56
callq 0x6190
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14413
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
addq %r14, %rbx
movq %rbx, %rbp
movzbl (%rbp), %eax
cmpl $0xd, %eax
ja 0x14347
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jae 0x14347
movq 0xd8(%rsp), %rsi
movq 0xd0(%rsp), %rax
subq %rax, %rsi
je 0x14aaa
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x13cb4
sarq $0x5, %rsi
cmpq $0x2, %rsi
jb 0x1494f
decq %rsi
leaq 0xb0(%rsp), %rdi
callq 0x1bb0c
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rcx
movq %rcx, %rdx
subq %rsi, %rdx
je 0x1495f
movl $0x20, %eax
xorl %edi, %edi
movq 0xd0(%rsp), %rcx
movq (%rcx,%rax), %rcx
movq %rcx, (%rsi,%rdi,8)
incq %rdi
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rcx
movq %rcx, %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
addq $0x20, %rax
cmpq %rdx, %rdi
jb 0x144a0
jmp 0x14963
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
leaq 0x50(%rsp), %r15
je 0x13cb4
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
subq %rsi, %rdx
je 0x13cb4
sarq $0x2, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x13cb4
movzbl 0x6(%rbp), %eax
cmpl $0x20, %eax
je 0x14535
cmpl $0x9, %eax
jne 0x142b1
leaq 0x148(%rsp), %rbx
movq %rbx, %rdi
callq 0x62a0
addq $0x7, %rbp
movq %rbp, %rdi
callq 0x61a0
leaq 0x158(%rsp), %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x6470
movq %rsp, %r14
movq %r14, %rdi
leaq 0x160(%rsp), %rsi
callq 0x6620
leaq 0x2d0(%rsp), %rdi
movq %r14, %rsi
callq 0x20032
leaq 0x2d8(%rsp), %rcx
cmpq %rcx, %rax
je 0x14836
leaq 0x2d0(%rsp), %rdi
movq %r14, %rsi
callq 0x1b682
movl (%rax), %edx
jmp 0x1483b
movzbl 0x6(%rbp), %eax
cmpl $0x20, %eax
je 0x145c1
cmpl $0x9, %eax
jne 0x142cd
cmpq $0x0, 0xf0(%rsp)
je 0x13cb4
addq $0x7, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x148(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %rsp, %rbp
movq %rbp, %rdx
callq 0x1b0cc
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x13ad7
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x14639
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x90(%rsp), %rax
cmpq 0x98(%rsp), %rax
je 0x14924
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x14909
xorl %ebx, %ebx
xorl %r12d, %r12d
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), %r13
movq %r13, %rdi
leaq 0x37(%rsp), %rdx
callq 0x1b0cc
movq 0xf0(%rsp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
leaq 0x100(%rsp), %rdx
leaq 0x2d0(%rsp), %rcx
leaq 0x148(%rsp), %r8
movq %rbp, %r9
callq *0x10(%rax)
movl %eax, %ebp
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x1470c
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x6400
cmpq $0x0, 0x38(%rsp)
je 0x14733
movq 0x150(%rsp), %rdx
testq %rdx, %rdx
je 0x14733
movq 0x148(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x60f0
cmpq $0x0, 0x88(%rsp)
je 0x14759
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x14759
movq (%rsp), %rsi
movq 0x88(%rsp), %rdi
callq 0x60f0
movzbl %r14b, %r14d
testb %bpl, %bpl
movl $0x1, %eax
cmovnel %eax, %r14d
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14784
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x147a9
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
testb %bpl, %bpl
movq %rsp, %rbp
jne 0x147d8
incq %r12
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %rbx
cmpq %rcx, %r12
jb 0x1466d
testb $0x1, %r14b
leaq 0x50(%rsp), %r15
je 0x14909
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x1493d
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 0x14ad9
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x1493d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x148cd
movq (%rsp), %rsi
movq 0x28(%rsp), %rdi
callq *%rax
jmp 0x148cd
cmpl $0x6f, %ebx
jne 0x13cb4
movzbl 0x1(%rbp), %eax
cmpl $0x20, %eax
je 0x14875
cmpl $0x9, %eax
jne 0x13cb4
leaq 0x148(%rsp), %rbx
movq %rbx, %rdi
callq 0x62a0
addq $0x2, %rbp
movq %rbp, %rdi
callq 0x61a0
leaq 0x158(%rsp), %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x6470
movq %rsp, %rdi
leaq 0x160(%rsp), %rsi
callq 0x6620
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x148cd
movq (%rsp), %rsi
movq 0x28(%rsp), %rdi
callq *%rax
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x148e8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq %rbx, %rdi
movq 0x3a66e(%rip), %rsi     # 0x4ef60
callq 0x62e0
movq 0xe8(%rsp), %rdi
callq 0x6100
jmp 0x13cb4
cmpq $0x0, 0x38(%rsp)
je 0x1493d
movq 0x38(%rsp), %rdi
leaq 0x280f4(%rip), %rsi     # 0x3ca11
callq 0x6750
jmp 0x1493d
cmpq $0x0, 0x38(%rsp)
je 0x1493d
movq 0x38(%rsp), %rdi
leaq 0x28224(%rip), %rsi     # 0x3cb5c
callq 0x6750
leaq 0x90(%rsp), %rdi
callq 0x1b6fe
jmp 0x13cb4
movq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq *%rax
jmp 0x13cb4
sarq $0x3, %rdx
cmpq %rsi, %rcx
je 0x14ac9
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
jmp 0x14517
cmpq $0x0, 0x88(%rsp)
je 0x149dc
leaq 0x318(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x6620
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
movq 0x88(%rsp), %rdi
callq 0x60f0
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x149dc
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x149f8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x14a15
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0xd0(%rsp), %rdi
callq 0x1b6fe
leaq 0x100(%rsp), %rdi
callq 0x1bb3e
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x14a49
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0x2d0(%rsp), %rdi
callq 0x1ce82
movq 0x3a503(%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 0x27c03(%rip), %rdi     # 0x3c695
leaq 0x27c02(%rip), %rsi     # 0x3c69b
leaq 0x2803e(%rip), %rcx     # 0x3cade
movl $0xa55, %edx            # imm = 0xA55
callq 0x6250
leaq 0x280e9(%rip), %rdi     # 0x3cb9a
leaq 0x27be3(%rip), %rsi     # 0x3c69b
leaq 0x2801f(%rip), %rcx     # 0x3cade
movl $0xaf0, %edx            # imm = 0xAF0
callq 0x6250
leaq 0x281a4(%rip), %rdi     # 0x3cc74
xorl %esi, %esi
xorl %eax, %eax
callq 0x6590
leaq 0x28194(%rip), %rdi     # 0x3cc74
xorl %esi, %esi
xorl %eax, %eax
callq 0x6590
jmp 0x14b03
jmp 0x14b03
jmp 0x14c4d
jmp 0x14b03
jmp 0x14c4d
jmp 0x14b62
movq %rax, %rbx
jmp 0x14bf5
movq %rax, %rbx
jmp 0x14c1a
jmp 0x14b4b
jmp 0x14b4b
jmp 0x14c4d
movq %rax, %rbx
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x14c50
movq 0x158(%rsp), %rsi
jmp 0x14c41
jmp 0x14c4d
jmp 0x14c4d
jmp 0x14b62
jmp 0x14b4b
movq %rax, %rbx
jmp 0x14b80
jmp 0x14c4d
movq %rax, %rbx
jmp 0x14c89
jmp 0x14c4d
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14b80
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x3a3d9(%rip), %rsi     # 0x4ef60
leaq 0x148(%rsp), %rdi
callq 0x62e0
leaq 0x1c8(%rsp), %rdi
callq 0x6100
jmp 0x14c50
jmp 0x14bd7
jmp 0x14c4d
movq %rax, %rbx
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x14bda
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0x14bda
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14bf5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x14c1a
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0x90(%rsp), %rdi
callq 0x1b6fe
jmp 0x14c50
jmp 0x14c2b
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14c50
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0x14c50
jmp 0x14c4d
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x14c6c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x14c89
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0xd0(%rsp), %rdi
callq 0x1b6fe
leaq 0x100(%rsp), %rdi
callq 0x1bb3e
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x14cbd
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
leaq 0x2d0(%rsp), %rdi
callq 0x1ce82
movq 0x3a28f(%rip), %rsi     # 0x4ef60
leaq 0x300(%rsp), %rdi
callq 0x62e0
leaq 0x380(%rsp), %rdi
callq 0x6100
movq %rbx, %rdi
callq 0x66e0
nop