// File: tomfunkhouser[P]gaps/apps/msh2prp/msh2prp.cpp
// Function: ComputeCurvatureProperties(gaps::R3Mesh*)
static R3MeshPropertySet *
ComputeCurvatureProperties(R3Mesh *mesh)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Computing curvature properties ...\n");
    fflush(stdout);
  }

  // Allocate property set
  R3MeshPropertySet *properties = new R3MeshPropertySet(mesh);
  if (!properties) {
    RNFail("Unable to allocate property set.\n");
    return NULL;
  }

  // Allocate properites
  R3MeshProperty *gauss = new R3MeshProperty(mesh, "GaussCurvature");
  R3MeshProperty *mean = new R3MeshProperty(mesh, "MeanCurvature");
  R3MeshProperty *min = new R3MeshProperty(mesh, "MinCurvature");
  R3MeshProperty *max = new R3MeshProperty(mesh, "MaxCurvature");

  // Get convenient variables
  int nf = mesh->NFaces();
  int nv = mesh->NVertices();

  // Compute Vertex Area
  double *pointareas = new double [ nv ];
  R3Vector *cornerareas = new R3Vector [ nf ];
  for (int i = 0; i < nf; i++) {
    // Edges
    R3MeshFace * face = mesh->Face(i);
    R3MeshVertex * vertex[3];
    vertex[0] = mesh->VertexOnFace(face, 0);
    vertex[1] = mesh->VertexOnFace(face, 1);
    vertex[2] = mesh->VertexOnFace(face, 2);
    R3Vector e[3];
    e[0] = mesh->VertexPosition(vertex[2]) - mesh->VertexPosition(vertex[1]);
    e[1] = mesh->VertexPosition(vertex[0]) - mesh->VertexPosition(vertex[2]);
    e[2] = mesh->VertexPosition(vertex[1]) - mesh->VertexPosition(vertex[0]);
    // Compute corner weights
    R3Vector rcross = e[0] % e[1];
    RNScalar area = 0.5 * rcross.Length();
    RNScalar l2[3] = { e[0].Dot(e[0]), e[1].Dot(e[1]), e[2].Dot(e[2]) };
    RNScalar ew[3] = { l2[0] * (l2[1] + l2[2] - l2[0]),
                       l2[1] * (l2[2] + l2[0] - l2[1]),
                       l2[2] * (l2[0] + l2[1] - l2[2]) };
    RNScalar dot01 = e[0].Dot(e[1]);
    RNScalar dot02 = e[0].Dot(e[2]);
    RNScalar dot12 = e[1].Dot(e[2]);
    if (ew[0] <= 0.0) {
      cornerareas[i][1] = (RNIsNotZero(dot02)) ? -0.25 * l2[2] * area / dot02 : 0;
      cornerareas[i][2] = (RNIsNotZero(dot01)) ? -0.25 * l2[1] * area / dot02 : 0;
      cornerareas[i][0] = area - cornerareas[i][1] - cornerareas[i][2];
    } 
    else if (ew[1] <= 0.0) {
      cornerareas[i][2] = (RNIsNotZero(dot01)) ? -0.25 * l2[0] * area / dot01 : 0;
      cornerareas[i][0] = (RNIsNotZero(dot12)) ? -0.25 * l2[2] * area / dot12 : 0;
      cornerareas[i][1] = area - cornerareas[i][2] - cornerareas[i][0];
    } 
    else if (ew[2] <= 0.0) {
      cornerareas[i][0] = (RNIsNotZero(dot12)) ? -0.25 * l2[1] * area / dot12 : 0;
      cornerareas[i][1] = (RNIsNotZero(dot02)) ? -0.25 * l2[0] * area / dot02 : 0;
      cornerareas[i][2] = area - cornerareas[i][0] - cornerareas[i][1];
    } 
    else {
      double ewsum = ew[0] + ew[1] + ew[2];
      double ewscale = (RNIsNotZero(ewsum)) ? 0.5 * area / ewsum : 0;
      for (int j = 0; j < 3; j++)
        cornerareas[i][j] = ewscale * (ew[(j+1)%3] + ew[(j+2)%3]);
    }
    pointareas[mesh->VertexID(vertex[0])] += cornerareas[i][0];
    pointareas[mesh->VertexID(vertex[1])] += cornerareas[i][1];
    pointareas[mesh->VertexID(vertex[2])] += cornerareas[i][2];
  }

  RNScalar *curv1 = new RNScalar [nv];
  RNScalar *curv2 = new RNScalar [nv];
  RNScalar *curv12 = new RNScalar [nv];
  R3Vector *pdir1 = new R3Vector [nv];
  R3Vector *pdir2 = new R3Vector [nv];

  // Set up an initial coordinate system per vertex
  for (int i = 0; i < nf; i++) {
    R3MeshFace * face = mesh->Face(i);
    R3MeshVertex * vertex[3];
    vertex[0] = mesh->VertexOnFace(face, 0);
    vertex[1] = mesh->VertexOnFace(face, 1);
    vertex[2] = mesh->VertexOnFace(face, 2);
    pdir1[mesh->VertexID(vertex[0])] = mesh->VertexPosition(vertex[1]) -
      mesh->VertexPosition(vertex[0]);
    pdir1[mesh->VertexID(vertex[1])] = mesh->VertexPosition(vertex[2]) -
      mesh->VertexPosition(vertex[1]);
    pdir1[mesh->VertexID(vertex[2])] = mesh->VertexPosition(vertex[0]) -
      mesh->VertexPosition(vertex[2]);
  }

  for (int i = 0; i < nv; i++) {
    R3MeshVertex * vertex = mesh->Vertex(i);
    pdir1[i] = pdir1[i] % mesh->VertexNormal(vertex);
    pdir1[i].Normalize();
    pdir2[i] = mesh->VertexNormal(vertex) % pdir1[i];
  }

  // Compute curvature per-face
  for (int i = 0; i < nf; i++) {
    R3MeshFace * face = mesh->Face(i);
    R3MeshVertex * vertex[3];
    vertex[0] = mesh->VertexOnFace(face, 0);
    vertex[1] = mesh->VertexOnFace(face, 1);
    vertex[2] = mesh->VertexOnFace(face, 2);
    // Edges
    R3Vector e[3];
    e[0] = mesh->VertexPosition(vertex[2]) - mesh->VertexPosition(vertex[1]);
    e[1] = mesh->VertexPosition(vertex[0]) - mesh->VertexPosition(vertex[2]);
    e[2] = mesh->VertexPosition(vertex[1]) - mesh->VertexPosition(vertex[0]);
    // N-T-B coordinate system per face
    R3Vector t = e[0];
    t.Normalize();
    R3Vector n = e[0] % e[1];
    R3Vector b = n % t;
    b.Normalize();

    // Estimate curvature based on variation of normals along edges
    RNScalar m[3] = { 0.0, 0.0, 0.0 };
    RNScalar w[3][3] = { {0,0,0}, {0,0,0}, {0,0,0} };
    for (int j = 0; j < 3; j++) {
      RNScalar u = e[j].Dot(t);
      RNScalar v = e[j].Dot(b);
      w[0][0] += u*u;
      w[0][1] += u*v;
      w[2][2] += v*v;
      R3Vector dn = mesh->VertexNormal(vertex[(j+2)%3]) -
        mesh->VertexNormal(vertex[(j+1)%3]);
      RNScalar dnu = dn.Dot(t);
      RNScalar dnv = dn.Dot(b);
      m[0] += dnu*u;
      m[1] += dnu*v + dnv*u;
      m[2] += dnv*v;
    }
    w[1][1] = w[0][0] + w[2][2];
    w[1][2] = w[0][1];
    w[1][0] = w[0][1];
    w[2][1] = w[1][2];
    RNScalar * matrix_a = new RNScalar[9];
    for (int kk=0; kk<9; kk++) {
      matrix_a[kk] = w[kk/3][kk%3];
    }
    RNScalar * bp = new RNScalar[3];
    bp[0]=m[0];bp[1]=m[1];bp[2]=m[2];
    RNSvdSolve(3, 3, matrix_a, bp, m, 0.0);
    delete[] matrix_a;
    delete[] bp;
    // Push it back out to the vertices
    for (int j = 0; j < 3; j++) {
      int vj = mesh->VertexID(vertex[j]);
      RNScalar c1, c12, c2;
      proj_curv(t, b, m[0], m[1], m[2], pdir1[vj], pdir2[vj], c1, c12, c2);
      RNScalar wt = (pointareas[vj] > 0) ? cornerareas[i][j] / pointareas[vj] : 1;
      curv1[vj]  += wt * c1;
      curv12[vj] += wt * c12;
      curv2[vj]  += wt * c2;
    }
  }

  for (int i = 0; i < nv; i++) {
    R3MeshVertex * vertex = mesh->Vertex(i);
    R3Vector normal = mesh->VertexNormal(vertex);
    diagonalize_curv(pdir1[i], pdir2[i],
                     curv1[i], curv12[i], curv2[i],
                     normal, pdir1[i], pdir2[i],
                     curv1[i], curv2[i]);
    gauss->SetVertexValue(i, curv1[i] * curv2[i]);
    mean->SetVertexValue(i, (curv1[i] + curv2[i])/2);
    max->SetVertexValue(i, curv1[i]);
    min->SetVertexValue(i, curv2[i]);
  }

  // Insert properties at multiple scales
  InsertProperty(properties, gauss);
  InsertProperty(properties, mean);
  InsertProperty(properties, max);
  InsertProperty(properties, min);

  // Delete temporary memory
  delete [] pointareas;
  delete [] cornerareas;
  delete [] curv1;
  delete [] curv2;
  delete [] curv12;
  delete [] pdir1;
  delete [] pdir2;

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Properties = %d\n", properties->NProperties());
    fflush(stdout);
  }

  // Return property set
  return properties;
}

// Assembly:
subq $0x758, %rsp            # imm = 0x758
movq %rdi, 0x748(%rsp)
leaq 0x738(%rsp), %rdi
callq 0xe98e0
leaq 0x738(%rsp), %rdi
callq 0x1f280
cmpl $0x0, 0x1b42c0(%rip)    # 0x1ca740
je 0x1649f
leaq 0x15de9e(%rip), %rdi    # 0x174327
movb $0x0, %al
callq 0x11090
movq 0x1aaaf9(%rip), %rax    # 0x1c0f90
movq (%rax), %rdi
callq 0x117f0
movl $0x18, %edi
callq 0x11680
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x2a0(%rsp)
movq 0x748(%rsp), %rsi
callq 0x24ce0
jmp 0x164c6
movq 0x2a0(%rsp), %rax
movq %rax, 0x730(%rsp)
cmpq $0x0, 0x730(%rsp)
jne 0x1652b
leaq 0x15dd6e(%rip), %rdi    # 0x174256
movb $0x0, %al
callq 0xedb00
movq $0x0, 0x750(%rsp)
jmp 0x186bb
movq 0x2a0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
movl $0x18, %esi
callq 0x11690
jmp 0x186cb
movl $0x448, %edi            # imm = 0x448
callq 0x11680
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x298(%rsp)
movq 0x748(%rsp), %rsi
leaq 0x15ddf9(%rip), %rdx    # 0x17434b
xorl %eax, %eax
movl %eax, %ecx
callq 0x27ef0
jmp 0x1655d
movq 0x298(%rsp), %rax
movq %rax, 0x718(%rsp)
movl $0x448, %edi            # imm = 0x448
callq 0x11680
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x290(%rsp)
movq 0x748(%rsp), %rsi
leaq 0x15ddc6(%rip), %rdx    # 0x17435a
xorl %eax, %eax
movl %eax, %ecx
callq 0x27ef0
jmp 0x1659f
movq 0x290(%rsp), %rax
movq %rax, 0x710(%rsp)
movl $0x448, %edi            # imm = 0x448
callq 0x11680
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x288(%rsp)
movq 0x748(%rsp), %rsi
leaq 0x15dd92(%rip), %rdx    # 0x174368
xorl %eax, %eax
movl %eax, %ecx
callq 0x27ef0
jmp 0x165e1
movq 0x288(%rsp), %rax
movq %rax, 0x708(%rsp)
movl $0x448, %edi            # imm = 0x448
callq 0x11680
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x280(%rsp)
movq 0x748(%rsp), %rsi
leaq 0x15dd5d(%rip), %rdx    # 0x174375
xorl %eax, %eax
movl %eax, %ecx
callq 0x27ef0
jmp 0x16623
movq 0x280(%rsp), %rax
movq %rax, 0x700(%rsp)
movq 0x748(%rsp), %rdi
callq 0x1f2a0
movl %eax, 0x6fc(%rsp)
movq 0x748(%rsp), %rdi
callq 0x1f2e0
movl %eax, 0x6f8(%rsp)
movslq 0x6f8(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x11040
movq %rax, 0x6f0(%rsp)
movslq 0x6fc(%rsp), %rax
movq %rax, 0x270(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x268(%rsp)
callq 0x11040
movq %rax, %rcx
movq 0x270(%rsp), %rax
movq %rcx, 0x278(%rsp)
cmpq $0x0, %rax
je 0x16740
movq 0x278(%rsp), %rax
movq 0x270(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x258(%rsp)
movq %rax, 0x260(%rsp)
movq 0x260(%rsp), %rdi
movq %rdi, 0x250(%rsp)
callq 0x89430
jmp 0x1671f
movq 0x258(%rsp), %rcx
movq 0x250(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x260(%rsp)
jne 0x16708
movq 0x278(%rsp), %rax
movq %rax, 0x6e8(%rsp)
movl $0x0, 0x6e4(%rsp)
movl 0x6e4(%rsp), %eax
cmpl 0x6fc(%rsp), %eax
jge 0x17475
movq 0x748(%rsp), %rdi
movl 0x6e4(%rsp), %esi
callq 0x1f640
movq %rax, 0x6d8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6d8(%rsp), %rsi
xorl %edx, %edx
callq 0x1f670
movq %rax, 0x6c0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6d8(%rsp), %rsi
movl $0x1, %edx
callq 0x1f670
movq %rax, 0x6c8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6d8(%rsp), %rsi
movl $0x2, %edx
callq 0x1f670
movq %rax, 0x6d0(%rsp)
leaq 0x670(%rsp), %rax
movq %rax, %rcx
addq $0x48, %rcx
movq %rcx, 0x240(%rsp)
movq %rax, 0x248(%rsp)
movq 0x248(%rsp), %rdi
movq %rdi, 0x238(%rsp)
callq 0x89430
movq 0x238(%rsp), %rax
movq 0x240(%rsp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x248(%rsp)
jne 0x1680d
movq 0x748(%rsp), %rdi
movq 0x6d0(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x220(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6c8(%rsp), %rsi
callq 0x1f4b0
movq 0x220(%rsp), %rsi
movq %rax, %rdx
leaq 0x658(%rsp), %rdi
callq 0x88640
leaq 0x670(%rsp), %rdi
leaq 0x658(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x6c0(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x228(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6d0(%rsp), %rsi
callq 0x1f4b0
movq 0x228(%rsp), %rsi
movq %rax, %rdx
leaq 0x640(%rsp), %rdi
callq 0x88640
leaq 0x670(%rsp), %rdi
addq $0x18, %rdi
leaq 0x640(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x6c8(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x230(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6c0(%rsp), %rsi
callq 0x1f4b0
movq 0x230(%rsp), %rsi
movq %rax, %rdx
leaq 0x628(%rsp), %rdi
callq 0x88640
leaq 0x670(%rsp), %rdi
addq $0x30, %rdi
leaq 0x628(%rsp), %rsi
callq 0x8a100
leaq 0x670(%rsp), %rsi
leaq 0x670(%rsp), %rdx
addq $0x18, %rdx
leaq 0x610(%rsp), %rdi
callq 0x8a280
leaq 0x610(%rsp), %rdi
callq 0x89620
movaps %xmm0, %xmm1
movsd 0x15d67f(%rip), %xmm0   # 0x174020
mulsd %xmm1, %xmm0
movsd %xmm0, 0x608(%rsp)
leaq 0x670(%rsp), %rdi
leaq 0x670(%rsp), %rsi
callq 0x89a50
movsd %xmm0, 0x5f0(%rsp)
leaq 0x670(%rsp), %rdi
addq $0x18, %rdi
leaq 0x670(%rsp), %rsi
addq $0x18, %rsi
callq 0x89a50
movsd %xmm0, 0x5f8(%rsp)
leaq 0x670(%rsp), %rdi
addq $0x30, %rdi
leaq 0x670(%rsp), %rsi
addq $0x30, %rsi
callq 0x89a50
movsd %xmm0, 0x600(%rsp)
movsd 0x5f0(%rsp), %xmm0
movsd 0x5f8(%rsp), %xmm1
addsd 0x600(%rsp), %xmm1
subsd 0x5f0(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5d0(%rsp)
movsd 0x5f8(%rsp), %xmm0
movsd 0x600(%rsp), %xmm1
addsd 0x5f0(%rsp), %xmm1
subsd 0x5f8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5d8(%rsp)
movsd 0x600(%rsp), %xmm0
movsd 0x5f0(%rsp), %xmm1
addsd 0x5f8(%rsp), %xmm1
subsd 0x600(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5e0(%rsp)
leaq 0x670(%rsp), %rdi
leaq 0x670(%rsp), %rsi
addq $0x18, %rsi
callq 0x89a50
movsd %xmm0, 0x5c8(%rsp)
leaq 0x670(%rsp), %rdi
leaq 0x670(%rsp), %rsi
addq $0x30, %rsi
callq 0x89a50
movsd %xmm0, 0x5c0(%rsp)
leaq 0x670(%rsp), %rdi
addq $0x18, %rdi
leaq 0x670(%rsp), %rsi
addq $0x30, %rsi
callq 0x89a50
movsd %xmm0, 0x5b8(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x5d0(%rsp), %xmm0
jb 0x16de5
movsd 0x5c0(%rsp), %xmm0
leaq 0x1b3b59(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x16b73
movsd 0x15d4db(%rip), %xmm0   # 0x174028
mulsd 0x600(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5c0(%rsp), %xmm0
movsd %xmm0, 0x218(%rsp)
jmp 0x16b81
xorps %xmm0, %xmm0
movsd %xmm0, 0x218(%rsp)
jmp 0x16b81
movsd 0x218(%rsp), %xmm0
movsd %xmm0, 0x210(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd 0x210(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x5c8(%rsp), %xmm0
leaq 0x1b3abf(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x16c0d
movsd 0x15d441(%rip), %xmm0   # 0x174028
mulsd 0x5f8(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5c0(%rsp), %xmm0
movsd %xmm0, 0x208(%rsp)
jmp 0x16c1b
xorps %xmm0, %xmm0
movsd %xmm0, 0x208(%rsp)
jmp 0x16c1b
movsd 0x208(%rsp), %xmm0
movsd %xmm0, 0x1e8(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd 0x1e8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x608(%rsp), %xmm0
movsd %xmm0, 0x1f0(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd 0x1f0(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x1f8(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd 0x1f8(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x200(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd 0x200(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x17309
movq 0x298(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
movl $0x448, %esi            # imm = 0x448
callq 0x11690
jmp 0x186cb
movq 0x290(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
movl $0x448, %esi            # imm = 0x448
callq 0x11690
jmp 0x186cb
movq 0x288(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
movl $0x448, %esi            # imm = 0x448
callq 0x11690
jmp 0x186cb
movq 0x280(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
movl $0x448, %esi            # imm = 0x448
callq 0x11690
jmp 0x186cb
movq 0x268(%rsp), %rsi
movq 0x278(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
callq 0x11d00
jmp 0x186cb
xorps %xmm0, %xmm0
ucomisd 0x5d8(%rsp), %xmm0
jb 0x16fd8
movsd 0x5c8(%rsp), %xmm0
leaq 0x1b3889(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x16e43
movsd 0x15d20b(%rip), %xmm0   # 0x174028
mulsd 0x5f0(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5c8(%rsp), %xmm0
movsd %xmm0, 0x1e0(%rsp)
jmp 0x16e51
xorps %xmm0, %xmm0
movsd %xmm0, 0x1e0(%rsp)
jmp 0x16e51
movsd 0x1e0(%rsp), %xmm0
movsd %xmm0, 0x1d8(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd 0x1d8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x5b8(%rsp), %xmm0
leaq 0x1b37ef(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x16edd
movsd 0x15d171(%rip), %xmm0   # 0x174028
mulsd 0x600(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5b8(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rsp)
jmp 0x16eeb
xorps %xmm0, %xmm0
movsd %xmm0, 0x1d0(%rsp)
jmp 0x16eeb
movsd 0x1d0(%rsp), %xmm0
movsd %xmm0, 0x1b0(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd 0x1b0(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x608(%rsp), %xmm0
movsd %xmm0, 0x1b8(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd 0x1b8(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x1c0(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd 0x1c0(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x1c8(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd 0x1c8(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x17307
xorps %xmm0, %xmm0
ucomisd 0x5e0(%rsp), %xmm0
jb 0x171cb
movsd 0x5b8(%rsp), %xmm0
leaq 0x1b3696(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x17036
movsd 0x15d018(%rip), %xmm0   # 0x174028
mulsd 0x5f8(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5b8(%rsp), %xmm0
movsd %xmm0, 0x1a8(%rsp)
jmp 0x17044
xorps %xmm0, %xmm0
movsd %xmm0, 0x1a8(%rsp)
jmp 0x17044
movsd 0x1a8(%rsp), %xmm0
movsd %xmm0, 0x1a0(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd 0x1a0(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x5c0(%rsp), %xmm0
leaq 0x1b35ff(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x170cd
movsd 0x15cf81(%rip), %xmm0   # 0x174028
mulsd 0x5f0(%rsp), %xmm0
mulsd 0x608(%rsp), %xmm0
divsd 0x5c0(%rsp), %xmm0
movsd %xmm0, 0x198(%rsp)
jmp 0x170db
xorps %xmm0, %xmm0
movsd %xmm0, 0x198(%rsp)
jmp 0x170db
movsd 0x198(%rsp), %xmm0
movsd %xmm0, 0x178(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd 0x178(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x608(%rsp), %xmm0
movsd %xmm0, 0x180(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd 0x180(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x188(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd 0x188(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0x190(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd 0x190(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x17305
movsd 0x5d0(%rsp), %xmm0
addsd 0x5d8(%rsp), %xmm0
addsd 0x5e0(%rsp), %xmm0
movsd %xmm0, 0x5b0(%rsp)
movsd 0x5b0(%rsp), %xmm0
leaq 0x1b3491(%rip), %rax    # 0x1ca690
movsd (%rax), %xmm1
callq 0x1f690
cmpl $0x0, %eax
je 0x17232
movsd 0x15ce0b(%rip), %xmm0   # 0x174020
mulsd 0x608(%rsp), %xmm0
divsd 0x5b0(%rsp), %xmm0
movsd %xmm0, 0x170(%rsp)
jmp 0x17240
xorps %xmm0, %xmm0
movsd %xmm0, 0x170(%rsp)
jmp 0x17240
movsd 0x170(%rsp), %xmm0
movsd %xmm0, 0x5a8(%rsp)
movl $0x0, 0x5a4(%rsp)
cmpl $0x3, 0x5a4(%rsp)
jge 0x17303
movsd 0x5a8(%rsp), %xmm0
movl 0x5a4(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movsd 0x5d0(%rsp,%rax,8), %xmm1
movl 0x5a4(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %edx, %rax
addsd 0x5d0(%rsp,%rax,8), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x168(%rsp)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl 0x5a4(%rsp), %esi
callq 0x1f6f0
movsd 0x168(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x5a4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5a4(%rsp)
jmp 0x1725d
jmp 0x17305
jmp 0x17307
jmp 0x17309
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x1f6f0
movsd (%rax), %xmm0
movsd %xmm0, 0x138(%rsp)
movq 0x6f0(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6c0(%rsp), %rsi
callq 0x1f3b0
movsd 0x138(%rsp), %xmm0
movl %eax, %ecx
movq 0x140(%rsp), %rax
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0x1f6f0
movsd (%rax), %xmm0
movsd %xmm0, 0x148(%rsp)
movq 0x6f0(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6c8(%rsp), %rsi
callq 0x1f3b0
movsd 0x148(%rsp), %xmm0
movl %eax, %ecx
movq 0x150(%rsp), %rax
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x6e8(%rsp), %rdi
movslq 0x6e4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x2, %esi
callq 0x1f6f0
movsd (%rax), %xmm0
movsd %xmm0, 0x158(%rsp)
movq 0x6f0(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x748(%rsp), %rdi
movq 0x6d0(%rsp), %rsi
callq 0x1f3b0
movsd 0x158(%rsp), %xmm0
movl %eax, %ecx
movq 0x160(%rsp), %rax
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x6e4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6e4(%rsp)
jmp 0x1675b
movslq 0x6f8(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x11040
movq %rax, 0x598(%rsp)
movslq 0x6f8(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x11040
movq %rax, 0x590(%rsp)
movslq 0x6f8(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x11040
movq %rax, 0x588(%rsp)
movslq 0x6f8(%rsp), %rax
movq %rax, 0x128(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x120(%rsp)
callq 0x11040
movq %rax, %rcx
movq 0x128(%rsp), %rax
movq %rcx, 0x130(%rsp)
cmpq $0x0, %rax
je 0x175bc
movq 0x130(%rsp), %rax
movq 0x128(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x110(%rsp)
movq %rax, 0x118(%rsp)
movq 0x118(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x89430
jmp 0x1759b
movq 0x110(%rsp), %rcx
movq 0x108(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x118(%rsp)
jne 0x17584
movq 0x130(%rsp), %rax
movq %rax, 0x580(%rsp)
movslq 0x6f8(%rsp), %rax
movq %rax, 0xf8(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0xf0(%rsp)
callq 0x11040
movq %rax, %rcx
movq 0xf8(%rsp), %rax
movq %rcx, 0x100(%rsp)
cmpq $0x0, %rax
je 0x17680
movq 0x100(%rsp), %rax
movq 0xf8(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x89430
jmp 0x1765f
movq 0xe0(%rsp), %rcx
movq 0xd8(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0xe8(%rsp)
jne 0x17648
movq 0x100(%rsp), %rax
movq %rax, 0x578(%rsp)
movl $0x0, 0x574(%rsp)
movl 0x574(%rsp), %eax
cmpl 0x6fc(%rsp), %eax
jge 0x17947
movq 0x748(%rsp), %rdi
movl 0x574(%rsp), %esi
callq 0x1f640
movq %rax, 0x568(%rsp)
movq 0x748(%rsp), %rdi
movq 0x568(%rsp), %rsi
xorl %edx, %edx
callq 0x1f670
movq %rax, 0x550(%rsp)
movq 0x748(%rsp), %rdi
movq 0x568(%rsp), %rsi
movl $0x1, %edx
callq 0x1f670
movq %rax, 0x558(%rsp)
movq 0x748(%rsp), %rdi
movq 0x568(%rsp), %rsi
movl $0x2, %edx
callq 0x1f670
movq %rax, 0x560(%rsp)
movq 0x748(%rsp), %rdi
movq 0x558(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0xa8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x550(%rsp), %rsi
callq 0x1f4b0
movq 0xa8(%rsp), %rsi
movq %rax, %rdx
leaq 0x538(%rsp), %rdi
callq 0x88640
movq 0x580(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x550(%rsp), %rsi
callq 0x1f3b0
movq 0xb0(%rsp), %rdi
cltq
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x538(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x560(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0xb8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x558(%rsp), %rsi
callq 0x1f4b0
movq 0xb8(%rsp), %rsi
movq %rax, %rdx
leaq 0x520(%rsp), %rdi
callq 0x88640
movq 0x580(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x558(%rsp), %rsi
callq 0x1f3b0
movq 0xc0(%rsp), %rdi
cltq
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x520(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x550(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0xc8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x560(%rsp), %rsi
callq 0x1f4b0
movq 0xc8(%rsp), %rsi
movq %rax, %rdx
leaq 0x508(%rsp), %rdi
callq 0x88640
movq 0x580(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x560(%rsp), %rsi
callq 0x1f3b0
movq 0xd0(%rsp), %rdi
cltq
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x508(%rsp), %rsi
callq 0x8a100
movl 0x574(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x574(%rsp)
jmp 0x1769b
movq 0x120(%rsp), %rsi
movq 0x130(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
callq 0x11d00
jmp 0x186cb
movq 0xf0(%rsp), %rsi
movq 0x100(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x728(%rsp)
movl %eax, 0x724(%rsp)
callq 0x11d00
jmp 0x186cb
movl $0x0, 0x504(%rsp)
movl 0x504(%rsp), %eax
cmpl 0x6f8(%rsp), %eax
jge 0x17a84
movq 0x748(%rsp), %rdi
movl 0x504(%rsp), %esi
callq 0x1f380
movq %rax, 0x4f8(%rsp)
movq 0x580(%rsp), %rax
movslq 0x504(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xa0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4f8(%rsp), %rsi
callq 0x1f4d0
movq 0xa0(%rsp), %rsi
movq %rax, %rdx
leaq 0x4e0(%rsp), %rdi
callq 0x8a280
movq 0x580(%rsp), %rdi
movslq 0x504(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x4e0(%rsp), %rsi
callq 0x8a100
movq 0x580(%rsp), %rdi
movslq 0x504(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x89ba0
movq 0x748(%rsp), %rdi
movq 0x4f8(%rsp), %rsi
callq 0x1f4d0
movq %rax, %rsi
movq 0x580(%rsp), %rdx
movslq 0x504(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdx
leaq 0x4c8(%rsp), %rdi
callq 0x8a280
movq 0x578(%rsp), %rdi
movslq 0x504(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x8a100
movl 0x504(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x504(%rsp)
jmp 0x17952
movl $0x0, 0x4c4(%rsp)
movl 0x4c4(%rsp), %eax
cmpl 0x6fc(%rsp), %eax
jge 0x1830a
movq 0x748(%rsp), %rdi
movl 0x4c4(%rsp), %esi
callq 0x1f640
movq %rax, 0x4b8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4b8(%rsp), %rsi
xorl %edx, %edx
callq 0x1f670
movq %rax, 0x4a0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4b8(%rsp), %rsi
movl $0x1, %edx
callq 0x1f670
movq %rax, 0x4a8(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4b8(%rsp), %rsi
movl $0x2, %edx
callq 0x1f670
movq %rax, 0x4b0(%rsp)
leaq 0x450(%rsp), %rax
movq %rax, %rcx
addq $0x48, %rcx
movq %rcx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x89430
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x98(%rsp)
jne 0x17b41
movq 0x748(%rsp), %rdi
movq 0x4b0(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x70(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4a8(%rsp), %rsi
callq 0x1f4b0
movq 0x70(%rsp), %rsi
movq %rax, %rdx
leaq 0x438(%rsp), %rdi
callq 0x88640
leaq 0x450(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x4a0(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x78(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4b0(%rsp), %rsi
callq 0x1f4b0
movq 0x78(%rsp), %rsi
movq %rax, %rdx
leaq 0x420(%rsp), %rdi
callq 0x88640
leaq 0x450(%rsp), %rdi
addq $0x18, %rdi
leaq 0x420(%rsp), %rsi
callq 0x8a100
movq 0x748(%rsp), %rdi
movq 0x4a8(%rsp), %rsi
callq 0x1f4b0
movq %rax, 0x80(%rsp)
movq 0x748(%rsp), %rdi
movq 0x4a0(%rsp), %rsi
callq 0x1f4b0
movq 0x80(%rsp), %rsi
movq %rax, %rdx
leaq 0x408(%rsp), %rdi
callq 0x88640
leaq 0x450(%rsp), %rdi
addq $0x30, %rdi
leaq 0x408(%rsp), %rsi
callq 0x8a100
leaq 0x450(%rsp), %rsi
leaq 0x3f0(%rsp), %rdi
callq 0x89480
leaq 0x3f0(%rsp), %rdi
callq 0x89ba0
leaq 0x450(%rsp), %rsi
leaq 0x450(%rsp), %rdx
addq $0x18, %rdx
leaq 0x3d8(%rsp), %rdi
callq 0x8a280
leaq 0x3c0(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
leaq 0x3f0(%rsp), %rdx
callq 0x8a280
leaq 0x3c0(%rsp), %rdi
callq 0x89ba0
leaq 0x3a0(%rsp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x11360
leaq 0x350(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x11360
movl $0x0, 0x34c(%rsp)
cmpl $0x3, 0x34c(%rsp)
jge 0x17f72
movslq 0x34c(%rsp), %rax
leaq 0x450(%rsp), %rdi
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x3f0(%rsp), %rsi
callq 0x89a50
movsd %xmm0, 0x340(%rsp)
movslq 0x34c(%rsp), %rax
leaq 0x450(%rsp), %rdi
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x89a50
movsd %xmm0, 0x338(%rsp)
movsd 0x340(%rsp), %xmm0
movsd 0x340(%rsp), %xmm2
movsd 0x350(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x350(%rsp)
movsd 0x340(%rsp), %xmm0
movsd 0x338(%rsp), %xmm2
movsd 0x358(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x358(%rsp)
movsd 0x338(%rsp), %xmm0
movsd 0x338(%rsp), %xmm2
movsd 0x390(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x390(%rsp)
movq 0x748(%rsp), %rdi
movl 0x34c(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq 0x4a0(%rsp,%rax,8), %rsi
callq 0x1f4d0
movq %rax, 0x68(%rsp)
movq 0x748(%rsp), %rdi
movl 0x34c(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq 0x4a0(%rsp,%rax,8), %rsi
callq 0x1f4d0
movq 0x68(%rsp), %rsi
movq %rax, %rdx
leaq 0x320(%rsp), %rdi
callq 0x8a830
leaq 0x320(%rsp), %rdi
leaq 0x3f0(%rsp), %rsi
callq 0x89a50
movsd %xmm0, 0x318(%rsp)
leaq 0x320(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x89a50
movsd %xmm0, 0x310(%rsp)
movsd 0x318(%rsp), %xmm0
movsd 0x340(%rsp), %xmm2
movsd 0x3a0(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x3a0(%rsp)
movsd 0x318(%rsp), %xmm0
movsd 0x338(%rsp), %xmm2
movsd 0x310(%rsp), %xmm1
mulsd 0x340(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd 0x3a8(%rsp), %xmm0
movsd %xmm0, 0x3a8(%rsp)
movsd 0x310(%rsp), %xmm0
movsd 0x338(%rsp), %xmm2
movsd 0x3b0(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x3b0(%rsp)
movl 0x34c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34c(%rsp)
jmp 0x17d30
movsd 0x350(%rsp), %xmm0
addsd 0x390(%rsp), %xmm0
movsd %xmm0, 0x370(%rsp)
movsd 0x358(%rsp), %xmm0
movsd %xmm0, 0x378(%rsp)
movsd 0x358(%rsp), %xmm0
movsd %xmm0, 0x368(%rsp)
movsd 0x378(%rsp), %xmm0
movsd %xmm0, 0x388(%rsp)
movl $0x48, %edi
callq 0x11040
movq %rax, 0x308(%rsp)
movl $0x0, 0x304(%rsp)
cmpl $0x9, 0x304(%rsp)
jge 0x18054
movl 0x304(%rsp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %eax, %rcx
leaq 0x350(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movl 0x304(%rsp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movq 0x60(%rsp), %rax
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x308(%rsp), %rax
movslq 0x304(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x304(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x304(%rsp)
jmp 0x17fe0
movl $0x18, %edi
callq 0x11040
movq %rax, 0x2f8(%rsp)
movsd 0x3a0(%rsp), %xmm0
movq 0x2f8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x3a8(%rsp), %xmm0
movq 0x2f8(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movsd 0x3b0(%rsp), %xmm0
movq 0x2f8(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movq 0x308(%rsp), %rdx
movq 0x2f8(%rsp), %rcx
leaq 0x3a0(%rsp), %r8
movl $0x3, %esi
xorps %xmm0, %xmm0
movl %esi, %edi
callq 0xecf90
movq 0x308(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x180eb
movq 0x58(%rsp), %rdi
callq 0x118b0
movq 0x2f8(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x18108
movq 0x50(%rsp), %rdi
callq 0x118b0
movl $0x0, 0x2f4(%rsp)
cmpl $0x3, 0x2f4(%rsp)
jge 0x182f2
movq 0x748(%rsp), %rdi
movslq 0x2f4(%rsp), %rax
movq 0x4a0(%rsp,%rax,8), %rsi
callq 0x1f3b0
movl %eax, 0x2f0(%rsp)
movsd 0x3a0(%rsp), %xmm0
movsd 0x3a8(%rsp), %xmm1
movsd 0x3b0(%rsp), %xmm2
movq 0x580(%rsp), %rdx
movslq 0x2f0(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdx
movq 0x578(%rsp), %rcx
movslq 0x2f0(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
leaq 0x3f0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
leaq 0x2e8(%rsp), %r8
leaq 0x2e0(%rsp), %r9
leaq 0x2d8(%rsp), %rax
movq %rax, (%rsp)
callq 0x1c1b0
movq 0x6f0(%rsp), %rax
movslq 0x2f0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x18221
movq 0x6e8(%rsp), %rdi
movslq 0x4c4(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl 0x2f4(%rsp), %esi
callq 0x1f6f0
movsd (%rax), %xmm0
movq 0x6f0(%rsp), %rax
movslq 0x2f0(%rsp), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x48(%rsp)
jmp 0x18231
movsd 0x15bdef(%rip), %xmm0   # 0x174018
movsd %xmm0, 0x48(%rsp)
jmp 0x18231
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x2d0(%rsp)
movsd 0x2d0(%rsp), %xmm0
movsd 0x2e8(%rsp), %xmm2
movq 0x598(%rsp), %rax
movslq 0x2f0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd 0x2d0(%rsp), %xmm0
movsd 0x2e0(%rsp), %xmm2
movq 0x588(%rsp), %rax
movslq 0x2f0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd 0x2d0(%rsp), %xmm0
movsd 0x2d8(%rsp), %xmm2
movq 0x590(%rsp), %rax
movslq 0x2f0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x2f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f4(%rsp)
jmp 0x18113
jmp 0x182f4
movl 0x4c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c4(%rsp)
jmp 0x17a8f
movl $0x0, 0x2cc(%rsp)
movl 0x2cc(%rsp), %eax
cmpl 0x6f8(%rsp), %eax
jge 0x18534
movq 0x748(%rsp), %rdi
movl 0x2cc(%rsp), %esi
callq 0x1f380
movq %rax, 0x2c0(%rsp)
movq 0x748(%rsp), %rdi
movq 0x2c0(%rsp), %rsi
callq 0x1f4d0
movq %rax, %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x89480
movq 0x580(%rsp), %rdi
movslq 0x2cc(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x578(%rsp), %rsi
movslq 0x2cc(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movq 0x598(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x588(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x590(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x580(%rsp), %rcx
movslq 0x2cc(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x578(%rsp), %r8
movslq 0x2cc(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %r8
movq 0x598(%rsp), %r9
movslq 0x2cc(%rsp), %rax
shlq $0x3, %rax
addq %rax, %r9
movq 0x590(%rsp), %rax
movslq 0x2cc(%rsp), %rdx
shlq $0x3, %rdx
addq %rdx, %rax
leaq 0x2a8(%rsp), %rdx
movq %rax, (%rsp)
callq 0x1c420
movq 0x718(%rsp), %rdi
movl 0x2cc(%rsp), %esi
movq 0x598(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x590(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
callq 0x2ae50
movq 0x710(%rsp), %rdi
movl 0x2cc(%rsp), %esi
movq 0x598(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x590(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x15bb4d(%rip), %xmm1   # 0x174010
divsd %xmm1, %xmm0
callq 0x2ae50
movq 0x700(%rsp), %rdi
movl 0x2cc(%rsp), %esi
movq 0x598(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x2ae50
movq 0x708(%rsp), %rdi
movl 0x2cc(%rsp), %esi
movq 0x590(%rsp), %rax
movslq 0x2cc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x2ae50
movl 0x2cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2cc(%rsp)
jmp 0x18315
movq 0x730(%rsp), %rdi
movq 0x718(%rsp), %rsi
xorl %edx, %edx
callq 0x148a0
movq 0x730(%rsp), %rdi
movq 0x710(%rsp), %rsi
xorl %edx, %edx
callq 0x148a0
movq 0x730(%rsp), %rdi
movq 0x700(%rsp), %rsi
xorl %edx, %edx
callq 0x148a0
movq 0x730(%rsp), %rdi
movq 0x708(%rsp), %rsi
xorl %edx, %edx
callq 0x148a0
movq 0x6f0(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x185ad
movq 0x40(%rsp), %rdi
callq 0x118b0
movq 0x6e8(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x185ca
movq 0x38(%rsp), %rdi
callq 0x118b0
movq 0x598(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x185e7
movq 0x30(%rsp), %rdi
callq 0x118b0
movq 0x590(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x18604
movq 0x28(%rsp), %rdi
callq 0x118b0
movq 0x588(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x18621
movq 0x20(%rsp), %rdi
callq 0x118b0
movq 0x580(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x1863e
movq 0x18(%rsp), %rdi
callq 0x118b0
movq 0x578(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x1865b
movq 0x10(%rsp), %rdi
callq 0x118b0
cmpl $0x0, 0x1b20de(%rip)    # 0x1ca740
je 0x186ab
leaq 0x738(%rsp), %rdi
callq 0xe99a0
leaq 0x15bb94(%rip), %rdi    # 0x17420c
movb $0x1, %al
callq 0x11090
movq 0x730(%rsp), %rdi
callq 0x1f400
movl %eax, %esi
leaq 0x15bc22(%rip), %rdi    # 0x1742b7
movb $0x0, %al
callq 0x11090
movq 0x1a88ed(%rip), %rax    # 0x1c0f90
movq (%rax), %rdi
callq 0x117f0
movq 0x730(%rsp), %rax
movq %rax, 0x750(%rsp)
movq 0x750(%rsp), %rax
addq $0x758, %rsp            # imm = 0x758
retq
movq 0x728(%rsp), %rdi
callq 0x11bb0
nopl (%rax,%rax)