// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::GeodesicDistances(gaps::R3MeshVertex const*, double) const
RNLength *R3Mesh::
GeodesicDistances(const R3MeshVertex *source_vertex, RNLength max_distance) const
{
  // Create arrays of upper bounds on distances
  RNLength *vertex_distances = new RNLength [ NVertices() ];
  RNLength *edge_distances = new RNLength [ NEdges() ];
  RNLength *face_distances = new RNLength [ NFaces() ];
  assert(vertex_distances && edge_distances && face_distances);
  for (int i = 0; i < NVertices(); i++) vertex_distances[i] = FLT_MAX;
  for (int i = 0; i < NEdges(); i++) edge_distances[i] = FLT_MAX;
  for (int i = 0; i < NFaces(); i++) face_distances[i] = FLT_MAX;
  vertex_distances [VertexID(source_vertex)] = 0;

  // Initialize heap of beams originating at source vertex
  R3MeshGeodesicBeam tmp;
  RNHeap<R3MeshGeodesicBeam *> heap(&tmp, &(tmp.distance));
  RNArray<R3MeshGeodesicBeam *> beams;
  R3MeshCreateGeodesicBeamsForVertex(this, source_vertex, max_distance, 0, NULL, 
    vertex_distances, edge_distances, face_distances, heap, beams);
  for (int i = 0; i < VertexValence(source_vertex); i++) {
    R3MeshEdge *e = EdgeOnVertex(source_vertex, i);
    R3MeshVertex *vertex = VertexAcrossEdge(e, source_vertex);
    edge_distances [EdgeID(e)] = EdgeLength(e);
    vertex_distances [VertexID(vertex)] = EdgeLength(e);
    if (R3MeshVertexIsSaddleOrBoundary(this, vertex)) {
      R3MeshCreateGeodesicBeamsForVertex(this, vertex, max_distance, EdgeLength(e), NULL, 
        vertex_distances, edge_distances, face_distances, heap, beams);
    }
  }

  // Pop beams off heap
  while (!heap.IsEmpty()) {
    // Get beam
    R3MeshGeodesicBeam *beam = heap.Pop();
    assert(beam);

    // Get face across edge
    R3MeshFace *face = FaceAcrossEdge(beam->edge, beam->face);
    assert(face);

    // Check beam distances versus upper bounds on distances found already
    if (beam->distance > beam->distance - beam->distance_to_source + vertex_distances[VertexID(beam->source)]) continue;
    if (beam->distance >= edge_distances[EdgeID(beam->edge)]) continue;
    if (beam->distance >= face_distances[FaceID(face)]) continue;

    // Construct beam extent
    R3Point left_span_position = beam->span.Start();
    R3Vector left_vector =  left_span_position.Vector();
    R3Vector left_normal = left_vector % R3posz_vector; left_normal.Normalize();
    R3Plane left_plane(left_span_position, left_normal);
    R3Point right_span_position = beam->span.End();
    R3Vector right_vector =  right_span_position.Vector();
    R3Vector right_normal = R3posz_vector % right_vector; right_normal.Normalize();
    R3Plane right_plane(right_span_position, right_normal);

    // Find affine that takes points on face into beam coordinate system
    R3Vector face_normal = FaceNormal(face);
    face_normal.Transform(beam->affine);
    R3Affine affine = R3identity_affine;
    affine.Translate(beam->span.Midpoint().Vector());
    affine.Rotate(face_normal, R3posz_vector);
    affine.Translate(-(beam->span.Midpoint().Vector()));
    affine.Transform(beam->affine);

    // Spawn beams across edges
    for (int i = 0; i < 2; i++) {
      R3MeshEdge *edge = EdgeOnFace(face, beam->edge, i);
      R3MeshFace *neighbor_face = FaceAcrossEdge(edge, face);
      if (!neighbor_face) continue;

      // Check versus upper-bound distances
      if (beam->distance >= edge_distances[EdgeID(edge)]) continue;
      if (beam->distance >= face_distances[FaceID(neighbor_face)]) continue;

      // Get edge span in unfolded beam coordinate system
      R3MeshVertex *v_ccw = VertexOnFace(face, edge, RN_CCW);
      R3MeshVertex *v_cw = VertexOnFace(face, edge, RN_CW);
      R3Point p_ccw = VertexPosition(v_ccw);
      R3Point p_cw = VertexPosition(v_cw);
      p_ccw.Transform(affine);
      p_cw.Transform(affine);
      R3Span edge_span(p_ccw, p_cw);
      // assert(RNIsZero(p_ccw[2]));
      // assert(RNIsZero(p_cw[2]));

      // Check if source is on correct side of edge span
      R3Vector span_vector = edge_span.Vector();
      if (RNIsZero(span_vector.Length())) continue;
      R3Vector span_normal = R3posz_vector % span_vector; span_normal.Normalize();
      R3Plane span_plane(edge_span.Midpoint(), span_normal);
      if (RNIsPositive(R3SignedDistance(span_plane, R3zero_point))) continue;
      
      // Check for edge-beam intersection
      // RNScalar left_dcw = R3SignedDistance(left_plane, edge_span.End());
      // if (RNIsNegative(left_dcw)) continue;
      // RNScalar right_dccw = R3SignedDistance(right_plane, edge_span.Start());
      // if (RNIsNegative(right_dccw)) continue;
        
      // Clip edge span to beam
      if (!edge_span.Clip(left_plane)) continue;
      if (!edge_span.Clip(right_plane)) continue;

      // Get lower bound on distance to edge span
      RNLength beam_distance = beam->distance_to_source + R3Distance(R3zero_point, edge_span);
      if ((max_distance > 0) && (beam_distance > max_distance)) continue;

      // Check versus upper-bound distances
      if (beam_distance >= edge_distances[EdgeID(edge)]) continue;
      if (beam_distance >= face_distances[FaceID(neighbor_face)]) continue;

      // Create beam
      R3MeshGeodesicBeam *child_beam = new R3MeshGeodesicBeam();
      child_beam->source = beam->source;
      child_beam->face = face;
      child_beam->edge = edge;
      child_beam->affine = affine;
      child_beam->span = edge_span;
      child_beam->distance = beam_distance;
      child_beam->distance_to_source = beam->distance_to_source;
      child_beam->parent = beam;

      // Add beam to heap
      heap.Push(child_beam);
      beams.Insert(child_beam);
    }

    // Update upper bound distances and spawn beams from vertices
    for (int i = 0; i < 3; i++) {
      R3MeshVertex *vertex = VertexOnFace(face, i);
      R3Point vertex_position = VertexPosition(vertex);
      vertex_position.Transform(affine);

      // Compute distance to vertex along this path
      RNLength vertex_distance = 0;
      RNBoolean vertex_visible = FALSE;
      if (R3SignedDistance(left_plane, vertex_position) < 0) {
        // Vertex is to the left of the beam
        RNLength left_distance1 = R3Distance(R3zero_point, left_span_position);
        RNLength left_distance2 = R3Distance(left_span_position, vertex_position);
        vertex_distance = beam->distance_to_source + left_distance1 + left_distance2;
      }
      else if (R3SignedDistance(right_plane, vertex_position) < 0) {
        // Vertex is to the right of the beam
        RNLength right_distance1 = R3Distance(R3zero_point, right_span_position);
        RNLength right_distance2 = R3Distance(right_span_position, vertex_position);
        vertex_distance = beam->distance_to_source + right_distance1 + right_distance2;
      }
      else {
        // Vertex is inside the beam
        vertex_distance = beam->distance_to_source + R3Distance(R3zero_point, vertex_position);
        vertex_visible = TRUE;
      }

      // Update upper bound distances
      if (vertex_distance < vertex_distances[VertexID(vertex)]) {
        // Remember vertex distance
        RNLength old_vertex_distance = vertex_distances[VertexID(vertex)];
        vertex_distances[VertexID(vertex)] = vertex_distance;

        // Update edge distances
        for (int j = 0; j < 2; j++) {
          R3MeshEdge *edge = EdgeOnFace(face, beam->edge, j);
          if (vertex_distance < edge_distances[EdgeID(edge)]) {
            R3MeshVertex *v = VertexAcrossEdge(edge, vertex);
            if (vertex_distance > vertex_distances[VertexID(v)]) {
              edge_distances[EdgeID(edge)] = vertex_distance;
            }
          }
        }

        // Update face distance
        if (vertex_distance < face_distances[FaceID(face)]) {
          R3MeshVertex *v0 = VertexOnFace(face, vertex, RN_CCW);
          R3MeshVertex *v1 = VertexOnFace(face, vertex, RN_CW);
          if ((vertex_distance > vertex_distances[VertexID(v0)]) && (vertex_distance > vertex_distances[VertexID(v1)])) {
            face_distances[FaceID(face)] = vertex_distance;
          }
        }

        // Spawn beam from "across" vertex if it is a visible saddle or boundary
        if (vertex_visible && (vertex == VertexAcrossFace(face, beam->edge))) { 
          if (RNIsLess(vertex_distance, old_vertex_distance)) {
            if (R3MeshVertexIsSaddleOrBoundary(this, vertex)) {
              R3MeshCreateGeodesicBeamsForVertex(this, vertex, max_distance, vertex_distance, beam, 
                vertex_distances, edge_distances, face_distances, heap, beams);
            }
          }
        }
      }
    }
  }

  // Delete all beams
  for (int i = 0; i < beams.NEntries(); i++) {
    delete beams[i];
  }

  // Delete edge and face distances
  delete [] edge_distances;
  delete [] face_distances;

  // Return vertex distances
  return vertex_distances;
}

