// File: tomfunkhouser[P]gaps/apps/prpview/prpview.cpp
// Function: GLUTRedraw()
void GLUTRedraw(void)
{
  // Set viewing transformation
  viewer->Camera().Load();

  // Clear window 
  glClearColor(1, 1, 1, 1);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  // Set backface culling
  if (show_backfacing) glDisable(GL_CULL_FACE);
  else glEnable(GL_CULL_FACE);

  // Set overhead light
  static GLfloat light2_position[] = { 3.0, 4.0, 5.0, 0.0 };
  glLightfv(GL_LIGHT2, GL_POSITION, light2_position);
  // glEnable(GL_LIGHT2);

  // Draw faces
  if (show_faces) {
    if (show_values) {
      glEnable(GL_LIGHTING);
      glEnable(GL_POLYGON_OFFSET_FILL);
      glPolygonOffset(2, 1);
      RNGrfxBegin(RN_GRFX_TRIANGLES);
      for (int i = 0; i < mesh->NFaces(); i++) {
        R3MeshFace *face = mesh->Face(i);
        for (int j = 0; j < 3; j++) {
          R3MeshVertex *vertex = mesh->VertexOnFace(face, j);
          RNLoadRgb(NormalizedColor(vertex));
          R3LoadNormal(mesh->VertexNormal(vertex));
          R3LoadPoint(mesh->VertexPosition(vertex));
        }
      }
      RNGrfxEnd();
      glDisable(GL_POLYGON_OFFSET_FILL);
    }
    else {
      glEnable(GL_LIGHTING);
      RNLoadRgb(0.8, 0.8, 0.8);
      RNGrfxBegin(RN_GRFX_TRIANGLES);
      for (int i = 0; i < mesh->NFaces(); i++) {
        R3MeshFace *face = mesh->Face(i);
        R3LoadNormal(mesh->FaceNormal(face));
        for (int j = 0; j < 3; j++) {
          R3MeshVertex *vertex = mesh->VertexOnFace(face, j);
          R3LoadNormal(mesh->VertexNormal(vertex));
          R3LoadPoint(mesh->VertexPosition(vertex));
        }
      }
      RNGrfxEnd();
    }
  }

  // Draw vertices
  if (show_vertices) {
    if (show_values) {
      glDisable(GL_LIGHTING);
      RNGrfxBegin(RN_GRFX_POINTS);
      for (int i = 0; i < mesh->NVertices(); i++) {
        R3MeshVertex *vertex = mesh->Vertex(i);
        RNLoadRgb(NormalizedColor(vertex));
        R3LoadNormal(mesh->VertexNormal(vertex));
        R3LoadPoint(mesh->VertexPosition(vertex));
      }
      RNGrfxEnd();
    }
    else {
      glEnable(GL_LIGHTING);
      RNLoadRgb(0.8, 0.8, 0.8);
      RNGrfxBegin(RN_GRFX_POINTS);
      for (int i = 0; i < mesh->NVertices(); i++) {
        R3MeshVertex *vertex = mesh->Vertex(i);
        R3LoadNormal(mesh->VertexNormal(vertex));
        R3LoadNormal(mesh->VertexNormal(vertex));
        R3LoadPoint(mesh->VertexPosition(vertex));
      }
      RNGrfxEnd();
    }
  }

  // Draw points
  if (points && show_points) {
    // Draw points
    glEnable(GL_LIGHTING);
    if (color_with_redness) RNLoadRgb(0, 0, 1);
    else RNLoadRgb(1, 1, 0);
    RNLength radius = 0.008 * mesh->BBox().LongestAxisLength();
    for (int i = 0; i < points->NEntries(); i++) {
      Point *point = points->Kth(i);
      R3Sphere(point->position, radius).Draw();
    }
  }

  // Draw isocontours
  if (show_isocontours) {
    glDisable(GL_LIGHTING);
    RNLoadRgb(1, 1, 1);
    glLineWidth(1);
    RNGrfxBegin(RN_GRFX_LINES);
    for (int isostep = 1; isostep < nisosteps; isostep++) {
      double isolevel = (double) isostep / (double) nisosteps;
      for (int i = 0; i < mesh->NFaces(); i++) {
        R3MeshFace *face = mesh->Face(i);
        for (int j = 0; j < 3; j++) {
          R3MeshVertex *vertex = mesh->VertexOnFace(face, j);
          RNScalar value = NormalizedValue(vertex);
          R3MeshVertex *vertex1 = mesh->VertexOnFace(face, (j+1)%3);
          RNScalar value1 = NormalizedValue(vertex1);
          R3MeshVertex *vertex2 = mesh->VertexOnFace(face, (j+2)%3);
          RNScalar value2 = NormalizedValue(vertex2);
          RNScalar t1, t2;
          if (value < isolevel) {
            if ((value1 <= isolevel) || (value2 <= isolevel)) continue;
            t1 = (isolevel - value) / (value1 - value);
            t2 = (isolevel - value) / (value2 - value);
          }
          else if (value > isolevel) {
            if ((value1 >= isolevel) || (value2 >= isolevel)) continue;
            t1 = (value - isolevel) / (value - value1);
            t2 = (value - isolevel) / (value - value2);
          }
          else continue;
          R3Point position = mesh->VertexPosition(vertex);
          R3Point position1 = mesh->VertexPosition(vertex1);
          R3Point position2 = mesh->VertexPosition(vertex2);
          R3Vector vector1 = t1 * (position1 - position);
          R3Vector vector2 = t2 * (position2 - position);
          R3Point point1 = position + vector1;
          R3Point point2 = position + vector2;
          R3LoadPoint(point1);
          R3LoadPoint(point2);
        }
      }
    }
    RNGrfxEnd();
    glLineWidth(1);
  }

  // Draw extrema
  if (show_global_maxima || show_global_minima || show_local_maxima || show_local_minima) {
    glEnable(GL_LIGHTING);
    for (int i = 0; i < mesh->NVertices(); i++) {
      R3MeshVertex *vertex = mesh->Vertex(i);
      R3Point position = mesh->VertexPosition(vertex);
      RNScalar value = Value(vertex);
      if (show_global_minima && (value == current_property->Minimum())) {
        RNLoadRgb(1, 1, 1);
        RNScalar radius = 0.01 * mesh->BBox().DiagonalLength();
        R3Sphere(position, radius).Draw();
      }
      if (show_global_maxima && (value == current_property->Maximum())) {
        RNLoadRgb(1, 1, 1);
        RNScalar radius = 0.01 * mesh->BBox().DiagonalLength();
        R3Sphere(position, radius).Draw();
      }
      if (show_local_minima && (current_property->IsLocalMinimum(vertex))) {
        RNLoadRgb(0.5, 1, 1);
        RNScalar radius = 0.005 * mesh->BBox().DiagonalLength();
        R3Sphere(position, radius).Draw();
      }
      if (show_local_maxima && (current_property->IsLocalMaximum(vertex))) {
        RNLoadRgb(0, 0.5, 0);
        RNScalar radius = 0.005 * mesh->BBox().DiagonalLength();
        R3Sphere(position, radius).Draw();
      }
    }
  }

  // Draw text
  if (show_text) {
    char buffer[1024];
    glDisable(GL_LIGHTING);
    RNLength d = 0.004 * mesh->BBox().DiagonalRadius();
    for (int i = 0; i < mesh->NVertices(); i++) {
      R3MeshVertex *vertex = mesh->Vertex(i);
      R3Point position = mesh->VertexPosition(vertex);
      const R3Vector normal = mesh->VertexNormal(vertex);
      sprintf(buffer, "%g", Value(vertex));
      R3DrawText(position + d * normal, buffer);
    }
  }

  // Draw statistics
  if (show_statistics) {
    glDisable(GL_LIGHTING);
    RNLoadRgb(0, 0, 0);
    double y = GLUTwindow_height - 20;
    viewer->DrawText(10, y, current_property->Name()); y-= 20;
    DrawText(10, y, "Index", properties->PropertyIndex(current_property)); y-= 20;
    DrawText(10, y, "Mean", current_property->Mean()); y-= 20;
    DrawText(10, y, "Min", current_property->Minimum()); y-= 20;
    DrawText(10, y, "Max", current_property->Maximum()); y-= 20;
    DrawText(10, y, "Stddev", current_property->StandardDeviation()); y-= 20;
    DrawText(10, y, "Entropy", current_property->Entropy()); y-= 20;
    DrawText(10, y, "Min Display Value", value_range.Min()); y-= 20;
    DrawText(10, y, "Max Display Value", value_range.Max()); y-= 20;
    DrawText(10, y, "Min Display Percentile", percentile_range.Min()); y-= 20;
    DrawText(10, y, "Max Display Percentile", percentile_range.Max()); y-= 20;
  }

  // Capture image and exit
  if (image_name) {
    R2Image image(GLUTwindow_width, GLUTwindow_height, 3);
    image.Capture();
    image.Write(image_name);
    GLUTStop();
  }

  // Swap buffers 
  glutSwapBuffers();
}

