// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/msh2msh/msh2msh.cpp
// Function: main
int main(int argc, char **argv)
{
  // Check number of arguments
  if (!ParseArgs(argc, argv)) exit(1);

  // Read mesh
  R3Mesh *mesh = ReadMesh(input_mesh_name);
  if (!mesh) exit(-1);

  // Merge meshes from list
  if (merge_list_name) {
    if (!MergeList(mesh, merge_list_name)) exit(-1);
  }

  // Rotate so that principal axes are aligned with canonical coordinate frame
  if (rotate_by_pca) {
    R3Point centroid = mesh->Centroid();
    R3Triad triad = mesh->PrincipleAxes(&centroid);
    R3Affine rotation = R3identity_affine;
    rotation.Translate(centroid.Vector());
    rotation.Transform(R3Affine(triad.InverseMatrix()));
    rotation.Translate(-centroid.Vector());
    xform.Transform(rotation);
  }

  // Scale based on mesh area
  if (scale_by_area) {
    RNArea area = mesh->Area();
    if (area > 0) xform.Scale(1 / sqrt(area));
  }

  // Scale based on principal component analysis
  if (scale_by_pca) {
    RNScalar variances[3];
    R3Point centroid = mesh->Centroid();
    mesh->PrincipleAxes(&centroid, variances);
    if (variances[0] > 0) xform.Scale(1.0 / sqrt(variances[0]));
  }

  // Center mesh at origin
  if (translate_by_centroid) {
    // R3Point centroid = R3zero_point;
    // for (int i = 0; i < mesh->NVertices(); i++) {
    //   R3MeshVertex *vertex = mesh->Vertex(i);
    //   centroid += mesh->VertexPosition(vertex);
    // }
    // if (mesh->NVertices() > 0) centroid /= mesh->NVertices();
    R3Point centroid = mesh->Centroid();
    xform.Translate(-centroid.Vector());
  }

  // Normalize translation, rotation, and scale
  if (align_by_pca) {
    xform = mesh->PCANormalizationTransformation();
  }

  // Transform 
  if (!xform.IsIdentity()) {
    mesh->Transform(xform);
  }

  // Delete interior faces
  if (delete_interior_faces) {
    DeleteInteriorFaces(mesh);
  }

  // Remove small components
  if (min_component_area > 0) {
    DeleteSmallConnectedComponents(mesh, min_component_area);
  }

  // Clean 
  if (clean) {
    mesh->DeleteUnusedEdges();
    mesh->DeleteUnusedVertices();
  }

  // Flip every face
  if (flip_faces) {
    for (int i = 0; i < mesh->NFaces(); i++) {
      mesh->FlipFace(mesh->Face(i));
    }
  }

  // Fill holes
  if (fill_holes) {
    mesh->FillHoles();
  }

  // Smooth
  if (smooth_factor > 0) {
    mesh->Smooth(smooth_factor);
  }

  // Subdivide edges that are too long
  if (max_edge_length > 0) {
    mesh->SubdivideLongEdges(max_edge_length);
  }

  // Split edges that are too long
  if (min_edge_length > 0) {
    mesh->CollapseShortEdges(min_edge_length);
  }

  // Swap edges
  if (swap_edges) {
    mesh->SwapEdges();
  }

  // Transfer colors
  if (source_mesh_name) {
    CopyFromSource(mesh, source_mesh_name);
  }
  
  // Write mesh
  if (!WriteMesh(mesh, output_mesh_name)) exit(-1);

  // Write transformation
  if (!xform.IsIdentity() && output_xform_name) {
    if (!WriteMatrix(xform.Matrix(), output_xform_name)) exit(-1);
  }

  // Return success 
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x13a8, %rsp           # imm = 0x13A8
callq 0x10b6c
testl %eax, %eax
je 0x12b6e
movq 0xc6436(%rip), %r14     # 0xd7bb8
leaq 0x3a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x6806c
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe700
movl $0x138, %edi            # imm = 0x138
callq 0xe430
movq %rax, %r15
movq %rax, %rdi
callq 0x20aa8
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x180(%rax)
testl %eax, %eax
je 0x1183b
cmpl $0x0, 0xc6589(%rip)     # 0xd7d54
je 0x11847
leaq 0x88bc6(%rip), %rdi     # 0x9a39a
callq 0xe690
leaq 0x3a0(%rsp), %rdi
callq 0x680ce
leaq 0x88ad6(%rip), %rdi     # 0x9a2c3
movb $0x1, %al
callq 0xe070
movl 0x34(%r15), %esi
leaq 0x88a77(%rip), %rdi     # 0x9a276
xorl %eax, %eax
callq 0xe070
movl 0x24(%r15), %esi
leaq 0x88a75(%rip), %rdi     # 0x9a286
xorl %eax, %eax
callq 0xe070
movl 0x14(%r15), %esi
leaq 0x88a73(%rip), %rdi     # 0x9a296
xorl %eax, %eax
callq 0xe070
movq 0xc573f(%rip), %rax     # 0xd6f70
movq (%rax), %rdi
callq 0xe500
jmp 0x11847
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
xorl %r15d, %r15d
movq %r15, (%rsp)
testq %r15, %r15
je 0x12b64
movq 0xc637d(%rip), %r15     # 0xd7bd8
testq %r15, %r15
je 0x11900
leaq 0x8d0b8(%rip), %rsi     # 0x9e923
movq %r15, %rdi
callq 0xe510
testq %rax, %rax
je 0x12b78
movq %rax, %r14
leaq 0x8af2a(%rip), %rsi     # 0x9c7b0
leaq 0x3a0(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xe7e0
cmpl $0x1, %eax
jne 0x118f8
leaq 0x220(%rsp), %r15
leaq 0x3a0(%rsp), %r12
leaq 0x8aefc(%rip), %r13     # 0x9c7b0
movq %r15, %rdi
callq 0x20aa8
movq %r15, %rdi
movq %r12, %rsi
callq 0x2dac6
testl %eax, %eax
je 0x12b57
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x2d404
movq %r15, %rdi
callq 0x20fd6
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe7e0
cmpl $0x1, %eax
je 0x118b4
movq %r14, %rdi
callq 0xe420
cmpl $0x0, 0xc6441(%rip)     # 0xd7d48
movq (%rsp), %r15
je 0x11a7b
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x21034
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x21678
leaq 0xc2eeb(%rip), %rax     # 0xd4828
addq $0x10, %rax
leaq 0x3a8(%rsp), %r14
movq %rax, -0x8(%r14)
leaq 0xc697c(%rip), %r15     # 0xd82d0
leaq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x3d30e
movl $0x88, %esi
addq %rsi, %rbx
addq 0xc5671(%rip), %rsi     # 0xd6fe0
movq %rbx, %rdi
callq 0x3d30e
movq 0x108(%r15), %rax
movq %rax, 0x4a8(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movsd 0x60(%rsp), %xmm2
leaq 0x220(%rsp), %rdi
callq 0x414aa
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
callq 0x3e448
andb $-0x3, 0x4a8(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x3bce4
movq (%rsp), %r15
leaq 0x220(%rsp), %rdi
leaq 0x150(%rsp), %rsi
xorl %edx, %edx
callq 0x3af82
leaq 0x3a0(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x3b13e
leaq 0x220(%rsp), %rdi
callq 0x3afd0
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movsd 0x60(%rsp), %xmm2
leaq 0x150(%rsp), %rdi
callq 0x414aa
leaq 0x220(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x42140
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
callq 0x3e448
leaq 0x3a0(%rsp), %rsi
andb $-0x3, 0x108(%rsi)
leaq 0xc61a7(%rip), %rdi     # 0xd7c10
callq 0x3b13e
leaq 0x3a0(%rsp), %rdi
callq 0x3afd0
cmpl $0x0, 0xc62be(%rip)     # 0xd7d40
je 0x11ac6
movq %r15, %rdi
callq 0x211f8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x11ac6
jb 0x11a9e
sqrtsd %xmm0, %xmm0
jmp 0x11aa3
callq 0xe330
movsd 0x88565(%rip), %xmm1    # 0x9a010
divsd %xmm0, %xmm1
leaq 0xc6162(%rip), %rdi     # 0xd7c18
movapd %xmm1, %xmm0
callq 0x3e5f6
andb $-0x3, 0xc6252(%rip)    # 0xd7d18
cmpl $0x0, 0xc6277(%rip)     # 0xd7d44
je 0x11b3f
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21034
leaq 0x3a0(%rsp), %rdi
leaq 0x220(%rsp), %r14
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x21678
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x11b3f
jb 0x11b17
sqrtsd %xmm0, %xmm0
jmp 0x11b1c
callq 0xe330
movsd 0x884ec(%rip), %xmm1    # 0x9a010
divsd %xmm0, %xmm1
leaq 0xc60e9(%rip), %rdi     # 0xd7c18
movapd %xmm1, %xmm0
callq 0x3e5f6
andb $-0x3, 0xc61d9(%rip)    # 0xd7d18
cmpl $0x0, 0xc620a(%rip)     # 0xd7d50
je 0x11ba2
leaq 0x3a0(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21034
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movsd 0x10(%rbx), %xmm2
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
callq 0x414aa
leaq 0x220(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42140
leaq 0xc6085(%rip), %rdi     # 0xd7c18
movq %r14, %rsi
callq 0x3e448
andb $-0x3, 0xc6176(%rip)    # 0xd7d18
cmpl $0x0, 0xc61a3(%rip)     # 0xd7d4c
je 0x11c17
leaq 0x3a0(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x21b40
leaq 0x3a8(%rsp), %rsi
leaq 0xc603b(%rip), %rdi     # 0xd7c18
callq 0x3eef2
movl $0x88, %eax
addq %rax, %rbx
leaq 0xc601f(%rip), %rdi     # 0xd7c10
addq %rax, %rdi
movq %rbx, %rsi
callq 0x3eef2
leaq 0x3a0(%rsp), %rdi
movq 0x108(%rdi), %rax
movq %rax, 0xc6106(%rip)     # 0xd7d18
callq 0x3afd0
leaq 0xc5ff2(%rip), %rdi     # 0xd7c10
callq 0x3b040
testl %eax, %eax
jne 0x11c3a
movq (%r15), %rax
leaq 0xc5fdf(%rip), %rsi     # 0xd7c10
movq %r15, %rdi
callq *0x118(%rax)
cmpl $0x0, 0xc5fbf(%rip)     # 0xd7c00
je 0x122da
leaq 0x360(%rsp), %rbx
movq %rbx, %rdi
callq 0x6806c
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe700
leaq 0xf8(%r15), %rbx
movq 0xf8(%r15), %rax
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq *0x68(%rax)
movq %rbx, %rdi
callq 0x388c4
movapd %xmm0, %xmm2
mulsd 0x8838a(%rip), %xmm2    # 0x9a018
movapd %xmm2, 0x10(%rsp)
movapd 0x883b4(%rip), %xmm0    # 0x9a050
xorpd %xmm2, %xmm0
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm2, %xmm3
callq 0x5e138
movapd 0x10(%rsp), %xmm0
mulsd 0x8835a(%rip), %xmm0    # 0x9a020
leaq 0x220(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5237e
leaq 0x150(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x52658
movsd 0x2d0(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xc5e34(%rip), %rax     # 0xd7b38
movsd (%rax), %xmm0
movapd %xmm0, 0x30(%rsp)
movslq 0x34(%r15), %r14
leaq (,%r14,4), %rbx
testq %r14, %r14
movq $-0x1, %rdi
cmovnsq %rbx, %rdi
callq 0xe030
movq %rax, %r13
movapd 0x88318(%rip), %xmm2    # 0x9a050
movapd 0x30(%rsp), %xmm4
xorpd %xmm4, %xmm2
movsd 0x882c6(%rip), %xmm0    # 0x9a010
movapd 0x10(%rsp), %xmm3
divsd %xmm3, %xmm0
cmpnlesd %xmm3, %xmm2
movapd %xmm2, %xmm1
andpd %xmm0, %xmm1
cmpnlesd %xmm4, %xmm3
andpd %xmm0, %xmm3
andnpd %xmm3, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x80(%rsp)
testl %r14d, %r14d
jle 0x11d8d
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0xe250
movapd 0x80(%rsp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
leaq 0x3a8(%rsp), %r14
leaq 0x8ada6(%rip), %rax     # 0x9cb58
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %eax, %eax
leaq 0xc2a63(%rip), %rcx     # 0xd4828
addq $0x10, %rcx
movq %rcx, 0x20(%rsp)
leaq 0xc64fb(%rip), %rcx     # 0xd82d0
addq $0x8, %rcx
movq %rcx, 0xa0(%rsp)
movl $0x88, %ecx
addq 0xc51f3(%rip), %rcx     # 0xd6fe0
movq %rcx, 0x98(%rsp)
leaq 0x138(%rsp), %r12
leaq 0x220(%rsp), %rbp
leaq 0x3a0(%rsp), %rbx
movq %r13, 0x90(%rsp)
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x3a0(%rsp)
movq %r14, %rdi
movq 0xa0(%rsp), %rsi
callq 0x3d30e
leaq 0x428(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x3d30e
leaq 0xc647d(%rip), %rax     # 0xd82d0
movq 0x108(%rax), %rax
movq %rax, 0x4a8(%rsp)
movq %r12, %rdi
callq 0x4220e
callq 0x6a64c
mulsd 0x8(%rsp), %xmm0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3ea72
andb $-0x3, 0x4a8(%rsp)
movq %r12, %rdi
callq 0x4220e
callq 0x6a64c
mulsd 0x8(%rsp), %xmm0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3ea72
andb $-0x3, 0x4a8(%rsp)
movq %r12, %rdi
callq 0x4220e
callq 0x6a64c
mulsd 0x8(%rsp), %xmm0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3ea72
andb $-0x3, 0x4a8(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movsd 0x60(%rsp), %xmm2
leaq 0x68(%rsp), %rdi
callq 0x414aa
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
callq 0x42140
movq %r14, %rdi
movq %r12, %rsi
callq 0x3e448
andb $-0x3, 0x4a8(%rsp)
movq %rbp, %rdi
movsd 0x8810d(%rip), %xmm0    # 0x9a028
callq 0x53dc2
leaq 0xc5c21(%rip), %rax     # 0xd7b48
movsd (%rax), %xmm0
leaq 0x150(%rsp), %rdi
callq 0x53dc2
movl 0x34(%r15), %eax
testl %eax, %eax
jle 0x12107
xorl %r13d, %r13d
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %r15
movq 0x18(%rax), %r14
addq $0x18, %rsi
movq %r12, %rdi
callq 0x40a22
addq $0x18, %r15
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x40a22
addq $0x18, %r14
leaq 0x120(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x40a22
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4132e
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4132e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4132e
movsd 0x138(%rsp), %xmm0
movsd 0x140(%rsp), %xmm1
leaq 0x110(%rsp), %rdi
callq 0x60e4a
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
leaq 0x100(%rsp), %rdi
callq 0x60e4a
movsd 0x120(%rsp), %xmm0
movsd 0x128(%rsp), %xmm1
leaq 0xf0(%rsp), %rdi
callq 0x60e4a
movsd 0x148(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x130(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x110(%rsp), %xmm0
movsd 0x118(%rsp), %xmm1
leaq 0x390(%rsp), %rdi
movq %rbp, %rsi
callq 0x59022
movsd 0x100(%rsp), %xmm0
movsd 0x108(%rsp), %xmm1
leaq 0x380(%rsp), %rdi
movq %rbp, %rsi
callq 0x59022
movsd 0xf0(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
leaq 0x370(%rsp), %rdi
movq %rbp, %rsi
callq 0x59022
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movq %rbp, %rdi
leaq 0x390(%rsp), %rsi
leaq 0x380(%rsp), %rdx
leaq 0x370(%rsp), %rcx
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm3
movsd 0x30(%rsp), %xmm4
movsd 0x28(%rsp), %xmm5
leaq 0x150(%rsp), %r8
callq 0x58750
incq %r13
movq (%rsp), %r15
movslq 0x34(%r15), %rax
cmpq %rax, %r13
jl 0x11f47
movq 0x90(%rsp), %r13
leaq 0x3a8(%rsp), %r14
movslq 0x2ec(%rsp), %rcx
testq %rcx, %rcx
jle 0x12150
movq 0x2d8(%rsp), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x12148
addsd 0x87ee3(%rip), %xmm0    # 0x9a018
cvttsd2si %xmm0, %edi
testl %edi, %edi
js 0x12148
cmpl %edi, %eax
jle 0x12148
movl %edi, %edi
incl (%r13,%rdi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x1211e
movq %rbx, %rdi
callq 0x3afd0
movq 0x48(%rsp), %rax
incl %eax
cmpl $0x64, %eax
jne 0x11e15
leaq 0x3a0(%rsp), %rdi
callq 0x68608
cmpl $0x0, 0x34(%r15)
movq %r15, %rcx
jle 0x1220c
xorl %r15d, %r15d
leaq 0x3a0(%rsp), %rbx
movq 0x28(%rcx), %rax
movq (%rax,%r15,8), %r14
testb $0x2, 0xa8(%r14)
jne 0x121b0
movq (%rsp), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x2c0(%rax)
movsd 0x90(%r14), %xmm0
mulsd 0x87e6f(%rip), %xmm0    # 0x9a030
divsd 0x80(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl (%r13,%r15,4), %xmm1
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd 0x87e54(%rip), %xmm0    # 0x9a038
ucomisd %xmm0, %xmm1
ja 0x121fc
movl 0x3ac(%rsp), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6869e
incq %r15
movq (%rsp), %rcx
movslq 0x34(%rcx), %rax
cmpq %rax, %r15
jl 0x1218e
cmpl $0x0, 0x3ac(%rsp)
movq %rcx, %r15
jle 0x12240
xorl %ebx, %ebx
movq 0x3a0(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x70(%rax)
incq %rbx
movslq 0x3ac(%rsp), %rax
cmpq %rax, %rbx
jl 0x1221b
cmpl $0x0, 0xc5b0d(%rip)     # 0xd7d54
je 0x122a6
leaq 0x88158(%rip), %rdi     # 0x9a3a8
callq 0xe690
leaq 0x360(%rsp), %rdi
callq 0x680ce
leaq 0x88058(%rip), %rdi     # 0x9a2c1
movb $0x1, %al
callq 0xe070
movl 0x3ac(%rsp), %esi
leaq 0x8805c(%rip), %rdi     # 0x9a2da
xorl %eax, %eax
callq 0xe070
movl 0x34(%r15), %esi
leaq 0x88064(%rip), %rdi     # 0x9a2f4
xorl %eax, %eax
callq 0xe070
movq 0xc4cd2(%rip), %rax     # 0xd6f70
movq (%rax), %rdi
callq 0xe500
leaq 0x3a0(%rsp), %rdi
callq 0x68672
leaq 0x150(%rsp), %rdi
callq 0x52830
leaq 0x220(%rsp), %rdi
callq 0x52830
leaq 0xa8(%rsp), %rdi
callq 0x5e9b8
movsd 0xc5a4e(%rip), %xmm1    # 0xd7d30
xorpd %xmm0, %xmm0
movsd %xmm1, 0x48(%rsp)
ucomisd %xmm0, %xmm1
jbe 0x1262f
leaq 0x3a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x6806c
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe700
movslq 0x34(%r15), %rbx
testq %rbx, %rbx
je 0x1262f
movl %ebx, %ebp
shlq $0x2, %rbx
testl %ebp, %ebp
movq $-0x1, %rdi
cmovnsq %rbx, %rdi
callq 0xe030
movq %rax, %r14
testl %ebp, %ebp
jle 0x1234c
movq %r14, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0xe250
leaq 0x220(%rsp), %rdi
callq 0x68608
xorl %ebx, %ebx
leaq 0xc510e(%rip), %r13     # 0xd7470
leaq 0x150(%rsp), %r12
movl $0x0, 0x20(%rsp)
movl $0x0, 0x30(%rsp)
movl 0x34(%r15), %eax
cmpl %eax, %ebx
jge 0x123b4
movslq %eax, %rcx
movslq %ebx, %rdx
subq %rdx, %rcx
leaq (%r14,%rdx,4), %rsi
shlq $0x3, %rdx
addq 0x28(%r15), %rdx
xorl %edi, %edi
xorl %r8d, %r8d
cmpl $0x0, (%rsi,%rdi,4)
jns 0x123a6
movq (%rdx,%rdi,8), %r8
js 0x123b9
incq %rdi
cmpq %rdi, %rcx
jne 0x1239c
movl %eax, %ebx
jmp 0x123bb
xorl %r8d, %r8d
jmp 0x123bb
addl %edi, %ebx
movq %r8, 0x28(%rsp)
testq %r8, %r8
je 0x12545
incl (%r13)
movq %r12, %rdi
callq 0x68608
leaq 0xa8(%rsp), %rdi
callq 0x68608
movl 0x15c(%rsp), %edx
movq %r12, %rdi
movq 0x28(%rsp), %rbp
movq %rbp, %rsi
callq 0x6869e
movq %rbx, 0x8(%rsp)
movl (%r13), %eax
movl %eax, 0xb8(%rbp)
movl 0x15c(%rsp), %eax
xorpd %xmm0, %xmm0
testl %eax, %eax
je 0x124e9
movsd %xmm0, 0x10(%rsp)
movq 0x150(%rsp), %rcx
movslq %eax, %rsi
movq -0x8(%rcx,%rsi,8), %rbp
decl %esi
movq %r12, %rdi
callq 0x68812
movl 0xb4(%rsp), %edx
leaq 0xa8(%rsp), %rdi
movq %rbp, %rsi
callq 0x6869e
testb $0x2, 0xa8(%rbp)
jne 0x1246a
movq (%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
callq *0x2c0(%rax)
movsd 0x10(%rsp), %xmm0
addsd 0x90(%rbp), %xmm0
movsd %xmm0, 0x10(%rsp)
movslq 0xa4(%rbp), %rax
movl 0x30(%rsp), %ecx
movl %ecx, (%r14,%rax,4)
movl $0x4, %r15d
movq (%rbp,%r15,8), %rax
movq 0x18(%rax), %rsi
cmpq %rbp, %rsi
jne 0x124a5
movq 0x20(%rax), %rsi
testq %rsi, %rsi
je 0x124cb
movl (%r13), %eax
cmpl %eax, 0xb8(%rsi)
je 0x124cb
movl %eax, 0xb8(%rsi)
movl 0x15c(%rsp), %edx
movq %r12, %rdi
callq 0x6869e
incq %r15
cmpq $0x7, %r15
jne 0x12493
movl 0x15c(%rsp), %eax
testl %eax, %eax
movq (%rsp), %r15
jne 0x12421
jmp 0x124ef
movsd %xmm0, 0x10(%rsp)
cmpl $0x0, 0xb4(%rsp)
je 0x1252b
movsd 0x48(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
movq 0x8(%rsp), %rbx
jbe 0x12525
leaq 0x220(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x68938
incl 0x20(%rsp)
incl 0x30(%rsp)
jmp 0x12530
movq 0x8(%rsp), %rbx
leaq 0xa8(%rsp), %rdi
callq 0x68672
movq %r12, %rdi
callq 0x68672
cmpq $0x0, 0x28(%rsp)
jne 0x1237a
cmpl $0x0, 0x22c(%rsp)
jle 0x12584
xorl %r15d, %r15d
movq 0x220(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
incq %r15
movslq 0x22c(%rsp), %rax
cmpq %rax, %r15
jl 0x1255e
movq %r14, %rdi
callq 0xe580
cmpl $0x0, 0xc57c1(%rip)     # 0xd7d54
movq (%rsp), %r15
je 0x12622
leaq 0x87e21(%rip), %rdi     # 0x9a3c5
callq 0xe690
leaq 0x3a0(%rsp), %rdi
callq 0x680ce
leaq 0x87d04(%rip), %rdi     # 0x9a2c1
movb $0x1, %al
callq 0xe070
leaq 0x87d45(%rip), %rdi     # 0x9a310
movl 0x20(%rsp), %ebp
movl %ebp, %esi
xorl %eax, %eax
callq 0xe070
movl 0x22c(%rsp), %esi
leaq 0x87cf4(%rip), %rdi     # 0x9a2da
xorl %eax, %eax
callq 0xe070
movl 0x30(%rsp), %esi
subl %ebp, %esi
leaq 0x87d35(%rip), %rdi     # 0x9a32f
xorl %eax, %eax
callq 0xe070
movl 0x34(%r15), %esi
leaq 0x87ce8(%rip), %rdi     # 0x9a2f4
xorl %eax, %eax
callq 0xe070
movq 0xc4956(%rip), %rax     # 0xd6f70
movq (%rax), %rdi
callq 0xe500
leaq 0x220(%rsp), %rdi
callq 0x68672
cmpl $0x0, 0xc55be(%rip)     # 0xd7bf4
je 0x1264d
movq (%r15), %rax
movq %r15, %rdi
callq *0x80(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x78(%rax)
cmpl $0x0, 0xc559c(%rip)     # 0xd7bf0
je 0x1267f
cmpl $0x0, 0x34(%r15)
jle 0x1267f
xorl %ebx, %ebx
movq (%r15), %rax
movq 0x28(%r15), %rcx
movq (%rcx,%rbx,8), %rsi
movq %r15, %rdi
callq *0xe0(%rax)
incq %rbx
movslq 0x34(%r15), %rax
cmpq %rax, %rbx
jl 0x1265f
cmpl $0x0, 0xc5576(%rip)     # 0xd7bfc
je 0x12698
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %r15, %rdi
callq 0x27b0c
movsd 0xc5568(%rip), %xmm0    # 0xd7c08
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x126ba
movq (%r15), %rax
movq %r15, %rdi
callq *0xf8(%rax)
xorpd %xmm1, %xmm1
movsd 0xc5666(%rip), %xmm0    # 0xd7d28
ucomisd %xmm1, %xmm0
jbe 0x126d0
movq %r15, %rdi
callq 0x266b8
movsd 0xc5648(%rip), %xmm0    # 0xd7d20
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x126ea
movq %r15, %rdi
callq 0x2646e
cmpl $0x0, 0xc5507(%rip)     # 0xd7bf8
je 0x12703
movsd 0x87945(%rip), %xmm0    # 0x9a040
movq %r15, %rdi
callq 0x26f5c
movq 0xc54c6(%rip), %rbx     # 0xd7bd0
testq %rbx, %rbx
je 0x129f2
leaq 0x3a0(%rsp), %r14
movq %r14, %rdi
callq 0x20aa8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2dac6
testl %eax, %eax
je 0x129e5
leaq 0xa8(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x12d50
cmpl $0x0, 0xc548e(%rip)     # 0xd7be0
je 0x128e1
cmpl $0x0, 0x14(%r15)
jle 0x129d8
xorl %ebx, %ebx
leaq 0x150(%rsp), %r12
leaq 0x220(%rsp), %r14
movq 0x8(%r15), %rax
movq (%rax,%rbx,8), %r13
leaq 0x58(%r13), %rbp
movq %rbp, %rdi
leaq 0xc7c95(%rip), %rsi     # 0xda420
callq 0x6850e
leaq 0x170(%rsp), %rdi
callq 0x40a10
movq %r14, %r15
addq $0x18, %r13
leaq 0xc539d(%rip), %rax     # 0xd7b48
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x147a6
movl 0x150(%rsp), %eax
cmpl $0x3, %eax
je 0x12862
cmpl $0x2, %eax
je 0x12802
cmpl $0x1, %eax
jne 0x128c8
movq 0x158(%rsp), %rsi
addq $0x58, %rsi
movq %rbp, %rdi
callq 0x6850e
jmp 0x128c8
movq 0x160(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq $0x18, %rsi
addq $0x18, %rdx
movq %r15, %rdi
callq 0x3fe96
movq %r15, %rdi
movq %r13, %rsi
callq 0x4013c
movsd 0x268(%rsp), %xmm1
mulsd 0x877da(%rip), %xmm1    # 0x9a018
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setbe %al
movq 0x160(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %rsi
addq $0x58, %rsi
movq %rbp, %rdi
callq 0x6850e
jmp 0x128c8
movq 0x168(%rsp), %rdx
movq %r15, %rdi
leaq 0x3a0(%rsp), %rsi
movq %r13, %rcx
callq 0x22af2
movsd 0x220(%rsp), %xmm0
movsd 0x228(%rsp), %xmm1
movsd 0x230(%rsp), %xmm2
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x414aa
movq %r15, %rdi
callq 0x4163e
movq 0x168(%rsp), %rcx
cltq
movq 0x8(%rcx,%rax,8), %rsi
addq $0x58, %rsi
movq %rbp, %rdi
callq 0x6850e
incq %rbx
movq (%rsp), %r15
movslq 0x14(%r15), %rax
cmpq %rax, %rbx
jl 0x12775
jmp 0x129d8
cmpl $0x0, 0xc52fc(%rip)     # 0xd7be4
jne 0x12900
cmpl $0x0, 0xc52f7(%rip)     # 0xd7be8
jne 0x12900
cmpl $0x0, 0xc52f2(%rip)     # 0xd7bec
je 0x129d8
cmpl $0x0, 0x34(%r15)
jle 0x129d8
xorl %ebp, %ebp
leaq 0x150(%rsp), %r14
leaq 0xa8(%rsp), %rbx
leaq 0x220(%rsp), %r12
movq 0x28(%r15), %rax
movq (%rax,%rbp,8), %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x21184
leaq 0x240(%rsp), %rdi
callq 0x40a10
leaq 0xc51f9(%rip), %rax     # 0xd7b48
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x147a6
cmpl $0x0, 0xc5273(%rip)     # 0xd7be4
je 0x12988
movq 0x238(%rsp), %rax
movl 0xa0(%rax), %eax
movl %eax, 0xa0(%r13)
cmpl $0x0, 0xc5259(%rip)     # 0xd7be8
je 0x129a6
movq 0x238(%rsp), %rax
movl 0x9c(%rax), %eax
movl %eax, 0x9c(%r13)
cmpl $0x0, 0xc523f(%rip)     # 0xd7bec
je 0x129c4
movq 0x238(%rsp), %rax
movl 0x98(%rax), %eax
movl %eax, 0x98(%r13)
incq %rbp
movq (%rsp), %r15
movslq 0x34(%r15), %rax
cmpq %rax, %rbp
jl 0x12925
leaq 0xa8(%rsp), %rdi
callq 0x12e66
leaq 0x3a0(%rsp), %rdi
callq 0x20fd6
movq 0xc51c7(%rip), %r14     # 0xd7bc0
leaq 0x3a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x6806c
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe700
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x1d0(%rax)
movl %eax, %ebx
testl %eax, %eax
je 0x12aa2
cmpl $0x0, 0xc5325(%rip)     # 0xd7d54
je 0x12aa2
leaq 0x87918(%rip), %rdi     # 0x9a350
movq %r14, %rsi
xorl %eax, %eax
callq 0xe070
leaq 0x3a0(%rsp), %rdi
callq 0x680ce
leaq 0x8786d(%rip), %rdi     # 0x9a2c3
movb $0x1, %al
callq 0xe070
movl 0x34(%r15), %esi
leaq 0x8780e(%rip), %rdi     # 0x9a276
xorl %eax, %eax
callq 0xe070
movl 0x24(%r15), %esi
leaq 0x8780c(%rip), %rdi     # 0x9a286
xorl %eax, %eax
callq 0xe070
movl 0x14(%r15), %esi
leaq 0x8780a(%rip), %rdi     # 0x9a296
xorl %eax, %eax
callq 0xe070
movq 0xc44d6(%rip), %rax     # 0xd6f70
movq (%rax), %rdi
callq 0xe500
testl %ebx, %ebx
je 0x12b64
leaq 0xc515f(%rip), %rdi     # 0xd7c10
callq 0x3b040
testl %eax, %eax
sete %al
movq 0xc5106(%rip), %r14     # 0xd7bc8
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x12b43
leaq 0x89464(%rip), %rsi     # 0x9bf3a
movq %r14, %rdi
callq 0xe510
movq %rax, %rbx
testq %rax, %rax
je 0x12b2d
leaq 0xc512b(%rip), %r15     # 0xd7c18
xorl %r12d, %r12d
leaq 0x8786f(%rip), %r14     # 0x9a366
xorl %r13d, %r13d
movsd (%r15,%r13,8), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movb $0x1, %al
callq 0xe610
incq %r13
cmpq $0x4, %r13
jne 0x12afa
incq %r12
addq $0x20, %r15
cmpq $0x4, %r12
jne 0x12af7
movq %rbx, %rdi
callq 0xe420
jmp 0x12b3e
leaq 0x87722(%rip), %rdi     # 0x9a256
movq %r14, %rsi
xorl %eax, %eax
callq 0x6aa3a
testq %rbx, %rbx
je 0x12b64
xorl %eax, %eax
addq $0x13a8, %rsp           # imm = 0x13A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x220(%rsp), %rdi
callq 0x20fd6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xe530
movl $0x1, %edi
callq 0xe530
leaq 0x8772a(%rip), %rdi     # 0x9a2a9
movq %r15, %rsi
xorl %eax, %eax
callq 0x6aa3a
jmp 0x12b64
jmp 0x12c30
jmp 0x12c54
jmp 0x12b99
jmp 0x12ba1
movq %rax, %rbx
jmp 0x12c48
movq %rax, %rbx
jmp 0x12cdf
jmp 0x12c09
movq %rax, %rbx
jmp 0x12cec
movq %rax, %rbx
jmp 0x12cf9
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x3afd0
jmp 0x12c0c
movq %rax, %rbx
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdi
callq 0xe440
jmp 0x12d06
jmp 0x12c38
jmp 0x12c38
jmp 0x12c38
jmp 0x12c38
jmp 0x12c38
jmp 0x12c09
jmp 0x12c09
jmp 0x12c09
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x3b658
jmp 0x12d06
jmp 0x12c38
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x3afd0
jmp 0x12d06
jmp 0x12c38
jmp 0x12c38
movq %rax, %rbx
jmp 0x12cb1
jmp 0x12c30
jmp 0x12ca1
jmp 0x12c38
movq %rax, %rbx
jmp 0x12cbe
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x12e66
leaq 0x3a0(%rsp), %rdi
jmp 0x12c71
jmp 0x12c54
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x68672
jmp 0x12cdf
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x20fd6
jmp 0x12d06
jmp 0x12ccf
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x3b658
jmp 0x12cdf
jmp 0x12ccf
jmp 0x12ccf
jmp 0x12ccf
jmp 0x12ccf
jmp 0x12ca1
jmp 0x12ccf
jmp 0x12ccf
jmp 0x12ccf
jmp 0x12ccf
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x68672
leaq 0x150(%rsp), %rdi
callq 0x68672
leaq 0x220(%rsp), %rdi
callq 0x68672
jmp 0x12d06
jmp 0x12ccf
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x3afd0
leaq 0x150(%rsp), %rdi
callq 0x52830
leaq 0x220(%rsp), %rdi
callq 0x52830
leaq 0xa8(%rsp), %rdi
callq 0x5e9b8
movq %rbx, %rdi
callq 0xe780