// File: /workspace/github_cpp_makefile_star2_O3/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, 0x30(%rsp)
testq %r8, %r8
jne 0x19ca2
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
testq %rdx, %rdx
jne 0x19cae
movq 0x10(%r14), %rax
movq (%rax), %rdx
movq %rdx, 0x70(%rsp)
movq 0x8(%rsp), %r13
movq 0x8(%r13), %rcx
cmpq $0x0, 0x28(%rsp)
jne 0x19cd0
movq 0x20(%r14), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r15
movq %rcx, 0x68(%rsp)
movq 0x10(%rcx), %r12
cmpl $0x0, 0x1e4(%r13)
jle 0x19d14
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 0x19cee
movq %r14, (%rsp)
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0xa9ca8
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movl 0xc(%rbx), %edx
movq %rbx, %rdi
callq 0xa9d3e
movq 0x68(%rsp), %r14
cmpl $0x2, 0x24(%r14)
jl 0x19f86
movl $0x1, %ebp
leaq 0x58(%rsp), %rbx
movl $0xd0, %edi
callq 0x134e0
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
callq 0x3715c
movl 0x64(%rsp), %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa9d3e
incl %ebp
movl 0x24(%r14), %eax
cmpl %eax, %ebp
jl 0x19d56
cmpl $0x2, %eax
jl 0x19f86
movl $0x1, %r13d
movq 0x58(%rsp), %rbx
movq (%rbx,%r13,8), %rbp
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rax
movq %rax, 0x78(%rsp)
movq 0x28(%rax), %r14
movq 0x30(%rsp), %rdx
testq %r14, %r14
je 0x19de2
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x19dda
leaq 0xc3638(%rip), %rsi     # 0xdd404
callq 0x13710
movq 0x30(%rsp), %rdx
testl %eax, %eax
je 0x19de2
movslq 0x20(%r14), %rax
movq (%rbx,%rax,8), %rdx
movq %r13, 0x80(%rsp)
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x38f02
movq 0x78(%rsp), %rbx
movq 0xb8(%rbx), %rsi
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x10(%rax)
cmpl $0x0, 0x4c(%rbx)
jle 0x19f69
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %r13
movl 0xb4(%r13), %eax
testl %eax, %eax
jne 0x19e52
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r13, %rsi
callq *0x88(%rax)
testl %eax, %eax
je 0x19e5b
movl 0xb4(%r13), %eax
incl %eax
movl %eax, 0xb4(%r13)
movl $0xc8, %edi
callq 0x134e0
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2b70a
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movq (%rbp), %rax
movq %rbp, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
movl 0xb4(%rbx), %eax
cmpl $0x1, %eax
jne 0x19eb8
movq (%r15), %rax
movq 0x8(%r15), %rdx
movl 0x28(%r15), %ecx
movq %r15, %rdi
movq %rbx, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x19eec
movl 0xb4(%rbx), %eax
decl %eax
movl %eax, 0xb4(%rbx)
jne 0x19eec
testb $0x2, 0x89(%rbx)
je 0x19eec
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
movl 0xb4(%r13), %eax
cmpl $0x1, %eax
jne 0x19f1d
movq (%r12), %rax
movq 0x8(%r12), %rdx
movl 0x28(%r12), %ecx
movq %r12, %rdi
movq %r13, %rsi
callq *0x90(%rax)
testl %eax, %eax
je 0x19f54
movl 0xb4(%r13), %eax
decl %eax
movl %eax, 0xb4(%r13)
jne 0x19f54
testb $0x2, 0x89(%r13)
je 0x19f54
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x18(%rax)
movq %r13, %rdi
callq 0x2ca06
movl $0xc8, %esi
movq %r13, %rdi
callq 0x134f0
incq %r14
movq 0x78(%rsp), %rbx
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x19e1a
movq 0x80(%rsp), %r13
incq %r13
movq 0x68(%rsp), %r14
movslq 0x24(%r14), %rax
cmpq %rax, %r13
jl 0x19d95
leaq 0x48(%rsp), %rdi
callq 0xa9ca8
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0x48(%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xa9d3e
movq 0x8(%rsp), %r14
cmpl $0x2, 0x1c(%r14)
jl 0x1a0d6
movl $0x1, %ebp
leaq 0x48(%rsp), %rbx
movl $0xf8, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x16b68
movl 0x54(%rsp), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d3e
incl %ebp
movl 0x1c(%r14), %eax
cmpl %eax, %ebp
jl 0x19fc2
cmpl $0x2, %eax
jl 0x1a0d6
movl $0x1, %ebx
leaq 0xc33fd(%rip), %r15     # 0xdd404
movq %r14, %rax
movq 0x48(%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 0x1a04e
movq 0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x1a046
movq %r15, %rsi
callq 0x13710
movq 0x70(%rsp), %rdx
testl %eax, %eax
je 0x1a04e
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 0x17056
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 0x1a0c1
xorl %r14d, %r14d
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rax
movslq 0x20(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r12, %rdi
callq 0x17dd6
incq %r14
movslq 0x6c(%r13), %rax
cmpq %rax, %r14
jl 0x1a098
incq %rbx
movq 0x8(%rsp), %r14
movslq 0x1c(%r14), %rax
cmpq %rax, %rbx
jl 0x1a007
leaq 0x38(%rsp), %rdi
callq 0xa9ca8
movq (%rsp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
leaq 0x38(%rsp), %rdi
movl 0xc(%rdi), %edx
callq 0xa9d3e
cmpl $0x2, 0x2c(%r14)
movq %r14, %rcx
jl 0x1a20f
movl $0x1, %ebp
leaq 0x38(%rsp), %rbx
movq %rcx, %r14
movl $0x98, %edi
callq 0x134e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x4018c
movl 0x44(%rsp), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa9d3e
incl %ebp
movl 0x2c(%r14), %eax
cmpl %eax, %ebp
jl 0x1a113
cmpl $0x2, %eax
movq %r14, %rcx
jl 0x1a20f
movl $0x1, %r14d
movq 0x38(%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 0x1a19c
movq 0x60(%r15), %rdi
testq %rdi, %rdi
je 0x1a193
leaq 0xc327f(%rip), %rsi     # 0xdd404
callq 0x13710
movq 0x28(%rsp), %r13
testl %eax, %eax
je 0x1a19c
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 0x4048a
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 0x1a155
cmpl $0x0, 0x3c(%rcx)
jle 0x1a2eb
xorl %r14d, %r14d
leaq 0x10(%rsp), %r13
movq 0x30(%rcx), %rax
movq (%rax,%r14,8), %r15
movl 0x2c(%r15), %ebx
movq %r13, %rdi
callq 0xa9ca8
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 0xa9d3e
movslq 0x28(%r15), %rbp
testq %rbp, %rbp
jle 0x1a28a
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 0x1a274
jmp 0x1a28f
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 0x3ef3c
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x40(%rax)
testq %r13, %r13
je 0x1a2c9
movq %r13, %rdi
callq 0x13680
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xa9d12
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x3c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a221
cmpl $0x0, 0x4c(%rcx)
jle 0x1a3c7
xorl %r14d, %r14d
leaq 0x10(%rsp), %r13
movq 0x40(%rcx), %rax
movq (%rax,%r14,8), %r15
movl 0x2c(%r15), %ebx
movq %r13, %rdi
callq 0xa9ca8
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 0xa9d3e
movslq 0x28(%r15), %rbp
testq %rbp, %rbp
jle 0x1a366
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 0x1a350
jmp 0x1a36b
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 0x40838
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x50(%rax)
testq %r13, %r13
je 0x1a3a5
movq %r13, %rdi
callq 0x13680
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xa9d12
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x4c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a2fd
cmpl $0x0, 0x5c(%rcx)
jle 0x1a4b3
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
movq 0x50(%rcx), %rax
movq (%rax,%r14,8), %rbp
movl 0x34(%rbp), %ebx
movq %r15, %rdi
callq 0xa9ca8
cmpl $0x0, 0x24(%rbp)
jle 0x1a422
xorl %r12d, %r12d
movq 0x18(%rbp), %rax
movq (%rax,%r12,8), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movl 0x1c(%rsp), %edx
movq %r15, %rdi
callq 0xa9d3e
incq %r12
movslq 0x24(%rbp), %rax
cmpq %rax, %r12
jl 0x1a3f5
movslq 0x30(%rbp), %r13
testq %r13, %r13
jle 0x1a456
leaq (,%r13,8), %rdi
callq 0x13030
movq %rax, %r12
movq 0x28(%rbp), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r12,%rcx,8)
incq %rcx
cmpq %rcx, %r13
jne 0x1a441
jmp 0x1a45c
xorl %r13d, %r13d
xorl %r12d, %r12d
movl $0x38, %edi
callq 0x134e0
movq %rax, %rbp
movq %rax, %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %rcx
movl %r13d, %r8d
callq 0x3fde0
movq (%rsp), %rdi
movq (%rdi), %rax
movq %rbp, %rsi
callq *0x60(%rax)
testq %r12, %r12
je 0x1a496
movq %r12, %rdi
callq 0x13680
movq %r15, %rdi
callq 0xa9d12
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x5c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a3d9
cmpl $0x0, 0x6c(%rcx)
jle 0x1a59e
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
movq 0x60(%rcx), %rax
movq (%rax,%r14,8), %r13
movl 0x34(%r13), %ebx
movq %r15, %rdi
callq 0xa9ca8
cmpl $0x0, 0x24(%r13)
jle 0x1a510
xorl %r12d, %r12d
movq 0x18(%r13), %rax
movq (%rax,%r12,8), %rax
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movl 0x1c(%rsp), %edx
movq %r15, %rdi
callq 0xa9d3e
incq %r12
movslq 0x24(%r13), %rax
cmpq %rax, %r12
jl 0x1a4e3
movslq 0x30(%r13), %rbp
testq %rbp, %rbp
jle 0x1a544
leaq (,%rbp,8), %rdi
callq 0x13030
movq %rax, %r12
movq 0x28(%r13), %rax
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r12,%rcx,8)
incq %rcx
cmpq %rcx, %rbp
jne 0x1a52f
jmp 0x1a547
xorl %r12d, %r12d
movl $0x38, %edi
callq 0x134e0
movq %rax, %r13
movq %rax, %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x409fc
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *0x70(%rax)
testq %r12, %r12
je 0x1a581
movq %r12, %rdi
callq 0x13680
movq %r15, %rdi
callq 0xa9d12
incq %r14
movq 0x8(%rsp), %rcx
movslq 0x6c(%rcx), %rax
cmpq %rax, %r14
jl 0x1a4c5
cmpl $0x0, 0x7c(%rcx)
jle 0x1a617
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 0x48(%rsp), %rdx
movq (%rdx,%rax,8), %r15
movslq 0x10(%rcx), %rax
movq 0x38(%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 0x40d14
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 0x1a5a7
leaq 0x10(%rsp), %rdi
callq 0xa9ca8
movq 0x8(%rsp), %rcx
cmpl $0x0, 0x8c(%rcx)
movq (%rsp), %r14
jle 0x1a73b
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 0x3b0fc
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 0x58(%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 0xa9d3e
incq %rbx
movq 0x8(%rsp), %rcx
movslq 0x8c(%rcx), %rax
cmpq %rax, %rbx
jl 0x1a63e
cmpl $0x0, 0x9c(%rcx)
jle 0x1a897
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 0x3b724
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 0x1a85e
movslq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
jmp 0x1a860
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 0x1a74a
orb $0x1, 0x1e8(%r14)
leaq 0x10(%rsp), %rdi
callq 0xa9d12
leaq 0x38(%rsp), %rdi
callq 0xa9d12
leaq 0x48(%rsp), %rdi
callq 0xa9d12
leaq 0x58(%rsp), %rdi
callq 0xa9d12
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a9be
jmp 0x1a9be
jmp 0x1a9db
jmp 0x1a9db
jmp 0x1aa07
jmp 0x1aa07
jmp 0x1a9e4
jmp 0x1a9e4
jmp 0x1a9e4
jmp 0x1a9e4
jmp 0x1aa07
movq %rax, %r14
movl $0x98, %esi
movq %r15, %rdi
jmp 0x1a978
movq %rax, %r14
movl $0xf8, %esi
movq %r15, %rdi
callq 0x134f0
jmp 0x1a9fb
movq %rax, %r14
movl $0xd0, %esi
movq %r13, %rdi
jmp 0x1a9d2
jmp 0x1a9e4
movq %rax, %r14
movl $0x1d8, %esi            # imm = 0x1D8
jmp 0x1a99c
movq %rax, %r14
movl $0xd0, %esi
movq %r12, %rdi
jmp 0x1a99f
movq %rax, %r14
movl $0x38, %esi
movq %r13, %rdi
jmp 0x1a99f
jmp 0x1a9be
movq %rax, %r14
movl $0x50, %esi
movq %rbx, %rdi
callq 0x134f0
jmp 0x1a9f1
movq %rax, %r14
movl $0x38, %esi
movq %rbp, %rdi
jmp 0x1a99f
jmp 0x1a9be
jmp 0x1a994
jmp 0x1a9be
jmp 0x1a9e4
movq %rax, %r14
movl $0x30, %esi
movq %r15, %rdi
callq 0x134f0
jmp 0x1a9e7
jmp 0x1a9be
jmp 0x1a9e4
jmp 0x1a9be
jmp 0x1a9db
jmp 0x1aa07
jmp 0x1a9e4
jmp 0x1a9e4
jmp 0x1a9be
jmp 0x1a9e4
jmp 0x1a9db
jmp 0x1a9e4
jmp 0x1a9e4
movq %rax, %r14
jmp 0x1a9f1
jmp 0x1aa07
jmp 0x1a9e4
movq %rax, %r14
movl $0xc8, %esi
movq %rbx, %rdi
callq 0x134f0
jmp 0x1aa0a
jmp 0x1a9e4
movq %rax, %r14
jmp 0x1a9fb
jmp 0x1a9e4
jmp 0x1a9e4
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xa9d12
leaq 0x38(%rsp), %rdi
callq 0xa9d12
leaq 0x48(%rsp), %rdi
callq 0xa9d12
jmp 0x1aa0a
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0xa9d12
movq %r14, %rdi
callq 0x138b0