// Assembly:
subq $0xa08, %rsp            # imm = 0xA08
movq %rdi, 0xa00(%rsp)
movq %rsi, 0x9f8(%rsp)
movsd %xmm0, 0x9f0(%rsp)
movq 0xa00(%rsp), %rdi
movq %rdi, 0x390(%rsp)
callq 0x135e0
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq 0x390(%rsp), %rdi
movq %rax, 0x9e8(%rsp)
callq 0x135c0
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq 0x390(%rsp), %rdi
movq %rax, 0x9e0(%rsp)
callq 0x135a0
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq %rax, 0x9d8(%rsp)
movl $0x0, 0x9d4(%rsp)
movq 0x390(%rsp), %rdi
movl 0x9d4(%rsp), %eax
movl %eax, 0x38c(%rsp)
callq 0x135e0
movl %eax, %ecx
movl 0x38c(%rsp), %eax
cmpl %ecx, %eax
jge 0x256f3
movq 0x9e8(%rsp), %rax
movslq 0x9d4(%rsp), %rcx
movsd 0x10d945(%rip), %xmm0   # 0x133020
movsd %xmm0, (%rax,%rcx,8)
movl 0x9d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9d4(%rsp)
jmp 0x2569b
movl $0x0, 0x9d0(%rsp)
movq 0x390(%rsp), %rdi
movl 0x9d0(%rsp), %eax
movl %eax, 0x388(%rsp)
callq 0x135c0
movl %eax, %ecx
movl 0x388(%rsp), %eax
cmpl %ecx, %eax
jge 0x25756
movq 0x9e0(%rsp), %rax
movslq 0x9d0(%rsp), %rcx
movsd 0x10d8e2(%rip), %xmm0   # 0x133020
movsd %xmm0, (%rax,%rcx,8)
movl 0x9d0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9d0(%rsp)
jmp 0x256fe
movl $0x0, 0x9cc(%rsp)
movq 0x390(%rsp), %rdi
movl 0x9cc(%rsp), %eax
movl %eax, 0x384(%rsp)
callq 0x135a0
movl %eax, %ecx
movl 0x384(%rsp), %eax
cmpl %ecx, %eax
jge 0x257b9
movq 0x9d8(%rsp), %rax
movslq 0x9cc(%rsp), %rcx
movsd 0x10d87f(%rip), %xmm0   # 0x133020
movsd %xmm0, (%rax,%rcx,8)
movl 0x9cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9cc(%rsp)
jmp 0x25761
movq 0x390(%rsp), %rdi
movq 0x9e8(%rsp), %rax
movq %rax, 0x370(%rsp)
movq 0x9f8(%rsp), %rsi
callq 0x36910
movl %eax, %ecx
movq 0x370(%rsp), %rax
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
leaq 0x838(%rsp), %rdi
movq %rdi, 0x378(%rsp)
callq 0x39010
movq 0x378(%rsp), %rsi
leaq 0x9b0(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq 0x800(%rsp), %rdi
movl $0x1, %r8d
callq 0x39070
jmp 0x25831
leaq 0x7e0(%rsp), %rdi
callq 0x39110
jmp 0x25840
movq 0x390(%rsp), %rdi
movq 0x9f8(%rsp), %rsi
movsd 0x9f0(%rsp), %xmm0
movq 0x9e8(%rsp), %rcx
movq 0x9e0(%rsp), %r8
movq 0x9d8(%rsp), %r9
movq %rsp, %rax
leaq 0x7e0(%rsp), %rdx
movq %rdx, 0x8(%rax)
leaq 0x800(%rsp), %rdx
movq %rdx, (%rax)
xorl %eax, %eax
movl %eax, %edx
xorps %xmm1, %xmm1
callq 0x27110
jmp 0x25899
movl $0x0, 0x7dc(%rsp)
movq 0x390(%rsp), %rdi
movl 0x7dc(%rsp), %eax
movl %eax, 0x368(%rsp)
movq 0x9f8(%rsp), %rsi
callq 0x36b50
movl %eax, 0x36c(%rsp)
jmp 0x258d0
movl 0x368(%rsp), %eax
movl 0x36c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x25b63
movq 0x390(%rsp), %rdi
movq 0x9f8(%rsp), %rsi
movl 0x7dc(%rsp), %edx
callq 0x36ec0
movq %rax, 0x360(%rsp)
jmp 0x2590c
movq 0x390(%rsp), %rdi
movq 0x360(%rsp), %rax
movq %rax, 0x7d0(%rsp)
movq 0x7d0(%rsp), %rsi
movq 0x9f8(%rsp), %rdx
callq 0x36f50
movq %rax, 0x358(%rsp)
jmp 0x25943
movq 0x390(%rsp), %rdi
movq 0x358(%rsp), %rax
movq %rax, 0x7c8(%rsp)
movq 0x7d0(%rsp), %rsi
callq 0x13cc0
movsd %xmm0, 0x350(%rsp)
jmp 0x25973
movq 0x390(%rsp), %rdi
movq 0x9e0(%rsp), %rax
movq %rax, 0x340(%rsp)
movq 0x7d0(%rsp), %rsi
callq 0x36980
movl %eax, 0x34c(%rsp)
jmp 0x259a1
movq 0x390(%rsp), %rdi
movq 0x340(%rsp), %rax
movsd 0x350(%rsp), %xmm0
movl 0x34c(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x7d0(%rsp), %rsi
callq 0x13cc0
movsd %xmm0, 0x338(%rsp)
jmp 0x259e1
movq 0x390(%rsp), %rdi
movq 0x9e8(%rsp), %rax
movq %rax, 0x328(%rsp)
movq 0x7c8(%rsp), %rsi
callq 0x36910
movl %eax, 0x334(%rsp)
jmp 0x25a0f
movq 0x390(%rsp), %rdi
movq 0x328(%rsp), %rax
movsd 0x338(%rsp), %xmm0
movl 0x334(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x7c8(%rsp), %rsi
callq 0x27740
movl %eax, 0x324(%rsp)
jmp 0x25a4d
movl 0x324(%rsp), %eax
cmpl $0x0, %eax
je 0x25b4b
movq 0x390(%rsp), %rdi
movq 0x7c8(%rsp), %rax
movq %rax, 0x308(%rsp)
movsd 0x9f0(%rsp), %xmm0
movsd %xmm0, 0x310(%rsp)
movq 0x7d0(%rsp), %rsi
callq 0x13cc0
movsd %xmm0, 0x318(%rsp)
jmp 0x25a9f
movsd 0x318(%rsp), %xmm1
movsd 0x310(%rsp), %xmm0
movq 0x308(%rsp), %rsi
movq 0x390(%rsp), %rdi
movq 0x9e8(%rsp), %rcx
movq 0x9e0(%rsp), %r8
movq 0x9d8(%rsp), %r9
movq %rsp, %rax
leaq 0x7e0(%rsp), %rdx
movq %rdx, 0x8(%rax)
leaq 0x800(%rsp), %rdx
movq %rdx, (%rax)
xorl %eax, %eax
movl %eax, %edx
callq 0x27110
jmp 0x25afe
jmp 0x25b4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x270f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x270e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x270d9
jmp 0x25b4d
movl 0x7dc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7dc(%rsp)
jmp 0x258a4
jmp 0x25b65
leaq 0x800(%rsp), %rdi
callq 0x39120
movl %eax, 0x304(%rsp)
jmp 0x25b7b
movl 0x304(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x25b93
jmp 0x26fca
leaq 0x800(%rsp), %rdi
callq 0x39140
movq %rax, 0x2f8(%rsp)
jmp 0x25baa
movq 0x390(%rsp), %rdi
movq 0x2f8(%rsp), %rax
movq %rax, 0x7c0(%rsp)
movq 0x7c0(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
callq 0x373c0
movq %rax, 0x2f0(%rsp)
jmp 0x25be1
movq 0x390(%rsp), %rdi
movq 0x2f0(%rsp), %rax
movq %rax, 0x7b8(%rsp)
movq 0x7c0(%rsp), %rax
movsd 0x178(%rax), %xmm0
movsd %xmm0, 0x2d0(%rsp)
movsd 0x180(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x2d8(%rsp)
movq 0x9e8(%rsp), %rcx
movq %rcx, 0x2e0(%rsp)
movq (%rax), %rsi
callq 0x36910
movl %eax, 0x2ec(%rsp)
jmp 0x25c48
movsd 0x2d0(%rsp), %xmm0
movq 0x2e0(%rsp), %rax
movsd 0x2d8(%rsp), %xmm1
movl 0x2ec(%rsp), %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x25c7c
jmp 0x25b65
movq 0x390(%rsp), %rdi
movq 0x7c0(%rsp), %rax
movsd 0x178(%rax), %xmm0
movsd %xmm0, 0x2b8(%rsp)
movq 0x9e0(%rsp), %rcx
movq %rcx, 0x2c0(%rsp)
movq 0x10(%rax), %rsi
callq 0x36980
movl %eax, 0x2cc(%rsp)
jmp 0x25cbf
movsd 0x2b8(%rsp), %xmm0
movq 0x2c0(%rsp), %rax
movl 0x2cc(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x25ce6
jmp 0x25b65
movq 0x390(%rsp), %rdi
movq 0x7c0(%rsp), %rax
movsd 0x178(%rax), %xmm0
movsd %xmm0, 0x2a0(%rsp)
movq 0x9d8(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq 0x7b8(%rsp), %rsi
callq 0x369a0
movl %eax, 0x2b4(%rsp)
jmp 0x25d2d
movsd 0x2a0(%rsp), %xmm0
movq 0x2a8(%rsp), %rax
movl 0x2b4(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x25d54
jmp 0x25b65
movq 0x7c0(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
callq 0x39250
movq %rax, 0x298(%rsp)
jmp 0x25d72
movq 0x298(%rsp), %rsi
leaq 0x7a0(%rsp), %rdi
callq 0x6eb90
jmp 0x25d89
leaq 0x788(%rsp), %rdi
leaq 0x7a0(%rsp), %rsi
callq 0x36d10
jmp 0x25da0
leaq 0x553859(%rip), %rdx    # 0x579600
leaq 0x770(%rsp), %rdi
leaq 0x788(%rsp), %rsi
callq 0x70af0
jmp 0x25dbe
leaq 0x770(%rsp), %rdi
callq 0x70410
jmp 0x25dcd
leaq 0x750(%rsp), %rdi
leaq 0x7a0(%rsp), %rsi
leaq 0x770(%rsp), %rdx
callq 0x6c260
jmp 0x25dec
movq 0x7c0(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
callq 0x39260
movq %rax, 0x290(%rsp)
jmp 0x25e0a
movq 0x290(%rsp), %rsi
leaq 0x738(%rsp), %rdi
callq 0x6eb90
jmp 0x25e21
leaq 0x720(%rsp), %rdi
leaq 0x738(%rsp), %rsi
callq 0x36d10
jmp 0x25e38
leaq 0x5537c1(%rip), %rsi    # 0x579600
leaq 0x708(%rsp), %rdi
leaq 0x720(%rsp), %rdx
callq 0x70af0
jmp 0x25e56
leaq 0x708(%rsp), %rdi
callq 0x70410
jmp 0x25e65
leaq 0x6e8(%rsp), %rdi
leaq 0x738(%rsp), %rsi
leaq 0x708(%rsp), %rdx
callq 0x6c260
jmp 0x25e84
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
callq 0x13840
movq %rax, 0x288(%rsp)
jmp 0x25ea3
movq 0x288(%rsp), %rsi
leaq 0x6d0(%rsp), %rdi
callq 0x6fcf0
jmp 0x25eba
movq 0x7c0(%rsp), %rsi
addq $0x18, %rsi
leaq 0x6d0(%rsp), %rdi
callq 0x70e10
jmp 0x25ed5
leaq 0x152a74(%rip), %rsi    # 0x178950
leaq 0x5c0(%rsp), %rdi
callq 0x36c20
jmp 0x25eeb
movq 0x7c0(%rsp), %rsi
addq $0x128, %rsi            # imm = 0x128
leaq 0x590(%rsp), %rdi
callq 0x6d780
jmp 0x25f09
leaq 0x5a8(%rsp), %rdi
leaq 0x590(%rsp), %rsi
callq 0x36d10
jmp 0x25f20
leaq 0x5c0(%rsp), %rdi
leaq 0x5a8(%rsp), %rsi
callq 0x36cd0
jmp 0x25f37
leaq 0x5536c2(%rip), %rdx    # 0x579600
leaq 0x5c0(%rsp), %rdi
leaq 0x6d0(%rsp), %rsi
callq 0x39270
jmp 0x25f55
movq 0x7c0(%rsp), %rsi
addq $0x128, %rsi            # imm = 0x128
leaq 0x548(%rsp), %rdi
callq 0x6d780
jmp 0x25f73
leaq 0x560(%rsp), %rdi
leaq 0x548(%rsp), %rsi
callq 0x36d10
jmp 0x25f8a
leaq 0x578(%rsp), %rdi
leaq 0x560(%rsp), %rsi
callq 0x70fa0
jmp 0x25fa1
leaq 0x5c0(%rsp), %rdi
leaq 0x578(%rsp), %rsi
callq 0x36cd0
jmp 0x25fb8
movq 0x7c0(%rsp), %rsi
addq $0x18, %rsi
leaq 0x5c0(%rsp), %rdi
callq 0x4d700
jmp 0x25fd3
movl $0x0, 0x544(%rsp)
cmpl $0x2, 0x544(%rsp)
jge 0x266f3
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
movq 0x7c0(%rsp), %rax
movq 0x10(%rax), %rdx
movl 0x544(%rsp), %ecx
callq 0x386a0
movq %rax, 0x280(%rsp)
jmp 0x2601e
movq 0x390(%rsp), %rdi
movq 0x280(%rsp), %rax
movq %rax, 0x538(%rsp)
movq 0x538(%rsp), %rsi
movq 0x7b8(%rsp), %rdx
callq 0x373c0
movq %rax, 0x278(%rsp)
jmp 0x26055
movq 0x278(%rsp), %rax
movq %rax, 0x530(%rsp)
cmpq $0x0, 0x530(%rsp)
jne 0x2608e
jmp 0x266b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x26fb8
movq 0x390(%rsp), %rdi
movq 0x7c0(%rsp), %rax
movsd 0x178(%rax), %xmm0
movsd %xmm0, 0x260(%rsp)
movq 0x9e0(%rsp), %rax
movq %rax, 0x268(%rsp)
movq 0x538(%rsp), %rsi
callq 0x36980
movl %eax, 0x274(%rsp)
jmp 0x260d5
movsd 0x260(%rsp), %xmm0
movq 0x268(%rsp), %rax
movl 0x274(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x260fc
jmp 0x266b2
movq 0x390(%rsp), %rdi
movq 0x7c0(%rsp), %rax
movsd 0x178(%rax), %xmm0
movsd %xmm0, 0x248(%rsp)
movq 0x9d8(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x530(%rsp), %rsi
callq 0x369a0
movl %eax, 0x25c(%rsp)
jmp 0x26143
movsd 0x248(%rsp), %xmm0
movq 0x250(%rsp), %rax
movl 0x25c(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x2616a
jmp 0x266b2
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
movq 0x538(%rsp), %rdx
xorl %ecx, %ecx
callq 0x37380
movq %rax, 0x240(%rsp)
jmp 0x26193
movq 0x390(%rsp), %rdi
movq 0x240(%rsp), %rax
movq %rax, 0x528(%rsp)
movq 0x7b8(%rsp), %rsi
movq 0x538(%rsp), %rdx
movl $0x1, %ecx
callq 0x37380
movq %rax, 0x238(%rsp)
jmp 0x261cf
movq 0x390(%rsp), %rdi
movq 0x238(%rsp), %rax
movq %rax, 0x520(%rsp)
movq 0x528(%rsp), %rsi
callq 0x13660
movq %rax, 0x230(%rsp)
jmp 0x261fe
movq 0x230(%rsp), %rsi
leaq 0x508(%rsp), %rdi
callq 0x6eb90
jmp 0x26215
movq 0x390(%rsp), %rdi
movq 0x520(%rsp), %rsi
callq 0x13660
movq %rax, 0x228(%rsp)
jmp 0x26234
movq 0x228(%rsp), %rsi
leaq 0x4f0(%rsp), %rdi
callq 0x6eb90
jmp 0x2624b
leaq 0x508(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x6f7c0
jmp 0x26262
leaq 0x4f0(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x6f7c0
jmp 0x26279
leaq 0x4a0(%rsp), %rdi
leaq 0x508(%rsp), %rsi
leaq 0x4f0(%rsp), %rdx
callq 0x6d550
jmp 0x26298
leaq 0x4a0(%rsp), %rdi
callq 0x392b0
movq %rax, 0x220(%rsp)
jmp 0x262af
movq 0x220(%rsp), %rsi
leaq 0x488(%rsp), %rdi
callq 0x6fcf0
jmp 0x262c6
leaq 0x488(%rsp), %rdi
callq 0x6fe90
movsd %xmm0, 0x218(%rsp)
jmp 0x262de
movsd 0x218(%rsp), %xmm0
leaq 0x1521f2(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm1
callq 0x36b80
movl %eax, 0x214(%rsp)
jmp 0x26300
movl 0x214(%rsp), %eax
cmpl $0x0, %eax
je 0x26311
jmp 0x266b2
leaq 0x5532e8(%rip), %rsi    # 0x579600
leaq 0x470(%rsp), %rdi
leaq 0x488(%rsp), %rdx
callq 0x70af0
jmp 0x2632f
leaq 0x470(%rsp), %rdi
callq 0x70410
jmp 0x2633e
leaq 0x438(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
callq 0x6d780
jmp 0x26355
leaq 0x450(%rsp), %rdi
leaq 0x438(%rsp), %rsi
leaq 0x470(%rsp), %rdx
callq 0x6c260
jmp 0x26374
leaq 0x553135(%rip), %rsi    # 0x5794b0
leaq 0x450(%rsp), %rdi
callq 0x86f90
movsd %xmm0, 0x208(%rsp)
jmp 0x26393
movsd 0x208(%rsp), %xmm0
leaq 0x15213d(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm1
callq 0x36d50
movl %eax, 0x204(%rsp)
jmp 0x263b5
movl 0x204(%rsp), %eax
cmpl $0x0, %eax
je 0x263c6
jmp 0x266b2
leaq 0x4a0(%rsp), %rdi
leaq 0x750(%rsp), %rsi
callq 0x6dd30
movl %eax, 0x200(%rsp)
jmp 0x263e4
movl 0x200(%rsp), %eax
cmpl $0x0, %eax
jne 0x263f5
jmp 0x266b2
leaq 0x4a0(%rsp), %rdi
leaq 0x6e8(%rsp), %rsi
callq 0x6dd30
movl %eax, 0x1fc(%rsp)
jmp 0x26413
movl 0x1fc(%rsp), %eax
cmpl $0x0, %eax
jne 0x26424
jmp 0x266b2
movq 0x7c0(%rsp), %rax
movsd 0x180(%rax), %xmm0
movsd %xmm0, 0x1e8(%rsp)
leaq 0x55306c(%rip), %rdi    # 0x5794b0
leaq 0x4a0(%rsp), %rsi
callq 0x86d80
movsd %xmm0, 0x1f0(%rsp)
jmp 0x2645c
movsd 0x1f0(%rsp), %xmm1
movsd 0x1e8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x430(%rsp)
movsd 0x9f0(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x264a6
movsd 0x430(%rsp), %xmm0
ucomisd 0x9f0(%rsp), %xmm0
jbe 0x264a6
jmp 0x266b2
movq 0x390(%rsp), %rdi
movsd 0x430(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rsp)
movq 0x9e0(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movq 0x538(%rsp), %rsi
callq 0x36980
movl %eax, 0x1e4(%rsp)
jmp 0x264e6
movsd 0x1d0(%rsp), %xmm0
movq 0x1d8(%rsp), %rax
movl 0x1e4(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x2650d
jmp 0x266b2
movq 0x390(%rsp), %rdi
movsd 0x430(%rsp), %xmm0
movsd %xmm0, 0x1b8(%rsp)
movq 0x9d8(%rsp), %rax
movq %rax, 0x1c0(%rsp)
movq 0x530(%rsp), %rsi
callq 0x369a0
movl %eax, 0x1cc(%rsp)
jmp 0x2654d
movsd 0x1b8(%rsp), %xmm0
movq 0x1c0(%rsp), %rax
movl 0x1cc(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x26574
jmp 0x266b2
movl $0x190, %edi            # imm = 0x190
callq 0xf4c0
movq %rax, 0x1b0(%rsp)
jmp 0x26588
movq 0x1b0(%rsp), %rdi
xorl %esi, %esi
movl $0x190, %edx            # imm = 0x190
callq 0xf280
movq 0x1b0(%rsp), %rdi
callq 0x39010
jmp 0x265ab
movq 0x1b0(%rsp), %rax
movq %rax, 0x428(%rsp)
movq 0x7c0(%rsp), %rax
movq (%rax), %rcx
movq 0x428(%rsp), %rax
movq %rcx, (%rax)
movq 0x7b8(%rsp), %rcx
movq 0x428(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x538(%rsp), %rcx
movq 0x428(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x428(%rsp), %rdi
addq $0x18, %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x392c0
jmp 0x26614
movq 0x428(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq 0x4a0(%rsp), %rsi
callq 0x39330
jmp 0x26632
movsd 0x430(%rsp), %xmm0
movq 0x428(%rsp), %rax
movsd %xmm0, 0x178(%rax)
movq 0x7c0(%rsp), %rax
movsd 0x180(%rax), %xmm0
movq 0x428(%rsp), %rax
movsd %xmm0, 0x180(%rax)
movq 0x7c0(%rsp), %rcx
movq 0x428(%rsp), %rax
movq %rcx, 0x188(%rax)
movq 0x428(%rsp), %rsi
leaq 0x800(%rsp), %rdi
callq 0x39380
jmp 0x26699
movq 0x428(%rsp), %rsi
leaq 0x7e0(%rsp), %rdi
callq 0x395a0
jmp 0x266b0
jmp 0x266b2
movl 0x544(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x544(%rsp)
jmp 0x25fde
movq 0x1b0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
movl $0x190, %esi            # imm = 0x190
callq 0xf4d0
jmp 0x26fb8
movl $0x0, 0x424(%rsp)
cmpl $0x3, 0x424(%rsp)
jge 0x26fa6
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
movl 0x424(%rsp), %edx
callq 0x13700
movq %rax, 0x1a8(%rsp)
jmp 0x26732
movq 0x390(%rsp), %rdi
movq 0x1a8(%rsp), %rax
movq %rax, 0x418(%rsp)
movq 0x418(%rsp), %rsi
callq 0x13660
movq %rax, 0x1a0(%rsp)
jmp 0x26761
movq 0x1a0(%rsp), %rsi
leaq 0x400(%rsp), %rdi
callq 0x6eb90
jmp 0x26778
leaq 0x400(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x6f7c0
jmp 0x2678f
movq $0x0, 0x3f8(%rsp)
movl $0x0, 0x3f4(%rsp)
leaq 0x750(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x86f90
movsd %xmm0, 0x198(%rsp)
jmp 0x267c6
movsd 0x198(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2686f
leaq 0x552ccd(%rip), %rdi    # 0x5794b0
leaq 0x7a0(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x190(%rsp)
jmp 0x267fb
movsd 0x190(%rsp), %xmm0
movsd %xmm0, 0x3e8(%rsp)
leaq 0x7a0(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x188(%rsp)
jmp 0x2682d
movsd 0x188(%rsp), %xmm0
movsd %xmm0, 0x3e0(%rsp)
movq 0x7c0(%rsp), %rax
movsd 0x180(%rax), %xmm0
addsd 0x3e8(%rsp), %xmm0
addsd 0x3e0(%rsp), %xmm0
movsd %xmm0, 0x3f8(%rsp)
jmp 0x26999
leaq 0x6e8(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x86f90
movsd %xmm0, 0x180(%rsp)
jmp 0x2688f
movsd 0x180(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x26935
leaq 0x552c04(%rip), %rdi    # 0x5794b0
leaq 0x738(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x178(%rsp)
jmp 0x268c4
movsd 0x178(%rsp), %xmm0
movsd %xmm0, 0x3d8(%rsp)
leaq 0x738(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x170(%rsp)
jmp 0x268f6
movsd 0x170(%rsp), %xmm0
movsd %xmm0, 0x3d0(%rsp)
movq 0x7c0(%rsp), %rax
movsd 0x180(%rax), %xmm0
addsd 0x3d8(%rsp), %xmm0
addsd 0x3d0(%rsp), %xmm0
movsd %xmm0, 0x3f8(%rsp)
jmp 0x26997
movq 0x7c0(%rsp), %rax
movsd 0x180(%rax), %xmm0
movsd %xmm0, 0x160(%rsp)
leaq 0x552b5b(%rip), %rdi    # 0x5794b0
leaq 0x400(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x168(%rsp)
jmp 0x2696d
movsd 0x168(%rsp), %xmm1
movsd 0x160(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x3f8(%rsp)
movl $0x1, 0x3f4(%rsp)
jmp 0x26999
movq 0x390(%rsp), %rdi
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x148(%rsp)
movq 0x9e8(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x418(%rsp), %rsi
callq 0x36910
movl %eax, 0x15c(%rsp)
jmp 0x269d9
movsd 0x148(%rsp), %xmm1
movq 0x150(%rsp), %rax
movl 0x15c(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x26f8e
movq 0x390(%rsp), %rdi
movq 0x9e8(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x418(%rsp), %rsi
callq 0x36910
movl %eax, 0x144(%rsp)
jmp 0x26a31
movq 0x390(%rsp), %rdi
movq 0x138(%rsp), %rax
movl 0x144(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x3c8(%rsp)
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
movq 0x9e8(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x418(%rsp), %rsi
callq 0x36910
movl %eax, 0x134(%rsp)
jmp 0x26a91
movq 0x128(%rsp), %rax
movsd 0x120(%rsp), %xmm0
movl 0x134(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, 0x3c4(%rsp)
cmpl $0x2, 0x3c4(%rsp)
jge 0x26c89
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
movq 0x7c0(%rsp), %rax
movq 0x10(%rax), %rdx
movl 0x3c4(%rsp), %ecx
callq 0x386a0
movq %rax, 0x118(%rsp)
jmp 0x26afc
movq 0x390(%rsp), %rdi
movq 0x118(%rsp), %rax
movq %rax, 0x3b8(%rsp)
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
movq 0x9e0(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x3b8(%rsp), %rsi
callq 0x36980
movl %eax, 0x114(%rsp)
jmp 0x26b4c
movsd 0x100(%rsp), %xmm1
movq 0x108(%rsp), %rax
movl 0x114(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x26c71
movq 0x390(%rsp), %rdi
movq 0x3b8(%rsp), %rsi
movq 0x418(%rsp), %rdx
callq 0x36f50
movq %rax, 0xf8(%rsp)
jmp 0x26b9d
movq 0x390(%rsp), %rdi
movq 0xf8(%rsp), %rax
movq %rax, 0x3b0(%rsp)
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0x9e8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x3b0(%rsp), %rsi
callq 0x36910
movl %eax, 0xf4(%rsp)
jmp 0x26bed
movsd 0xe0(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movl 0xf4(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x26c6f
movq 0x390(%rsp), %rdi
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movq 0x9e0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x3b8(%rsp), %rsi
callq 0x36980
movl %eax, 0xdc(%rsp)
jmp 0x26c4f
movq 0xd0(%rsp), %rax
movsd 0xc8(%rsp), %xmm0
movl 0xdc(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x26c71
jmp 0x26c73
movl 0x3c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c4(%rsp)
jmp 0x26abc
movq 0x390(%rsp), %rdi
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x9d8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x7b8(%rsp), %rsi
callq 0x369a0
movl %eax, 0xc4(%rsp)
jmp 0x26cc9
movsd 0xb0(%rsp), %xmm1
movq 0xb8(%rsp), %rax
movl 0xc4(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x26e74
movq 0x390(%rsp), %rdi
movq 0x7b8(%rsp), %rsi
movq 0x418(%rsp), %rdx
xorl %ecx, %ecx
callq 0x395d0
movq %rax, 0xa8(%rsp)
jmp 0x26d1c
movq 0x390(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq %rax, 0x3a8(%rsp)
movq 0x7b8(%rsp), %rsi
movq 0x418(%rsp), %rdx
movl $0x1, %ecx
callq 0x395d0
movq %rax, 0xa0(%rsp)
jmp 0x26d58
movq 0x390(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq %rax, 0x3a0(%rsp)
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x9e8(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x3a8(%rsp), %rsi
callq 0x36910
movl %eax, 0x9c(%rsp)
jmp 0x26da8
movsd 0x88(%rsp), %xmm0
movq 0x90(%rsp), %rax
movl 0x9c(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x26e72
movq 0x390(%rsp), %rdi
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x9e8(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x3a0(%rsp), %rsi
callq 0x36910
movl %eax, 0x84(%rsp)
jmp 0x26e08
movsd 0x70(%rsp), %xmm0
movq 0x78(%rsp), %rax
movl 0x84(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x26e72
movq 0x390(%rsp), %rdi
movsd 0x3f8(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x9d8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x7b8(%rsp), %rsi
callq 0x369a0
movl %eax, 0x6c(%rsp)
jmp 0x26e5b
movq 0x60(%rsp), %rax
movsd 0x58(%rsp), %xmm0
movl 0x6c(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x26e74
cmpl $0x0, 0x3f4(%rsp)
je 0x26f8c
movq 0x390(%rsp), %rdi
movq 0x418(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x7b8(%rsp), %rsi
movq 0x7c0(%rsp), %rax
movq 0x10(%rax), %rdx
callq 0x37070
movq %rax, 0x50(%rsp)
jmp 0x26eb7
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq %rcx, %rax
jne 0x26f8c
movsd 0x3f8(%rsp), %xmm0
movsd 0x3c8(%rsp), %xmm1
leaq 0x1515fd(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm2
callq 0x39630
movl %eax, 0x44(%rsp)
jmp 0x26ef2
movl 0x44(%rsp), %eax
cmpl $0x0, %eax
je 0x26f8a
movq 0x390(%rsp), %rdi
movq 0x418(%rsp), %rsi
callq 0x27740
movl %eax, 0x40(%rsp)
jmp 0x26f1a
movl 0x40(%rsp), %eax
cmpl $0x0, %eax
je 0x26f88
movq 0x390(%rsp), %rdi
movq 0x418(%rsp), %rsi
movsd 0x9f0(%rsp), %xmm0
movsd 0x3f8(%rsp), %xmm1
movq 0x7c0(%rsp), %rdx
movq 0x9e8(%rsp), %rcx
movq 0x9e0(%rsp), %r8
movq 0x9d8(%rsp), %r9
movq %rsp, %rax
leaq 0x7e0(%rsp), %r10
movq %r10, 0x8(%rax)
leaq 0x800(%rsp), %r10
movq %r10, (%rax)
callq 0x27110
jmp 0x26f86
jmp 0x26f88
jmp 0x26f8a
jmp 0x26f8c
jmp 0x26f8e
jmp 0x26f90
movl 0x424(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x424(%rsp)
jmp 0x266fe
leaq 0x5c0(%rsp), %rdi
callq 0x4d430
jmp 0x25b65
leaq 0x5c0(%rsp), %rdi
callq 0x4d430
jmp 0x270d9
movl $0x0, 0x39c(%rsp)
movl 0x39c(%rsp), %eax
movl %eax, 0x38(%rsp)
leaq 0x7e0(%rsp), %rdi
callq 0x13600
movl %eax, 0x3c(%rsp)
jmp 0x26ff3
movl 0x38(%rsp), %eax
movl 0x3c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2705e
movl 0x39c(%rsp), %esi
leaq 0x7e0(%rsp), %rdi
callq 0x39660
movq %rax, 0x30(%rsp)
jmp 0x2701a
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x27046
movq 0x28(%rsp), %rdi
callq 0x39680
movq 0x28(%rsp), %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xf4d0
jmp 0x27048
movl 0x39c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x39c(%rsp)
jmp 0x26fd5
movq 0x9e0(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x2707b
movq 0x20(%rsp), %rdi
callq 0xf670
movq 0x9d8(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x27098
movq 0x18(%rsp), %rdi
callq 0xf670
movq 0x9e8(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x7e0(%rsp), %rdi
callq 0x396a0
leaq 0x800(%rsp), %rdi
callq 0x396b0
leaq 0x838(%rsp), %rdi
callq 0x39680
movq 0x10(%rsp), %rax
addq $0xa08, %rsp            # imm = 0xA08
retq
leaq 0x7e0(%rsp), %rdi
callq 0x396a0
leaq 0x800(%rsp), %rdi
callq 0x396b0
leaq 0x838(%rsp), %rdi
callq 0x39680
movq 0x7f8(%rsp), %rdi
callq 0xf890
nopl (%rax)