// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::WritePrincetonElement(gaps::R3Scene const*, gaps::R3SceneElement*, gaps::R3Affine const&, _IO_FILE*, char const*)
static int
WritePrincetonElement(const R3Scene *scene, R3SceneElement *element,
  const R3Affine& transformation, FILE *fp, const char *indent)
{
  // Get material index
  R3Material *material = element->Material();
  int material_index = (material) ? material->SceneIndex() : -1;
  
  // Write shapes
  for (int i = 0; i < element->NShapes(); i++) {
    R3Shape *shape = element->Shape(i);
    if (shape->ClassID() == R3Box::CLASS_ID()) {
      R3Box *box = (R3Box *) shape;
      fprintf(fp, "%sbox  %d   %g %g %g   %g %g %g\n", indent, material_index,
        box->XMin(), box->YMin(), box->ZMin(), box->XMax(), box->YMax(), box->ZMax());
    }
    else if (shape->ClassID() == R3OrientedBox::CLASS_ID()) {
      R3OrientedBox *obb = (R3OrientedBox *) shape;
      R3Point center = obb->Center();
      R3Vector axis0 = obb->Axis(0);
      R3Vector axis1 = obb->Axis(1);
      fprintf(fp, "%sobb  %d   %g %g %g   %g %g %g   %g %g %g   %g %g %g\n", indent, material_index,
        center.X(), center.Y(), center.Z(),
        axis0.X(), axis0.Y(), axis0.Z(), axis1.X(), axis1.Y(), axis1.Z(),
        obb->Radius(0), obb->Radius(1), obb->Radius(2));
   }
   else if (shape->ClassID() == R3Sphere::CLASS_ID()) {
      R3Sphere *sphere = (R3Sphere *) shape;
      R3Point center = sphere->Center();
      fprintf(fp, "%ssphere  %d   %g %g %g   %g\n", indent, material_index,
        center.X(), center.Y(), center.Z(), sphere->Radius());
    }
    else if (shape->ClassID() == R3Cone::CLASS_ID()) {
      R3Cone *cone = (R3Cone *) shape;
      R3Point center = cone->Axis().Midpoint();
      if (RNIsNotEqual(cone->Axis().Vector().Dot(R3posz_vector), 1.0)) RNFail("Warning: cone not axis aligned\n");
      fprintf(fp, "%scone  %d   %g %g %g   %g %g\n", indent, material_index,
        center.X(), center.Y(), center.Z(), cone->Radius(), cone->Height());
    }
    else if (shape->ClassID() == R3Cylinder::CLASS_ID()) {
      R3Cylinder *cylinder = (R3Cylinder *) shape;
      R3Point center = cylinder->Axis().Midpoint();
      if (RNIsNotEqual(cylinder->Axis().Vector().Dot(R3posz_vector), 1.0)) RNFail("Warning: cylinder not axis aligned\n");
      fprintf(fp, "%scylinder  %d   %g %g %g   %g %g\n", indent, material_index,
        center.X(), center.Y(), center.Z(), cylinder->Radius(), cylinder->Height());
    }
    else if (shape->ClassID() == R3Rectangle::CLASS_ID()) {
      R3Rectangle *rectangle = (R3Rectangle *) shape;
      R3TriangleVertex *v0 = new R3TriangleVertex(rectangle->Corner(0,0));
      R3TriangleVertex *v1 = new R3TriangleVertex(rectangle->Corner(1,0));
      R3TriangleVertex *v2 = new R3TriangleVertex(rectangle->Corner(1,1));
      R3TriangleVertex *v3 = new R3TriangleVertex(rectangle->Corner(0,1));
      if (transformation.IsMirrored()) { R3TriangleVertex *swap = v0; v0 = v3; v3 = swap; }
      if (transformation.IsMirrored()) { R3TriangleVertex *swap = v1; v1 = v2; v2 = swap; }
      const R3Point& p0 = v0->Position();
      const R3Point& p1 = v1->Position();
      const R3Point& p2 = v2->Position();
      const R3Point& p3 = v3->Position();
      fprintf(fp, "%stri  %d   %g %g %g   %g %g %g   %g %g %g\n", indent, material_index,
        p0.X(), p0.Y(), p0.Z(), p1.X(), p1.Y(), p1.Z(), p2.X(), p2.Y(), p2.Z());
      fprintf(fp, "%stri  %d   %g %g %g   %g %g %g   %g %g %g\n", indent, material_index,
        p0.X(), p0.Y(), p0.Z(), p2.X(), p2.Y(), p2.Z(), p3.X(), p3.Y(), p3.Z());
    }
    else if (shape->ClassID() == R3Triangle::CLASS_ID()) {
      R3Triangle *triangle = (R3Triangle *) shape;
      R3TriangleVertex *v0 = triangle->V0();
      R3TriangleVertex *v1 = triangle->V1();
      R3TriangleVertex *v2 = triangle->V2();
      if (transformation.IsMirrored()) { R3TriangleVertex *swap = v0; v0 = v2; v2 = swap; }
      const R3Point& p0 = v0->Position();
      const R3Point& p1 = v1->Position();
      const R3Point& p2 = v2->Position();
      fprintf(fp, "%stri  %d   %g %g %g   %g %g %g   %g %g %g\n", indent, material_index,
        p0.X(), p0.Y(), p0.Z(), p1.X(), p1.Y(), p1.Z(), p2.X(), p2.Y(), p2.Z());
    }
    else if (shape->ClassID() == R3TriangleArray::CLASS_ID()) {
      R3TriangleArray *array = (R3TriangleArray *) shape;
      for (int j = 0; j < array->NTriangles(); j++) {
        R3Triangle *triangle = array->Triangle(j);
        R3TriangleVertex *v0 = (transformation.IsMirrored()) ? triangle->V2() : triangle->V0();
        R3TriangleVertex *v1 = triangle->V1();
        R3TriangleVertex *v2 = (transformation.IsMirrored()) ? triangle->V0() : triangle->V2();
        const R3Point& p0 = v0->Position();
        const R3Point& p1 = v1->Position();
        const R3Point& p2 = v2->Position();
        fprintf(fp, "%stri  %d   %g %g %g   %g %g %g   %g %g %g\n", indent, material_index,
          p0.X(), p0.Y(), p0.Z(), p1.X(), p1.Y(), p1.Z(), p2.X(), p2.Y(), p2.Z());
      }
    }
    else {
      RNFail("Warning: unrecognized shape type %d\n", shape->ClassID());
      // return 0;
    }
  }
  
  // Return success
  return 1;
}

