// File: tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelUtils.cpp
// Function: gaps::CreateClusterObjects(gaps::R3SurfelScene*, gaps::R3SurfelPointGraph*, gaps::R3SurfelObject*, gaps::R3SurfelNode*, double, double, int)
RNArray<R3SurfelObject *> *
CreateClusterObjects(R3SurfelScene *scene, R3SurfelPointGraph *graph, 
  R3SurfelObject *parent_object, R3SurfelNode *parent_node, 
  RNLength max_offplane_distance, RNAngle max_normal_angle,
  int min_points_per_object)
{
  // Get convenient variables
  R3SurfelTree *tree = scene->Tree();
  if (!tree) return 0;
  R3SurfelDatabase *database = tree->Database();
  if (!database) return 0;

  // Check number of points
  if (graph->NPoints() < min_points_per_object) return NULL;

  // Check parent object
  if (!parent_object) parent_object = scene->RootObject();

  // Check parent node
  if (!parent_node) parent_node = tree->RootNode();

  // Create normals
  R3Vector *normals = NULL;
  if ((max_offplane_distance > 0) || (max_normal_angle > 0)) {
    normals = CreateNormals(graph, FALSE);
  }

  // Create cluster for every point
  RNArray<R3SurfelCluster *> clusters;
  for (int i = 0; i < graph->NPoints(); i++) {
    R3SurfelPoint *point = graph->Point(i);
    R3Point position = point->Position();
    R3SurfelCluster *cluster = new R3SurfelCluster();
    cluster->parent = NULL;
    cluster->points.Insert(point);
    cluster->bbox.Reset(position, position);
    cluster->id = i;
    clusters.Insert(cluster);
  }

  // Check clusters
  if (clusters.IsEmpty()) {
    if (normals) delete [] normals;
    return NULL;  
  }

  // Create cluster pairs and add to heap
  R3SurfelClusterPair tmp;
  RNHeap<R3SurfelClusterPair *> heap(&tmp, &tmp.similarity, NULL, FALSE);;
  for (int index0 = 0; index0 < graph->NPoints(); index0++) {
    R3SurfelPoint *point0 = graph->Point(index0);
    R3SurfelCluster *cluster0 = clusters.Kth(index0);
    R3Point position0 = point0->Position();
    const R3Vector& normal0 = (normals) ? normals[index0] : R3zero_vector;
    R3Plane plane0(position0, normal0);
    for (int j = 0; j < graph->NNeighbors(index0); j++) {
      R3SurfelPoint *point1 = graph->Neighbor(index0, j);
      int index1 = graph->PointIndex(point1);
      if (index1 < index0) continue;
      R3Point position1 = point1->Position();

      // Compute plane similarity
      RNScalar plane_similarity = 1;
      if (max_offplane_distance > 0) {
        RNScalar offplane_distance = R3Distance(plane0, position1);
        if (offplane_distance > max_offplane_distance) continue;
        plane_similarity *= 1.0 - 0.9 * offplane_distance / max_offplane_distance;
      }

      // Compute normal similarity
      RNScalar normal_similarity = 1;
      if (max_normal_angle > 0) {
        if (normals) {
          const R3Vector& normal1 = normals[index1];
          RNScalar dot = fabs(normal0.Dot(normal1));
          RNAngle normal_angle = (dot < 1) ? acos(dot) : 0;
          if (normal_angle > max_normal_angle) continue;
          normal_similarity *= 1.0 - 0.9 * normal_angle / max_normal_angle;
        }
      }

      // Compute distance similarity
      RNScalar distance_similarity = 1.0;
      if (graph->MaxDistance() > 0) {
        RNScalar distance = R3Distance(position0, position1);
        distance_similarity = 1.0 - 0.99 * distance / graph->MaxDistance();
      }

      // Create pair
      R3SurfelCluster *cluster1 = clusters.Kth(index1);
      R3SurfelClusterPair *pair = new R3SurfelClusterPair();
      pair->clusters[0] = cluster0;
      pair->clusters[1] = cluster1;
      pair->similarity = distance_similarity * normal_similarity * plane_similarity;
      heap.Push(pair);
    }
  }

  // Check cluster pairs
  if (heap.IsEmpty()) {
    for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
    if (normals) delete [] normals;
    return NULL;
  }

  // Merge clusters hierarchically
  while (!heap.IsEmpty()) {
    // Get pair
    R3SurfelClusterPair *pair = heap.Pop();

    // Get clusters
    R3SurfelCluster *cluster0 = pair->clusters[0];
    R3SurfelCluster *cluster1 = pair->clusters[1];
    while (cluster0->parent) cluster0 = cluster0->parent;
    while (cluster1->parent) cluster1 = cluster1->parent;
    if (cluster0 == cluster1) continue;

    // Merge clusters
    cluster0->points.Append(cluster1->points);
    cluster0->bbox.Union(cluster1->bbox);
    cluster1->parent = cluster0;
    cluster1->points.Empty(TRUE);
    cluster1->bbox = R3null_box;

    // Delete pair
    delete pair;
  }

  // Create array of objects
  RNArray<R3SurfelObject *> *objects = new RNArray<R3SurfelObject *>();
  if (!objects) {
    RNFail("Unable to create array of objects\n");
    for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
    if (normals) delete [] normals;
    return NULL;
  }

  // Create objects with copies of surfels
  for (int i = 0; i < clusters.NEntries(); i++) {
    R3SurfelCluster *cluster = clusters.Kth(i);

    // Check cluster
    if (cluster->points.NEntries() < min_points_per_object) { delete cluster; continue; }
    if (cluster->parent) { delete cluster; continue; }

    // Create surfels
    R3Point origin = cluster->bbox.Centroid();
    R3Surfel *surfels = new R3Surfel [ cluster->points.NEntries() ];
    for (int j = 0; j < cluster->points.NEntries(); j++) {
      R3SurfelPoint *point = cluster->points.Kth(j);
      R3SurfelBlock *block = point->Block();
      const R3Surfel *surfel = point->Surfel();
      RNCoord x = surfel->X() + block->PositionOrigin().X() - origin.X();
      RNCoord y = surfel->Y() + block->PositionOrigin().Y() - origin.Y();
      RNCoord z = surfel->Z() + block->PositionOrigin().Z() - origin.Z();
      surfels[j].SetPosition(x, y, z);
      surfels[j].SetColor(surfel->Color());
      surfels[j].SetAerial(surfel->IsAerial());
    }

    // Create block
    R3SurfelBlock *block = new R3SurfelBlock(surfels, cluster->points.NEntries(), origin);
    if (!block) {
      RNFail("Unable to create node\n");
      for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
      if (normals) delete [] normals;
      delete [] surfels;
      return NULL;
    }

    // Delete surfels
    delete [] surfels;

    // Create node
    char node_name[256];
    sprintf(node_name, "O%d\n", objects->NEntries());
    R3SurfelNode *node = new R3SurfelNode(node_name);
    if (!node) {
      RNFail("Unable to create node\n");
      for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
      if (normals) delete [] normals;
      delete block;
      return NULL;
    }

    // Create object
    char object_name[256];
    sprintf(object_name, "O%d\n", objects->NEntries());
    R3SurfelObject *object = new R3SurfelObject(object_name);
    if (!object) {
      RNFail("Unable to create object\n");
      for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
      if (normals) delete [] normals;
      delete block;
      delete node;
      return NULL;
    }
     
    // Insert everything
    block->UpdateProperties();
    database->InsertBlock(block);
    node->InsertBlock(block);
    tree->InsertNode(node, parent_node);
    object->InsertNode(node);
    scene->InsertObject(object, parent_object);
    objects->Insert(object);

    // Delete cluster
    delete cluster;

    // Print debug statement
    printf("    %d %d\n", i, block->NSurfels());
  }
  
  // Delete normals
  delete [] normals;

  // Return objects
  return objects;
}

