// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureEvaluation.cpp
// Function: gaps::R3SurfelPointSetFeature::UpdateFeatureVector(gaps::R3SurfelObject*, gaps::R3SurfelFeatureVector&) const
int R3SurfelPointSetFeature::
UpdateFeatureVector(R3SurfelObject *object, R3SurfelFeatureVector& vector) const
{
  // Get/check scene
  R3SurfelScene *scene = Scene();
  int scene_index = SceneIndex();
  if (!scene) return 0;
  assert(scene == object->Scene());
  assert(scene_index >= 0);

  // Check if feature value is already up to date
  if (vector.Value(scene_index) != RN_UNKNOWN) return 1;

  // Update all pointset features
  R3SurfelFeature *z_max_feature = scene->FindFeatureByName("PointSetZMax");
  R3SurfelFeature *z_mean_feature = scene->FindFeatureByName("PointSetZMean");
  R3SurfelFeature *z_stddev_feature = scene->FindFeatureByName("PointSetZStddev");
  R3SurfelFeature *xy_max_feature = scene->FindFeatureByName("PointSetXYMax");
  R3SurfelFeature *xy_stddev1_feature = scene->FindFeatureByName("PointSetXYStddev1");
  R3SurfelFeature *xy_stddev2_feature = scene->FindFeatureByName("PointSetXYStddev2");

  // Extract surfel point set
  R3SurfelPointSet pointset;
  for (int i = 0; i < object->NNodes(); i++) {
    R3SurfelNode *node = object->Node(i);
    for (int j = 0; j < node->NBlocks(); j++) {
      R3SurfelBlock *block = node->Block(j);
      pointset.InsertPoints(block);
    }
  }

  // Check point set
  if (pointset.NPoints() == 0) {
    if (z_max_feature) vector.SetValue(z_max_feature->SceneIndex(), 0);
    if (z_mean_feature) vector.SetValue(z_mean_feature->SceneIndex(), 0);
    if (z_stddev_feature) vector.SetValue(z_stddev_feature->SceneIndex(), 0);
    if (xy_max_feature) vector.SetValue(xy_max_feature->SceneIndex(), 0);
    if (xy_stddev1_feature) vector.SetValue(xy_stddev1_feature->SceneIndex(), 0);
    if (xy_stddev2_feature) vector.SetValue(xy_stddev2_feature->SceneIndex(), 0);
    return 1;
  }

  // Compute sums, mins, maxs
  RNScalar x_sum = 0;
  RNScalar y_sum = 0;
  RNScalar z_sum = 0;
  RNScalar z_min = FLT_MAX;
  RNScalar z_max = -FLT_MAX;
  for (int i = 0; i < pointset.NPoints(); i++) {
    const R3SurfelPoint *point = pointset.Point(i);
    R3Point position = point->Position();
    if (position.Z() < z_min) z_min = position.Z();
    if (position.Z() > z_max) z_max = position.Z();
    x_sum += position.X();
    y_sum += position.Y();
    z_sum += position.Z();
  }

  // Compute means
  RNScalar x_mean = x_sum / pointset.NPoints();
  RNScalar y_mean = y_sum / pointset.NPoints();
  RNScalar z_mean = z_sum / pointset.NPoints();

  // Compute Z residuals and XY covariances
  RNScalar z_ssd = 0;
  RNScalar sq_r_max = -FLT_MAX;
  RNScalar xy_covariance[4] = { 0 };
  for (int i = 0; i < pointset.NPoints(); i++) {
    const R3SurfelPoint *point = pointset.Point(i);
    R3Point position = point->Position();
    RNScalar x_delta = position.X() - x_mean;
    RNScalar y_delta = position.Y() - y_mean;
    RNScalar z_delta = position.Z() - z_mean;
    z_ssd += z_delta * z_delta;
    RNScalar sq_r = x_delta*x_delta + y_delta*y_delta;
    if (sq_r > sq_r_max) sq_r_max = sq_r;
    xy_covariance[0] += x_delta * x_delta;
    xy_covariance[1] += x_delta * y_delta;
    xy_covariance[2] += y_delta * x_delta;
    xy_covariance[3] += y_delta * y_delta;
  }

  // Compute Z standard deviation
  RNScalar z_variance = z_ssd / pointset.NPoints();
  RNScalar z_stddev = sqrt(z_variance);

  // Normalize XY covariances
  for (int i = 0; i < 4; i++) {
    xy_covariance[i] /= pointset.NPoints();
  }

  // Calculate XY values
  RNScalar U[4], W[2], Vt[4];
  RNSvdDecompose(2, 2, xy_covariance, U, W, Vt); 
  RNScalar xy_stddev1 = sqrt(W[0]);
  RNScalar xy_stddev2 = sqrt(W[1]);
  assert(xy_stddev1 >= xy_stddev2);
  RNScalar xy_max = sqrt(sq_r_max);

  // Set vector values 
  if (z_max_feature) vector.SetValue(z_max_feature->SceneIndex(), z_max - z_min);
  if (z_mean_feature) vector.SetValue(z_mean_feature->SceneIndex(), z_mean - z_min);
  if (z_stddev_feature) vector.SetValue(z_stddev_feature->SceneIndex(), z_stddev);
  if (xy_max_feature) vector.SetValue(xy_max_feature->SceneIndex(), xy_max);
  if (xy_stddev1_feature) vector.SetValue(xy_stddev1_feature->SceneIndex(), xy_stddev1);
  if (xy_stddev2_feature) vector.SetValue(xy_stddev2_feature->SceneIndex(), xy_stddev2);

  // Return success
  return 1;
}