// Assembly:
subq $0x888, %rsp            # imm = 0x888
movq 0x1ddd82(%rip), %rdi    # 0x204c70
callq 0x2a9a0
movq %rax, %rdi
xorl %esi, %esi
callq 0x2ffa0
movss 0x16f1ab(%rip), %xmm3   # 0x1960b0
movaps %xmm3, %xmm0
movaps %xmm3, %xmm1
movaps %xmm3, %xmm2
callq 0x22fb0
movl $0x4100, %edi           # imm = 0x4100
callq 0x22210
cmpl $0x0, 0x1ddd58(%rip)    # 0x204c7c
je 0x26f32
movl $0xb44, %edi            # imm = 0xB44
callq 0x22220
jmp 0x26f3c
movl $0xb44, %edi            # imm = 0xB44
callq 0x22900
movl $0x4002, %edi           # imm = 0x4002
movl $0x1203, %esi           # imm = 0x1203
leaq 0x1d7b53(%rip), %rdx    # 0x1feaa0
callq 0x23250
cmpl $0x0, 0x1d7b57(%rip)    # 0x1feab0
je 0x271fe
cmpl $0x0, 0x1d7b4e(%rip)    # 0x1feab4
je 0x270c8
movl $0xb50, %edi            # imm = 0xB50
callq 0x22900
movl $0x8037, %edi           # imm = 0x8037
callq 0x22900
movss 0x16f12c(%rip), %xmm0   # 0x1960b4
movss 0x16f120(%rip), %xmm1   # 0x1960b0
callq 0x23120
movl $0x4, %edi
callq 0x2a9b0
movl $0x0, 0x884(%rsp)
movl 0x884(%rsp), %eax
movl %eax, 0xb4(%rsp)
movq 0x1ddcc1(%rip), %rdi    # 0x204c80
callq 0x2a9d0
movl %eax, %ecx
movl 0xb4(%rsp), %eax
cmpl %ecx, %eax
jge 0x270b4
movq 0x1ddca4(%rip), %rdi    # 0x204c80
movl 0x884(%rsp), %esi
callq 0x2a9f0
movq %rax, 0x878(%rsp)
movl $0x0, 0x874(%rsp)
cmpl $0x3, 0x874(%rsp)
jge 0x2709c
movq 0x1ddc70(%rip), %rdi    # 0x204c80
movq 0x878(%rsp), %rsi
movl 0x874(%rsp), %edx
callq 0x2aa20
movq %rax, 0x868(%rsp)
movq 0x868(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x284a0
leaq 0x850(%rsp), %rdi
callq 0x2aa40
movq 0x1ddc2b(%rip), %rdi    # 0x204c80
movq 0x868(%rsp), %rsi
callq 0x2aab0
movq %rax, %rdi
callq 0x2aa90
movq 0x1ddc0f(%rip), %rdi    # 0x204c80
movq 0x868(%rsp), %rsi
callq 0x2ab40
movq %rax, %rdi
callq 0x2ab20
movl 0x874(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x874(%rsp)
jmp 0x26ffb
jmp 0x2709e
movl 0x884(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x884(%rsp)
jmp 0x26faa
callq 0x2ab60
movl $0x8037, %edi           # imm = 0x8037
callq 0x22220
jmp 0x271fc
movl $0xb50, %edi            # imm = 0xB50
callq 0x22900
movsd 0x16ef4e(%rip), %xmm2   # 0x196028
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x2ab70
movl $0x4, %edi
callq 0x2a9b0
movl $0x0, 0x84c(%rsp)
movl 0x84c(%rsp), %eax
movl %eax, 0xb0(%rsp)
movq 0x1ddb71(%rip), %rdi    # 0x204c80
callq 0x2a9d0
movl %eax, %ecx
movl 0xb0(%rsp), %eax
cmpl %ecx, %eax
jge 0x271f7
movq 0x1ddb54(%rip), %rdi    # 0x204c80
movl 0x84c(%rsp), %esi
callq 0x2a9f0
movq %rax, 0x840(%rsp)
movq 0x1ddb39(%rip), %rdi    # 0x204c80
movq 0x840(%rsp), %rsi
callq 0x2aba0
movq %rax, %rdi
callq 0x2aa90
movl $0x0, 0x83c(%rsp)
cmpl $0x3, 0x83c(%rsp)
jge 0x271df
movq 0x1ddb08(%rip), %rdi    # 0x204c80
movq 0x840(%rsp), %rsi
movl 0x83c(%rsp), %edx
callq 0x2aa20
movq %rax, 0x830(%rsp)
movq 0x1ddae5(%rip), %rdi    # 0x204c80
movq 0x830(%rsp), %rsi
callq 0x2aab0
movq %rax, %rdi
callq 0x2aa90
movq 0x1ddac9(%rip), %rdi    # 0x204c80
movq 0x830(%rsp), %rsi
callq 0x2ab40
movq %rax, %rdi
callq 0x2ab20
movl 0x83c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x83c(%rsp)
jmp 0x27167
jmp 0x271e1
movl 0x84c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84c(%rsp)
jmp 0x270fa
callq 0x2ab60
jmp 0x271fe
cmpl $0x0, 0x1dda83(%rip)    # 0x204c88
je 0x273da
cmpl $0x0, 0x1d78a2(%rip)    # 0x1feab4
je 0x272f4
movl $0xb50, %edi            # imm = 0xB50
callq 0x22220
xorl %edi, %edi
callq 0x2a9b0
movl $0x0, 0x82c(%rsp)
movl 0x82c(%rsp), %eax
movl %eax, 0xac(%rsp)
movq 0x1dda37(%rip), %rdi    # 0x204c80
callq 0x2abd0
movl %eax, %ecx
movl 0xac(%rsp), %eax
cmpl %ecx, %eax
jge 0x272ea
movq 0x1dda1a(%rip), %rdi    # 0x204c80
movl 0x82c(%rsp), %esi
callq 0x2abf0
movq %rax, 0x820(%rsp)
movq 0x820(%rsp), %rsi
leaq 0x808(%rsp), %rdi
callq 0x284a0
leaq 0x808(%rsp), %rdi
callq 0x2aa40
movq 0x1dd9dd(%rip), %rdi    # 0x204c80
movq 0x820(%rsp), %rsi
callq 0x2aab0
movq %rax, %rdi
callq 0x2aa90
movq 0x1dd9c1(%rip), %rdi    # 0x204c80
movq 0x820(%rsp), %rsi
callq 0x2ab40
movq %rax, %rdi
callq 0x2ab20
movl 0x82c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x82c(%rsp)
jmp 0x27234
callq 0x2ab60
jmp 0x273d8
movl $0xb50, %edi            # imm = 0xB50
callq 0x22900
movsd 0x16ed22(%rip), %xmm2   # 0x196028
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x2ab70
xorl %edi, %edi
callq 0x2a9b0
movl $0x0, 0x804(%rsp)
movl 0x804(%rsp), %eax
movl %eax, 0xa8(%rsp)
movq 0x1dd948(%rip), %rdi    # 0x204c80
callq 0x2abd0
movl %eax, %ecx
movl 0xa8(%rsp), %eax
cmpl %ecx, %eax
jge 0x273d3
movq 0x1dd92b(%rip), %rdi    # 0x204c80
movl 0x804(%rsp), %esi
callq 0x2abf0
movq %rax, 0x7f8(%rsp)
movq 0x1dd910(%rip), %rdi    # 0x204c80
movq 0x7f8(%rsp), %rsi
callq 0x2aab0
movq %rax, %rdi
callq 0x2aa90
movq 0x1dd8f4(%rip), %rdi    # 0x204c80
movq 0x7f8(%rsp), %rsi
callq 0x2aab0
movq %rax, %rdi
callq 0x2aa90
movq 0x1dd8d8(%rip), %rdi    # 0x204c80
movq 0x7f8(%rsp), %rsi
callq 0x2ab40
movq %rax, %rdi
callq 0x2ab20
movl 0x804(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x804(%rsp)
jmp 0x27323
callq 0x2ab60
jmp 0x273da
cmpq $0x0, 0x1dd8ae(%rip)    # 0x204c90
je 0x27537
cmpl $0x0, 0x1dd8a9(%rip)    # 0x204c98
je 0x27537
movl $0xb50, %edi            # imm = 0xB50
callq 0x22900
cmpl $0x0, 0x1dd896(%rip)    # 0x204c9c
je 0x27418
xorl %esi, %esi
movl $0x1, %edx
movl %esi, %edi
callq 0x2ac20
jmp 0x27426
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x2ac20
movq 0x1dd853(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0xc07e0
movaps %xmm0, %xmm1
movsd 0x16ebeb(%rip), %xmm0   # 0x196030
mulsd %xmm1, %xmm0
movsd %xmm0, 0x7f0(%rsp)
movl $0x0, 0x7ec(%rsp)
movl 0x7ec(%rsp), %eax
movl %eax, 0xa4(%rsp)
movq 0x1dd81e(%rip), %rdi    # 0x204c90
callq 0x2ac70
movl %eax, %ecx
movl 0xa4(%rsp), %eax
cmpl %ecx, %eax
jge 0x27535
movq 0x1dd801(%rip), %rdi    # 0x204c90
movl 0x7ec(%rsp), %esi
callq 0x2ac80
movq %rax, 0x7e0(%rsp)
movq 0x7e0(%rsp), %rsi
movsd 0x7f0(%rsp), %xmm0
leaq 0x7b8(%rsp), %rdi
callq 0xbad00
leaq 0x7b0(%rsp), %rdi
movl $0x772, %esi            # imm = 0x772
callq 0x2aca0
jmp 0x274d5
movq 0x7b0(%rsp), %rsi
leaq 0x7b8(%rsp), %rdi
callq 0x68690
jmp 0x274ec
leaq 0x7b8(%rsp), %rdi
callq 0x2acc0
movl 0x7ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7ec(%rsp)
jmp 0x2745d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0x7b8(%rsp), %rdi
callq 0x2acc0
jmp 0x28486
jmp 0x27537
cmpl $0x0, 0x1dd762(%rip)    # 0x204ca0
je 0x279f4
movl $0xb50, %edi            # imm = 0xB50
callq 0x22220
movl $0x1, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x2ac20
movss 0x16eb4c(%rip), %xmm0   # 0x1960b0
callq 0x23300
movl $0x1, %edi
callq 0x2a9b0
movl $0x1, 0x7a0(%rsp)
movl 0x7a0(%rsp), %eax
cmpl 0x1d752d(%rip), %eax    # 0x1feab8
jge 0x279e2
cvtsi2sdl 0x7a0(%rsp), %xmm0
cvtsi2sdl 0x1d7516(%rip), %xmm1 # 0x1feab8
divsd %xmm1, %xmm0
movsd %xmm0, 0x798(%rsp)
movl $0x0, 0x794(%rsp)
movl 0x794(%rsp), %eax
movl %eax, 0xa0(%rsp)
movq 0x1dd6b1(%rip), %rdi    # 0x204c80
callq 0x2a9d0
movl %eax, %ecx
movl 0xa0(%rsp), %eax
cmpl %ecx, %eax
jge 0x279ca
movq 0x1dd694(%rip), %rdi    # 0x204c80
movl 0x794(%rsp), %esi
callq 0x2a9f0
movq %rax, 0x788(%rsp)
movl $0x0, 0x784(%rsp)
cmpl $0x3, 0x784(%rsp)
jge 0x279b2
movq 0x1dd660(%rip), %rdi    # 0x204c80
movq 0x788(%rsp), %rsi
movl 0x784(%rsp), %edx
callq 0x2aa20
movq %rax, 0x778(%rsp)
movq 0x778(%rsp), %rdi
callq 0x28780
movsd %xmm0, 0x770(%rsp)
movq 0x1dd627(%rip), %rdi    # 0x204c80
movq 0x788(%rsp), %rsi
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
callq 0x2aa20
movq %rax, 0x768(%rsp)
movq 0x768(%rsp), %rdi
callq 0x28780
movsd %xmm0, 0x760(%rsp)
movq 0x1dd5e3(%rip), %rdi    # 0x204c80
movq 0x788(%rsp), %rsi
movl 0x784(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
callq 0x2aa20
movq %rax, 0x758(%rsp)
movq 0x758(%rsp), %rdi
callq 0x28780
movsd %xmm0, 0x750(%rsp)
movsd 0x770(%rsp), %xmm1
movsd 0x798(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x27792
movsd 0x760(%rsp), %xmm1
movsd 0x798(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x27726
movsd 0x750(%rsp), %xmm1
movsd 0x798(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x2772b
jmp 0x2799c
movsd 0x798(%rsp), %xmm0
subsd 0x770(%rsp), %xmm0
movsd 0x760(%rsp), %xmm1
subsd 0x770(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x748(%rsp)
movsd 0x798(%rsp), %xmm0
subsd 0x770(%rsp), %xmm0
movsd 0x750(%rsp), %xmm1
subsd 0x770(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x740(%rsp)
jmp 0x27842
movsd 0x770(%rsp), %xmm0
ucomisd 0x798(%rsp), %xmm0
jbe 0x2783b
movsd 0x760(%rsp), %xmm0
ucomisd 0x798(%rsp), %xmm0
jae 0x277d2
movsd 0x750(%rsp), %xmm0
ucomisd 0x798(%rsp), %xmm0
jb 0x277d7
jmp 0x2799c
movsd 0x770(%rsp), %xmm0
subsd 0x798(%rsp), %xmm0
movsd 0x770(%rsp), %xmm1
subsd 0x760(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x748(%rsp)
movsd 0x770(%rsp), %xmm0
subsd 0x798(%rsp), %xmm0
movsd 0x770(%rsp), %xmm1
subsd 0x750(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x740(%rsp)
jmp 0x27840
jmp 0x2799c
jmp 0x27842
movq 0x1dd437(%rip), %rdi    # 0x204c80
movq 0x778(%rsp), %rsi
callq 0x2ab40
movq %rax, %rsi
leaq 0x728(%rsp), %rdi
callq 0xd49e0
movq 0x1dd413(%rip), %rdi    # 0x204c80
movq 0x768(%rsp), %rsi
callq 0x2ab40
movq %rax, %rsi
leaq 0x710(%rsp), %rdi
callq 0xd49e0
movq 0x1dd3ef(%rip), %rdi    # 0x204c80
movq 0x758(%rsp), %rsi
callq 0x2ab40
movq %rax, %rsi
leaq 0x6f8(%rsp), %rdi
callq 0xd49e0
movsd 0x748(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
leaq 0x6c8(%rsp), %rdi
leaq 0x710(%rsp), %rsi
leaq 0x728(%rsp), %rdx
callq 0xd4d00
movsd 0x90(%rsp), %xmm0
leaq 0x6e0(%rsp), %rdi
leaq 0x6c8(%rsp), %rsi
callq 0x2acd0
movsd 0x740(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
leaq 0x698(%rsp), %rdi
leaq 0x6f8(%rsp), %rsi
leaq 0x728(%rsp), %rdx
callq 0xd4d00
movsd 0x98(%rsp), %xmm0
leaq 0x6b0(%rsp), %rdi
leaq 0x698(%rsp), %rsi
callq 0x2acd0
leaq 0x680(%rsp), %rdi
leaq 0x728(%rsp), %rsi
leaq 0x6e0(%rsp), %rdx
callq 0xd4f60
leaq 0x668(%rsp), %rdi
leaq 0x728(%rsp), %rsi
leaq 0x6b0(%rsp), %rdx
callq 0xd4f60
leaq 0x680(%rsp), %rdi
callq 0x2ab20
leaq 0x668(%rsp), %rdi
callq 0x2ab20
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x2760b
jmp 0x279b4
movl 0x794(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x794(%rsp)
jmp 0x275ba
jmp 0x279cc
movl 0x7a0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7a0(%rsp)
jmp 0x2757e
callq 0x2ab60
movss 0x16e6c1(%rip), %xmm0   # 0x1960b0
callq 0x23300
cmpl $0x0, 0x1dd2a9(%rip)    # 0x204ca4
jne 0x27a1c
cmpl $0x0, 0x1dd2a4(%rip)    # 0x204ca8
jne 0x27a1c
cmpl $0x0, 0x1dd29f(%rip)    # 0x204cac
jne 0x27a1c
cmpl $0x0, 0x1dd29a(%rip)    # 0x204cb0
je 0x27e84
movl $0xb50, %edi            # imm = 0xB50
callq 0x22900
movl $0x0, 0x664(%rsp)
movl 0x664(%rsp), %eax
movl %eax, 0x8c(%rsp)
movq 0x1dd23a(%rip), %rdi    # 0x204c80
callq 0x2abd0
movl %eax, %ecx
movl 0x8c(%rsp), %eax
cmpl %ecx, %eax
jge 0x27e82
movq 0x1dd21d(%rip), %rdi    # 0x204c80
movl 0x664(%rsp), %esi
callq 0x2abf0
movq %rax, 0x658(%rsp)
movq 0x1dd202(%rip), %rdi    # 0x204c80
movq 0x658(%rsp), %rsi
callq 0x2ab40
movq %rax, %rsi
leaq 0x640(%rsp), %rdi
callq 0xd49e0
movq 0x658(%rsp), %rdi
callq 0x28840
movsd %xmm0, 0x638(%rsp)
cmpl $0x0, 0x1dd1f0(%rip)    # 0x204ca8
je 0x27bad
movsd 0x638(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x1dd1e1(%rip), %rdi    # 0x204cb8
callq 0x6d130
movaps %xmm0, %xmm1
movsd 0x80(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jne 0x27bad
jp 0x27bad
movl $0x1, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x2ac20
movq 0x1dd173(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0xc0890
movsd 0x16e52e(%rip), %xmm1   # 0x196050
mulsd %xmm1, %xmm0
movsd %xmm0, 0x630(%rsp)
movsd 0x630(%rsp), %xmm0
leaq 0x608(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0xbad00
leaq 0x600(%rsp), %rdi
movl $0x772, %esi            # imm = 0x772
callq 0x2aca0
jmp 0x27b61
movq 0x600(%rsp), %rsi
leaq 0x608(%rsp), %rdi
callq 0x68690
jmp 0x27b78
leaq 0x608(%rsp), %rdi
callq 0x2acc0
jmp 0x27bad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0x608(%rsp), %rdi
callq 0x2acc0
jmp 0x28486
cmpl $0x0, 0x1dd0f0(%rip)    # 0x204ca4
je 0x27ca3
movsd 0x638(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x1dd0e8(%rip), %rdi    # 0x204cb8
callq 0x6d250
movaps %xmm0, %xmm1
movsd 0x78(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jne 0x27ca3
jp 0x27ca3
movl $0x1, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x2ac20
movq 0x1dd07d(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0xc0890
movsd 0x16e438(%rip), %xmm1   # 0x196050
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5f8(%rsp)
movsd 0x5f8(%rsp), %xmm0
leaq 0x5d0(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0xbad00
leaq 0x5c8(%rsp), %rdi
movl $0x772, %esi            # imm = 0x772
callq 0x2aca0
jmp 0x27c57
movq 0x5c8(%rsp), %rsi
leaq 0x5d0(%rsp), %rdi
callq 0x68690
jmp 0x27c6e
leaq 0x5d0(%rsp), %rdi
callq 0x2acc0
jmp 0x27ca3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0x5d0(%rsp), %rdi
callq 0x2acc0
jmp 0x28486
cmpl $0x0, 0x1dd006(%rip)    # 0x204cb0
je 0x27d88
movq 0x1dd001(%rip), %rdi    # 0x204cb8
movq 0x658(%rsp), %rsi
callq 0x6cd80
cmpl $0x0, %eax
je 0x27d88
movsd 0x16e383(%rip), %xmm0   # 0x196058
movl $0x1, %esi
movl %esi, %edi
callq 0x2ad10
movq 0x1dcf98(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0xc0890
movsd 0x16e363(%rip), %xmm1   # 0x196060
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5c0(%rsp)
movsd 0x5c0(%rsp), %xmm0
leaq 0x598(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0xbad00
leaq 0x590(%rsp), %rdi
movl $0x772, %esi            # imm = 0x772
callq 0x2aca0
jmp 0x27d3c
movq 0x590(%rsp), %rsi
leaq 0x598(%rsp), %rdi
callq 0x68690
jmp 0x27d53
leaq 0x598(%rsp), %rdi
callq 0x2acc0
jmp 0x27d88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0x598(%rsp), %rdi
callq 0x2acc0
jmp 0x28486
cmpl $0x0, 0x1dcf1d(%rip)    # 0x204cac
je 0x27e6a
movq 0x1dcf1c(%rip), %rdi    # 0x204cb8
movq 0x658(%rsp), %rsi
callq 0x6ced0
cmpl $0x0, %eax
je 0x27e6a
movsd 0x16e29e(%rip), %xmm0   # 0x196058
xorl %esi, %esi
movl %esi, %edi
callq 0x2ad40
movq 0x1dceb6(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0xc0890
movsd 0x16e281(%rip), %xmm1   # 0x196060
mulsd %xmm1, %xmm0
movsd %xmm0, 0x588(%rsp)
movsd 0x588(%rsp), %xmm0
leaq 0x560(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0xbad00
leaq 0x558(%rsp), %rdi
movl $0x772, %esi            # imm = 0x772
callq 0x2aca0
jmp 0x27e1e
movq 0x558(%rsp), %rsi
leaq 0x560(%rsp), %rdi
callq 0x68690
jmp 0x27e35
leaq 0x560(%rsp), %rdi
callq 0x2acc0
jmp 0x27e6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0x560(%rsp), %rdi
callq 0x2acc0
jmp 0x28486
jmp 0x27e6c
movl 0x664(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x664(%rsp)
jmp 0x27a31
jmp 0x27e84
cmpl $0x0, 0x1dce35(%rip)    # 0x204cc0
je 0x27ff3
movl $0xb50, %edi            # imm = 0xB50
callq 0x22220
movq 0x1dcdde(%rip), %rdi    # 0x204c80
callq 0x2ac50
movq %rax, %rdi
callq 0x2ad70
movaps %xmm0, %xmm1
movsd 0x16e17e(%rip), %xmm0   # 0x196038
mulsd %xmm1, %xmm0
movsd %xmm0, 0x148(%rsp)
movl $0x0, 0x144(%rsp)
movl 0x144(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0x1dcd9c(%rip), %rdi    # 0x204c80
callq 0x2abd0
movl %eax, %ecx
movl 0x74(%rsp), %eax
cmpl %ecx, %eax
jge 0x27ff1
movq 0x1dcd82(%rip), %rdi    # 0x204c80
movl 0x144(%rsp), %esi
callq 0x2abf0
movq %rax, 0x138(%rsp)
movq 0x1dcd67(%rip), %rdi    # 0x204c80
movq 0x138(%rsp), %rsi
callq 0x2ab40
movq %rax, %rsi
leaq 0x120(%rsp), %rdi
callq 0xd49e0
movq 0x1dcd43(%rip), %rdi    # 0x204c80
movq 0x138(%rsp), %rsi
callq 0x2aab0
movq %rax, %rsi
leaq 0x108(%rsp), %rdi
callq 0xd5b40
leaq 0x150(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x138(%rsp), %rdi
callq 0x28840
movq 0x68(%rsp), %rdi
leaq 0x16e2af(%rip), %rsi    # 0x19622f
movb $0x1, %al
callq 0x22150
movsd 0x148(%rsp), %xmm0
leaq 0xd8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x2acd0
leaq 0xf0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
callq 0xd4f60
leaq 0x150(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x2ad90
movl 0x144(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x144(%rsp)
jmp 0x27ed2
jmp 0x27ff3
cmpl $0x0, 0x1d6ac2(%rip)    # 0x1feabc
je 0x283f3
movl $0xb50, %edi            # imm = 0xB50
callq 0x22220
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x2ac20
movl 0x1d6aa5(%rip), %eax    # 0x1feac0
subl $0x14, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xd0(%rsp)
movq 0x1dcc3e(%rip), %rax    # 0x204c70
movq %rax, 0x8(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x1dcc6b(%rip), %rdi    # 0x204cb8
callq 0x2adf0
movq 0x8(%rsp), %rdi
movsd 0x10(%rsp), %xmm1
movq %rax, %rsi
movsd 0x16dfe0(%rip), %xmm0   # 0x196048
xorl %eax, %eax
movl %eax, %edx
callq 0x2e3d0
movsd 0xd0(%rsp), %xmm0
movsd 0x16dfbe(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x1dcc23(%rip), %rdi    # 0x204cc8
movq 0x1dcc0c(%rip), %rsi    # 0x204cb8
callq 0x692b0
movsd 0x18(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x16df85(%rip), %xmm0   # 0x196048
leaq 0x170b62(%rip), %rdi    # 0x198c2c
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16df60(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x1dcbb5(%rip), %rdi    # 0x204cb8
callq 0x6d010
movsd 0x20(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16df2f(%rip), %xmm0   # 0x196048
leaq 0x16e112(%rip), %rdi    # 0x196232
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16df0a(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x1dcb5f(%rip), %rdi    # 0x204cb8
callq 0x6d130
movsd 0x28(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16ded9(%rip), %xmm0   # 0x196048
leaq 0x16e0c1(%rip), %rdi    # 0x196237
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16deb4(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x1dcb09(%rip), %rdi    # 0x204cb8
callq 0x6d250
movsd 0x30(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16de83(%rip), %xmm0   # 0x196048
leaq 0x16e06f(%rip), %rdi    # 0x19623b
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16de5e(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x1dcab3(%rip), %rdi    # 0x204cb8
callq 0x6d370
movsd 0x38(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16de2d(%rip), %xmm0   # 0x196048
leaq 0x16e01d(%rip), %rdi    # 0x19623f
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16de08(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x1dca5d(%rip), %rdi    # 0x204cb8
callq 0x6d510
movsd 0x40(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16ddd7(%rip), %xmm0   # 0x196048
leaq 0x16dfce(%rip), %rdi    # 0x196246
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16ddb2(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
leaq 0x1dc997(%rip), %rdi    # 0x204c48
callq 0x2ae00
movsd 0x48(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16dd81(%rip), %xmm0   # 0x196048
leaq 0x16df80(%rip), %rdi    # 0x19624e
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16dd5c(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
leaq 0x1dc941(%rip), %rdi    # 0x204c48
callq 0x2ae10
movsd 0x50(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16dd2b(%rip), %xmm0   # 0x196048
leaq 0x16df3c(%rip), %rdi    # 0x196260
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16dd06(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x1dc8db(%rip), %rdi    # 0x204c38
callq 0x2ae00
movsd 0x58(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16dcd5(%rip), %xmm0   # 0x196048
leaq 0x16def8(%rip), %rdi    # 0x196272
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16dcb0(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0x1dc885(%rip), %rdi    # 0x204c38
callq 0x2ae10
movsd 0x60(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x16dc7f(%rip), %xmm0   # 0x196048
leaq 0x16deb9(%rip), %rdi    # 0x196289
callq 0x26e40
movsd 0xd0(%rsp), %xmm0
movsd 0x16dc5a(%rip), %xmm1   # 0x196040
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
cmpq $0x0, 0x1dc8d5(%rip)    # 0x204cd0
je 0x28479
movl 0x1d66c1(%rip), %esi    # 0x1feac4
movl 0x1d66b7(%rip), %edx    # 0x1feac0
leaq 0xb8(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x3, %ecx
callq 0xedd90
movq (%rsp), %rdi
callq 0xef1b0
jmp 0x2842a
movq 0x1dc89f(%rip), %rsi    # 0x204cd0
leaq 0xb8(%rsp), %rdi
callq 0x2ae20
jmp 0x28440
callq 0x26ec0
jmp 0x28447
leaq 0xb8(%rsp), %rdi
callq 0xee2b0
jmp 0x28479
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a8(%rsp)
movl %eax, 0x7a4(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xee2b0
jmp 0x28486
callq 0x182110
addq $0x888, %rsp            # imm = 0x888
retq
movq 0x7a8(%rsp), %rdi
callq 0x23270
nopw %cs:(%rax,%rax)