// File: 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:
subq $0x868, %rsp            # imm = 0x868
movq %rdi, 0x858(%rsp)
movq %rsi, 0x850(%rsp)
movq 0x858(%rsp), %rax
movq %rax, 0x498(%rsp)
movq 0x850(%rsp), %rdi
leaq 0x178050(%rip), %rsi    # 0x1a48f6
movl $0x10, %edx
callq 0x2ee30
cmpl $0x0, %eax
jne 0x2c8e2
movq 0x498(%rsp), %rax
movq 0x1c0(%rax), %rsi
leaq 0x178033(%rip), %rdi    # 0x1a48fe
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x864(%rsp)
jmp 0x2ee16
movq 0x498(%rsp), %rax
movq 0x850(%rsp), %rdi
movq 0x1d0(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x498(%rsp), %rax
movq 0x850(%rsp), %rcx
movq %rcx, 0x438(%rsp)
movq 0x8(%rax), %rdi
callq 0x16cf0
movq 0x438(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x440(%rsp)
callq 0x16c20
movq 0x440(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x448(%rsp)
callq 0x16c40
movq 0x448(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x450(%rsp)
callq 0x16c80
movq 0x450(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x458(%rsp)
callq 0x30660
movq 0x458(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x460(%rsp)
callq 0x306b0
movq 0x460(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x468(%rsp)
callq 0x16c60
movq 0x468(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x470(%rsp)
callq 0x16ca0
movq 0x470(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x478(%rsp)
callq 0x30700
movq 0x478(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x480(%rsp)
callq 0x30750
movq 0x480(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x488(%rsp)
callq 0x16cc0
movq 0x488(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x490(%rsp)
callq 0x31090
movq 0x490(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x84c(%rsp)
cmpl $0x3, 0x84c(%rsp)
jge 0x2cb4e
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x84c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84c(%rsp)
jmp 0x2cb22
movl $0x0, 0x848(%rsp)
cmpl $0x4, 0x848(%rsp)
jge 0x2cbf5
movl $0x0, 0x844(%rsp)
cmpl $0x4, 0x844(%rsp)
jge 0x2cbdd
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x430(%rsp)
callq 0x31ac0
movq %rax, %rdi
callq 0x31ae0
movq %rax, %rdi
movl 0x848(%rsp), %esi
callq 0x31af0
movq 0x430(%rsp), %rdi
movslq 0x844(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x2ef80
movl 0x844(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x844(%rsp)
jmp 0x2cb72
jmp 0x2cbdf
movl 0x848(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x848(%rsp)
jmp 0x2cb59
movl $0x0, 0x840(%rsp)
movq 0x498(%rsp), %rdi
movl 0x840(%rsp), %eax
movl %eax, 0x42c(%rsp)
callq 0x31090
movl %eax, %ecx
movl 0x42c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2cc74
movq 0x498(%rsp), %rdi
movq 0x850(%rsp), %rax
movq %rax, 0x420(%rsp)
movl 0x840(%rsp), %esi
callq 0x310b0
movq 0x420(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movl 0x840(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x840(%rsp)
jmp 0x2cc00
movl $0x0, 0x83c(%rsp)
movq 0x498(%rsp), %rax
movl 0x83c(%rsp), %ecx
movl %ecx, 0x41c(%rsp)
movq 0x8(%rax), %rdi
callq 0x16cf0
movl %eax, %ecx
movl 0x41c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2ceee
movq 0x498(%rsp), %rax
movq 0x8(%rax), %rdi
movl 0x83c(%rsp), %esi
callq 0x30a90
movq %rax, 0x830(%rsp)
movq 0x830(%rsp), %rdi
callq 0x31100
cmpq $0x0, %rax
je 0x2cd00
movq 0x830(%rsp), %rdi
callq 0x31100
movq %rax, %rdi
callq 0x31130
movl %eax, 0x418(%rsp)
jmp 0x2cd0e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x418(%rsp)
jmp 0x2cd0e
movl 0x418(%rsp), %eax
movl %eax, 0x82c(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x3f0(%rsp)
movq 0x830(%rsp), %rdi
callq 0x31110
movq 0x3f0(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rdi
movl 0x82c(%rsp), %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x3f8(%rsp)
movq 0x830(%rsp), %rdi
callq 0x31660
movq 0x3f8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x400(%rsp)
movq 0x830(%rsp), %rdi
callq 0x186b0
movq 0x400(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x408(%rsp)
movq 0x830(%rsp), %rdi
callq 0x5ecb0
movq 0x408(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x410(%rsp)
movq 0x830(%rsp), %rdi
callq 0x5ecf0
movq 0x410(%rsp), %rdi
callq 0x2ef80
movl $0x0, 0x828(%rsp)
cmpl $0x8, 0x828(%rsp)
jge 0x2ce45
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x828(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x828(%rsp)
jmp 0x2ce19
movl $0x0, 0x824(%rsp)
movl 0x824(%rsp), %eax
movl %eax, 0x3ec(%rsp)
movq 0x830(%rsp), %rdi
callq 0x186b0
movl %eax, %ecx
movl 0x3ec(%rsp), %eax
cmpl %ecx, %eax
jge 0x2ced6
movq 0x830(%rsp), %rdi
movl 0x824(%rsp), %esi
callq 0x186d0
movq %rax, 0x818(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x3e0(%rsp)
movq 0x818(%rsp), %rdi
callq 0x31b10
movq 0x3e0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl 0x824(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x824(%rsp)
jmp 0x2ce50
jmp 0x2ced8
movl 0x83c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x83c(%rsp)
jmp 0x2cc7f
movl $0x0, 0x814(%rsp)
movq 0x498(%rsp), %rdi
movl 0x814(%rsp), %eax
movl %eax, 0x3dc(%rsp)
callq 0x16c20
movl %eax, %ecx
movl 0x3dc(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d25b
movq 0x498(%rsp), %rdi
movl 0x814(%rsp), %esi
callq 0x185f0
movq %rax, 0x808(%rsp)
movq 0x808(%rsp), %rdi
callq 0x312c0
cmpq $0x0, %rax
je 0x2cf72
movq 0x808(%rsp), %rdi
callq 0x312c0
movq %rax, %rdi
callq 0x1bf60
movl %eax, 0x3d8(%rsp)
jmp 0x2cf80
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x3d8(%rsp)
jmp 0x2cf80
movl 0x3d8(%rsp), %eax
movl %eax, 0x804(%rsp)
movq 0x808(%rsp), %rdi
callq 0x19790
movq %rax, 0x7f8(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x3a0(%rsp)
movq 0x808(%rsp), %rdi
callq 0x1bf70
movq 0x3a0(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rax
movq %rax, 0x3a8(%rsp)
movq 0x808(%rsp), %rdi
callq 0x19370
movq 0x3a8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rdi
movl 0x804(%rsp), %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x3b0(%rsp)
movq 0x808(%rsp), %rdi
callq 0x1bb10
movq 0x3b0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x3b8(%rsp)
movq 0x808(%rsp), %rdi
callq 0x18660
movq 0x3b8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x3c0(%rsp)
movq 0x7f8(%rsp), %rdi
callq 0x1bc40
movq 0x3c0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x3c8(%rsp)
movq 0x808(%rsp), %rdi
callq 0x1c0f0
movq 0x3c8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x3d0(%rsp)
movq 0x808(%rsp), %rdi
callq 0x31b30
movq %rax, 0x7f0(%rsp)
leaq 0x7f0(%rsp), %rdi
callq 0x1c310
movq 0x3d0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x7ec(%rsp)
cmpl $0x7, 0x7ec(%rsp)
jge 0x2d13b
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x7ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7ec(%rsp)
jmp 0x2d10f
movl $0x0, 0x7e8(%rsp)
movl 0x7e8(%rsp), %eax
movl %eax, 0x39c(%rsp)
movq 0x7f8(%rsp), %rdi
callq 0x1bc40
movl %eax, %ecx
movl 0x39c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d1b2
movq 0x850(%rsp), %rax
movq %rax, 0x390(%rsp)
movq 0x7f8(%rsp), %rdi
movl 0x7e8(%rsp), %esi
callq 0x18640
movq 0x390(%rsp), %rdi
callq 0x2ef80
movl 0x7e8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7e8(%rsp)
jmp 0x2d146
movl $0x0, 0x7e4(%rsp)
movl 0x7e4(%rsp), %eax
movl %eax, 0x38c(%rsp)
movq 0x808(%rsp), %rdi
callq 0x18660
movl %eax, %ecx
movl 0x38c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d243
movq 0x808(%rsp), %rdi
movl 0x7e4(%rsp), %esi
callq 0x18680
movq %rax, 0x7d8(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x380(%rsp)
movq 0x7d8(%rsp), %rdi
callq 0x31130
movq 0x380(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl 0x7e4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7e4(%rsp)
jmp 0x2d1bd
jmp 0x2d245
movl 0x814(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x814(%rsp)
jmp 0x2cef9
movl $0x0, 0x7d4(%rsp)
movq 0x498(%rsp), %rdi
movl 0x7d4(%rsp), %eax
movl %eax, 0x37c(%rsp)
callq 0x16c40
movl %eax, %ecx
movl 0x37c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d4e8
movq 0x498(%rsp), %rdi
movl 0x7d4(%rsp), %esi
callq 0x307a0
movq %rax, 0x7c8(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x31310
movq %rax, 0x7c0(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x312f0
cmpq $0x0, %rax
je 0x2d2f4
movq 0x7c8(%rsp), %rdi
callq 0x312f0
movq %rax, %rdi
callq 0x31300
movl %eax, 0x378(%rsp)
jmp 0x2d302
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x378(%rsp)
jmp 0x2d302
movl 0x378(%rsp), %eax
movl %eax, 0x7bc(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x338(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x30850
movq 0x338(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rax
movq %rax, 0x340(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x70720
movq 0x340(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x348(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x30860
movq 0x348(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rdi
movl 0x7bc(%rsp), %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x350(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x30c50
movq 0x350(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x358(%rsp)
movq 0x7c0(%rsp), %rdi
callq 0x31b50
movq 0x358(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x360(%rsp)
movq 0x7c0(%rsp), %rdi
callq 0x31b60
movq 0x360(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x368(%rsp)
movq 0x7c0(%rsp), %rdi
callq 0x31b70
movq 0x368(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x370(%rsp)
movq 0x7c8(%rsp), %rdi
callq 0x31320
movq %rax, 0x7b0(%rsp)
leaq 0x7b0(%rsp), %rdi
callq 0x1c310
movq 0x370(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x7ac(%rsp)
cmpl $0x3, 0x7ac(%rsp)
jge 0x2d4d0
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x7ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7ac(%rsp)
jmp 0x2d4a4
jmp 0x2d4d2
movl 0x7d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7d4(%rsp)
jmp 0x2d266
movl $0x0, 0x7a8(%rsp)
movq 0x498(%rsp), %rdi
movl 0x7a8(%rsp), %eax
movl %eax, 0x334(%rsp)
callq 0x16c80
movl %eax, %ecx
movl 0x334(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d698
movq 0x498(%rsp), %rdi
movl 0x7a8(%rsp), %esi
callq 0x1c120
movq %rax, 0x7a0(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x7a0(%rsp), %rdi
callq 0x30960
movq 0x308(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rax
movq %rax, 0x310(%rsp)
movq 0x7a0(%rsp), %rdi
callq 0x31b80
movq 0x310(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x318(%rsp)
movq 0x7a0(%rsp), %rdi
callq 0x31ba0
movq 0x318(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x320(%rsp)
movq 0x7a0(%rsp), %rdi
callq 0x31bc0
movq 0x320(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x328(%rsp)
movq 0x7a0(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x328(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x79c(%rsp)
cmpl $0x4, 0x79c(%rsp)
jge 0x2d64f
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x79c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x79c(%rsp)
jmp 0x2d623
movq 0x7a0(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $0x3, %eax
jne 0x2d680
movq 0x850(%rsp), %rdi
movq 0x7a0(%rsp), %rax
movq 0x48(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
jmp 0x2d682
movl 0x7a8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7a8(%rsp)
jmp 0x2d4f3
movl $0x0, 0x798(%rsp)
movq 0x498(%rsp), %rdi
movl 0x798(%rsp), %eax
movl %eax, 0x304(%rsp)
callq 0x30660
movl %eax, %ecx
movl 0x304(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d8b6
movq 0x498(%rsp), %rdi
movl 0x798(%rsp), %esi
callq 0x30680
movq %rax, 0x790(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x790(%rsp), %rdi
callq 0x31380
movq 0x2e8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x790(%rsp), %rdi
callq 0x30d80
movq 0x2f0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x2f8(%rsp)
movq 0x790(%rsp), %rdi
callq 0x31390
movq 0x2f8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x78c(%rsp)
cmpl $0x4, 0x78c(%rsp)
jge 0x2d7a6
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x78c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78c(%rsp)
jmp 0x2d77a
movl $0x0, 0x788(%rsp)
movl 0x788(%rsp), %eax
movl %eax, 0x2e4(%rsp)
movq 0x790(%rsp), %rdi
callq 0x30d80
movl %eax, %ecx
movl 0x2e4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d827
movq 0x850(%rsp), %rax
movq %rax, 0x2d8(%rsp)
movq 0x790(%rsp), %rdi
movl 0x788(%rsp), %esi
callq 0x30da0
movq %rax, %rdi
callq 0x1bf60
movq 0x2d8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl 0x788(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x788(%rsp)
jmp 0x2d7b1
movl $0x0, 0x784(%rsp)
movl 0x784(%rsp), %eax
movl %eax, 0x2d4(%rsp)
movq 0x790(%rsp), %rdi
callq 0x31390
movl %eax, %ecx
movl 0x2d4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d89e
movq 0x850(%rsp), %rax
movq %rax, 0x2c8(%rsp)
movq 0x790(%rsp), %rdi
movl 0x784(%rsp), %esi
callq 0x313a0
movq 0x2c8(%rsp), %rdi
callq 0x2ef80
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x2d832
jmp 0x2d8a0
movl 0x798(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x798(%rsp)
jmp 0x2d6a3
movl $0x0, 0x780(%rsp)
movq 0x498(%rsp), %rdi
movl 0x780(%rsp), %eax
movl %eax, 0x2c4(%rsp)
callq 0x306b0
movl %eax, %ecx
movl 0x2c4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2dad4
movq 0x498(%rsp), %rdi
movl 0x780(%rsp), %esi
callq 0x306d0
movq %rax, 0x778(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq 0x778(%rsp), %rdi
callq 0x313c0
movq 0x2a8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x2b0(%rsp)
movq 0x778(%rsp), %rdi
callq 0x30e40
movq 0x2b0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movq 0x778(%rsp), %rdi
callq 0x313d0
movq 0x2b8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x774(%rsp)
cmpl $0x4, 0x774(%rsp)
jge 0x2d9c4
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x774(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x774(%rsp)
jmp 0x2d998
movl $0x0, 0x770(%rsp)
movl 0x770(%rsp), %eax
movl %eax, 0x2a4(%rsp)
movq 0x778(%rsp), %rdi
callq 0x30e40
movl %eax, %ecx
movl 0x2a4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2da45
movq 0x850(%rsp), %rax
movq %rax, 0x298(%rsp)
movq 0x778(%rsp), %rdi
movl 0x770(%rsp), %esi
callq 0x30e60
movq %rax, %rdi
callq 0x31300
movq 0x298(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl 0x770(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x770(%rsp)
jmp 0x2d9cf
movl $0x0, 0x76c(%rsp)
movl 0x76c(%rsp), %eax
movl %eax, 0x294(%rsp)
movq 0x778(%rsp), %rdi
callq 0x313d0
movl %eax, %ecx
movl 0x294(%rsp), %eax
cmpl %ecx, %eax
jge 0x2dabc
movq 0x850(%rsp), %rax
movq %rax, 0x288(%rsp)
movq 0x778(%rsp), %rdi
movl 0x76c(%rsp), %esi
callq 0x313e0
movq 0x288(%rsp), %rdi
callq 0x2ef80
movl 0x76c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x76c(%rsp)
jmp 0x2da50
jmp 0x2dabe
movl 0x780(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x780(%rsp)
jmp 0x2d8c1
movl $0x0, 0x768(%rsp)
movq 0x498(%rsp), %rdi
movl 0x768(%rsp), %eax
movl %eax, 0x284(%rsp)
callq 0x16c60
movl %eax, %ecx
movl 0x284(%rsp), %eax
cmpl %ecx, %eax
jge 0x2dc4e
movq 0x498(%rsp), %rdi
movl 0x768(%rsp), %esi
callq 0x30630
movq %rax, 0x760(%rsp)
movq 0x760(%rsp), %rdi
callq 0x30ec0
movq %rax, 0x758(%rsp)
movq 0x760(%rsp), %rdi
callq 0x1bca0
movq %rax, 0x750(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x260(%rsp)
movq 0x758(%rsp), %rdi
callq 0x1bf60
movq 0x260(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x268(%rsp)
movq 0x750(%rsp), %rdi
callq 0x31300
movq 0x268(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x270(%rsp)
movq 0x760(%rsp), %rdi
callq 0x1bc90
movq 0x270(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x278(%rsp)
movq 0x760(%rsp), %rdi
callq 0x1bc80
movq 0x278(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x74c(%rsp)
cmpl $0x4, 0x74c(%rsp)
jge 0x2dc36
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x74c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74c(%rsp)
jmp 0x2dc0a
jmp 0x2dc38
movl 0x768(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x768(%rsp)
jmp 0x2dadf
movl $0x0, 0x748(%rsp)
movq 0x498(%rsp), %rdi
movl 0x748(%rsp), %eax
movl %eax, 0x25c(%rsp)
callq 0x16ca0
movl %eax, %ecx
movl 0x25c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e0e9
movq 0x498(%rsp), %rdi
movl 0x748(%rsp), %esi
callq 0x307d0
movq %rax, 0x740(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x1f8(%rsp)
movq 0x740(%rsp), %rdi
callq 0x30870
movq 0x1f8(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rax
movq %rax, 0x200(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31bd0
movq %rax, %rdi
callq 0x187b0
movq 0x200(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x208(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31bd0
movq %rax, %rdi
callq 0x187c0
movq 0x208(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31bd0
movq %rax, %rdi
callq 0x187a0
movq 0x210(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x218(%rsp)
movq 0x740(%rsp), %rsi
leaq 0x728(%rsp), %rdi
callq 0x31bf0
leaq 0x728(%rsp), %rdi
callq 0x31c70
movq 0x218(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x220(%rsp)
movq 0x740(%rsp), %rsi
leaq 0x710(%rsp), %rdi
callq 0x31bf0
leaq 0x710(%rsp), %rdi
callq 0x31c80
movq 0x220(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x228(%rsp)
movq 0x740(%rsp), %rsi
leaq 0x6f8(%rsp), %rdi
callq 0x31bf0
leaq 0x6f8(%rsp), %rdi
callq 0x31c90
movq 0x228(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x230(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31c40
movq %rax, %rdi
callq 0x31c70
movq 0x230(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x238(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31c40
movq %rax, %rdi
callq 0x31c80
movq 0x238(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x240(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31c40
movq %rax, %rdi
callq 0x31c90
movq 0x240(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x248(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31410
movq 0x248(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x740(%rsp), %rdi
callq 0x314f0
cmpq $0x0, %rax
je 0x2df27
movq 0x740(%rsp), %rdi
callq 0x314f0
movq %rax, %rdi
callq 0x31130
movl %eax, 0x1f4(%rsp)
jmp 0x2df35
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x1f4(%rsp)
jmp 0x2df35
movq 0x250(%rsp), %rdi
movl 0x1f4(%rsp), %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31470
movq 0x1b8(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x1c0(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31490
movq 0x1c0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31430
movq 0x1c8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x1d0(%rsp)
movq 0x740(%rsp), %rdi
callq 0x314b0
movq %rax, %rdi
callq 0x308e0
movq 0x1d0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movq 0x740(%rsp), %rdi
callq 0x314b0
movq %rax, %rdi
callq 0x30910
movq 0x1d8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x1e0(%rsp)
movq 0x740(%rsp), %rdi
callq 0x314d0
movq %rax, 0x6f0(%rsp)
leaq 0x6f0(%rsp), %rdi
callq 0x1c310
movq 0x1e0(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x1e8(%rsp)
movq 0x740(%rsp), %rdi
callq 0x31450
movq 0x1e8(%rsp), %rdi
callq 0x2ef80
movl $0x0, 0x6ec(%rsp)
cmpl $0x4, 0x6ec(%rsp)
jge 0x2e0d1
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x6ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6ec(%rsp)
jmp 0x2e0a5
jmp 0x2e0d3
movl 0x748(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x748(%rsp)
jmp 0x2dc59
movl $0x0, 0x6e8(%rsp)
movq 0x498(%rsp), %rdi
movl 0x6e8(%rsp), %eax
movl %eax, 0x1b4(%rsp)
callq 0x16cc0
movl %eax, %ecx
movl 0x1b4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2ead2
movq 0x498(%rsp), %rdi
movl 0x6e8(%rsp), %esi
callq 0x30800
movq %rax, 0x6e0(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x30890
movq 0x150(%rsp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2ee30
movq 0x850(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x30940
movq %rax, %rdi
callq 0x187b0
movq 0x158(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x30940
movq %rax, %rdi
callq 0x187c0
movq 0x160(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x30940
movq %rax, %rdi
callq 0x187a0
movq 0x168(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x6e0(%rsp), %rsi
leaq 0x6c8(%rsp), %rdi
callq 0x31ca0
leaq 0x6c8(%rsp), %rdi
callq 0x31c70
movq 0x170(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x178(%rsp)
movq 0x6e0(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x31ca0
leaq 0x6b0(%rsp), %rdi
callq 0x31c80
movq 0x178(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x180(%rsp)
movq 0x6e0(%rsp), %rsi
leaq 0x698(%rsp), %rdi
callq 0x31ca0
leaq 0x698(%rsp), %rdi
callq 0x31c90
movq 0x180(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31cf0
movq %rax, %rdi
callq 0x31c70
movq 0x188(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x190(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31cf0
movq %rax, %rdi
callq 0x31c80
movq 0x190(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31cf0
movq %rax, %rdi
callq 0x31c90
movq 0x198(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31d20
movq 0x1a0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x6e0(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2e3ba
movq 0x6e0(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x31650
movl %eax, 0x14c(%rsp)
jmp 0x2e3c8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14c(%rsp)
jmp 0x2e3c8
movq 0x1a8(%rsp), %rdi
movl 0x14c(%rsp), %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x308f0
movq 0x100(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x30920
movq 0x108(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31540
movq 0x110(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31560
movq 0x118(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31580
movq %rax, %rdi
callq 0x308e0
movq 0x120(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31580
movq %rax, %rdi
callq 0x30910
movq 0x128(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31600
movq %rax, 0x690(%rsp)
leaq 0x690(%rsp), %rdi
callq 0x1c310
movq 0x130(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x315a0
movq 0x138(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31d40
movq 0x140(%rsp), %rdi
movl %eax, %ecx
xorl %esi, %esi
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
callq 0x2ef20
movl $0x0, 0x68c(%rsp)
cmpl $0x3, 0x68c(%rsp)
jge 0x2e5c9
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x68c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68c(%rsp)
jmp 0x2e59d
movq 0x6e0(%rsp), %rdi
callq 0x315a0
cmpl $0x0, %eax
je 0x2e689
movq 0x6e0(%rsp), %rdi
callq 0x315c0
movq %rax, 0x680(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x315e0
movq %rax, 0x678(%rsp)
movq 0x850(%rsp), %rdi
movq 0x680(%rsp), %rax
movsd (%rax), %xmm0
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x680(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x680(%rsp), %rax
movsd 0x10(%rax), %xmm0
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x678(%rsp), %rax
movsd (%rax), %xmm0
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x678(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x2ef80
movq 0x6e0(%rsp), %rdi
callq 0x31d40
cmpl $0x0, %eax
je 0x2eaba
movq 0x6e0(%rsp), %rdi
callq 0x31500
movq %rax, 0x670(%rsp)
movq 0x6e0(%rsp), %rdi
callq 0x31520
movq %rax, 0x668(%rsp)
movq 0x670(%rsp), %rsi
leaq 0x5e8(%rsp), %rdi
callq 0xd55b0
movq 0x670(%rsp), %rsi
addq $0x60, %rsi
leaq 0x568(%rsp), %rdi
callq 0xd55b0
leaq 0x550(%rsp), %rdi
leaq 0x5e8(%rsp), %rsi
leaq 0x5cf9a2(%rip), %rdx    # 0x5fe0b0
callq 0xdc230
leaq 0x538(%rsp), %rdi
leaq 0x568(%rsp), %rsi
leaq 0x5cf986(%rip), %rdx    # 0x5fe0b0
callq 0xdc230
leaq 0x520(%rsp), %rdi
leaq 0x5e8(%rsp), %rsi
leaq 0x5cfb02(%rip), %rdx    # 0x5fe248
callq 0xdbfc0
leaq 0x508(%rsp), %rdi
leaq 0x568(%rsp), %rsi
leaq 0x5cfae6(%rip), %rdx    # 0x5fe248
callq 0xdbfc0
leaq 0x4f0(%rsp), %rdi
leaq 0x5e8(%rsp), %rsi
leaq 0x5cfa6a(%rip), %rdx    # 0x5fe1e8
callq 0xdbfc0
leaq 0x4d8(%rsp), %rdi
leaq 0x568(%rsp), %rsi
leaq 0x5cfa4e(%rip), %rdx    # 0x5fe1e8
callq 0xdbfc0
movq 0x850(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x187b0
movq 0x70(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x187c0
movq 0x78(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x187a0
movq 0x80(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x31c70
movq 0x88(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x31c80
movq 0x90(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x31c90
movq 0x98(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x31c70
movq 0xa0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x31c80
movq 0xa8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x31c90
movq 0xb0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x187b0
movq 0xb8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x187c0
movq 0xc0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x187a0
movq 0xc8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0x508(%rsp), %rdi
callq 0x31c70
movq 0xd0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x508(%rsp), %rdi
callq 0x31c80
movq 0xd8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x508(%rsp), %rdi
callq 0x31c90
movq 0xe0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xe8(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x31c70
movq 0xe8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x31c80
movq 0xf0(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x31c90
movq 0xf8(%rsp), %rdi
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x668(%rsp), %rax
movsd (%rax), %xmm0
callq 0x2ef80
movq 0x850(%rsp), %rdi
movq 0x668(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x2ef80
jmp 0x2eabc
movl 0x6e8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6e8(%rsp)
jmp 0x2e0f4
movl $0x0, 0x4d4(%rsp)
movq 0x498(%rsp), %rdi
movl 0x4d4(%rsp), %eax
movl %eax, 0x6c(%rsp)
callq 0x30700
movl %eax, %ecx
movl 0x6c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2ec53
movq 0x498(%rsp), %rdi
movl 0x4d4(%rsp), %esi
callq 0x30720
movq %rax, 0x4c8(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x4c8(%rsp), %rdi
callq 0x1bc50
movq 0x50(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x4c8(%rsp), %rdi
callq 0x30cc0
movq %rax, %rdi
callq 0x1bf60
movq 0x58(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x4c8(%rsp), %rdi
callq 0x1bcd0
movq 0x60(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x4c4(%rsp)
cmpl $0x4, 0x4c4(%rsp)
jge 0x2ebd0
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x4c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c4(%rsp)
jmp 0x2eba4
movl $0x0, 0x4c0(%rsp)
movl 0x4c0(%rsp), %eax
movl %eax, 0x4c(%rsp)
movq 0x4c8(%rsp), %rdi
callq 0x1bcd0
movl %eax, %ecx
movl 0x4c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2ec3b
movq 0x850(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x4c8(%rsp), %rdi
movl 0x4c0(%rsp), %esi
callq 0x1bce0
movq 0x40(%rsp), %rdi
callq 0x2ef80
movl 0x4c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c0(%rsp)
jmp 0x2ebdb
jmp 0x2ec3d
movl 0x4d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4d4(%rsp)
jmp 0x2eadd
movl $0x0, 0x4bc(%rsp)
movq 0x498(%rsp), %rdi
movl 0x4bc(%rsp), %eax
movl %eax, 0x3c(%rsp)
callq 0x30750
movl %eax, %ecx
movl 0x3c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2edd4
movq 0x498(%rsp), %rdi
movl 0x4bc(%rsp), %esi
callq 0x30770
movq %rax, 0x4b0(%rsp)
movq 0x850(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x4b0(%rsp), %rdi
callq 0x31340
movq 0x20(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x4b0(%rsp), %rdi
callq 0x30d40
movq %rax, %rdi
callq 0x31300
movq 0x28(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movq 0x850(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x4b0(%rsp), %rdi
callq 0x31350
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x2ef20
movl $0x0, 0x4ac(%rsp)
cmpl $0x4, 0x4ac(%rsp)
jge 0x2ed51
movq 0x850(%rsp), %rdi
xorl %esi, %esi
callq 0x2ef20
movl 0x4ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4ac(%rsp)
jmp 0x2ed25
movl $0x0, 0x4a8(%rsp)
movl 0x4a8(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x4b0(%rsp), %rdi
callq 0x31350
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2edbc
movq 0x850(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x4b0(%rsp), %rdi
movl 0x4a8(%rsp), %esi
callq 0x31360
movq 0x10(%rsp), %rdi
callq 0x2ef80
movl 0x4a8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4a8(%rsp)
jmp 0x2ed5c
jmp 0x2edbe
movl 0x4bc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4bc(%rsp)
jmp 0x2ec5e
movq 0x498(%rsp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, 0x8(%rsp)
leaq 0x4a0(%rsp), %rdi
movl $0x1, %esi
callq 0x1b970
movq 0x8(%rsp), %rdi
movq 0x4a0(%rsp), %rsi
callq 0x31a80
movl $0x1, 0x864(%rsp)
movl 0x864(%rsp), %eax
addq $0x868, %rsp            # imm = 0x868
retq
nopw %cs:(%rax,%rax)