// Assembly:
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdi, 0x3e8(%rsp)
movq %rsi, 0x3e0(%rsp)
movq %rdx, 0x3d8(%rsp)
movq 0x3e8(%rsp), %rdi
movq %rdi, 0x190(%rsp)
callq 0x18620
movq 0x190(%rsp), %rdi
movq %rax, 0x3d0(%rsp)
callq 0x18630
movl %eax, 0x3cc(%rsp)
cmpq $0x0, 0x3d0(%rsp)
jne 0x1720b
movl $0x0, 0x3f4(%rsp)
jmp 0x17f38
movq 0x3d8(%rsp), %rdi
movl 0x3cc(%rsp), %esi
callq 0x18640
movsd 0x18cf59(%rip), %xmm1   # 0x1a4180
ucomisd %xmm1, %xmm0
jne 0x17231
jp 0x17231
jmp 0x17241
movl $0x1, 0x3f4(%rsp)
jmp 0x17f38
movq 0x3d0(%rsp), %rdi
leaq 0x18cf48(%rip), %rsi    # 0x1a4198
callq 0x1dc00
movq %rax, 0x3c0(%rsp)
movq 0x3d0(%rsp), %rdi
leaq 0x18cf39(%rip), %rsi    # 0x1a41a5
callq 0x1dc00
movq %rax, 0x3b8(%rsp)
movq 0x3d0(%rsp), %rdi
leaq 0x18cf2b(%rip), %rsi    # 0x1a41b3
callq 0x1dc00
movq %rax, 0x3b0(%rsp)
movq 0x3d0(%rsp), %rdi
leaq 0x18cf1f(%rip), %rsi    # 0x1a41c3
callq 0x1dc00
movq %rax, 0x3a8(%rsp)
movq 0x3d0(%rsp), %rdi
leaq 0x18cf11(%rip), %rsi    # 0x1a41d1
callq 0x1dc00
movq %rax, 0x3a0(%rsp)
movq 0x3d0(%rsp), %rdi
leaq 0x18cf07(%rip), %rsi    # 0x1a41e3
callq 0x1dc00
movq %rax, 0x398(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x55df0
movl $0x0, 0x334(%rsp)
movl 0x334(%rsp), %eax
movl %eax, 0x188(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x18660
movl %eax, 0x18c(%rsp)
jmp 0x17325
movl 0x188(%rsp), %eax
movl 0x18c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x17449
movq 0x3e0(%rsp), %rdi
movl 0x334(%rsp), %esi
callq 0x18680
movq %rax, 0x180(%rsp)
jmp 0x17359
movq 0x180(%rsp), %rax
movq %rax, 0x318(%rsp)
movl $0x0, 0x314(%rsp)
movl 0x314(%rsp), %eax
movl %eax, 0x178(%rsp)
movq 0x318(%rsp), %rdi
callq 0x186b0
movl %eax, 0x17c(%rsp)
jmp 0x17398
movl 0x178(%rsp), %eax
movl 0x17c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x17431
movq 0x318(%rsp), %rdi
movl 0x314(%rsp), %esi
callq 0x186d0
movq %rax, 0x170(%rsp)
jmp 0x173cc
movq 0x170(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x308(%rsp), %rsi
leaq 0x338(%rsp), %rdi
callq 0x56a60
jmp 0x173f3
jmp 0x173f5
movl 0x314(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x314(%rsp)
jmp 0x17374
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x328(%rsp)
movl %eax, 0x324(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x56040
jmp 0x17f47
jmp 0x17433
movl 0x334(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x334(%rsp)
jmp 0x17301
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0x16c(%rsp)
jmp 0x1745f
movl 0x16c(%rsp), %eax
cmpl $0x0, %eax
jne 0x1766a
cmpq $0x0, 0x3c0(%rsp)
je 0x174bf
movq 0x3d8(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x3c0(%rsp), %rdi
callq 0x18630
movl %eax, 0x168(%rsp)
jmp 0x174a0
movl 0x168(%rsp), %esi
movq 0x160(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x174bd
jmp 0x174bf
cmpq $0x0, 0x3b8(%rsp)
je 0x1750f
movq 0x3d8(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x3b8(%rsp), %rdi
callq 0x18630
movl %eax, 0x15c(%rsp)
jmp 0x174f0
movl 0x15c(%rsp), %esi
movq 0x150(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x1750d
jmp 0x1750f
cmpq $0x0, 0x3b0(%rsp)
je 0x1755f
movq 0x3d8(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x3b0(%rsp), %rdi
callq 0x18630
movl %eax, 0x14c(%rsp)
jmp 0x17540
movl 0x14c(%rsp), %esi
movq 0x140(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x1755d
jmp 0x1755f
cmpq $0x0, 0x3a8(%rsp)
je 0x175af
movq 0x3d8(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x3a8(%rsp), %rdi
callq 0x18630
movl %eax, 0x13c(%rsp)
jmp 0x17590
movl 0x13c(%rsp), %esi
movq 0x130(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x175ad
jmp 0x175af
cmpq $0x0, 0x3a0(%rsp)
je 0x175ff
movq 0x3d8(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x3a0(%rsp), %rdi
callq 0x18630
movl %eax, 0x12c(%rsp)
jmp 0x175e0
movl 0x12c(%rsp), %esi
movq 0x120(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x175fd
jmp 0x175ff
cmpq $0x0, 0x398(%rsp)
je 0x1764f
movq 0x3d8(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x398(%rsp), %rdi
callq 0x18630
movl %eax, 0x11c(%rsp)
jmp 0x17630
movl 0x11c(%rsp), %esi
movq 0x110(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
callq *%rax
jmp 0x1764d
jmp 0x1764f
movl $0x1, 0x3f4(%rsp)
movl $0x1, 0x304(%rsp)
jmp 0x17f2b
xorps %xmm0, %xmm0
movsd %xmm0, 0x2f8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2f0(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2e8(%rsp)
movsd 0x18cafa(%rip), %xmm0   # 0x1a4190
movsd %xmm0, 0x2e0(%rsp)
movsd 0x18cae1(%rip), %xmm0   # 0x1a4188
movsd %xmm0, 0x2d8(%rsp)
movl $0x0, 0x2d4(%rsp)
movl 0x2d4(%rsp), %eax
movl %eax, 0x108(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0x10c(%rsp)
jmp 0x176df
movl 0x108(%rsp), %eax
movl 0x10c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x178a1
movl 0x2d4(%rsp), %esi
leaq 0x338(%rsp), %rdi
callq 0x18710
movq %rax, 0x100(%rsp)
jmp 0x17713
movq 0x100(%rsp), %rax
movq %rax, 0x2c8(%rsp)
movq 0x2c8(%rsp), %rsi
leaq 0x2b0(%rsp), %rdi
callq 0x18730
jmp 0x1773a
leaq 0x2b0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0xf8(%rsp)
jmp 0x17752
movsd 0xf8(%rsp), %xmm1
movsd 0x2e0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17794
leaq 0x2b0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0xf0(%rsp)
jmp 0x17782
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0x2e0(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0xe8(%rsp)
jmp 0x177ac
movsd 0xe8(%rsp), %xmm0
ucomisd 0x2d8(%rsp), %xmm0
jbe 0x177ea
leaq 0x2b0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0xe0(%rsp)
jmp 0x177d8
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x2d8(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x187b0
movsd %xmm0, 0xd8(%rsp)
jmp 0x17802
movsd 0xd8(%rsp), %xmm1
movsd 0x2f8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2f8(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x187c0
movsd %xmm0, 0xd0(%rsp)
jmp 0x17839
movsd 0xd0(%rsp), %xmm1
movsd 0x2f0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2f0(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0xc8(%rsp)
jmp 0x17870
movsd 0xc8(%rsp), %xmm0
addsd 0x2e8(%rsp), %xmm0
movsd %xmm0, 0x2e8(%rsp)
movl 0x2d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2d4(%rsp)
jmp 0x176bb
movsd 0x2f8(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0xc4(%rsp)
jmp 0x178c9
movsd 0xb8(%rsp), %xmm0
movl 0xc4(%rsp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x2a8(%rsp)
movsd 0x2f0(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0xb4(%rsp)
jmp 0x17912
movsd 0xa8(%rsp), %xmm0
movl 0xb4(%rsp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x2a0(%rsp)
movsd 0x2e8(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0xa4(%rsp)
jmp 0x1795b
movsd 0x98(%rsp), %xmm0
movl 0xa4(%rsp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x298(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x290(%rsp)
movsd 0x18c7f8(%rip), %xmm0   # 0x1a4188
movsd %xmm0, 0x288(%rsp)
leaq 0x260(%rsp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x132c0
movl $0x0, 0x25c(%rsp)
movl 0x25c(%rsp), %eax
movl %eax, 0x90(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0x94(%rsp)
jmp 0x179dc
movl 0x90(%rsp), %eax
movl 0x94(%rsp), %ecx
cmpl %ecx, %eax
jge 0x17c19
movl 0x25c(%rsp), %esi
leaq 0x338(%rsp), %rdi
callq 0x18710
movq %rax, 0x88(%rsp)
jmp 0x17a10
movq 0x88(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x18730
jmp 0x17a37
leaq 0x238(%rsp), %rdi
callq 0x187b0
movsd %xmm0, 0x80(%rsp)
jmp 0x17a4f
movsd 0x80(%rsp), %xmm0
movsd 0x2a8(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x230(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x187c0
movsd %xmm0, 0x78(%rsp)
jmp 0x17a83
movsd 0x78(%rsp), %xmm0
movsd 0x2a0(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x228(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0x70(%rsp)
jmp 0x17ab4
movsd 0x70(%rsp), %xmm0
subsd 0x298(%rsp), %xmm0
movsd %xmm0, 0x220(%rsp)
movsd 0x220(%rsp), %xmm0
movsd 0x220(%rsp), %xmm2
movsd 0x290(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x290(%rsp)
movsd 0x230(%rsp), %xmm0
movsd 0x230(%rsp), %xmm2
movsd 0x228(%rsp), %xmm1
mulsd 0x228(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x218(%rsp)
movsd 0x218(%rsp), %xmm0
ucomisd 0x288(%rsp), %xmm0
jbe 0x17b53
movsd 0x218(%rsp), %xmm0
movsd %xmm0, 0x288(%rsp)
movsd 0x230(%rsp), %xmm0
movsd 0x230(%rsp), %xmm2
movsd 0x260(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x260(%rsp)
movsd 0x230(%rsp), %xmm0
movsd 0x228(%rsp), %xmm2
movsd 0x268(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x268(%rsp)
movsd 0x228(%rsp), %xmm0
movsd 0x230(%rsp), %xmm2
movsd 0x270(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x270(%rsp)
movsd 0x228(%rsp), %xmm0
movsd 0x228(%rsp), %xmm2
movsd 0x278(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x278(%rsp)
movl 0x25c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x25c(%rsp)
jmp 0x179b8
movsd 0x290(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0x6c(%rsp)
jmp 0x17c3b
movsd 0x60(%rsp), %xmm0
movl 0x6c(%rsp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x210(%rsp)
movsd 0x210(%rsp), %xmm0
callq 0x13420
movsd %xmm0, 0x208(%rsp)
movl $0x0, 0x204(%rsp)
cmpl $0x4, 0x204(%rsp)
jge 0x17cce
leaq 0x338(%rsp), %rdi
callq 0x18700
movl %eax, 0x5c(%rsp)
jmp 0x17c95
movl 0x5c(%rsp), %eax
cvtsi2sd %eax, %xmm1
movslq 0x204(%rsp), %rax
movsd 0x260(%rsp,%rax,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x260(%rsp,%rax,8)
movl 0x204(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x204(%rsp)
jmp 0x17c78
movl $0x2, %esi
leaq 0x260(%rsp), %rdx
leaq 0x1e0(%rsp), %rcx
leaq 0x1d0(%rsp), %r8
leaq 0x1b0(%rsp), %r9
movl %esi, %edi
callq 0x1445e0
jmp 0x17cfc
movsd 0x1d0(%rsp), %xmm0
callq 0x13420
movsd %xmm0, 0x1a8(%rsp)
movsd 0x1d8(%rsp), %xmm0
callq 0x13420
movsd %xmm0, 0x1a0(%rsp)
movsd 0x288(%rsp), %xmm0
callq 0x13420
movsd %xmm0, 0x198(%rsp)
cmpq $0x0, 0x3c0(%rsp)
je 0x17d98
movq 0x3d8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x3c0(%rsp), %rdi
callq 0x18630
movl %eax, 0x58(%rsp)
jmp 0x17d6c
movl 0x58(%rsp), %esi
movq 0x50(%rsp), %rdi
movsd 0x2d8(%rsp), %xmm0
movsd 0x2e0(%rsp), %xmm1
subsd %xmm1, %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17d96
jmp 0x17d98
cmpq $0x0, 0x3b8(%rsp)
je 0x17def
movq 0x3d8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x3b8(%rsp), %rdi
callq 0x18630
movl %eax, 0x4c(%rsp)
jmp 0x17dc3
movl 0x4c(%rsp), %esi
movq 0x40(%rsp), %rdi
movsd 0x298(%rsp), %xmm0
movsd 0x2e0(%rsp), %xmm1
subsd %xmm1, %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17ded
jmp 0x17def
cmpq $0x0, 0x3b0(%rsp)
je 0x17e39
movq 0x3d8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x3b0(%rsp), %rdi
callq 0x18630
movl %eax, 0x3c(%rsp)
jmp 0x17e1a
movl 0x3c(%rsp), %esi
movq 0x30(%rsp), %rdi
movsd 0x208(%rsp), %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17e37
jmp 0x17e39
cmpq $0x0, 0x3a8(%rsp)
je 0x17e83
movq 0x3d8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x3a8(%rsp), %rdi
callq 0x18630
movl %eax, 0x2c(%rsp)
jmp 0x17e64
movl 0x2c(%rsp), %esi
movq 0x20(%rsp), %rdi
movsd 0x198(%rsp), %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17e81
jmp 0x17e83
cmpq $0x0, 0x3a0(%rsp)
je 0x17ecd
movq 0x3d8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x3a0(%rsp), %rdi
callq 0x18630
movl %eax, 0x1c(%rsp)
jmp 0x17eae
movl 0x1c(%rsp), %esi
movq 0x10(%rsp), %rdi
movsd 0x1a8(%rsp), %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17ecb
jmp 0x17ecd
cmpq $0x0, 0x398(%rsp)
je 0x17f15
movq 0x3d8(%rsp), %rax
movq %rax, (%rsp)
movq 0x398(%rsp), %rdi
callq 0x18630
movl %eax, 0xc(%rsp)
jmp 0x17ef7
movl 0xc(%rsp), %esi
movq (%rsp), %rdi
movsd 0x1a0(%rsp), %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x17f13
jmp 0x17f15
movl $0x1, 0x3f4(%rsp)
movl $0x1, 0x304(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x56040
movl 0x3f4(%rsp), %eax
addq $0x3f8, %rsp            # imm = 0x3F8
retq
movq 0x328(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)