// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelScene.cpp
// Function: gaps::R3SurfelScene::WriteBinaryStream(_IO_FILE*)
int R3SurfelScene::
WriteBinaryStream(FILE *fp) 
{
  // Write file header
  if (!WriteBinaryString(fp, "SSB 1.1", 16)) {
    RNFail("Unable to write to %s\n", filename);
    return 0;
  }

  // Write scene header
  WriteBinaryString(fp, name);
  WriteBinaryInteger(fp, tree->NNodes());
  WriteBinaryInteger(fp, NObjects());
  WriteBinaryInteger(fp, NLabels());
  WriteBinaryInteger(fp, NFeatures());
  WriteBinaryInteger(fp, NObjectRelationships());
  WriteBinaryInteger(fp, NLabelRelationships());
  WriteBinaryInteger(fp, NLabelAssignments());
  WriteBinaryInteger(fp, NScans());
  WriteBinaryInteger(fp, NObjectProperties());
  WriteBinaryInteger(fp, NLabelProperties());
  WriteBinaryInteger(fp, NImages());
  WriteBinaryInteger(fp, NComments());
  for (int j = 0; j < 3; j++) WriteBinaryInteger(fp, 0);

  // Write transformation
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      WriteBinaryDouble(fp, Transformation().Matrix()[i][j]);
    }
  }

  // Write comments
  for (int i = 0; i < NComments(); i++) {
    WriteBinaryString(fp, Comment(i));
  }

  // Write nodes
  for (int i = 0; i < tree->NNodes(); i++) {
    R3SurfelNode *node = tree->Node(i);
    int parent_index = (node->Parent()) ? node->Parent()->TreeIndex() : -1;
    WriteBinaryString(fp, node->Name());
    WriteBinaryInteger(fp, parent_index);
    WriteBinaryInteger(fp, node->NParts());
    WriteBinaryInteger(fp, node->NBlocks());
    WriteBinaryDouble(fp, node->Complexity());
    WriteBinaryDouble(fp, node->Resolution());
    for (int j = 0; j < 8; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < node->NBlocks(); j++) {
      R3SurfelBlock *block = node->Block(j);
      WriteBinaryInteger(fp, block->DatabaseIndex());
    }
  }

  // Write objects
  for (int i = 0; i < NObjects(); i++) {
    R3SurfelObject *object = Object(i);
    int parent_index = (object->Parent()) ? object->Parent()->SceneIndex() : -1;
    const R3SurfelFeatureVector& feature_vector = object->FeatureVector();
    WriteBinaryString(fp, object->Name());
    WriteBinaryInteger(fp, object->Identifier());
    WriteBinaryInteger(fp, parent_index);
    WriteBinaryInteger(fp, object->NParts());
    WriteBinaryInteger(fp, object->NNodes());
    WriteBinaryInteger(fp, feature_vector.NValues());
    WriteBinaryDouble(fp, object->Complexity());
    WriteBinaryInteger(fp, object->Flags());
    for (int j = 0; j < 7; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < feature_vector.NValues(); j++) {
      WriteBinaryDouble(fp, feature_vector.Value(j));
    }
    for (int j = 0; j < object->NNodes(); j++) {
      R3SurfelNode *node = object->Node(j);
      WriteBinaryInteger(fp, node->TreeIndex());
    }
  }

  // Write labels
  for (int i = 0; i < NLabels(); i++) {
    R3SurfelLabel *label = Label(i);
    const RNRgb& color = label->Color();
    int parent_index = (label->Parent()) ? label->Parent()->SceneIndex() : -1;
    WriteBinaryString(fp, label->Name());
    WriteBinaryInteger(fp, label->Identifier());
    WriteBinaryInteger(fp, label->AssignmentKeystroke());
    WriteBinaryInteger(fp, parent_index);
    WriteBinaryInteger(fp, label->NParts());
    WriteBinaryDouble(fp, color.R());
    WriteBinaryDouble(fp, color.G());
    WriteBinaryDouble(fp, color.B());
    WriteBinaryInteger(fp, label->Flags());
    for (int j = 0; j < 3; j++) WriteBinaryInteger(fp, 0);
  }

  // Write features
  for (int i = 0; i < NFeatures(); i++) {
    R3SurfelFeature *feature = Feature(i);
    WriteBinaryString(fp, feature->Name());
    WriteBinaryDouble(fp, feature->Minimum());
    WriteBinaryDouble(fp, feature->Maximum());
    WriteBinaryDouble(fp, feature->Weight());
    WriteBinaryInteger(fp, feature->Type());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
    if (feature->Type() == R3_SURFEL_OVERHEAD_GRID_FEATURE_TYPE) {
      WriteBinaryString(fp, ((R3SurfelOverheadGridFeature *) feature)->filename);
    }
  }

  // Write object relationships
  for (int i = 0; i < NObjectRelationships(); i++) {
    R3SurfelObjectRelationship *relationship = ObjectRelationship(i);
    WriteBinaryInteger(fp, relationship->Type());
    WriteBinaryInteger(fp, relationship->NObjects());
    WriteBinaryInteger(fp, relationship->NOperands());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < relationship->NObjects(); j++) 
      WriteBinaryInteger(fp, relationship->Object(j)->SceneIndex());
    for (int j = 0; j < relationship->NOperands(); j++) 
      WriteBinaryDouble(fp, relationship->Operand(j));
  }

  // Write label relationships
  for (int i = 0; i < NLabelRelationships(); i++) {
    R3SurfelLabelRelationship *relationship = LabelRelationship(i);
    WriteBinaryInteger(fp, relationship->Type());
    WriteBinaryInteger(fp, relationship->NLabels());
    WriteBinaryInteger(fp, relationship->NOperands());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < relationship->NLabels(); j++) 
      WriteBinaryInteger(fp, relationship->Label(j)->SceneIndex());
    for (int j = 0; j < relationship->NOperands(); j++) 
      WriteBinaryDouble(fp, relationship->Operand(j));
  }

  // Write assignments
  for (int i = 0; i < NLabelAssignments(); i++) {
    R3SurfelLabelAssignment *assignment = LabelAssignment(i);
    R3SurfelObject *object = assignment->Object();
    R3SurfelLabel *label = assignment->Label();
    WriteBinaryInteger(fp, object->SceneIndex());
    WriteBinaryInteger(fp, label->SceneIndex());
    WriteBinaryDouble(fp, assignment->Confidence());
    WriteBinaryInteger(fp, assignment->Originator());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
  }

  // Write scans
  for (int i = 0; i < NScans(); i++) {
    R3SurfelScan *scan = Scan(i);
    WriteBinaryString(fp, scan->Name());
    WriteBinaryDouble(fp, scan->Viewpoint().X());
    WriteBinaryDouble(fp, scan->Viewpoint().Y());
    WriteBinaryDouble(fp, scan->Viewpoint().Z());
    WriteBinaryDouble(fp, scan->Towards().X());
    WriteBinaryDouble(fp, scan->Towards().Y());
    WriteBinaryDouble(fp, scan->Towards().Z());
    WriteBinaryDouble(fp, scan->Up().X());
    WriteBinaryDouble(fp, scan->Up().Y());
    WriteBinaryDouble(fp, scan->Up().Z());
    WriteBinaryDouble(fp, scan->Timestamp());
    WriteBinaryInteger(fp, (scan->Node()) ? scan->Node()->TreeIndex() : -1);
    WriteBinaryInteger(fp, scan->ImageWidth());
    WriteBinaryInteger(fp, scan->ImageHeight());
    WriteBinaryDouble(fp, scan->XFocal());
    WriteBinaryDouble(fp, scan->ImageCenter().X());
    WriteBinaryDouble(fp, scan->ImageCenter().Y());
    WriteBinaryInteger(fp, scan->Flags());
    WriteBinaryDouble(fp, scan->YFocal());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
  }

  // Write images
  for (int i = 0; i < NImages(); i++) {
    R3SurfelImage *image = Image(i);
    WriteBinaryString(fp, image->Name());
    WriteBinaryDouble(fp, image->Viewpoint().X());
    WriteBinaryDouble(fp, image->Viewpoint().Y());
    WriteBinaryDouble(fp, image->Viewpoint().Z());
    WriteBinaryDouble(fp, image->Towards().X());
    WriteBinaryDouble(fp, image->Towards().Y());
    WriteBinaryDouble(fp, image->Towards().Z());
    WriteBinaryDouble(fp, image->Up().X());
    WriteBinaryDouble(fp, image->Up().Y());
    WriteBinaryDouble(fp, image->Up().Z());
    WriteBinaryDouble(fp, image->Timestamp());
    WriteBinaryInteger(fp, (image->scan) ? image->scan->SceneIndex() : -1);
    WriteBinaryInteger(fp, image->ImageWidth());
    WriteBinaryInteger(fp, image->ImageHeight());
    WriteBinaryDouble(fp, image->XFocal());
    WriteBinaryDouble(fp, image->YFocal());
    WriteBinaryDouble(fp, image->ImageCenter().X());
    WriteBinaryDouble(fp, image->ImageCenter().Y());
    WriteBinaryInteger(fp, image->Flags());
    WriteBinaryInteger(fp, image->DistortionType());
    WriteBinaryInteger(fp, (image->HasRollingShutter()) ? 1 : 0);
    for (int j = 0; j < 3; j++) WriteBinaryInteger(fp, 0);

    // Write extra image parameters
    if (image->DistortionType() != R3_SURFEL_NO_DISTORTION) {
      const RNScalar *radial_distortion = image->RadialDistortion();
      const RNScalar *tangential_distortion = image->TangentialDistortion();
      WriteBinaryDouble(fp, radial_distortion[0]);
      WriteBinaryDouble(fp, radial_distortion[1]);
      WriteBinaryDouble(fp, radial_distortion[2]);
      WriteBinaryDouble(fp, tangential_distortion[0]);
      WriteBinaryDouble(fp, tangential_distortion[1]);
    }
    if (image->HasRollingShutter()) {
      const R3CoordSystem *rs_poses = image->RollingShutterPoses();
      const RNScalar *rs_timestamps = image->RollingShutterTimestamps();
      R4Matrix camera_to_world0 = rs_poses[0].Matrix();
      R4Matrix camera_to_world1 = rs_poses[1].Matrix();
      R3Point viewpoint0 = camera_to_world0 * R3zero_point;
      R3Point viewpoint1 = camera_to_world1 * R3zero_point;
      R3Vector towards0 = camera_to_world0 * R3negz_vector;
      R3Vector towards1 = camera_to_world1 * R3negz_vector;
      R3Vector up0 = camera_to_world0 * R3posy_vector;
      R3Vector up1 = camera_to_world1 * R3posy_vector;
      WriteBinaryDouble(fp, viewpoint0.X());
      WriteBinaryDouble(fp, viewpoint0.Y());
      WriteBinaryDouble(fp, viewpoint0.Z());
      WriteBinaryDouble(fp, towards0.X());
      WriteBinaryDouble(fp, towards0.Y());
      WriteBinaryDouble(fp, towards0.Z());
      WriteBinaryDouble(fp, up0.X());
      WriteBinaryDouble(fp, up0.Y());
      WriteBinaryDouble(fp, up0.Z());
      WriteBinaryDouble(fp, viewpoint1.X());
      WriteBinaryDouble(fp, viewpoint1.Y());
      WriteBinaryDouble(fp, viewpoint1.Z());
      WriteBinaryDouble(fp, towards1.X());
      WriteBinaryDouble(fp, towards1.Y());
      WriteBinaryDouble(fp, towards1.Z());
      WriteBinaryDouble(fp, up1.X());
      WriteBinaryDouble(fp, up1.Y());
      WriteBinaryDouble(fp, up1.Z());
      WriteBinaryDouble(fp, rs_timestamps[0]);
      WriteBinaryDouble(fp, rs_timestamps[1]);
    }
  }

  // Write object properties
  for (int i = 0; i < NObjectProperties(); i++) {
    R3SurfelObjectProperty *property = ObjectProperty(i);
    WriteBinaryInteger(fp, property->Type());
    WriteBinaryInteger(fp, property->Object()->SceneIndex());
    WriteBinaryInteger(fp, property->NOperands());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < property->NOperands(); j++) 
      WriteBinaryDouble(fp, property->Operand(j));
  }

  // Write label properties
  for (int i = 0; i < NLabelProperties(); i++) {
    R3SurfelLabelProperty *property = LabelProperty(i);
    WriteBinaryInteger(fp, property->Type());
    WriteBinaryInteger(fp, property->Label()->SceneIndex());
    WriteBinaryInteger(fp, property->NOperands());
    for (int j = 0; j < 4; j++) WriteBinaryInteger(fp, 0);
    for (int j = 0; j < property->NOperands(); j++) 
      WriteBinaryDouble(fp, property->Operand(j));
  }

  // Mark scene as clean
  flags.Remove(R3_SURFEL_SCENE_DIRTY_FLAG);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r14