// Assembly:
subq $0x598, %rsp            # imm = 0x598
movq %rdi, 0x590(%rsp)
movq %rsi, 0x588(%rsp)
movq %rdx, 0x580(%rsp)
movq %rcx, 0x578(%rsp)
movq %r8, 0x570(%rsp)
movq 0x588(%rsp), %rdi
callq 0x48b50
movq %rax, 0x568(%rsp)
cmpq $0x0, 0x568(%rsp)
je 0x46bc5
movq 0x568(%rsp), %rdi
callq 0x49d90
movl %eax, 0x34c(%rsp)
jmp 0x46bd3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x34c(%rsp)
jmp 0x46bd3
movl 0x34c(%rsp), %eax
movl %eax, 0x564(%rsp)
movl $0x0, 0x560(%rsp)
movl 0x560(%rsp), %eax
movl %eax, 0x348(%rsp)
movq 0x588(%rsp), %rdi
callq 0x2bbf0
movl %eax, %ecx
movl 0x348(%rsp), %eax
cmpl %ecx, %eax
jge 0x47f8c
movq 0x588(%rsp), %rdi
movl 0x560(%rsp), %esi
callq 0x2bc10
movq %rax, 0x558(%rsp)
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x344(%rsp)
callq 0xb71e0
movl %eax, %ecx
movl 0x344(%rsp), %eax
cmpl %ecx, %eax
jne 0x46d75
movq 0x558(%rsp), %rax
movq %rax, 0x550(%rsp)
movq 0x578(%rsp), %rax
movq %rax, 0x300(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x308(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x314(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e820
movsd %xmm0, 0x338(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e840
movsd %xmm0, 0x318(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e860
movsd %xmm0, 0x320(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e880
movsd %xmm0, 0x328(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e8a0
movsd %xmm0, 0x330(%rsp)
movq 0x550(%rsp), %rdi
callq 0x4e8c0
movq 0x300(%rsp), %rdi
movq 0x308(%rsp), %rdx
movl 0x314(%rsp), %ecx
movsd 0x318(%rsp), %xmm1
movsd 0x320(%rsp), %xmm2
movsd 0x328(%rsp), %xmm3
movsd 0x330(%rsp), %xmm4
movaps %xmm0, %xmm5
movsd 0x338(%rsp), %xmm0
leaq 0x148b20(%rip), %rsi    # 0x18f889
movb $0x6, %al
callq 0x22f30
jmp 0x47f74
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x2fc(%rsp)
callq 0xb4c60
movl %eax, %ecx
movl 0x2fc(%rsp), %eax
cmpl %ecx, %eax
jne 0x46ff9
movq 0x558(%rsp), %rax
movq %rax, 0x548(%rsp)
movq 0x548(%rsp), %rdi
callq 0x4e8e0
movq %rax, %rsi
leaq 0x530(%rsp), %rdi
callq 0xcc8b0
movq 0x548(%rsp), %rdi
xorl %esi, %esi
callq 0x4e900
movq %rax, %rsi
leaq 0x518(%rsp), %rdi
callq 0xcda10
movq 0x548(%rsp), %rdi
movl $0x1, %esi
callq 0x4e900
movq %rax, %rsi
leaq 0x500(%rsp), %rdi
callq 0xcda10
movq 0x578(%rsp), %rax
movq %rax, 0x288(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x290(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x29c(%rsp)
leaq 0x530(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x2f0(%rsp)
leaq 0x530(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x2a0(%rsp)
leaq 0x530(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x2a8(%rsp)
leaq 0x518(%rsp), %rdi
callq 0x2b910
movsd %xmm0, 0x2b0(%rsp)
leaq 0x518(%rsp), %rdi
callq 0x2b920
movsd %xmm0, 0x2b8(%rsp)
leaq 0x518(%rsp), %rdi
callq 0x2b930
movsd %xmm0, 0x2c0(%rsp)
leaq 0x500(%rsp), %rdi
callq 0x2b910
movsd %xmm0, 0x2c8(%rsp)
leaq 0x500(%rsp), %rdi
callq 0x2b920
movsd %xmm0, 0x2d0(%rsp)
leaq 0x500(%rsp), %rdi
callq 0x2b930
movsd %xmm0, 0x2d8(%rsp)
movq 0x548(%rsp), %rdi
xorl %esi, %esi
callq 0x4e930
movsd %xmm0, 0x2e0(%rsp)
movq 0x548(%rsp), %rdi
movl $0x1, %esi
callq 0x4e930
movsd %xmm0, 0x2e8(%rsp)
movq 0x548(%rsp), %rdi
movl $0x2, %esi
callq 0x4e930
movq 0x288(%rsp), %rdi
movq 0x290(%rsp), %rdx
movl 0x29c(%rsp), %ecx
movsd 0x2a0(%rsp), %xmm1
movsd 0x2a8(%rsp), %xmm2
movsd 0x2b0(%rsp), %xmm3
movsd 0x2b8(%rsp), %xmm4
movsd 0x2c0(%rsp), %xmm5
movsd 0x2c8(%rsp), %xmm6
movsd 0x2d0(%rsp), %xmm7
movsd 0x2d8(%rsp), %xmm11
movsd 0x2e0(%rsp), %xmm10
movsd 0x2e8(%rsp), %xmm9
movaps %xmm0, %xmm8
movsd 0x2f0(%rsp), %xmm0
leaq 0x1488d8(%rip), %rsi    # 0x18f8aa
movsd %xmm11, (%rsp)
movsd %xmm10, 0x8(%rsp)
movsd %xmm9, 0x10(%rsp)
movsd %xmm8, 0x18(%rsp)
movb $0x8, %al
callq 0x22f30
jmp 0x47f72
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x284(%rsp)
callq 0xb2a80
movl %eax, %ecx
movl 0x284(%rsp), %eax
cmpl %ecx, %eax
jne 0x47119
movq 0x558(%rsp), %rax
movq %rax, 0x4f8(%rsp)
movq 0x4f8(%rsp), %rdi
callq 0x4e950
movq %rax, %rsi
leaq 0x4e0(%rsp), %rdi
callq 0xcc8b0
movq 0x578(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x258(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x264(%rsp)
leaq 0x4e0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x278(%rsp)
leaq 0x4e0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x268(%rsp)
leaq 0x4e0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x270(%rsp)
movq 0x4f8(%rsp), %rdi
callq 0x487f0
movq 0x250(%rsp), %rdi
movq 0x258(%rsp), %rdx
movl 0x264(%rsp), %ecx
movsd 0x268(%rsp), %xmm1
movsd 0x270(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x278(%rsp), %xmm0
leaq 0x1487d4(%rip), %rsi    # 0x18f8e1
movb $0x4, %al
callq 0x22f30
jmp 0x47f70
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x24c(%rsp)
callq 0xb32e0
movl %eax, %ecx
movl 0x24c(%rsp), %eax
cmpl %ecx, %eax
jne 0x472a7
movq 0x558(%rsp), %rax
movq %rax, 0x4d8(%rsp)
movq 0x4d8(%rsp), %rdi
callq 0x4e960
movq %rax, %rsi
leaq 0x4c0(%rsp), %rdi
callq 0xcb4d0
movq 0x4d8(%rsp), %rdi
callq 0x4e960
movq %rax, %rdi
callq 0x4e970
movq %rax, %rdi
leaq 0x1b819d(%rip), %rsi    # 0x1ff330
callq 0xcdfe0
leaq 0x1af109(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm2
movsd 0x146e65(%rip), %xmm1   # 0x18e010
callq 0x48a20
cmpl $0x0, %eax
je 0x471c3
leaq 0x148743(%rip), %rdi    # 0x18f8ff
movb $0x0, %al
callq 0xf3b00
movq 0x578(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x218(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x224(%rsp)
leaq 0x4c0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x240(%rsp)
leaq 0x4c0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x228(%rsp)
leaq 0x4c0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x230(%rsp)
movq 0x4d8(%rsp), %rdi
callq 0x4e980
movsd %xmm0, 0x238(%rsp)
movq 0x4d8(%rsp), %rdi
callq 0x4e9a0
movq 0x210(%rsp), %rdi
movq 0x218(%rsp), %rdx
movl 0x224(%rsp), %ecx
movsd 0x228(%rsp), %xmm1
movsd 0x230(%rsp), %xmm2
movsd 0x238(%rsp), %xmm3
movaps %xmm0, %xmm4
movsd 0x240(%rsp), %xmm0
leaq 0x148684(%rip), %rsi    # 0x18f91f
movb $0x5, %al
callq 0x22f30
jmp 0x47f6e
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x20c(%rsp)
callq 0xb3e70
movl %eax, %ecx
movl 0x20c(%rsp), %eax
cmpl %ecx, %eax
jne 0x47435
movq 0x558(%rsp), %rax
movq %rax, 0x4b8(%rsp)
movq 0x4b8(%rsp), %rdi
callq 0x4e9c0
movq %rax, %rsi
leaq 0x4a0(%rsp), %rdi
callq 0xcb4d0
movq 0x4b8(%rsp), %rdi
callq 0x4e9c0
movq %rax, %rdi
callq 0x4e970
movq %rax, %rdi
leaq 0x1b800f(%rip), %rsi    # 0x1ff330
callq 0xcdfe0
leaq 0x1aef7b(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm2
movsd 0x146cd7(%rip), %xmm1   # 0x18e010
callq 0x48a20
cmpl $0x0, %eax
je 0x47351
leaq 0x1485f4(%rip), %rdi    # 0x18f93e
movb $0x0, %al
callq 0xf3b00
movq 0x578(%rsp), %rax
movq %rax, 0x1d0(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x1e4(%rsp)
leaq 0x4a0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x200(%rsp)
leaq 0x4a0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x1e8(%rsp)
leaq 0x4a0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x1f0(%rsp)
movq 0x4b8(%rsp), %rdi
callq 0x4e9d0
movsd %xmm0, 0x1f8(%rsp)
movq 0x4b8(%rsp), %rdi
callq 0x4e9f0
movq 0x1d0(%rsp), %rdi
movq 0x1d8(%rsp), %rdx
movl 0x1e4(%rsp), %ecx
movsd 0x1e8(%rsp), %xmm1
movsd 0x1f0(%rsp), %xmm2
movsd 0x1f8(%rsp), %xmm3
movaps %xmm0, %xmm4
movsd 0x200(%rsp), %xmm0
leaq 0x148539(%rip), %rsi    # 0x18f962
movb $0x5, %al
callq 0x22f30
jmp 0x47f6c
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x1cc(%rsp)
callq 0xaa190
movl %eax, %ecx
movl 0x1cc(%rsp), %eax
cmpl %ecx, %eax
jne 0x47a24
movq 0x558(%rsp), %rax
movq %rax, 0x498(%rsp)
movl $0x68, %edi
callq 0x229e0
movq %rax, 0x1c0(%rsp)
movq 0x498(%rsp), %rsi
leaq 0x478(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x4ea10
jmp 0x474a0
movq 0x1c0(%rsp), %rdi
leaq 0x478(%rsp), %rsi
callq 0xb06c0
jmp 0x474b7
movq 0x1c0(%rsp), %rax
movq %rax, 0x490(%rsp)
movl $0x68, %edi
callq 0x229e0
movq %rax, 0x1b8(%rsp)
movq 0x498(%rsp), %rsi
leaq 0x448(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4ea10
jmp 0x474f7
movq 0x1b8(%rsp), %rdi
leaq 0x448(%rsp), %rsi
callq 0xb06c0
jmp 0x4750e
movq 0x1b8(%rsp), %rax
movq %rax, 0x460(%rsp)
movl $0x68, %edi
callq 0x229e0
movq %rax, 0x1b0(%rsp)
movq 0x498(%rsp), %rsi
leaq 0x428(%rsp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x4ea10
jmp 0x4754e
movq 0x1b0(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0xb06c0
jmp 0x47565
movq 0x1b0(%rsp), %rax
movq %rax, 0x440(%rsp)
movl $0x68, %edi
callq 0x229e0
movq %rax, 0x1a8(%rsp)
movq 0x498(%rsp), %rsi
leaq 0x408(%rsp), %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x4ea10
jmp 0x475a5
movq 0x1a8(%rsp), %rdi
leaq 0x408(%rsp), %rsi
callq 0xb06c0
jmp 0x475bc
movq 0x1a8(%rsp), %rax
movq %rax, 0x420(%rsp)
movq 0x580(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, %eax
je 0x476c4
movq 0x490(%rsp), %rax
movq %rax, 0x400(%rsp)
movq 0x420(%rsp), %rax
movq %rax, 0x490(%rsp)
movq 0x400(%rsp), %rax
movq %rax, 0x420(%rsp)
jmp 0x476c4
movq 0x1c0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x470(%rsp)
movl %eax, 0x46c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x47f99
movq 0x1b8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x470(%rsp)
movl %eax, 0x46c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x47f99
movq 0x1b0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x470(%rsp)
movl %eax, 0x46c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x47f99
movq 0x1a8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x470(%rsp)
movl %eax, 0x46c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x47f99
movq 0x580(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, %eax
je 0x47707
movq 0x460(%rsp), %rax
movq %rax, 0x3f8(%rsp)
movq 0x440(%rsp), %rax
movq %rax, 0x460(%rsp)
movq 0x3f8(%rsp), %rax
movq %rax, 0x440(%rsp)
movq 0x490(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3f0(%rsp)
movq 0x460(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3e8(%rsp)
movq 0x440(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3e0(%rsp)
movq 0x420(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3d8(%rsp)
movq 0x578(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x100(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x10c(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x148(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x110(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x118(%rsp)
movq 0x3e8(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x120(%rsp)
movq 0x3e8(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x128(%rsp)
movq 0x3e8(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x130(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x138(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x140(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b840
movq 0xf8(%rsp), %rdi
movq 0x100(%rsp), %rdx
movl 0x10c(%rsp), %ecx
movsd 0x110(%rsp), %xmm1
movsd 0x118(%rsp), %xmm2
movsd 0x120(%rsp), %xmm3
movsd 0x128(%rsp), %xmm4
movsd 0x130(%rsp), %xmm5
movsd 0x138(%rsp), %xmm6
movsd 0x140(%rsp), %xmm7
movaps %xmm0, %xmm8
movsd 0x148(%rsp), %xmm0
leaq 0x1480d5(%rip), %rsi    # 0x18f985
movsd %xmm8, (%rsp)
movb $0x8, %al
callq 0x22f30
movq 0x578(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x158(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x164(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x1a0(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x168(%rsp)
movq 0x3f0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x170(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x178(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x180(%rsp)
movq 0x3e0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x188(%rsp)
movq 0x3d8(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x190(%rsp)
movq 0x3d8(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x198(%rsp)
movq 0x3d8(%rsp), %rdi
callq 0x2b840
movq 0x150(%rsp), %rdi
movq 0x158(%rsp), %rdx
movl 0x164(%rsp), %ecx
movsd 0x168(%rsp), %xmm1
movsd 0x170(%rsp), %xmm2
movsd 0x178(%rsp), %xmm3
movsd 0x180(%rsp), %xmm4
movsd 0x188(%rsp), %xmm5
movsd 0x190(%rsp), %xmm6
movsd 0x198(%rsp), %xmm7
movaps %xmm0, %xmm8
movsd 0x1a0(%rsp), %xmm0
leaq 0x147f73(%rip), %rsi    # 0x18f985
movsd %xmm8, (%rsp)
movb $0x8, %al
callq 0x22f30
jmp 0x47f6a
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0xf4(%rsp)
callq 0xb0540
movl %eax, %ecx
movl 0xf4(%rsp), %eax
cmpl %ecx, %eax
jne 0x47c8a
movq 0x558(%rsp), %rax
movq %rax, 0x3d0(%rsp)
movq 0x3d0(%rsp), %rdi
callq 0x48c20
movq %rax, 0x3c8(%rsp)
movq 0x3d0(%rsp), %rdi
callq 0x48c30
movq %rax, 0x3c0(%rsp)
movq 0x3d0(%rsp), %rdi
callq 0x48c40
movq %rax, 0x3b8(%rsp)
movq 0x580(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, %eax
je 0x47ae4
movq 0x3c8(%rsp), %rax
movq %rax, 0x3b0(%rsp)
movq 0x3b8(%rsp), %rax
movq %rax, 0x3c8(%rsp)
movq 0x3b0(%rsp), %rax
movq %rax, 0x3b8(%rsp)
movq 0x3c8(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3a8(%rsp)
movq 0x3c0(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x3a0(%rsp)
movq 0x3b8(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x398(%rsp)
movq 0x578(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0xac(%rsp)
movq 0x3a8(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0xe8(%rsp)
movq 0x3a8(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0xb0(%rsp)
movq 0x3a8(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0xb8(%rsp)
movq 0x3a0(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0xc0(%rsp)
movq 0x3a0(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0xc8(%rsp)
movq 0x3a0(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0xd0(%rsp)
movq 0x398(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0xd8(%rsp)
movq 0x398(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0xe0(%rsp)
movq 0x398(%rsp), %rdi
callq 0x2b840
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rdx
movl 0xac(%rsp), %ecx
movsd 0xb0(%rsp), %xmm1
movsd 0xb8(%rsp), %xmm2
movsd 0xc0(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm4
movsd 0xd0(%rsp), %xmm5
movsd 0xd8(%rsp), %xmm6
movsd 0xe0(%rsp), %xmm7
movaps %xmm0, %xmm8
movsd 0xe8(%rsp), %xmm0
leaq 0x147d0d(%rip), %rsi    # 0x18f985
movsd %xmm8, (%rsp)
movb $0x8, %al
callq 0x22f30
jmp 0x47f68
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, 0x94(%rsp)
callq 0xac600
movl %eax, %ecx
movl 0x94(%rsp), %eax
cmpl %ecx, %eax
jne 0x47f45
movq 0x558(%rsp), %rax
movq %rax, 0x390(%rsp)
movl $0x0, 0x38c(%rsp)
movl 0x38c(%rsp), %eax
movl %eax, 0x90(%rsp)
movq 0x390(%rsp), %rdi
callq 0x2bc40
movl %eax, %ecx
movl 0x90(%rsp), %eax
cmpl %ecx, %eax
jge 0x47f43
movq 0x390(%rsp), %rdi
movl 0x38c(%rsp), %esi
callq 0x2bc60
movq %rax, 0x380(%rsp)
movq 0x580(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, %eax
je 0x47d45
movq 0x380(%rsp), %rdi
callq 0x48c40
movq %rax, 0x88(%rsp)
jmp 0x47d5a
movq 0x380(%rsp), %rdi
callq 0x48c20
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x378(%rsp)
movq 0x380(%rsp), %rdi
callq 0x48c30
movq %rax, 0x370(%rsp)
movq 0x580(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
cmpl $0x0, %eax
je 0x47da9
movq 0x380(%rsp), %rdi
callq 0x48c20
movq %rax, 0x80(%rsp)
jmp 0x47dbe
movq 0x380(%rsp), %rdi
callq 0x48c40
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x368(%rsp)
movq 0x378(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x360(%rsp)
movq 0x370(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x358(%rsp)
movq 0x368(%rsp), %rdi
callq 0x2bcf0
movq %rax, 0x350(%rsp)
movq 0x578(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x570(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x564(%rsp), %eax
movl %eax, 0x3c(%rsp)
movq 0x360(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x78(%rsp)
movq 0x360(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x40(%rsp)
movq 0x360(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x48(%rsp)
movq 0x358(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x50(%rsp)
movq 0x358(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x58(%rsp)
movq 0x358(%rsp), %rdi
callq 0x2b840
movsd %xmm0, 0x60(%rsp)
movq 0x350(%rsp), %rdi
callq 0x2b820
movsd %xmm0, 0x68(%rsp)
movq 0x350(%rsp), %rdi
callq 0x2b830
movsd %xmm0, 0x70(%rsp)
movq 0x350(%rsp), %rdi
callq 0x2b840
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movsd 0x40(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
movsd 0x50(%rsp), %xmm3
movsd 0x58(%rsp), %xmm4
movsd 0x60(%rsp), %xmm5
movsd 0x68(%rsp), %xmm6
movsd 0x70(%rsp), %xmm7
movaps %xmm0, %xmm8
movsd 0x78(%rsp), %xmm0
leaq 0x147a65(%rip), %rsi    # 0x18f985
movsd %xmm8, (%rsp)
movb $0x8, %al
callq 0x22f30
movl 0x38c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38c(%rsp)
jmp 0x47cd3
jmp 0x47f66
movq 0x558(%rsp), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, %esi
leaq 0x147a52(%rip), %rdi    # 0x18f9b1
movb $0x0, %al
callq 0xf3b00
jmp 0x47f68
jmp 0x47f6a
jmp 0x47f6c
jmp 0x47f6e
jmp 0x47f70
jmp 0x47f72
jmp 0x47f74
jmp 0x47f76
movl 0x560(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x560(%rsp)
jmp 0x46bec
movl $0x1, %eax
addq $0x598, %rsp            # imm = 0x598
retq
movq 0x470(%rsp), %rdi
callq 0x23290
nopw %cs:(%rax,%rax)