// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::exportGroupsToShape(tinyobj::shape_t*, tinyobj::PrimGroup const&, std::vector<tinyobj::tag_t, std::allocator<tinyobj::tag_t>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, std::vector<float, std::allocator<float>> const&)
static bool exportGroupsToShape(shape_t *shape, const PrimGroup &prim_group,
                                const std::vector<tag_t> &tags,
                                const int material_id, const std::string &name,
                                bool triangulate,
                                const std::vector<real_t> &v) {
  if (prim_group.IsEmpty()) {
    return false;
  }

  shape->name = name;

  // polygon
  if (!prim_group.faceGroup.empty()) {
    // Flatten vertices and indices
    for (size_t i = 0; i < prim_group.faceGroup.size(); i++) {
      const face_t &face = prim_group.faceGroup[i];

      size_t npolys = face.vertex_indices.size();

      if (npolys < 3) {
        // Face must have 3+ vertices.
        continue;
      }

      vertex_index_t i0 = face.vertex_indices[0];
      vertex_index_t i1(-1);
      vertex_index_t i2 = face.vertex_indices[1];

      if (triangulate) {
        // find the two axes to work in
        size_t axes[2] = {1, 2};
        for (size_t k = 0; k < npolys; ++k) {
          i0 = face.vertex_indices[(k + 0) % npolys];
          i1 = face.vertex_indices[(k + 1) % npolys];
          i2 = face.vertex_indices[(k + 2) % npolys];
          size_t vi0 = size_t(i0.v_idx);
          size_t vi1 = size_t(i1.v_idx);
          size_t vi2 = size_t(i2.v_idx);

          if (((3 * vi0 + 2) >= v.size()) || ((3 * vi1 + 2) >= v.size()) ||
              ((3 * vi2 + 2) >= v.size())) {
            // Invalid triangle.
            // FIXME(syoyo): Is it ok to simply skip this invalid triangle?
            continue;
          }
          real_t v0x = v[vi0 * 3 + 0];
          real_t v0y = v[vi0 * 3 + 1];
          real_t v0z = v[vi0 * 3 + 2];
          real_t v1x = v[vi1 * 3 + 0];
          real_t v1y = v[vi1 * 3 + 1];
          real_t v1z = v[vi1 * 3 + 2];
          real_t v2x = v[vi2 * 3 + 0];
          real_t v2y = v[vi2 * 3 + 1];
          real_t v2z = v[vi2 * 3 + 2];
          real_t e0x = v1x - v0x;
          real_t e0y = v1y - v0y;
          real_t e0z = v1z - v0z;
          real_t e1x = v2x - v1x;
          real_t e1y = v2y - v1y;
          real_t e1z = v2z - v1z;
          real_t cx = std::fabs(e0y * e1z - e0z * e1y);
          real_t cy = std::fabs(e0z * e1x - e0x * e1z);
          real_t cz = std::fabs(e0x * e1y - e0y * e1x);
          const real_t epsilon = std::numeric_limits<real_t>::epsilon();
          if (cx > epsilon || cy > epsilon || cz > epsilon) {
            // found a corner
            if (cx > cy && cx > cz) {
            } else {
              axes[0] = 0;
              if (cz > cx && cz > cy) axes[1] = 1;
            }
            break;
          }
        }

        real_t area = 0;
        for (size_t k = 0; k < npolys; ++k) {
          i0 = face.vertex_indices[(k + 0) % npolys];
          i1 = face.vertex_indices[(k + 1) % npolys];
          size_t vi0 = size_t(i0.v_idx);
          size_t vi1 = size_t(i1.v_idx);
          if (((vi0 * 3 + axes[0]) >= v.size()) ||
              ((vi0 * 3 + axes[1]) >= v.size()) ||
              ((vi1 * 3 + axes[0]) >= v.size()) ||
              ((vi1 * 3 + axes[1]) >= v.size())) {
            // Invalid index.
            continue;
          }
          real_t v0x = v[vi0 * 3 + axes[0]];
          real_t v0y = v[vi0 * 3 + axes[1]];
          real_t v1x = v[vi1 * 3 + axes[0]];
          real_t v1y = v[vi1 * 3 + axes[1]];
          area += (v0x * v1y - v0y * v1x) * static_cast<real_t>(0.5);
        }

        face_t remainingFace = face;  // copy
        size_t guess_vert = 0;
        vertex_index_t ind[3];
        real_t vx[3];
        real_t vy[3];

        // How many iterations can we do without decreasing the remaining
        // vertices.
        size_t remainingIterations = face.vertex_indices.size();
        size_t previousRemainingVertices = remainingFace.vertex_indices.size();

        while (remainingFace.vertex_indices.size() > 3 &&
               remainingIterations > 0) {
          npolys = remainingFace.vertex_indices.size();
          if (guess_vert >= npolys) {
            guess_vert -= npolys;
          }

          if (previousRemainingVertices != npolys) {
            // The number of remaining vertices decreased. Reset counters.
            previousRemainingVertices = npolys;
            remainingIterations = npolys;
          } else {
            // We didn't consume a vertex on previous iteration, reduce the
            // available iterations.
            remainingIterations--;
          }

          for (size_t k = 0; k < 3; k++) {
            ind[k] = remainingFace.vertex_indices[(guess_vert + k) % npolys];
            size_t vi = size_t(ind[k].v_idx);
            if (((vi * 3 + axes[0]) >= v.size()) ||
                ((vi * 3 + axes[1]) >= v.size())) {
              // ???
              vx[k] = static_cast<real_t>(0.0);
              vy[k] = static_cast<real_t>(0.0);
            } else {
              vx[k] = v[vi * 3 + axes[0]];
              vy[k] = v[vi * 3 + axes[1]];
            }
          }
          real_t e0x = vx[1] - vx[0];
          real_t e0y = vy[1] - vy[0];
          real_t e1x = vx[2] - vx[1];
          real_t e1y = vy[2] - vy[1];
          real_t cross = e0x * e1y - e0y * e1x;
          // if an internal angle
          if (cross * area < static_cast<real_t>(0.0)) {
            guess_vert += 1;
            continue;
          }

          // check all other verts in case they are inside this triangle
          bool overlap = false;
          for (size_t otherVert = 3; otherVert < npolys; ++otherVert) {
            size_t idx = (guess_vert + otherVert) % npolys;

            if (idx >= remainingFace.vertex_indices.size()) {
              // ???
              continue;
            }

            size_t ovi = size_t(remainingFace.vertex_indices[idx].v_idx);

            if (((ovi * 3 + axes[0]) >= v.size()) ||
                ((ovi * 3 + axes[1]) >= v.size())) {
              // ???
              continue;
            }
            real_t tx = v[ovi * 3 + axes[0]];
            real_t ty = v[ovi * 3 + axes[1]];
            if (pnpoly(3, vx, vy, tx, ty)) {
              overlap = true;
              break;
            }
          }

          if (overlap) {
            guess_vert += 1;
            continue;
          }

          // this triangle is an ear
          {
            index_t idx0, idx1, idx2;
            idx0.vertex_index = ind[0].v_idx;
            idx0.normal_index = ind[0].vn_idx;
            idx0.texcoord_index = ind[0].vt_idx;
            idx1.vertex_index = ind[1].v_idx;
            idx1.normal_index = ind[1].vn_idx;
            idx1.texcoord_index = ind[1].vt_idx;
            idx2.vertex_index = ind[2].v_idx;
            idx2.normal_index = ind[2].vn_idx;
            idx2.texcoord_index = ind[2].vt_idx;

            shape->mesh.indices.push_back(idx0);
            shape->mesh.indices.push_back(idx1);
            shape->mesh.indices.push_back(idx2);

            shape->mesh.num_face_vertices.push_back(3);
            shape->mesh.material_ids.push_back(material_id);
            shape->mesh.smoothing_group_ids.push_back(face.smoothing_group_id);
          }

          // remove v1 from the list
          size_t removed_vert_index = (guess_vert + 1) % npolys;
          while (removed_vert_index + 1 < npolys) {
            remainingFace.vertex_indices[removed_vert_index] =
                remainingFace.vertex_indices[removed_vert_index + 1];
            removed_vert_index += 1;
          }
          remainingFace.vertex_indices.pop_back();
        }

        if (remainingFace.vertex_indices.size() == 3) {
          i0 = remainingFace.vertex_indices[0];
          i1 = remainingFace.vertex_indices[1];
          i2 = remainingFace.vertex_indices[2];
          {
            index_t idx0, idx1, idx2;
            idx0.vertex_index = i0.v_idx;
            idx0.normal_index = i0.vn_idx;
            idx0.texcoord_index = i0.vt_idx;
            idx1.vertex_index = i1.v_idx;
            idx1.normal_index = i1.vn_idx;
            idx1.texcoord_index = i1.vt_idx;
            idx2.vertex_index = i2.v_idx;
            idx2.normal_index = i2.vn_idx;
            idx2.texcoord_index = i2.vt_idx;

            shape->mesh.indices.push_back(idx0);
            shape->mesh.indices.push_back(idx1);
            shape->mesh.indices.push_back(idx2);

            shape->mesh.num_face_vertices.push_back(3);
            shape->mesh.material_ids.push_back(material_id);
            shape->mesh.smoothing_group_ids.push_back(face.smoothing_group_id);
          }
        }
      } else {
        for (size_t k = 0; k < npolys; k++) {
          index_t idx;
          idx.vertex_index = face.vertex_indices[k].v_idx;
          idx.normal_index = face.vertex_indices[k].vn_idx;
          idx.texcoord_index = face.vertex_indices[k].vt_idx;
          shape->mesh.indices.push_back(idx);
        }

        shape->mesh.num_face_vertices.push_back(
            static_cast<unsigned char>(npolys));
        shape->mesh.material_ids.push_back(material_id);  // per face
        shape->mesh.smoothing_group_ids.push_back(
            face.smoothing_group_id);  // per face
      }
    }

    shape->mesh.tags = tags;
  }

  // line
  if (!prim_group.lineGroup.empty()) {
    // Flatten indices
    for (size_t i = 0; i < prim_group.lineGroup.size(); i++) {
      for (size_t j = 0; j < prim_group.lineGroup[i].vertex_indices.size();
           j++) {
        const vertex_index_t &vi = prim_group.lineGroup[i].vertex_indices[j];

        index_t idx;
        idx.vertex_index = vi.v_idx;
        idx.normal_index = vi.vn_idx;
        idx.texcoord_index = vi.vt_idx;

        shape->lines.indices.push_back(idx);
      }

      shape->lines.num_line_vertices.push_back(
          int(prim_group.lineGroup[i].vertex_indices.size()));
    }
  }

  // points
  if (!prim_group.pointsGroup.empty()) {
    // Flatten & convert indices
    for (size_t i = 0; i < prim_group.pointsGroup.size(); i++) {
      for (size_t j = 0; j < prim_group.pointsGroup[i].vertex_indices.size();
           j++) {
        const vertex_index_t &vi = prim_group.pointsGroup[i].vertex_indices[j];

        index_t idx;
        idx.vertex_index = vi.v_idx;
        idx.normal_index = vi.vn_idx;
        idx.texcoord_index = vi.vt_idx;

        shape->points.indices.push_back(idx);
      }
    }
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r9d, %ebp
movq %rdx, %rbx
movq %rdi, %r14
movl %ecx, 0xc(%rsp)
movq (%rsi), %rax
cmpq 0x8(%rsi), %rax
jne 0x12779
movq 0x18(%rsi), %rax
cmpq 0x20(%rsi), %rax
jne 0x12779
movq 0x30(%rsi), %rax
cmpq 0x38(%rsi), %rax
je 0x133c3
movq %rsi, 0x10(%rsp)
movq %r14, %rdi
movq %r8, %rsi
callq 0x6200
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
cmpq 0x8(%rdi), %rax
je 0x13185
movq %rbx, 0xf0(%rsp)
leaq 0x20(%r14), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x38(%r14), %rcx
movq %rcx, 0xb8(%rsp)
leaq 0x50(%r14), %rcx
movq %rcx, 0xb0(%rsp)
leaq 0x68(%r14), %rcx
movq %rcx, 0xa8(%rsp)
xorl %r15d, %r15d
movl %ebp, 0x8c(%rsp)
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rsi
movq 0x10(%rax,%rcx), %rbx
subq %rsi, %rbx
sarq $0x2, %rbx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rbx
cmpq $0x3, %rbx
jb 0x1311e
movq %r15, 0x90(%rsp)
leaq (%rax,%rcx), %rdx
movq %rdx, 0x18(%rsp)
leaq (%rax,%rcx), %r13
addq $0x8, %r13
testb %bpl, %bpl
je 0x12f1d
movq 0x130(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %r8
subq %rdi, %r8
sarq $0x2, %r8
movq %rbx, %r9
negq %r9
movl $0x1, %ecx
movq %rsi, %r10
movq 0x18(%rsp), %rbp
movq %rcx, %r11
movslq (%r10), %r15
incq %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %rbx
leaq (%r15,%r15,2), %rax
addq $0x2, %rax
cmpq %r8, %rax
jae 0x12968
movq %r9, %rax
addq %r11, %rax
cmovneq %r11, %rax
leaq (%rax,%rax,2), %rax
movslq (%rsi,%rax,4), %rax
leaq (%rax,%rax,2), %r12
addq $0x2, %r12
cmpq %r8, %r12
jae 0x12968
leaq (%rdx,%rdx,2), %rdx
movslq (%rsi,%rdx,4), %rdx
leaq (%rdx,%rdx,2), %r12
addq $0x2, %r12
cmpq %r8, %r12
jae 0x12968
leaq (%r15,%r15,2), %r15
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rdx,2), %rdx
movss (%rdi,%rax,4), %xmm4
movss 0x4(%rdi,%rdx,4), %xmm0
movaps %xmm4, %xmm1
subss (%rdi,%r15,4), %xmm1
movsd 0x4(%rdi,%r15,4), %xmm3
movsd 0x4(%rdi,%rax,4), %xmm2
subss %xmm2, %xmm0
shufps $0xd4, %xmm2, %xmm4     # xmm4 = xmm4[0,1],xmm2[1,3]
shufps $0x52, %xmm2, %xmm4     # xmm4 = xmm4[2,0],xmm2[1,1]
subps %xmm3, %xmm2
movss (%rdi,%rdx,4), %xmm5
movss 0x8(%rdi,%rdx,4), %xmm3
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
subps %xmm4, %xmm3
movaps %xmm3, %xmm4
shufps $0x0, %xmm3, %xmm4      # xmm4 = xmm4[0,0],xmm3[0,0]
movss %xmm0, %xmm4            # xmm4 = xmm0[0],xmm4[1,2,3]
mulss %xmm1, %xmm0
shufps $0xd4, %xmm2, %xmm1     # xmm1 = xmm1[0,1],xmm2[1,3]
shufps $0x52, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[1,1]
mulps %xmm1, %xmm4
movaps %xmm2, %xmm1
mulps %xmm3, %xmm1
subps %xmm4, %xmm1
movaps 0x29b66(%rip), %xmm5    # 0x3c490
andps %xmm5, %xmm1
pshufd $0x55, %xmm1, %xmm4     # xmm4 = xmm1[1,1,1,1]
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
mulss %xmm2, %xmm3
subss %xmm3, %xmm0
andps %xmm5, %xmm0
ucomiss 0x29b58(%rip), %xmm0    # 0x3c4a0
ja 0x1313a
ucomiss 0x29b4b(%rip), %xmm1    # 0x3c4a0
ja 0x1313a
ucomiss 0x29b3e(%rip), %xmm4    # 0x3c4a0
ja 0x1313a
leaq (%r9,%r11), %rax
incq %rax
addq $0xc, %r10
cmpq $0x1, %rax
jne 0x12855
movl $0x2, %r12d
movl $0x1, %r15d
xorps %xmm0, %xmm0
movss %xmm0, 0x80(%rsp)
movl $0x1, %eax
movq %rsi, %rcx
movq %r9, %rdx
addq %rax, %rdx
movl $0x0, %r11d
cmovneq %rax, %r11
movslq (%rcx), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rdx,%r15), %r10
cmpq %r8, %r10
jae 0x12a1a
addq %r12, %rdx
cmpq %r8, %rdx
jae 0x12a1a
leaq (%r11,%r11,2), %r11
movslq (%rsi,%r11,4), %r11
leaq (%r11,%r11,2), %r11
leaq (%r11,%r15), %rbx
cmpq %r8, %rbx
jae 0x12a1a
addq %r12, %r11
cmpq %r8, %r11
jae 0x12a1a
movss (%rdi,%r10,4), %xmm0
movss (%rdi,%rbx,4), %xmm1
mulss (%rdi,%rdx,4), %xmm1
mulss (%rdi,%r11,4), %xmm0
subss %xmm1, %xmm0
mulss 0x29840(%rip), %xmm0    # 0x3c244
movss 0x80(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x80(%rsp)
leaq (%r9,%rax), %rdx
incq %rdx
incq %rax
addq $0xc, %rcx
cmpq $0x1, %rdx
jne 0x1299d
movq (%rbp), %rax
movq %rax, 0xd0(%rsp)
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x1b564
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rcx
movq %rcx, %rax
subq %rdi, %rax
movq %rax, %rdx
sarq $0x2, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq $0x4, %rdx
jb 0x12e92
movq 0x10(%rbp), %r13
subq 0x8(%rbp), %r13
je 0x12e92
sarq $0x2, %r13
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r13
movq %rdx, %r9
xorl %ebp, %ebp
movq %rdx, %rbx
cmpq %rdx, %rbp
movq %rdx, %rax
movl $0x0, %edx
cmovbq %rdx, %rax
subq %rax, %rbp
decq %r13
movq 0x130(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %r8
subq %rsi, %r8
sarq $0x2, %r8
leaq 0x50(%rsp), %r10
xorl %r11d, %r11d
leaq (%r11,%rbp), %rax
xorl %edx, %edx
divq %rbx
leaq (%rdx,%rdx,2), %rax
movl 0x8(%rdi,%rax,4), %edx
movl %edx, 0x8(%r10)
movq (%rdi,%rax,4), %rax
movq %rax, (%r10)
cltq
leaq (%rax,%rax,2), %rax
leaq (%rax,%r15), %rdx
cmpq %r8, %rdx
jae 0x12b3f
addq %r12, %rax
cmpq %r8, %rax
jae 0x12b3f
movss (%rsi,%rdx,4), %xmm0
movss %xmm0, 0x9c(%rsp,%r11,4)
movd (%rsi,%rax,4), %xmm0
jmp 0x12b4f
movl $0x0, 0x9c(%rsp,%r11,4)
pxor %xmm0, %xmm0
movd %xmm0, 0xc4(%rsp,%r11,4)
incq %r11
addq $0xc, %r10
cmpq $0x3, %r11
jne 0x12af6
cmpq %rbx, %r9
cmovneq %rbx, %r13
movss 0xa0(%rsp), %xmm0
movss 0xa4(%rsp), %xmm1
subss %xmm0, %xmm1
movaps %xmm0, %xmm2
subss 0x9c(%rsp), %xmm2
movss 0xc8(%rsp), %xmm3
movss 0xcc(%rsp), %xmm0
movaps %xmm0, %xmm4
subss %xmm3, %xmm4
subss 0xc4(%rsp), %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm4
subss %xmm1, %xmm4
mulss 0x80(%rsp), %xmm4
xorps %xmm1, %xmm1
ucomiss %xmm4, %xmm1
jbe 0x12bd6
incq %rbp
jmp 0x12e65
cmpq $0x4, %rbx
jb 0x12cb7
movl $0x3, %r9d
leaq (%r9,%rbp), %rax
xorl %edx, %edx
divq %rbx
leaq (%rdx,%rdx,2), %rax
movslq (%rdi,%rax,4), %rax
leaq (%rax,%rax,2), %rax
leaq (%rax,%r15), %rdx
cmpq %r8, %rdx
jae 0x12cab
addq %r12, %rax
cmpq %r8, %rax
jae 0x12cab
movss (%rsi,%rdx,4), %xmm1
movss (%rsi,%rax,4), %xmm2
movl $0x2, %eax
xorl %r10d, %r10d
movaps %xmm0, %xmm3
xorl %edx, %edx
movq %rax, %r11
movq %r10, %rax
movaps %xmm3, %xmm4
movss 0xc4(%rsp,%r10,4), %xmm3
movaps %xmm2, %xmm5
cmpnltps %xmm4, %xmm5
movaps %xmm2, %xmm6
cmpltps %xmm3, %xmm6
xorps %xmm5, %xmm6
movd %xmm6, %r10d
testb $0x1, %r10b
jne 0x12c99
movss 0x9c(%rsp,%r11,4), %xmm5
movss 0x9c(%rsp,%rax,4), %xmm6
subss %xmm6, %xmm5
movaps %xmm2, %xmm7
subss %xmm3, %xmm7
mulss %xmm5, %xmm7
subss %xmm3, %xmm4
divss %xmm4, %xmm7
addss %xmm6, %xmm7
ucomiss %xmm1, %xmm7
jbe 0x12c99
xorl %r10d, %r10d
testl %edx, %edx
sete %r10b
movl %r10d, %edx
leaq 0x1(%rax), %r10
cmpq $0x3, %r10
jne 0x12c2b
testl %edx, %edx
jne 0x12bce
incq %r9
cmpq %rbx, %r9
jne 0x12be6
movl 0x50(%rsp), %eax
movl 0x5c(%rsp), %ecx
movl %eax, 0x44(%rsp)
movq 0x54(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x48(%rsp)
movl %ecx, 0x38(%rsp)
movq 0x60(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x3c(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x6c(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x30(%rsp)
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x12d29
movl 0x4c(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x44(%rsp), %rax
movq %rax, (%rsi)
movq 0x28(%r14), %rsi
addq $0xc, %rsi
movq %rsi, 0x28(%r14)
jmp 0x12d3c
movq 0x20(%rsp), %rdi
leaq 0x44(%rsp), %rdx
callq 0x1c7be
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x12d5f
movl 0x40(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x38(%rsp), %rax
movq %rax, (%rsi)
movq 0x28(%r14), %rsi
addq $0xc, %rsi
movq %rsi, 0x28(%r14)
jmp 0x12d72
movq 0x20(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x1c7be
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x12d8e
movl 0x34(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x2c(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x28(%r14)
jmp 0x12d9d
movq 0x20(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
callq 0x1c7be
movb $0x3, 0xb(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xb(%rsp), %rsi
callq 0x1b618
movq 0x58(%r14), %rsi
cmpq 0x60(%r14), %rsi
je 0x12dce
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%r14)
jmp 0x12de0
movq 0xb0(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xc0f6
movq 0x70(%r14), %rsi
cmpq 0x78(%r14), %rsi
je 0x12dfd
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x70(%r14)
jmp 0x12e0f
movq 0xa8(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0x1b73e
leaq 0x1(%rbp), %rax
xorl %edx, %edx
divq %rbx
leaq 0x1(%rdx), %rax
cmpq %rbx, %rax
jae 0x12e49
movq 0xd8(%rsp), %rcx
leaq (%rax,%rax,2), %rsi
leaq (%rdx,%rdx,2), %rdx
movl 0x8(%rcx,%rsi,4), %edi
movl %edi, 0x8(%rcx,%rdx,4)
movq (%rcx,%rsi,4), %rsi
movq %rsi, (%rcx,%rdx,4)
movq %rax, %rdx
incq %rax
jmp 0x12e1c
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rcx
addq $-0xc, %rcx
movq %rcx, 0xe0(%rsp)
movq %rcx, %rax
subq %rdi, %rax
movq %rax, %rdx
sarq $0x2, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq $0x4, %rdx
jb 0x12e92
movq %rbx, %r9
testq %r13, %r13
jne 0x12ac0
cmpq $0x24, %rax
jne 0x12fac
movl (%rdi), %eax
movl 0xc(%rdi), %ecx
movl 0x18(%rdi), %edx
movq 0x4(%rdi), %xmm0
movl %eax, 0x44(%rsp)
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x48(%rsp)
movl %ecx, 0x38(%rsp)
movq 0x10(%rdi), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x3c(%rsp)
movl %edx, 0x2c(%rsp)
movq 0x1c(%rdi), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x30(%rsp)
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
movl 0x8c(%rsp), %ebp
movq 0x90(%rsp), %r15
je 0x13016
movl 0x4c(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x44(%rsp), %rax
movq %rax, (%rsi)
movq 0x28(%r14), %rsi
addq $0xc, %rsi
movq %rsi, 0x28(%r14)
jmp 0x13029
movl $0x4, %r15d
movq %rbx, %r12
movq (%r13), %rax
movl -0x4(%rax,%r15), %ecx
movl %ecx, 0x50(%rsp)
movq (%rax,%r15), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x54(%rsp)
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x12f64
movl 0x58(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x50(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x28(%r14)
jmp 0x12f73
movq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x1c7be
addq $0xc, %r15
decq %r12
jne 0x12f26
movb %bl, 0x50(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x1b618
movq 0x58(%r14), %rsi
cmpq 0x60(%r14), %rsi
je 0x12fc0
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%r14)
jmp 0x12fd2
movl 0x8c(%rsp), %ebp
movq 0x90(%rsp), %r15
jmp 0x13104
movq 0xb0(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xc0f6
movq 0x10(%rsp), %rdi
movq 0x90(%rsp), %r15
movq 0x70(%r14), %rsi
cmpq 0x78(%r14), %rsi
je 0x12fff
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x70(%r14)
jmp 0x1311e
movq 0xa8(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0x1b73e
jmp 0x13119
movq 0x20(%rsp), %rdi
leaq 0x44(%rsp), %rdx
callq 0x1c7be
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x1304c
movl 0x40(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x38(%rsp), %rax
movq %rax, (%rsi)
movq 0x28(%r14), %rsi
addq $0xc, %rsi
movq %rsi, 0x28(%r14)
jmp 0x1305f
movq 0x20(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x1c7be
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x1307b
movl 0x34(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x2c(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x28(%r14)
jmp 0x1308a
movq 0x20(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
callq 0x1c7be
movb $0x3, 0xb(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xb(%rsp), %rsi
callq 0x1b618
movq 0x58(%r14), %rsi
cmpq 0x60(%r14), %rsi
je 0x130bb
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%r14)
jmp 0x130cd
movq 0xb0(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xc0f6
movq 0x70(%r14), %rsi
cmpq 0x78(%r14), %rsi
je 0x130ea
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x70(%r14)
jmp 0x130fc
movq 0xa8(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0x1b73e
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x13119
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x10(%rsp), %rdi
incq %r15
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rcx, %r15
jb 0x127da
jmp 0x1316c
ucomiss %xmm0, %xmm1
jbe 0x13148
ucomiss %xmm4, %xmm1
ja 0x1297d
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
cmpltps %xmm0, %xmm1
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
movmskpd %xmm1, %eax
xorl %r12d, %r12d
cmpl $0x3, %eax
setne %r12b
incq %r12
xorl %r15d, %r15d
jmp 0x12989
leaq 0x80(%r14), %rdi
movq 0xf0(%rsp), %rsi
callq 0x1b48e
movq 0x10(%rsp), %rdi
movq 0x18(%rdi), %rax
cmpq 0x20(%rdi), %rax
je 0x132c8
leaq 0x98(%r14), %r15
leaq 0xb0(%r14), %rcx
movq %rcx, 0x80(%rsp)
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %rbp
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rax
subq %rcx, %rax
je 0x13253
movl $0x4, %r12d
xorl %r13d, %r13d
movl -0x4(%rcx,%r12), %eax
movl %eax, 0x50(%rsp)
movq (%rcx,%r12), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x54(%rsp)
movq 0xa0(%r14), %rsi
cmpq 0xa8(%r14), %rsi
je 0x1320d
movl 0x58(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x50(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0xa0(%r14)
jmp 0x1321f
movq %r15, %rdi
leaq 0x50(%rsp), %rdx
callq 0x1c7be
movq 0x10(%rsp), %rdi
incq %r13
movq 0x18(%rdi), %rax
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rax
subq %rcx, %rax
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rax
addq $0xc, %r12
cmpq %rax, %r13
jb 0x131ca
jmp 0x13265
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movl %eax, 0x50(%rsp)
movq 0xb8(%r14), %rsi
cmpq 0xc0(%r14), %rsi
je 0x13288
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb8(%r14)
jmp 0x1329f
movq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x1c366
movq 0x10(%rsp), %rdi
incq %rbx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %rbx
jb 0x131ab
movq 0x30(%rdi), %r8
movq 0x38(%rdi), %rcx
movb $0x1, %al
cmpq %rcx, %r8
je 0x133b1
leaq 0xc8(%r14), %r15
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %rbp
movq (%r8,%rbp,8), %rdx
cmpq %rdx, 0x8(%r8,%rbp,8)
je 0x1338b
movl $0x4, %r13d
xorl %r12d, %r12d
movl -0x4(%rdx,%r13), %eax
movl %eax, 0x50(%rsp)
movq (%rdx,%r13), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x54(%rsp)
movq 0xd0(%r14), %rsi
cmpq 0xd8(%r14), %rsi
je 0x13343
movl 0x58(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x50(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0xd0(%r14)
jmp 0x13355
movq %r15, %rdi
leaq 0x50(%rsp), %rdx
callq 0x1c7be
movq 0x10(%rsp), %rdi
incq %r12
movq 0x30(%rdi), %r8
movq (%r8,%rbp,8), %rdx
movq 0x8(%r8,%rbp,8), %rcx
subq %rdx, %rcx
sarq $0x2, %rcx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rcx
addq $0xc, %r13
cmpq %rcx, %r12
jb 0x13300
movq 0x38(%rdi), %rcx
incq %rbx
movq %rcx, %rdx
subq %r8, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rdx, %rbx
jb 0x132e4
movb $0x1, %al
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x133b1
jmp 0x133cd
jmp 0x133cd
jmp 0x133cd
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x133ed
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq %rbx, %rdi
callq 0x66e0