movq %rdi, (%rsp)
leaq 0xbe0a3(%rip), %rsi     # 0xde912
movq %r14, %rdi
movl $0x10, %edx
callq 0x21695
testl %eax, %eax
je 0x21666
movq (%rsp), %rbx
movq 0x1d0(%rbx), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movq 0x8(%rbx), %rax
movl 0x24(%rax), %esi
movq %r14, %rdi
callq 0x21718
movl 0x1c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x2c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0xac(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x5c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x6c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x7c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x8c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x3c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x4c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x9c(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl 0x1e4(%rbx), %esi
movq %r14, %rdi
callq 0x21718
movl $0x3, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20935
movq (%rsp), %rax
leaq 0xb8(%rax), %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movsd (%r15,%r13,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
cmpq $0x4, %r13
jne 0x20954
incq %r12
addq $0x20, %r15
cmpq $0x4, %r12
jne 0x20951
movq (%rsp), %rax
cmpl $0x0, 0x1e4(%rax)
jle 0x209b3
xorl %r15d, %r15d
movq (%rsp), %rbx
movq 0x1d8(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
incq %r15
movslq 0x1e4(%rbx), %rax
cmpq %rax, %r15
jl 0x2098c
movq (%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x24(%rax)
jle 0x20a90
xorl %r12d, %r12d
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %r15
movq 0x28(%r15), %rax
testq %rax, %rax
je 0x209de
movl 0x20(%rax), %ebp
jmp 0x209e3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0xb8(%r15), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movq %r14, %rdi
movl %ebp, %esi
callq 0x21718
movl 0x3c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movl 0x4c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movq %r15, %rdi
callq 0x3770e
movq %r14, %rdi
callq 0x21749
movq %r15, %rdi
callq 0x37730
movq %r14, %rdi
callq 0x21749
movl $0x8, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20a3e
cmpl $0x0, 0x4c(%r15)
jle 0x20a78
xorl %r13d, %r13d
movq 0x40(%r15), %rax
movq (%rax,%r13,8), %rax
movl 0xa0(%rax), %esi
movq %r14, %rdi
callq 0x21718
incq %r13
movslq 0x4c(%r15), %rax
cmpq %rax, %r13
jl 0x20a56
incq %r12
movq (%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x24(%rax), %rcx
cmpq %rcx, %r12
jl 0x209c8
movq (%rsp), %rax
cmpl $0x0, 0x1c(%rax)
jle 0x20bb9
xorl %r13d, %r13d
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %r15
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x20abb
movl 0x10(%rax), %ebp
jmp 0x20ac0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x17376
movq %rax, %r12
movq 0x88(%r15), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movq %r15, %rdi
callq 0x17098
movq %r14, %rdi
movl %eax, %esi
callq 0x21718
movq %r14, %rdi
movl %ebp, %esi
callq 0x21718
movl 0x2c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movl 0x6c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movl 0x10(%r12), %esi
movq %r14, %rdi
callq 0x21718
movsd 0x98(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movl 0xe8(%r15), %esi
movq %r14, %rdi
callq 0x21718
movl $0x7, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20b45
cmpl $0x0, 0x10(%r12)
jle 0x20b7c
xorl %ebp, %ebp
movq 0x8(%r12), %rax
movsd (%rax,%rbp,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %rbp
movslq 0x10(%r12), %rax
cmpq %rax, %rbp
jl 0x20b5d
cmpl $0x0, 0x6c(%r15)
jle 0x20ba5
xorl %r12d, %r12d
movq 0x60(%r15), %rax
movq (%rax,%r12,8), %rax
movl 0x20(%rax), %esi
movq %r14, %rdi
callq 0x21718
incq %r12
movslq 0x6c(%r15), %rax
cmpq %rax, %r12
jl 0x20b86
incq %r13
movq (%rsp), %rax
movslq 0x1c(%rax), %rax
cmpq %rax, %r13
jl 0x20aa1
movq (%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jle 0x20c91
xorl %r12d, %r12d
movq (%rsp), %rax
movq 0x20(%rax), %rax
movq (%rax,%r12,8), %r15
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x20be4
movl 0x10(%rax), %ebp
jmp 0x20be9
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x60(%r15), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movq %r15, %rdi
callq 0x40828
movq %r14, %rdi
movl %eax, %esi
callq 0x21718
movl 0x6c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movq %r14, %rdi
movl %ebp, %esi
callq 0x21718
movl 0x2c(%r15), %esi
movq %r14, %rdi
callq 0x21718
movsd 0x70(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x78(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x80(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movl 0x88(%r15), %esi
movq %r14, %rdi
callq 0x21718
movl $0x3, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20c6f
incq %r12
movq (%rsp), %rax
movslq 0x2c(%rax), %rax
cmpq %rax, %r12
jl 0x20bca
movq (%rsp), %rax
cmpl $0x0, 0xac(%rax)
jle 0x20d4b
xorl %r12d, %r12d
movq (%rsp), %rax
movq 0xa0(%rax), %rax
movq (%rax,%r12,8), %r15
movq 0x18(%r15), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movsd 0x20(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x28(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x30(%r15), %xmm0
movq %r14, %rdi
callq 0x21749
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movl %eax, %esi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20d07
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
cmpl $0x3, %eax
jne 0x20d34
movq 0x48(%r15), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
incq %r12
movq (%rsp), %rax
movslq 0xac(%rax), %rax
cmpq %rax, %r12
jl 0x20ca5
movq (%rsp), %rax
cmpl $0x0, 0x5c(%rax)
jle 0x20e0d
xorl %r15d, %r15d
movq (%rsp), %rax
movq 0x50(%rax), %rax
movq (%rax,%r15,8), %r12
movl 0x34(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x24(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x30(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20d94
cmpl $0x0, 0x24(%r12)
jle 0x20dce
xorl %r13d, %r13d
movq 0x18(%r12), %rax
movq (%rax,%r13,8), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x21718
incq %r13
movslq 0x24(%r12), %rax
cmpq %rax, %r13
jl 0x20dad
cmpl $0x0, 0x30(%r12)
jle 0x20df9
xorl %r13d, %r13d
movq 0x28(%r12), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
movslq 0x30(%r12), %rax
cmpq %rax, %r13
jl 0x20dd9
incq %r15
movq (%rsp), %rax
movslq 0x5c(%rax), %rax
cmpq %rax, %r15
jl 0x20d5c
movq (%rsp), %rax
cmpl $0x0, 0x6c(%rax)
jle 0x20ecf
xorl %r15d, %r15d
movq (%rsp), %rax
movq 0x60(%rax), %rax
movq (%rax,%r15,8), %r12
movl 0x34(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x24(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x30(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20e56
cmpl $0x0, 0x24(%r12)
jle 0x20e90
xorl %r13d, %r13d
movq 0x18(%r12), %rax
movq (%rax,%r13,8), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x21718
incq %r13
movslq 0x24(%r12), %rax
cmpq %rax, %r13
jl 0x20e6f
cmpl $0x0, 0x30(%r12)
jle 0x20ebb
xorl %r13d, %r13d
movq 0x28(%r12), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
movslq 0x30(%r12), %rax
cmpq %rax, %r13
jl 0x20e9b
incq %r15
movq (%rsp), %rax
movslq 0x6c(%rax), %rax
cmpq %rax, %r15
jl 0x20e1e
movq (%rsp), %rax
cmpl $0x0, 0x7c(%rax)
jle 0x20f48
xorl %r15d, %r15d
movq (%rsp), %rax
movq 0x70(%rax), %rax
movq (%rax,%r15,8), %r12
movq 0x18(%r12), %rax
movq 0x28(%r12), %r13
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x21718
movl 0x10(%r13), %esi
movq %r14, %rdi
callq 0x21718
movsd 0x38(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movl 0x40(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x20f2a
incq %r15
movq (%rsp), %rax
movslq 0x7c(%rax), %rax
cmpq %rax, %r15
jl 0x20edc
movq (%rsp), %rax
cmpl $0x0, 0x8c(%rax)
jle 0x210ec
xorl %r13d, %r13d
leaq 0x98(%rsp), %r15
movq (%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax,%r13,8), %rbp
movq 0xb8(%rbp), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movsd 0x28(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x30(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x38(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
leaq 0x70(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x864ac
movsd 0x98(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movq %r15, %rdi
movq %r12, %rsi
callq 0x864ac
movsd 0xa0(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movq %r15, %rdi
movq %r12, %rsi
callq 0x864ac
movsd 0xa8(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x58(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x60(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x68(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x88(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movq 0x18(%rbp), %rax
testq %rax, %rax
je 0x2104b
movl 0x20(%rax), %esi
jmp 0x21050
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x21718
movl 0x90(%rbp), %esi
movq %r14, %rdi
callq 0x21718
movl 0x94(%rbp), %esi
movq %r14, %rdi
callq 0x21718
movsd 0xa8(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x98(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xa0(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movl 0xc0(%rbp), %esi
movq %r14, %rdi
callq 0x21718
movsd 0xb0(%rbp), %xmm0
movq %r14, %rdi
callq 0x21749
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x210c7
incq %r13
movq (%rsp), %rax
movslq 0x8c(%rax), %rax
cmpq %rax, %r13
jl 0x20f64
movq (%rsp), %rax
cmpl $0x0, 0x9c(%rax)
jle 0x21522
xorl %r13d, %r13d
movq (%rsp), %rax
movq 0x90(%rax), %rax
movq (%rax,%r13,8), %r12
movq 0x1c0(%r12), %rsi
movq %r14, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x21695
movsd 0x30(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x38(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x40(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
leaq 0x78(%r12), %rbp
leaq 0x98(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x864ac
movsd 0x98(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movq %r15, %rdi
movq %rbp, %rsi
callq 0x864ac
movsd 0xa0(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movq %r15, %rdi
movq %rbp, %rsi
callq 0x864ac
movsd 0xa8(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x60(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x68(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x70(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x90(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x21200
movl 0x10(%rax), %esi
jmp 0x21205
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x21718
movl 0x98(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x9c(%r12), %esi
movq %r14, %rdi
callq 0x21718
movsd 0xb0(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xb8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xa0(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xa8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movl 0x1c8(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0xc0(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl 0x1c8(%r12), %esi
andl $0x1, %esi
movq %r14, %rdi
callq 0x21718
movl $0x3, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x212ad
cmpl $0x0, 0xc0(%r12)
je 0x21320
movsd 0xc8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xd0(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xd8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xe0(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0xe8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
testb $0x1, 0x1c8(%r12)
je 0x2150b
leaq 0xf0(%r12), %rsi
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x7142e
leaq 0x150(%r12), %rsi
leaq 0x118(%rsp), %rdi
callq 0x7142e
leaq 0x80(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rbp
leaq 0x5152ff(%rip), %r13    # 0x536670
movq %r13, %rdx
callq 0x7514e
leaq 0x68(%rsp), %rdi
leaq 0x118(%rsp), %r15
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %r13
callq 0x7514e
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
leaq 0xc4ed5(%rip), %rbp     # 0xe6278
movq %rbp, %rdx
callq 0x750d6
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x750d6
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
leaq 0xc4e4e(%rip), %rbp     # 0xe6218
movq %rbp, %rdx
callq 0x750d6
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x750d6
movsd 0x80(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x88(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x90(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x50(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x58(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x60(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x20(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x28(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x30(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x68(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x70(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x78(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x38(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x40(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x48(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x8(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x10(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x18(%rsp), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x1b0(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
movsd 0x1b8(%r12), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
movq (%rsp), %rax
movslq 0x9c(%rax), %rax
cmpq %rax, %r13
jl 0x21100
movq (%rsp), %rax
cmpl $0x0, 0x3c(%rax)
jle 0x215bb
xorl %r15d, %r15d
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq (%rax,%r15,8), %r12
movl 0x2c(%r12), %esi
movq %r14, %rdi
callq 0x21718
movq 0x18(%r12), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x21718
movl 0x28(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x2156e
cmpl $0x0, 0x28(%r12)
jle 0x215a7
xorl %r13d, %r13d
movq 0x20(%r12), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
movslq 0x28(%r12), %rax
cmpq %rax, %r13
jl 0x21587
incq %r15
movq (%rsp), %rax
movslq 0x3c(%rax), %rax
cmpq %rax, %r15
jl 0x21533
movq (%rsp), %rax
cmpl $0x0, 0x4c(%rax)
jle 0x21654
xorl %r15d, %r15d
movq (%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax,%r15,8), %r12
movl 0x2c(%r12), %esi
movq %r14, %rdi
callq 0x21718
movq 0x18(%r12), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x21718
movl 0x28(%r12), %esi
movq %r14, %rdi
callq 0x21718
movl $0x4, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21718
decl %ebp
jne 0x21607
cmpl $0x0, 0x28(%r12)
jle 0x21640
xorl %r13d, %r13d
movq 0x20(%r12), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x21749
incq %r13
movslq 0x28(%r12), %rax
cmpq %rax, %r13
jl 0x21620
incq %r15
movq (%rsp), %rax
movslq 0x4c(%rax), %rax
cmpq %rax, %r15
jl 0x215cc
movq (%rsp), %rax
andb $-0x2, 0x1e8(%rax)
movl $0x1, %ebx
jmp 0x21681
movq (%rsp), %rax
movq 0x1c0(%rax), %rsi
leaq 0xbd2a2(%rip), %rdi     # 0xde91a
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xaddb2
movl %ebx, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq