// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::InsertScene(gaps::R3SurfelScene const&, gaps::R3SurfelObject*, gaps::R3SurfelLabel*, gaps::R3SurfelNode*)
void R3SurfelScene::
InsertScene(const R3SurfelScene& scene2, 
  R3SurfelObject *parent_object1, 
  R3SurfelLabel *parent_label1,
  R3SurfelNode *parent_node1)
{
  // Get convenient variables
  R3SurfelScene& scene1 = *this;
  R3SurfelTree *tree1 = scene1.Tree();
  R3SurfelTree *tree2 = scene2.Tree();
  R3SurfelDatabase *database1 = tree1->Database();
  R3SurfelDatabase *database2 = tree2->Database();

  // Find parents in scene1
  if (!parent_node1) parent_node1 = tree1->RootNode();
  if (!parent_object1) parent_object1 = scene1.RootObject();
  if (!parent_label1) parent_label1 = scene1.RootLabel();

 // COPY COMMENTS

  // Copy comments from scene2
  for (int i = 0; i < scene2.NComments(); i++) {
    const char *comment2 = scene2.Comment(i);
    scene1.InsertComment(comment2);
  }

 // COPY FEATURES

#if 0
  // Copy label features from scene2
  for (int i = 0; i < scene2.NFeatures(); i++) {
    R3SurfelFeature *feature2 = scene2.Feature(i);
    R3SurfelFeature *feature1 = new R3SurfelFeature(feature2->Name(), feature2->Minimum(), feature2->Maximum());
    scene1.InsertFeature(feature1);
  }
#endif

  // COPY NODES

  // Create surfel tree nodes in scene1
  RNArray<R3SurfelNode *> nodes1;
  nodes1.Insert(tree1->RootNode());
  for (int i = 1; i < tree2->NNodes(); i++) {
    R3SurfelNode *node1 = new R3SurfelNode();
    nodes1.Insert(node1);
  }

  // Copy node stuff from scene2
  for (int i = 1; i < tree2->NNodes(); i++) {
    R3SurfelNode *node1 = nodes1.Kth(i);
    R3SurfelNode *node2 = tree2->Node(i);
    R3SurfelNode *parent2 = node2->Parent();
    R3SurfelNode *parent1 = parent_node1;
    if (parent2 && (!parent2->Name() || strcmp(parent2->Name(), "Root")))
      parent1 = nodes1.Kth(parent2->TreeIndex());
    tree1->InsertNode(node1, parent1);
    node1->SetName(node2->Name());
    for (int j = 0; j < node2->NBlocks(); j++) {
      R3SurfelBlock *block2 = node2->Block(j);
      database2->ReadBlock(block2);
      R3SurfelBlock *block1 = new R3SurfelBlock(*block2);
      database1->InsertBlock(block1);
      node1->InsertBlock(block1);
      database1->ReleaseBlock(block1);
      database2->ReleaseBlock(block2);
    }      
  }

  // COPY OBJECTS

  // Create objects in scene1
  RNArray<R3SurfelObject *> objects1;
  objects1.Insert(scene1.RootObject());
  for (int i = 1; i < scene2.NObjects(); i++) {
    R3SurfelObject *object1 = new R3SurfelObject();
    objects1.Insert(object1);
  }

  // Copy object stuff from scene2
  for (int i = 1; i < scene2.NObjects(); i++) {
    R3SurfelObject *object1 = objects1.Kth(i);
    R3SurfelObject *object2 = scene2.Object(i);
    R3SurfelObject *parent2 = object2->Parent();
    R3SurfelObject *parent1 = parent_object1;
    if (parent2 && (!parent2->Name() || strcmp(parent2->Name(), "Root")))
      parent1 = objects1.Kth(parent2->SceneIndex());
    scene1.InsertObject(object1, parent1);
    object1->SetName(object2->Name());
    object1->SetIdentifier(object2->Identifier());
    object1->SetFeatureVector(object2->feature_vector);
    for (int j = 0; j < object2->NNodes(); j++) {
      R3SurfelNode *node2 = object2->Node(j);
      R3SurfelNode *node1 = nodes1.Kth(node2->TreeIndex());
      object1->InsertNode(node1);
    }
  }

  // COPY LABELS 

  // Create labels in scene1
  RNArray<R3SurfelLabel *> labels1;
  labels1.Insert(scene1.RootLabel());
  for (int i = 1; i < scene2.NLabels(); i++) {
    R3SurfelLabel *label1 = new R3SurfelLabel();
    labels1.Insert(label1);
  }

  // Copy label stuff from scene2
  for (int i = 1; i < scene2.NLabels(); i++) {
    R3SurfelLabel *label1 = labels1.Kth(i);
    R3SurfelLabel *label2 = scene2.Label(i);
    R3SurfelLabel *parent2 = label2->Parent();
    R3SurfelLabel *parent1 = parent_label1;
    if (parent2 && (!parent2->Name() || strcmp(parent2->Name(), "Root")))
      parent1 = labels1.Kth(parent2->SceneIndex());
    label1->SetName(label2->Name());
    label1->SetIdentifier(label2->Identifier());
    label1->SetAssignmentKeystroke(label2->AssignmentKeystroke());
    label1->SetColor(label2->Color());
    label1->SetFlags(label2->Flags());
    scene1.InsertLabel(label1, parent1);
  }

  // COPY OBJECT PROPERTIES

  // Copy object properties from scene2
  for (int i = 0; i < scene2.NObjectProperties(); i++) {
    R3SurfelObjectProperty *property2 = scene2.ObjectProperty(i);
    int type = property2->Type();
    RNArray<R3SurfelObject *> objects1;
    R3SurfelObject *object2 = property2->Object();
    R3SurfelObject *object1 = objects1.Kth(object2->SceneIndex());
    objects1.Insert(object1);
    int noperands1 = 0;
    RNScalar *operands1 = NULL;
    if (property2->NOperands() > 0) {
      noperands1 = property2->NOperands();
      operands1 = new RNScalar [ noperands1 ];
      for (int j = 0; j < noperands1; j++) {
        RNScalar operand2 = property2->Operand(j);
        operands1[j] = operand2;
      }
    }
    R3SurfelObjectProperty *property1 = new R3SurfelObjectProperty(type, object1, operands1, noperands1);
    scene1.InsertObjectProperty(property1);
    delete [] operands1;
  }

  // COPY LABEL PROPERTIES

  // Copy label properties from scene2
  for (int i = 0; i < scene2.NLabelProperties(); i++) {
    R3SurfelLabelProperty *property2 = scene2.LabelProperty(i);
    int type = property2->Type();
    RNArray<R3SurfelLabel *> labels1;
    R3SurfelLabel *label2 = property2->Label();
    R3SurfelLabel *label1 = labels1.Kth(label2->SceneIndex());
    labels1.Insert(label1);
    int noperands1 = 0;
    RNScalar *operands1 = NULL;
    if (property2->NOperands() > 0) {
      noperands1 = property2->NOperands();
      operands1 = new RNScalar [ noperands1 ];
      for (int j = 0; j < noperands1; j++) {
        RNScalar operand2 = property2->Operand(j);
        operands1[j] = operand2;
      }
    }
    R3SurfelLabelProperty *property1 = new R3SurfelLabelProperty(type, label1, operands1, noperands1);
    scene1.InsertLabelProperty(property1);
    delete [] operands1;
  }

  // COPY OBJECT RELATIONSHIPS

  // Copy object relationships from scene2
  for (int i = 0; i < scene2.NObjectRelationships(); i++) {
    R3SurfelObjectRelationship *relationship2 = scene2.ObjectRelationship(i);
    int type = relationship2->Type();
    RNArray<R3SurfelObject *> objects1;
    for (int j = 0; j < relationship2->NObjects(); j++) {
      R3SurfelObject *object2 = relationship2->Object(j);
      R3SurfelObject *object1 = objects1.Kth(object2->SceneIndex());
      objects1.Insert(object1);
    }
    int noperands1 = 0;
    RNScalar *operands1 = NULL;
    if (relationship2->NOperands() > 0) {
      noperands1 = relationship2->NOperands();
      operands1 = new RNScalar [ noperands1 ];
      for (int j = 0; j < noperands1; j++) {
        RNScalar operand2 = relationship2->Operand(j);
        operands1[j] = operand2;
      }
    }
    R3SurfelObjectRelationship *relationship1 = new R3SurfelObjectRelationship(type, objects1, operands1, noperands1);
    scene1.InsertObjectRelationship(relationship1);
    delete [] operands1;
  }

  // COPY LABEL RELATIONSHIPS

  // Copy label relationships from scene2
  for (int i = 0; i < scene2.NLabelRelationships(); i++) {
    R3SurfelLabelRelationship *relationship2 = scene2.LabelRelationship(i);
    int type = relationship2->Type();
    RNArray<R3SurfelLabel *> labels1;
    for (int j = 0; j < relationship2->NLabels(); j++) {
      R3SurfelLabel *label2 = relationship2->Label(j);
      R3SurfelLabel *label1 = labels1.Kth(label2->SceneIndex());
      labels1.Insert(label1);
    }
    int noperands1 = 0;
    RNScalar *operands1 = NULL;
    if (relationship2->NOperands() > 0) {
      noperands1 = relationship2->NOperands();
      operands1 = new RNScalar [ noperands1 ];
      for (int j = 0; j < noperands1; j++) {
        RNScalar operand2 = relationship2->Operand(j);
        operands1[j] = operand2;
      }
    }
    R3SurfelLabelRelationship *relationship1 = new R3SurfelLabelRelationship(type, labels1, operands1);
    scene1.InsertLabelRelationship(relationship1);
    delete [] operands1;
  }

  // COPY ASSIGNMENTS

  // Copy label assignments from scene2
  for (int i = 0; i < scene2.NLabelAssignments(); i++) {
    R3SurfelLabelAssignment *assignment2 = scene2.LabelAssignment(i);
    R3SurfelObject *object2 = assignment2->Object();
    R3SurfelLabel *label2 = assignment2->Label();
    R3SurfelObject *object1 = objects1.Kth(object2->SceneIndex());
    R3SurfelLabel *label1 = labels1.Kth(label2->SceneIndex());
    R3SurfelLabelAssignment *assignment1 = new R3SurfelLabelAssignment(object1, label1, assignment2->Confidence(), assignment2->Originator());
    scene1.InsertLabelAssignment(assignment1);
  }

  // COPY SCANS

  // Copy scans from scene2
  RNArray<R3SurfelScan *> scans1;
  for (int i = 0; i < scene2.NScans(); i++) {
    R3SurfelScan *scan2 = scene2.Scan(i);
    R3SurfelScan *scan1 = new R3SurfelScan(scan2->Name());
    scan1->SetPose(scan2->Pose());
    scan1->SetTimestamp(scan2->Timestamp());
    scan1->SetXFocal(scan2->XFocal());
    scan1->SetYFocal(scan2->YFocal());
    scan1->SetImageDimensions(scan2->ImageWidth(), scan2->ImageHeight());
    scan1->SetImageCenter(scan2->ImageCenter());
    scan1->SetFlags(scan2->Flags());
    R3SurfelNode *node2 = scan2->Node();
    R3SurfelNode *node1 = nodes1.Kth(node2->TreeIndex());
    scan1->SetNode(node1);
    scene1.InsertScan(scan1);
    scans1.Insert(scan1);
  }

  // COPY IMAGES
  
  // Copy images from scene2
  for (int i = 0; i < scene2.NImages(); i++) {
    R3SurfelImage *image2 = scene2.Image(i);
    R3SurfelImage *image1 = new R3SurfelImage(image2->Name());
    const R3CoordSystem *rolling_shutter_poses = image2->RollingShutterPoses();
    const RNScalar *rolling_shutter_timestamps = image2->RollingShutterTimestamps();
    image1->SetRollingShutterPoses(rolling_shutter_poses[0], rolling_shutter_poses[1]);
    image1->SetRollingShutterTimestamps(rolling_shutter_timestamps[0], rolling_shutter_timestamps[1]);
    image1->SetXFocal(image2->XFocal());
    image1->SetYFocal(image2->YFocal());
    image1->SetImageDimensions(image2->ImageWidth(), image2->ImageHeight());
    image1->SetImageCenter(image2->ImageCenter());
    image1->SetDistortionType(image2->DistortionType());
    image1->SetRadialDistortion(image2->RadialDistortion());
    image1->SetTangentialDistortion(image2->TangentialDistortion());
    image1->SetFlags(image2->Flags());
    R3SurfelScan *scan2 = image2->Scan();
    R3SurfelScan *scan1 = (scan2) ? scans1.Kth(scan2->SceneIndex()) : NULL;
    image1->SetScan(scan1);
    scene1.InsertImage(image1);

    // Copy image channels?
    // XXX
  }

  // Mark scene as dirty
  flags.Add(R3_SURFEL_SCENE_DIRTY_FLAG);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x28(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq %rax, 0x20(%rsp)
movq %r8, 0x38(%rsp)
testq %r8, %r8
jne 0x19e12
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
testq %rdx, %rdx
jne 0x19e1e
movq 0x10(%r14), %rax
movq (%rax), %rdx
movq %rdx, 0x70(%rsp)
movq 0x8(%rsp), %r13
movq 0x8(%r13), %rcx
cmpq $0x0, 0x28(%rsp)
jne 0x19e40
movq 0x20(%r14), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r15
movq %rcx, 0x30(%rsp)
movq 0x10(%rcx), %r12
cmpl $0x0, 0x1e4(%r13)
jle 0x19e84
xorl %ebx, %ebx
movq 0x1d8(%r13), %rax
movq (%rax,%rbx,8), %rsi
movq (%r14), %rax
movq %r14, %rdi
callq *0xc0(%rax)
incq %rbx
movslq 0x1e4(%r13), %rax
cmpq %rax, %rbx
jl 0x19e5e
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0xaaf34
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movl 0xc(%rbx), %edx
movq %rbx, %rdi
callq 0xaafca
movq 0x30(%rsp), %rax
cmpl $0x2, 0x24(%rax)
jl 0x19eef
movl $0x1, %ebp
leaq 0x60(%rsp), %rbx
movl $0xd0, %edi
callq 0x134e0
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
callq 0x37448
movl 0x6c(%rsp), %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xaafca
incl %ebp
movq 0x30(%rsp), %rax
cmpl 0x24(%rax), %ebp
jl 0x19ebd
movq %r14, (%rsp)
movq 0x30(%rsp), %rcx
cmpl $0x2, 0x24(%rcx)
jl 0x1a0d7
movl $0x1, %edx
movq 0x60(%rsp), %rbx
movq (%rbx,%rdx,8), %rbp
movq 0x18(%rcx), %rax
movq %rdx, 0x78(%rsp)
movq (%rax,%rdx,8), %r13
movq 0x28(%r13), %r14
movq 0x38(%rsp), %rdx
testq %r14, %r14
je 0x19f54
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x19f4c
leaq 0xc44c6(%rip), %rsi     # 0xde404
callq 0x13710
movq 0x38(%rsp), %rdx
testl %eax, %eax
je 0x19f54
movslq 0x20(%r14), %rax
movq (%rbx,%rax,8), %rdx
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x39272
movq 0xb8(%r13), %rsi
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x10(%rax)
movq %rbp, 0x80(%rsp)
cmpl $0x0, 0x4c(%r13)
jle 0x1a0bd
xorl %r14d, %r14d
movq %r13, %rbp
movq 0x40(%r13), %rax
movq (%rax,%r14,8), %r13
cmpl $0x0, 0xb4(%r13)
jne 0x19fbb
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r13, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x19fc2
incl 0xb4(%r13)
movl $0xc8, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2bb32
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movq 0x80(%rsp), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x28(%rax)
cmpl $0x1, 0xb4(%rbx)
jne 0x1a01b
movq (%r15), %rax
movq 0x8(%r15), %rdx
movl 0x28(%r15), %ecx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x1a04d
decl 0xb4(%rbx)
jne 0x1a04d
testb $0x2, 0x89(%rbx)
je 0x1a04d
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
cmpl $0x1, 0xb4(%r13)
jne 0x1a075
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r13, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x1a0aa
decl 0xb4(%r13)
jne 0x1a0aa
testb $0x2, 0x89(%r13)
je 0x1a0aa
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x18(%rax)
movq %r13, %rdi
callq 0x2ce2e
movl $0xc8, %esi
movq %r13, %rdi
callq 0x134f0
incq %r14
movq %rbp, %r13
movslq 0x4c(%rbp), %rax
cmpq %rax, %r14
jl 0x19f88
movq 0x78(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
movslq 0x24(%rcx), %rax
cmpq %rax, %rdx
jl 0x19f07
leaq 0x50(%rsp), %rdi
callq 0xaaf34
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0x50(%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xaafca
movq 0x8(%rsp), %r14
cmpl $0x2, 0x1c(%r14)
jl 0x1a13d
movl $0x1, %ebp
leaq 0x50(%rsp), %rbx
movl $0xf8, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x16bb8
movl 0x5c(%rsp), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xaafca
incl %ebp
cmpl 0x1c(%r14), %ebp
jl 0x1a10f
cmpl $0x2, 0x1c(%r14)
jl 0x1a223
movl $0x1, %ebx
leaq 0xc42b0(%rip), %r15     # 0xde404
movq %r14, %rax
movq 0x50(%rsp), %r14
movq (%r14,%rbx,8), %r12
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %r13
movq 0x18(%r13), %rbp
movq 0x70(%rsp), %rdx
testq %rbp, %rbp
je 0x1a19b
movq 0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x1a193
movq %r15, %rsi
callq 0x13710
movq 0x70(%rsp), %rdx
testl %eax, %eax
je 0x1a19b
movslq 0x10(%rbp), %rax
movq (%r14,%rax,8), %rdx
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x18(%rax)
movq 0x88(%r13), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq %r13, %rdi
callq 0x17098
movq (%r12), %rcx
movq %r12, %rdi
movl %eax, %esi
callq *0x18(%rcx)
leaq 0x70(%r13), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x20(%rax)
cmpl $0x0, 0x6c(%r13)
jle 0x1a20e
xorl %r14d, %r14d
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rax
movslq 0x20(%rax), %rax
movq 0x60(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r12, %rdi
callq 0x17e86
incq %r14
movslq 0x6c(%r13), %rax
cmpq %rax, %r14
jl 0x1a1e5
incq %rbx
movq 0x8(%rsp), %r14
movslq 0x1c(%r14), %rax
cmpq %rax, %rbx
jl 0x1a154
leaq 0x40(%rsp), %rdi
callq 0xaaf34
movq (%rsp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
leaq 0x40(%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xaafca
cmpl $0x2, 0x2c(%r14)
jl 0x1a284
movl $0x1, %ebp
leaq 0x40(%rsp), %rbx
movl $0x98, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x40528
movl 0x4c(%rsp), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xaafca
incl %ebp
cmpl 0x2c(%r14), %ebp
jl 0x1a256
cmpl $0x2, 0x2c(%r14)
movq %r14, %rcx
jl 0x1a352
movl $0x1, %r14d
movq 0x40(%rsp), %rbp
movq (%rbp,%r14,8), %r12
movq 0x20(%rcx), %rax
movq (%rax,%r14,8), %rbx
movq 0x18(%rbx), %r15
movq 0x28(%rsp), %r13
testq %r15, %r15
je 0x1a2df
movq 0x60(%r15), %rdi
testq %rdi, %rdi
je 0x1a2d6
leaq 0xc413c(%rip), %rsi     # 0xde404
callq 0x13710
movq 0x28(%rsp), %r13
testl %eax, %eax
je 0x1a2df
movslq 0x10(%r15), %rax
movq (%rbp,%rax,8), %r13
movq 0x60(%rbx), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x40828
movq (%r12), %rcx
movq %r12, %rdi
movl %eax, %esi
callq *0x20(%rcx)
movl 0x6c(%rbx), %esi
movq (%r12), %rax
movq %r12, %rdi
callq *0x28(%rax)
leaq 0x70(%rbx), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x30(%rax)
movq 0x88(%rbx), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movq %r13, %rdx
callq *0x30(%rax)
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x2c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a298
cmpl $0x0, 0x3c(%rcx)
jle 0x1a42e
xorl %r14d, %r14d
leaq 0x10(%rsp), %r13
movq 0x30(%rcx), %rax
movq (%rax,%r14,8), %r15
movl 0x2c(%r15), %ebx
movq %r13, %rdi
callq 0xaaf34
movq 0x18(%r15), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movl 0x1c(%rsp), %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0xaafca
movslq 0x28(%r15), %rbp
testq %rbp, %rbp
jle 0x1a3cd
leaq (,%rbp,8), %rdi
callq 0x13030
movq %rax, %r13
movq 0x20(%r15), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r13,%rcx,8)
incq %rcx
cmpq %rcx, %rbp
jne 0x1a3b7
jmp 0x1a3d2
xorl %r13d, %r13d
xorl %ebp, %ebp
movl $0x30, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %r13, %rcx
movl %ebp, %r8d
callq 0x3f2d4
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x40(%rax)
testq %r13, %r13
je 0x1a40c
movq %r13, %rdi
callq 0x13680
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xaaf9e
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x3c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a364
cmpl $0x0, 0x4c(%rcx)
jle 0x1a50a
xorl %r14d, %r14d
leaq 0x10(%rsp), %r13
movq 0x40(%rcx), %rax
movq (%rax,%r14,8), %r15
movl 0x2c(%r15), %ebx
movq %r13, %rdi
callq 0xaaf34
movq 0x18(%r15), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movl 0x1c(%rsp), %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0xaafca
movslq 0x28(%r15), %rbp
testq %rbp, %rbp
jle 0x1a4a9
leaq (,%rbp,8), %rdi
callq 0x13030
movq %rax, %r13
movq 0x20(%r15), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r13,%rcx,8)
incq %rcx
cmpq %rcx, %rbp
jne 0x1a493
jmp 0x1a4ae
xorl %r13d, %r13d
xorl %ebp, %ebp
movl $0x30, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %r13, %rcx
movl %ebp, %r8d
callq 0x40bd8
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x50(%rax)
testq %r13, %r13
je 0x1a4e8
movq %r13, %rdi
callq 0x13680
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xaaf9e
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x4c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a440
cmpl $0x0, 0x5c(%rcx)
jle 0x1a5f5
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
movq 0x50(%rcx), %rax
movq (%rax,%r14,8), %r13
movl 0x34(%r13), %ebp
movq %r15, %rdi
callq 0xaaf34
cmpl $0x0, 0x24(%r13)
jle 0x1a566
xorl %ebx, %ebx
movq 0x18(%r13), %rax
movq (%rax,%rbx,8), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movl 0x1c(%rsp), %edx
movq %r15, %rdi
callq 0xaafca
incq %rbx
movslq 0x24(%r13), %rax
cmpq %rax, %rbx
jl 0x1a539
movslq 0x30(%r13), %r12
testq %r12, %r12
jle 0x1a599
leaq (,%r12,8), %rdi
callq 0x13030
movq %rax, %rbx
movq 0x28(%r13), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %r12
jne 0x1a585
jmp 0x1a59e
xorl %r12d, %r12d
xorl %ebx, %ebx
movl $0x38, %edi
callq 0x134e0
movq %rax, %r13
movq %rax, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
movl %r12d, %r8d
callq 0x40174
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *0x60(%rax)
testq %rbx, %rbx
je 0x1a5d8
movq %rbx, %rdi
callq 0x13680
movq %r15, %rdi
callq 0xaaf9e
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x5c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a51c
cmpl $0x0, 0x6c(%rcx)
jle 0x1a6e3
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
movq 0x60(%rcx), %rax
movq (%rax,%r14,8), %r12
movl 0x34(%r12), %ebp
movq %r15, %rdi
callq 0xaaf34
cmpl $0x0, 0x24(%r12)
jle 0x1a655
xorl %ebx, %ebx
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movl 0x1c(%rsp), %edx
movq %r15, %rdi
callq 0xaafca
incq %rbx
movslq 0x24(%r12), %rax
cmpq %rax, %rbx
jl 0x1a626
movslq 0x30(%r12), %r13
testq %r13, %r13
jle 0x1a68a
leaq (,%r13,8), %rdi
callq 0x13030
movq %rax, %rbx
movq 0x28(%r12), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %r13
jne 0x1a676
jmp 0x1a68c
xorl %ebx, %ebx
movl $0x38, %edi
callq 0x134e0
movq %rax, %r12
movq %rax, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x40d9c
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x70(%rax)
testq %rbx, %rbx
je 0x1a6c6
movq %rbx, %rdi
callq 0x13680
movq %r15, %rdi
callq 0xaaf9e
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x6c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a607
cmpl $0x0, 0x7c(%rcx)
jle 0x1a75c
xorl %r14d, %r14d
movq 0x70(%rcx), %rax
movq (%rax,%r14,8), %r13
movq 0x18(%r13), %rax
movq 0x28(%r13), %rcx
movslq 0x10(%rax), %rax
movq 0x50(%rsp), %rdx
movq (%rdx,%rax,8), %r15
movslq 0x10(%rcx), %rax
movq 0x40(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movl $0x50, %edi
callq 0x134e0
movq %rax, %rbx
movsd 0x38(%r13), %xmm0
movl 0x40(%r13), %ecx
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x410bc
movq (%rsp), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x80(%rax)
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x7c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a6ec
leaq 0x10(%rsp), %rdi
callq 0xaaf34
movq 0x8(%rsp), %rcx
cmpl $0x0, 0x8c(%rcx)
movq (%rsp), %r14
jle 0x1a880
xorl %ebx, %ebx
leaq 0x10(%rsp), %r15
movq 0x80(%rcx), %rax
movq (%rax,%rbx,8), %r14
movl $0xd0, %edi
callq 0x134e0
movq %rax, %r12
movq 0xb8(%r14), %rsi
movq %rax, %rdi
callq 0x3b498
leaq 0x28(%r14), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movsd 0x88(%r14), %xmm0
movq (%r12), %rax
movq %r12, %rdi
callq *0x28(%rax)
movsd 0xa8(%r14), %xmm0
movq (%r12), %rax
movq %r12, %rdi
callq *0x50(%rax)
movsd 0xb0(%r14), %xmm0
movq (%r12), %rax
movq %r12, %rdi
callq *0x58(%rax)
movl 0x90(%r14), %esi
movl 0x94(%r14), %edx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
leaq 0x98(%r14), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x40(%rax)
movq 0xc0(%r14), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x60(%rax)
movq 0x18(%r14), %rax
movslq 0x20(%rax), %rax
movq 0x60(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x78(%rax)
movq (%rsp), %r14
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x90(%rax)
movl 0x1c(%rsp), %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xaafca
incq %rbx
movq 0x8(%rsp), %rcx
movslq 0x8c(%rcx), %rax
cmpq %rax, %rbx
jl 0x1a783
cmpl $0x0, 0x9c(%rcx)
jle 0x1a9dc
xorl %ebx, %ebx
movq 0x90(%rcx), %rax
movq (%rax,%rbx,8), %r14
movl $0x1d8, %edi            # imm = 0x1D8
callq 0x134e0
movq %rax, %r15
movq 0x1c0(%r14), %rsi
movq %rax, %rdi
callq 0x3babc
leaq 0xf0(%r14), %rsi
leaq 0x150(%r14), %rdx
movq (%r15), %rax
movq %r15, %rdi
callq *0xb8(%rax)
movsd 0x1b0(%r14), %xmm0
movsd 0x1b8(%r14), %xmm1
movq (%r15), %rax
movq %r15, %rdi
callq *0xc0(%rax)
movsd 0xb0(%r14), %xmm0
movq (%r15), %rax
movq %r15, %rdi
callq *0x88(%rax)
movsd 0xb8(%r14), %xmm0
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
movl 0x98(%r14), %esi
movl 0x9c(%r14), %edx
movq (%r15), %rax
movq %r15, %rdi
callq *0x70(%rax)
leaq 0xa0(%r14), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x78(%rax)
movl 0xc0(%r14), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0xa0(%rax)
leaq 0xc8(%r14), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0xa8(%rax)
leaq 0xe0(%r14), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0xb0(%rax)
movq 0x1c8(%r14), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0xd8(%rax)
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x1a9a3
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
jmp 0x1a9a5
xorl %esi, %esi
movq (%rsp), %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0xd0(%rax)
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0xa0(%rax)
incq %rbx
movq 0x8(%rsp), %rcx
movslq 0x9c(%rcx), %rax
cmpq %rax, %rbx
jl 0x1a88f
orb $0x1, 0x1e8(%r14)
leaq 0x10(%rsp), %rdi
callq 0xaaf9e
leaq 0x40(%rsp), %rdi
callq 0xaaf9e
leaq 0x50(%rsp), %rdi
callq 0xaaf9e
leaq 0x60(%rsp), %rdi
callq 0xaaf9e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1aaff
jmp 0x1aaff
jmp 0x1ab1c
jmp 0x1ab1c
jmp 0x1ab46
jmp 0x1ab46
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1ab23
movq %rax, %r14
movl $0x98, %esi
movq %r15, %rdi
jmp 0x1aab5
movq %rax, %r14
movl $0xf8, %esi
movq %r15, %rdi
callq 0x134f0
jmp 0x1ab3a
movq %rax, %r14
movl $0xd0, %esi
movq %r13, %rdi
jmp 0x1ab15
jmp 0x1ab23
movq %rax, %r14
movl $0x1d8, %esi            # imm = 0x1D8
jmp 0x1aad9
movq %rax, %r14
movl $0xd0, %esi
jmp 0x1aaa3
movq %rax, %r14
movl $0x38, %esi
movq %r12, %rdi
jmp 0x1aadc
jmp 0x1aaff
movq %rax, %r14
movl $0x50, %esi
movq %rbx, %rdi
callq 0x134f0
jmp 0x1ab30
movq %rax, %r14
movl $0x38, %esi
movq %r13, %rdi
jmp 0x1aadc
jmp 0x1aaff
jmp 0x1aad1
jmp 0x1aaff
jmp 0x1ab23
movq %rax, %r14
movl $0x30, %esi
movq %r15, %rdi
callq 0x134f0
jmp 0x1ab26
jmp 0x1aaff
jmp 0x1ab23
jmp 0x1ab46
jmp 0x1aaff
jmp 0x1ab1c
jmp 0x1ab46
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1aaff
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1ab23
jmp 0x1ab1c
movq %rax, %r14
jmp 0x1ab30
jmp 0x1ab46
jmp 0x1ab23
jmp 0x1ab23
movq %rax, %r14
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
jmp 0x1ab49
movq %rax, %r14
jmp 0x1ab3a
jmp 0x1ab23
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xaaf9e
leaq 0x40(%rsp), %rdi
callq 0xaaf9e
leaq 0x50(%rsp), %rdi
callq 0xaaf9e
jmp 0x1ab49
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0xaaf9e
movq %r14, %rdi
callq 0x138b0
nop