// Assembly:
subq $0x7c8, %rsp            # imm = 0x7C8
movq %rdi, 0x7b8(%rsp)
movq %rsi, 0x7b0(%rsp)
movq %rdx, 0x7a8(%rsp)
movq %rcx, 0x7a0(%rsp)
movsd %xmm0, 0x798(%rsp)
movsd %xmm1, 0x790(%rsp)
movl %r8d, 0x78c(%rsp)
movq 0x7b8(%rsp), %rdi
callq 0x16ce0
movq %rax, 0x780(%rsp)
cmpq $0x0, 0x780(%rsp)
jne 0x40a62
movq $0x0, 0x7c0(%rsp)
jmp 0x424fe
movq 0x780(%rsp), %rdi
callq 0x16d10
movq %rax, 0x778(%rsp)
cmpq $0x0, 0x778(%rsp)
jne 0x40a93
movq $0x0, 0x7c0(%rsp)
jmp 0x424fe
movq 0x7b0(%rsp), %rdi
callq 0x43e20
cmpl 0x78c(%rsp), %eax
jge 0x40aba
movq $0x0, 0x7c0(%rsp)
jmp 0x424fe
cmpq $0x0, 0x7a8(%rsp)
jne 0x40ada
movq 0x7b8(%rsp), %rdi
callq 0x31050
movq %rax, 0x7a8(%rsp)
cmpq $0x0, 0x7a0(%rsp)
jne 0x40afa
movq 0x780(%rsp), %rdi
callq 0x31030
movq %rax, 0x7a0(%rsp)
movq $0x0, 0x770(%rsp)
movsd 0x798(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x40b2a
movsd 0x790(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x40b41
movq 0x7b0(%rsp), %rdi
xorl %esi, %esi
callq 0x3c000
movq %rax, 0x770(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x447a0
movl $0x0, 0x75c(%rsp)
movl 0x75c(%rsp), %eax
movl %eax, 0x32c(%rsp)
movq 0x7b0(%rsp), %rdi
callq 0x43e20
movl %eax, 0x330(%rsp)
jmp 0x40b7d
movl 0x32c(%rsp), %eax
movl 0x330(%rsp), %ecx
cmpl %ecx, %eax
jge 0x40cf6
movq 0x7b0(%rsp), %rdi
movl 0x75c(%rsp), %esi
callq 0x43e40
movq %rax, 0x320(%rsp)
jmp 0x40bb1
movq 0x320(%rsp), %rax
movq %rax, 0x740(%rsp)
movq 0x740(%rsp), %rsi
leaq 0x728(%rsp), %rdi
callq 0x18730
jmp 0x40bd8
movl $0x58, %edi
callq 0x13570
movq %rax, 0x318(%rsp)
jmp 0x40bec
movq 0x318(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0x50(%rdi)
callq 0x447b0
jmp 0x40c19
movq 0x318(%rsp), %rax
movq %rax, 0x720(%rsp)
movq 0x720(%rsp), %rax
movq $0x0, (%rax)
movq 0x720(%rsp), %rdi
addq $0x8, %rdi
movq 0x740(%rsp), %rsi
callq 0x43e80
jmp 0x40c53
movq 0x720(%rsp), %rdi
addq $0x18, %rdi
leaq 0x728(%rsp), %rdx
movq %rdx, %rsi
callq 0xcc250
jmp 0x40c71
movl 0x75c(%rsp), %ecx
movq 0x720(%rsp), %rax
movl %ecx, 0x50(%rax)
movq 0x720(%rsp), %rsi
leaq 0x760(%rsp), %rdi
callq 0x44810
jmp 0x40c9a
jmp 0x40c9c
movl 0x75c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x75c(%rsp)
jmp 0x40b59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x424ef
movq 0x318(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
movl $0x58, %esi
callq 0x13580
jmp 0x424ef
leaq 0x760(%rsp), %rdi
callq 0x31da0
movl %eax, 0x314(%rsp)
jmp 0x40d0c
movl 0x314(%rsp), %eax
cmpl $0x0, %eax
je 0x40d64
cmpq $0x0, 0x770(%rsp)
je 0x40d48
movq 0x770(%rsp), %rax
movq %rax, 0x308(%rsp)
cmpq $0x0, %rax
je 0x40d46
movq 0x308(%rsp), %rdi
callq 0x13750
jmp 0x40d48
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424e0
leaq 0x710(%rsp), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
leaq 0x6c8(%rsp), %rdi
leaq 0x700(%rsp), %rsi
callq 0x44840
jmp 0x40d89
movl $0x0, 0x6c4(%rsp)
movl 0x6c4(%rsp), %eax
movl %eax, 0x300(%rsp)
movq 0x7b0(%rsp), %rdi
callq 0x43e20
movl %eax, 0x304(%rsp)
jmp 0x40db8
movl 0x300(%rsp), %eax
movl 0x304(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4134c
movq 0x7b0(%rsp), %rdi
movl 0x6c4(%rsp), %esi
callq 0x43e40
movq %rax, 0x2f8(%rsp)
jmp 0x40dec
movq 0x2f8(%rsp), %rax
movq %rax, 0x6b8(%rsp)
movl 0x6c4(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x448e0
movq %rax, 0x2f0(%rsp)
jmp 0x40e1a
movq 0x2f0(%rsp), %rax
movq %rax, 0x6b0(%rsp)
movq 0x6b8(%rsp), %rsi
leaq 0x698(%rsp), %rdi
callq 0x18730
jmp 0x40e41
cmpq $0x0, 0x770(%rsp)
je 0x40e6d
movq 0x770(%rsp), %rax
movslq 0x6c4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x2e8(%rsp)
jmp 0x40e7e
leaq 0x5bd32c(%rip), %rax    # 0x5fe1a0
movq %rax, 0x2e8(%rsp)
jmp 0x40e7e
movq 0x2e8(%rsp), %rax
movq %rax, 0x690(%rsp)
movq 0x690(%rsp), %rdx
leaq 0x670(%rsp), %rdi
leaq 0x698(%rsp), %rsi
callq 0xf5ab0
jmp 0x40ead
movl $0x0, 0x66c(%rsp)
movl 0x66c(%rsp), %eax
movl %eax, 0x2e0(%rsp)
movq 0x7b0(%rsp), %rdi
movl 0x6c4(%rsp), %esi
callq 0x43ef0
movl %eax, 0x2e4(%rsp)
jmp 0x40ee3
movl 0x2e0(%rsp), %eax
movl 0x2e4(%rsp), %ecx
cmpl %ecx, %eax
jge 0x41334
movq 0x7b0(%rsp), %rdi
movl 0x6c4(%rsp), %esi
movl 0x66c(%rsp), %edx
callq 0x43f20
movq %rax, 0x2d8(%rsp)
jmp 0x40f1e
movq 0x2d8(%rsp), %rax
movq %rax, 0x660(%rsp)
movq 0x7b0(%rsp), %rdi
movq 0x660(%rsp), %rsi
callq 0x43ec0
movl %eax, 0x2d4(%rsp)
jmp 0x40f4c
movl 0x2d4(%rsp), %eax
movl %eax, 0x65c(%rsp)
movl 0x65c(%rsp), %eax
cmpl 0x6c4(%rsp), %eax
jge 0x40f88
jmp 0x4131e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x424d1
movq 0x660(%rsp), %rsi
leaq 0x640(%rsp), %rdi
callq 0x18730
jmp 0x40f9f
movsd 0x1631c1(%rip), %xmm0   # 0x1a4168
movsd %xmm0, 0x638(%rsp)
movsd 0x798(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x41049
leaq 0x670(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0x444d0
movsd %xmm0, 0x2c8(%rsp)
jmp 0x40fe6
movsd 0x2c8(%rsp), %xmm0
movsd %xmm0, 0x630(%rsp)
movsd 0x630(%rsp), %xmm0
ucomisd 0x798(%rsp), %xmm0
jbe 0x41011
jmp 0x4131e
movsd 0x163aef(%rip), %xmm1   # 0x1a4b08
mulsd 0x630(%rsp), %xmm1
divsd 0x798(%rsp), %xmm1
movsd 0x163135(%rip), %xmm0   # 0x1a4168
subsd %xmm1, %xmm0
mulsd 0x638(%rsp), %xmm0
movsd %xmm0, 0x638(%rsp)
movsd 0x163117(%rip), %xmm0   # 0x1a4168
movsd %xmm0, 0x628(%rsp)
movsd 0x790(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4117b
cmpq $0x0, 0x770(%rsp)
je 0x41179
movq 0x770(%rsp), %rax
movslq 0x65c(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x620(%rsp)
movq 0x690(%rsp), %rdi
movq 0x620(%rsp), %rsi
callq 0xf9ac0
movsd %xmm0, 0x2c0(%rsp)
jmp 0x410bf
movsd 0x2c0(%rsp), %xmm0
movaps 0x1632f1(%rip), %xmm1   # 0x1a43c0
pand %xmm1, %xmm0
movsd %xmm0, 0x618(%rsp)
movsd 0x163084(%rip), %xmm0   # 0x1a4168
ucomisd 0x618(%rsp), %xmm0
jbe 0x41108
movsd 0x618(%rsp), %xmm0
callq 0x13520
movsd %xmm0, 0x2b8(%rsp)
jmp 0x41116
xorps %xmm0, %xmm0
movsd %xmm0, 0x2b8(%rsp)
jmp 0x41116
movsd 0x2b8(%rsp), %xmm0
movsd %xmm0, 0x610(%rsp)
movsd 0x610(%rsp), %xmm0
ucomisd 0x790(%rsp), %xmm0
jbe 0x41141
jmp 0x4131e
movsd 0x1639bf(%rip), %xmm1   # 0x1a4b08
mulsd 0x610(%rsp), %xmm1
divsd 0x790(%rsp), %xmm1
movsd 0x163005(%rip), %xmm0   # 0x1a4168
subsd %xmm1, %xmm0
mulsd 0x628(%rsp), %xmm0
movsd %xmm0, 0x628(%rsp)
jmp 0x4117b
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x608(%rsp)
movq 0x7b0(%rsp), %rdi
callq 0x44900
movsd %xmm0, 0x2b0(%rsp)
jmp 0x411a5
movsd 0x2b0(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4124e
leaq 0x698(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0x8e7e0
movsd %xmm0, 0x2a8(%rsp)
jmp 0x411db
movsd 0x2a8(%rsp), %xmm0
movsd %xmm0, 0x600(%rsp)
movsd 0x600(%rsp), %xmm0
movsd 0x163912(%rip), %xmm1   # 0x1a4b10
mulsd %xmm1, %xmm0
movsd %xmm0, 0x298(%rsp)
movq 0x7b0(%rsp), %rdi
callq 0x44900
movsd %xmm0, 0x2a0(%rsp)
jmp 0x41223
movsd 0x2a0(%rsp), %xmm0
movsd 0x298(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd 0x162f27(%rip), %xmm0   # 0x1a4168
subsd %xmm1, %xmm0
movsd %xmm0, 0x608(%rsp)
movl 0x65c(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x448e0
movq %rax, 0x290(%rsp)
jmp 0x4126c
movq 0x290(%rsp), %rax
movq %rax, 0x5f8(%rsp)
movl $0x18, %edi
callq 0x13570
movq %rax, 0x288(%rsp)
jmp 0x41290
movq 0x288(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x5f0(%rsp)
movq 0x6b0(%rsp), %rcx
movq 0x5f0(%rsp), %rax
movq %rcx, (%rax)
movq 0x5f8(%rsp), %rcx
movq 0x5f0(%rsp), %rax
movq %rcx, 0x8(%rax)
movsd 0x608(%rsp), %xmm0
movsd 0x628(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x638(%rsp), %xmm1
mulsd %xmm1, %xmm0
movq 0x5f0(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movq 0x5f0(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
callq 0x44910
jmp 0x4131c
jmp 0x4131e
movl 0x66c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x66c(%rsp)
jmp 0x40eb8
jmp 0x41336
movl 0x6c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c4(%rsp)
jmp 0x40d94
leaq 0x6c8(%rsp), %rdi
callq 0x44b30
movl %eax, 0x284(%rsp)
jmp 0x41362
movl 0x284(%rsp), %eax
cmpl $0x0, %eax
je 0x4146d
movl $0x0, 0x5ec(%rsp)
movl 0x5ec(%rsp), %eax
movl %eax, 0x27c(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0x280(%rsp)
jmp 0x413a1
movl 0x27c(%rsp), %eax
movl 0x280(%rsp), %ecx
cmpl %ecx, %eax
jge 0x41421
movl 0x5ec(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x44b50
movq %rax, 0x270(%rsp)
jmp 0x413d1
movq 0x270(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x268(%rsp)
cmpq $0x0, %rax
je 0x41409
movq 0x268(%rsp), %rdi
callq 0x44b70
movq 0x268(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x4140b
movl 0x5ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5ec(%rsp)
jmp 0x4137d
cmpq $0x0, 0x770(%rsp)
je 0x41451
movq 0x770(%rsp), %rax
movq %rax, 0x260(%rsp)
cmpq $0x0, %rax
je 0x4144f
movq 0x260(%rsp), %rdi
callq 0x13750
jmp 0x41451
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424c2
jmp 0x4146f
leaq 0x6c8(%rsp), %rdi
callq 0x44b30
movl %eax, 0x25c(%rsp)
jmp 0x41485
movl 0x25c(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4149d
jmp 0x415fa
leaq 0x6c8(%rsp), %rdi
callq 0x44ba0
movq %rax, 0x250(%rsp)
jmp 0x414b4
movq 0x250(%rsp), %rax
movq %rax, 0x5e0(%rsp)
movq 0x5e0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x5d8(%rsp)
movq 0x5e0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x5d0(%rsp)
movq 0x5d8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x4150e
movq 0x5d8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x5d8(%rsp)
jmp 0x414eb
jmp 0x41510
movq 0x5d0(%rsp), %rax
cmpq $0x0, (%rax)
je 0x41533
movq 0x5d0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x5d0(%rsp)
jmp 0x41510
movq 0x5d8(%rsp), %rax
cmpq 0x5d0(%rsp), %rax
jne 0x4154a
jmp 0x4146f
movq 0x5d8(%rsp), %rdi
addq $0x8, %rdi
movq 0x5d0(%rsp), %rsi
addq $0x8, %rsi
callq 0x142730
jmp 0x41569
movq 0x5d8(%rsp), %rdi
addq $0x18, %rdi
movq 0x5d0(%rsp), %rsi
addq $0x18, %rsi
callq 0xcbc30
jmp 0x41588
movq 0x5d8(%rsp), %rcx
movq 0x5d0(%rsp), %rax
movq %rcx, (%rax)
movq 0x5d0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x142550
jmp 0x415b3
movq 0x5d0(%rsp), %rdi
addq $0x18, %rdi
leaq 0x1bbd42(%rip), %rsi    # 0x1fd308
callq 0x1bd40
jmp 0x415cd
movq 0x5e0(%rsp), %rax
movq %rax, 0x248(%rsp)
cmpq $0x0, %rax
je 0x415f5
movq 0x248(%rsp), %rdi
movl $0x18, %esi
callq 0x13580
jmp 0x4146f
movl $0x10, %edi
callq 0x13570
movq %rax, 0x240(%rsp)
jmp 0x4160e
movq 0x240(%rsp), %rdi
callq 0x1b920
jmp 0x4161d
movq 0x240(%rsp), %rax
movq %rax, 0x5c8(%rsp)
cmpq $0x0, 0x5c8(%rsp)
jne 0x41776
leaq 0x163773(%rip), %rdi    # 0x1a4db6
xorl %eax, %eax
callq 0x1464b0
jmp 0x4164c
movl $0x0, 0x5c4(%rsp)
movl 0x5c4(%rsp), %eax
movl %eax, 0x238(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0x23c(%rsp)
jmp 0x4167b
movl 0x238(%rsp), %eax
movl 0x23c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4172a
movl 0x5c4(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x44b50
movq %rax, 0x230(%rsp)
jmp 0x416af
movq 0x230(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x228(%rsp)
cmpq $0x0, %rax
je 0x416e7
movq 0x228(%rsp), %rdi
callq 0x44b70
movq 0x228(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x416e9
movl 0x5c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c4(%rsp)
jmp 0x41657
movq 0x240(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
movl $0x10, %esi
callq 0x13580
jmp 0x424d1
cmpq $0x0, 0x770(%rsp)
je 0x4175a
movq 0x770(%rsp), %rax
movq %rax, 0x220(%rsp)
cmpq $0x0, %rax
je 0x41758
movq 0x220(%rsp), %rdi
callq 0x13750
jmp 0x4175a
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424c2
movl $0x0, 0x5c0(%rsp)
movl 0x5c0(%rsp), %eax
movl %eax, 0x218(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0x21c(%rsp)
jmp 0x417a5
movl 0x218(%rsp), %eax
movl 0x21c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4248a
movl 0x5c0(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x448e0
movq %rax, 0x210(%rsp)
jmp 0x417d9
movq 0x210(%rsp), %rax
movq %rax, 0x5b8(%rsp)
movq 0x5b8(%rsp), %rdi
addq $0x8, %rdi
callq 0x16d50
movl %eax, 0x20c(%rsp)
jmp 0x41803
movl 0x20c(%rsp), %eax
cmpl 0x78c(%rsp), %eax
jge 0x4184d
movq 0x5b8(%rsp), %rax
movq %rax, 0x200(%rsp)
cmpq $0x0, %rax
je 0x41848
movq 0x200(%rsp), %rdi
callq 0x44b70
movq 0x200(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x42474
movq 0x5b8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x41895
movq 0x5b8(%rsp), %rax
movq %rax, 0x1f8(%rsp)
cmpq $0x0, %rax
je 0x41890
movq 0x1f8(%rsp), %rdi
callq 0x44b70
movq 0x1f8(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x42474
movq 0x5b8(%rsp), %rsi
addq $0x18, %rsi
leaq 0x5a0(%rsp), %rdi
callq 0xcb780
jmp 0x418b0
movq 0x5b8(%rsp), %rdi
addq $0x8, %rdi
callq 0x16d50
movl %eax, 0x1f4(%rsp)
jmp 0x418ca
movl 0x1f4(%rsp), %eax
cltq
movq %rax, 0x1d8(%rsp)
movl $0x30, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x1e0(%rsp)
callq 0x13030
movq %rax, 0x1e8(%rsp)
jmp 0x41908
movq 0x1d8(%rsp), %rax
cmpq $0x0, %rax
je 0x41978
movq 0x1e8(%rsp), %rax
movq 0x1d8(%rsp), %rcx
imulq $0x30, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x1c8(%rsp)
movq %rax, 0x1d0(%rsp)
movq 0x1d0(%rsp), %rdi
movq %rdi, 0x1c0(%rsp)
callq 0x47310
jmp 0x41957
movq 0x1c8(%rsp), %rcx
movq 0x1c0(%rsp), %rax
addq $0x30, %rax
cmpq %rcx, %rax
movq %rax, 0x1d0(%rsp)
jne 0x41940
movq 0x1e8(%rsp), %rax
movq %rax, 0x598(%rsp)
movl $0x0, 0x594(%rsp)
movl 0x594(%rsp), %eax
movl %eax, 0x1b8(%rsp)
movq 0x5b8(%rsp), %rdi
addq $0x8, %rdi
callq 0x16d50
movl %eax, 0x1bc(%rsp)
jmp 0x419bb
movl 0x1b8(%rsp), %eax
movl 0x1bc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x41d99
movq 0x5b8(%rsp), %rdi
addq $0x8, %rdi
movl 0x594(%rsp), %esi
callq 0x44520
movq %rax, 0x1b0(%rsp)
jmp 0x419f3
movq 0x1b0(%rsp), %rax
movq %rax, 0x588(%rsp)
movq 0x588(%rsp), %rdi
callq 0x44cb0
movq %rax, 0x1a8(%rsp)
jmp 0x41a1a
movq 0x1a8(%rsp), %rax
movq %rax, 0x580(%rsp)
movq 0x588(%rsp), %rdi
callq 0x44cc0
movq %rax, 0x1a0(%rsp)
jmp 0x41a41
movq 0x1a0(%rsp), %rax
movq %rax, 0x578(%rsp)
movq 0x578(%rsp), %rdi
callq 0x44190
movss %xmm0, 0x19c(%rsp)
jmp 0x41a69
movss 0x19c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x188(%rsp)
movq 0x580(%rsp), %rdi
callq 0x189c0
movq %rax, 0x190(%rsp)
jmp 0x41a96
movq 0x190(%rsp), %rdi
callq 0x187b0
movsd %xmm0, 0x180(%rsp)
jmp 0x41aae
movsd 0x180(%rsp), %xmm1
movsd 0x188(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x170(%rsp)
leaq 0x5a0(%rsp), %rdi
callq 0x187b0
movsd %xmm0, 0x178(%rsp)
jmp 0x41ae5
movsd 0x178(%rsp), %xmm1
movsd 0x170(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x570(%rsp)
movq 0x578(%rsp), %rdi
callq 0x441a0
movss %xmm0, 0x16c(%rsp)
jmp 0x41b1c
movss 0x16c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x158(%rsp)
movq 0x580(%rsp), %rdi
callq 0x189c0
movq %rax, 0x160(%rsp)
jmp 0x41b49
movq 0x160(%rsp), %rdi
callq 0x187c0
movsd %xmm0, 0x150(%rsp)
jmp 0x41b61
movsd 0x150(%rsp), %xmm1
movsd 0x158(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x140(%rsp)
leaq 0x5a0(%rsp), %rdi
callq 0x187c0
movsd %xmm0, 0x148(%rsp)
jmp 0x41b98
movsd 0x148(%rsp), %xmm1
movsd 0x140(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x568(%rsp)
movq 0x578(%rsp), %rdi
callq 0x441b0
movss %xmm0, 0x13c(%rsp)
jmp 0x41bcf
movss 0x13c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x128(%rsp)
movq 0x580(%rsp), %rdi
callq 0x189c0
movq %rax, 0x130(%rsp)
jmp 0x41bfc
movq 0x130(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0x120(%rsp)
jmp 0x41c14
movsd 0x120(%rsp), %xmm1
movsd 0x128(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x110(%rsp)
leaq 0x5a0(%rsp), %rdi
callq 0x187a0
movsd %xmm0, 0x118(%rsp)
jmp 0x41c4b
movsd 0x118(%rsp), %xmm1
movsd 0x110(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x560(%rsp)
movq 0x598(%rsp), %rdi
movslq 0x594(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rax, %rdi
movsd 0x570(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movsd 0x568(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
movsd 0x560(%rsp), %xmm2
cvtsd2ss %xmm2, %xmm2
callq 0x44cd0
jmp 0x41cb3
movq 0x598(%rsp), %rax
movslq 0x594(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x100(%rsp)
movq 0x578(%rsp), %rdi
callq 0x44d40
movq %rax, 0x108(%rsp)
jmp 0x41ced
movq 0x108(%rsp), %rsi
movq 0x100(%rsp), %rdi
callq 0x44d10
jmp 0x41d04
movq 0x598(%rsp), %rax
movslq 0x594(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0x578(%rsp), %rdi
callq 0x44d90
movl %eax, 0xfc(%rsp)
jmp 0x41d3d
movl 0xfc(%rsp), %esi
movq 0xf0(%rsp), %rdi
callq 0x44d50
jmp 0x41d53
jmp 0x41d55
movl 0x594(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x594(%rsp)
jmp 0x41993
movq 0x1e0(%rsp), %rsi
movq 0x1e8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
callq 0x13a90
jmp 0x424d1
movl $0xc8, %edi
callq 0x13570
movq %rax, 0xe8(%rsp)
jmp 0x41dad
movq 0x598(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x5b8(%rsp), %rdi
addq $0x8, %rdi
callq 0x16d50
movl %eax, 0xe4(%rsp)
jmp 0x41dd7
movl 0xe4(%rsp), %edx
movq 0xd8(%rsp), %rsi
movq 0xe8(%rsp), %rdi
leaq 0x5a0(%rsp), %rcx
xorps %xmm0, %xmm0
callq 0x49310
jmp 0x41e00
movq 0xe8(%rsp), %rax
movq %rax, 0x558(%rsp)
cmpq $0x0, 0x558(%rsp)
jne 0x41f7c
leaq 0x162fb3(%rip), %rdi    # 0x1a4dd9
xorl %eax, %eax
callq 0x1464b0
jmp 0x41e2f
movl $0x0, 0x554(%rsp)
movl 0x554(%rsp), %eax
movl %eax, 0xd0(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0xd4(%rsp)
jmp 0x41e5e
movl 0xd0(%rsp), %eax
movl 0xd4(%rsp), %ecx
cmpl %ecx, %eax
jge 0x41f0d
movl 0x554(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x44b50
movq %rax, 0xc8(%rsp)
jmp 0x41e92
movq 0xc8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xc0(%rsp)
cmpq $0x0, %rax
je 0x41eca
movq 0xc0(%rsp), %rdi
callq 0x44b70
movq 0xc0(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x41ecc
movl 0x554(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x554(%rsp)
jmp 0x41e3a
movq 0xe8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
movl $0xc8, %esi
callq 0x13580
jmp 0x424d1
cmpq $0x0, 0x770(%rsp)
je 0x41f3d
movq 0x770(%rsp), %rax
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
je 0x41f3b
movq 0xb8(%rsp), %rdi
callq 0x13750
jmp 0x41f3d
movq 0x598(%rsp), %rax
movq %rax, 0xb0(%rsp)
cmpq $0x0, %rax
je 0x41f60
movq 0xb0(%rsp), %rdi
callq 0x13750
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424c2
movq 0x598(%rsp), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x41f9f
movq 0xa8(%rsp), %rdi
callq 0x13750
leaq 0x450(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x5c8(%rsp), %rdi
callq 0x16d50
movl %eax, 0xa4(%rsp)
jmp 0x41fc5
movl 0xa4(%rsp), %edx
movq 0x98(%rsp), %rdi
leaq 0x162e15(%rip), %rsi    # 0x1a4df0
xorl %eax, %eax
callq 0x130f0
movl $0xd0, %edi
callq 0x13570
movq %rax, 0x90(%rsp)
jmp 0x41ff6
movq 0x90(%rsp), %rdi
leaq 0x450(%rsp), %rsi
callq 0x5e770
jmp 0x4200d
movq 0x90(%rsp), %rax
movq %rax, 0x448(%rsp)
cmpq $0x0, 0x448(%rsp)
jne 0x42183
leaq 0x162da6(%rip), %rdi    # 0x1a4dd9
xorl %eax, %eax
callq 0x1464b0
jmp 0x4203c
movl $0x0, 0x444(%rsp)
movl 0x444(%rsp), %eax
movl %eax, 0x88(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0x8c(%rsp)
jmp 0x4206b
movl 0x88(%rsp), %eax
movl 0x8c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x42111
movl 0x444(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x44b50
movq %rax, 0x80(%rsp)
jmp 0x4209f
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, %rax
je 0x420ce
movq 0x78(%rsp), %rdi
callq 0x44b70
movq 0x78(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x420d0
movl 0x444(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x444(%rsp)
jmp 0x42047
movq 0x90(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
movl $0xd0, %esi
callq 0x13580
jmp 0x424d1
cmpq $0x0, 0x770(%rsp)
je 0x4213b
movq 0x770(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, %rax
je 0x42139
movq 0x70(%rsp), %rdi
callq 0x13750
jmp 0x4213b
movq 0x558(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, %rax
je 0x42167
movq 0x68(%rsp), %rdi
callq 0x4a1c0
movq 0x68(%rsp), %rdi
movl $0xc8, %esi
callq 0x13580
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424c2
leaq 0x340(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x5c8(%rsp), %rdi
callq 0x16d50
movl %eax, 0x64(%rsp)
jmp 0x421a3
movl 0x64(%rsp), %edx
movq 0x58(%rsp), %rdi
leaq 0x162c3d(%rip), %rsi    # 0x1a4df0
xorl %eax, %eax
callq 0x130f0
movl $0xf8, %edi
callq 0x13570
movq %rax, 0x50(%rsp)
jmp 0x421cb
movq 0x50(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x189f0
jmp 0x421df
movq 0x50(%rsp), %rax
movq %rax, 0x338(%rsp)
cmpq $0x0, 0x338(%rsp)
jne 0x4235b
leaq 0x162bf3(%rip), %rdi    # 0x1a4df5
xorl %eax, %eax
callq 0x1464b0
jmp 0x4220b
movl $0x0, 0x334(%rsp)
movl 0x334(%rsp), %eax
movl %eax, 0x48(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x16d50
movl %eax, 0x4c(%rsp)
jmp 0x42234
movl 0x48(%rsp), %eax
movl 0x4c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x422cb
movl 0x334(%rsp), %esi
leaq 0x760(%rsp), %rdi
callq 0x44b50
movq %rax, 0x40(%rsp)
jmp 0x4225f
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x4228b
movq 0x38(%rsp), %rdi
callq 0x44b70
movq 0x38(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
jmp 0x4228d
movl 0x334(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x334(%rsp)
jmp 0x42216
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
movl $0xf8, %esi
callq 0x13580
jmp 0x424d1
cmpq $0x0, 0x770(%rsp)
je 0x422f5
movq 0x770(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x422f3
movq 0x30(%rsp), %rdi
callq 0x13750
jmp 0x422f5
movq 0x558(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x42321
movq 0x28(%rsp), %rdi
callq 0x4a1c0
movq 0x28(%rsp), %rdi
movl $0xc8, %esi
callq 0x13580
movq 0x448(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x4233f
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
jmp 0x424c2
movq 0x558(%rsp), %rdi
callq 0x4c380
jmp 0x4236a
movq 0x778(%rsp), %rdi
movq 0x558(%rsp), %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
jmp 0x42385
movq 0x448(%rsp), %rdi
movq 0x558(%rsp), %rsi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
jmp 0x423a0
movq 0x780(%rsp), %rdi
movq 0x448(%rsp), %rsi
movq 0x7a0(%rsp), %rdx
callq 0x620c0
jmp 0x423bf
movq 0x338(%rsp), %rdi
movq 0x448(%rsp), %rsi
callq 0x1ac10
jmp 0x423d6
movq 0x7b8(%rsp), %rdi
movq 0x338(%rsp), %rsi
movq 0x7a8(%rsp), %rdx
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x423f9
movq 0x5c8(%rsp), %rdi
movq 0x338(%rsp), %rsi
callq 0x1be70
jmp 0x42410
movq 0x5b8(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x4243c
movq 0x18(%rsp), %rdi
callq 0x44b70
movq 0x18(%rsp), %rdi
movl $0x58, %esi
callq 0x13580
movl 0x5c0(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x558(%rsp), %rdi
callq 0x1c0e0
movl %eax, 0x14(%rsp)
jmp 0x4245a
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %esi
leaq 0x1629a5(%rip), %rdi    # 0x1a4e0e
xorl %eax, %eax
callq 0x13070
jmp 0x42472
jmp 0x42474
movl 0x5c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c0(%rsp)
jmp 0x41781
movq 0x770(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x424a7
movq 0x8(%rsp), %rdi
callq 0x13750
movq 0x5c8(%rsp), %rax
movq %rax, 0x7c0(%rsp)
movl $0x1, 0x71c(%rsp)
leaq 0x6c8(%rsp), %rdi
callq 0x44db0
jmp 0x424e0
leaq 0x6c8(%rsp), %rdi
callq 0x44db0
jmp 0x424ef
leaq 0x760(%rsp), %rdi
callq 0x44df0
jmp 0x424fe
leaq 0x760(%rsp), %rdi
callq 0x44df0
jmp 0x4250e
movq 0x7c0(%rsp), %rax
addq $0x7c8, %rsp            # imm = 0x7C8
retq
movq 0x750(%rsp), %rdi
callq 0x13970
nopl (%rax,%rax)