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

  // Clear window 
  glClearColor(background_color[0], background_color[1], background_color[2], 1.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  // Set lights
  static GLfloat light0_position[] = { 3.0, 4.0, 5.0, 0.0 };
  glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
  static GLfloat light1_position[] = { -3.0, -2.0, -3.0, 0.0 };
  glLightfv(GL_LIGHT1, GL_POSITION, light1_position);

  // Draw grid
  if (show_points) {
    glPointSize(5.0);
    glDisable(GL_LIGHTING);
    glDepthMask(FALSE);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);
    glDisable(GL_DEPTH_TEST);
    RNGrfxBegin(RN_GRFX_POINTS);
    RNScalar mean = grid->Mean();
    RNScalar scale = (RNIsZero(mean)) ? 1.0 : 0.25 / grid->Mean();
    for (int i = 0; i < grid->XResolution(); i++) {
      for (int j = 0; j < grid->YResolution(); j++) {
        for (int k = 0; k < grid->ZResolution(); k++) {
          RNScalar value = grid->GridValue(i, j, k);
          if (value <= grid_threshold) continue;
          RNScalar intensity = 1 - scale * value;
          RNLoadRgba(intensity, intensity, intensity, 0.5*(1-intensity));
          double x = i + 1.0 - (7*i%5)/6.0 - (7*j%5)/6.0 - (7*k%5)/6.0;
          double y = j + 1.0 - (7*i%5)/6.0 - (7*j%5)/6.0 - (7*k%5)/6.0;
          double z = k + 1.0 - (7*i%5)/6.0 - (7*j%5)/6.0 - (7*k%5)/6.0;
          R3LoadPoint(x, y, z);
        }
      }
    }
    RNGrfxEnd();
    glEnable(GL_DEPTH_TEST);
    glDisable(GL_BLEND);
    glBlendFunc(GL_ONE, GL_ZERO);
    glDepthMask(TRUE);
    glPointSize(1.0);
  }

  // Draw grid text
  if (show_text) {
    char buffer[64];
    glDisable(GL_LIGHTING);
    RNLoadRgb(0.0, 0.0, 1.0);
    for (int i = 0; i < grid->XResolution(); i++) {
      for (int j = 0; j < grid->YResolution(); j++) {
        for (int k = 0; k < grid->ZResolution(); k++) {
          RNScalar value = grid->GridValue(i, j, k);
          if (value >= grid_threshold) continue;
          sprintf(buffer, "%.2g", value);
          R3DrawText(i, j, k, buffer);
        }
      }
    }
  }

  // Draw grid isosurface
  if (show_isosurface) {
    glDisable(GL_LIGHTING);
    RNLoadRgb(1.0, 0.0, 0.0);
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    grid->DrawIsoSurface(grid_threshold);
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
  }

  // Draw grid X slices
  if (show_slices[RN_X] || show_slices[RN_Y] || show_slices[RN_Z]) {
    glDisable(GL_LIGHTING);
    RNLoadRgb(1.0, 1.0, 1.0);
    if (show_slices[RN_X]) grid->DrawSlice(RN_X, grid_slice_coords[RN_X]);
    if (show_slices[RN_Y]) grid->DrawSlice(RN_Y, grid_slice_coords[RN_Y]);
    if (show_slices[RN_Z]) grid->DrawSlice(RN_Z, grid_slice_coords[RN_Z]);
  }

  // Draw grid bounding box
  if (show_box) {
    glDisable(GL_LIGHTING);
    RNLoadRgb(0, 0, 0);
    R3Box(0, 0, 0, grid->XResolution()-1, grid->YResolution()-1, grid->ZResolution()-1).Outline();
#if 0
    if (show_slices[0]) R3Box(grid_slice_coords[0], 0, 0, grid_slice_coords[0], grid->YResolution()-1, grid->ZResolution()-1).Outline();
    if (show_slices[1]) R3Box(0, grid_slice_coords[1], 0, grid->XResolution()-1, grid_slice_coords[1], grid->ZResolution()-1).Outline();
    if (show_slices[2]) R3Box(0, 0, grid_slice_coords[2], grid->XResolution()-1, grid->YResolution()-1, grid_slice_coords[2]).Outline();
#endif
  }

  // Draw axes
  if (show_axes) {
    glDisable(GL_LIGHTING);
    glLineWidth(3);
    RNLoadRgb(1, 0, 0);
    R3BeginLine();
    R3LoadPoint(grid->XResolution()/2.0, grid->YResolution()/2.0, grid->ZResolution()/2.0);
    R3LoadPoint(grid->XResolution()/1.0, grid->YResolution()/2.0, grid->ZResolution()/2.0);
    R3EndLine();
    RNLoadRgb(0, 1, 0);
    R3BeginLine();
    R3LoadPoint(grid->XResolution()/2.0, grid->YResolution()/2.0, grid->ZResolution()/2.0);
    R3LoadPoint(grid->XResolution()/2.0, grid->YResolution()/1.0, grid->ZResolution()/2.0);
    R3EndLine();
    RNLoadRgb(0, 0, 1);
    R3BeginLine();
    R3LoadPoint(grid->XResolution()/2.0, grid->YResolution()/2.0, grid->ZResolution()/2.0);
    R3LoadPoint(grid->XResolution()/2.0, grid->YResolution()/2.0, grid->ZResolution()/1.0);
    R3EndLine();
    glLineWidth(1);
  }

  // Draw principle axes
  if (show_principle_axes) {
    static R3Point *center = NULL;
    static R3Vector axes[3];
    if (!center) {
      RNScalar variances[3];
      center = new R3Point(grid->GridCentroid());
      R3Triad triad = grid->GridPrincipleAxes(center, variances);
      axes[0] = sqrt(variances[0]) * triad[0];
      axes[1] = sqrt(variances[1]) * triad[1];
      axes[2] = sqrt(variances[2]) * triad[2];
    }
    glDisable(GL_LIGHTING);
    glLineWidth(3);
    RNLoadRgb(1, 0, 0);
    R3BeginLine();
    R3LoadPoint(*center - axes[0]);
    R3LoadPoint(*center + axes[0]);
    R3EndLine();
    RNLoadRgb(0, 1, 0);
    R3BeginLine();
    R3LoadPoint(*center - axes[1]);
    R3LoadPoint(*center + axes[1]);
    R3EndLine();
    RNLoadRgb(0, 0, 1);
    R3BeginLine();
    R3LoadPoint(*center - axes[2]);
    R3LoadPoint(*center + axes[2]);
    R3EndLine();
    glLineWidth(1);
  }

  // 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 $0x308, %rsp            # imm = 0x308
movq 0x19e412(%rip), %rdi    # 0x1c2230
callq 0x268e0
movq %rax, %rdi
xorl %esi, %esi
callq 0x2bbc0
movsd 0x18fa5b(%rip), %xmm0   # 0x1b3890
cvtsd2ss %xmm0, %xmm0
movsd 0x18fa57(%rip), %xmm1   # 0x1b3898
cvtsd2ss %xmm1, %xmm1
movsd 0x18fa53(%rip), %xmm2   # 0x1b38a0
cvtsd2ss %xmm2, %xmm2
movss 0x13b227(%rip), %xmm3   # 0x15f080
callq 0x20cd0
movl $0x4100, %edi           # imm = 0x4100
callq 0x201b0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
leaq 0x18fa37(%rip), %rdx    # 0x1b38b0
callq 0x20ed0
movl $0x4001, %edi           # imm = 0x4001
movl $0x1203, %esi           # imm = 0x1203
leaq 0x18fa31(%rip), %rdx    # 0x1b38c0
callq 0x20ed0
cmpl $0x0, 0x19e39d(%rip)    # 0x1c2238
je 0x24310
movss 0x13b1db(%rip), %xmm0   # 0x15f084
callq 0x20090
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
xorl %edi, %edi
callq 0x20470
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq 0x205f0
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x20740
movl $0xb71, %edi            # imm = 0xB71
callq 0x201c0
xorl %edi, %edi
callq 0x268f0
movq 0x19e350(%rip), %rdi    # 0x1c2240
callq 0x26910
movsd %xmm0, 0x300(%rsp)
movsd 0x300(%rsp), %xmm0
leaq 0x1989da(%rip), %rax    # 0x1bc8e8
movsd (%rax), %xmm1
callq 0x26960
cmpl $0x0, %eax
je 0x23f2f
movsd 0x13b0fc(%rip), %xmm0   # 0x15f020
movsd %xmm0, 0xc0(%rsp)
jmp 0x23f53
movq 0x19e30a(%rip), %rdi    # 0x1c2240
callq 0x26910
movaps %xmm0, %xmm1
movsd 0x13b0e2(%rip), %xmm0   # 0x15f028
divsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x2f8(%rsp)
movl $0x0, 0x2f4(%rsp)
movl 0x2f4(%rsp), %eax
movl %eax, 0xbc(%rsp)
movq 0x19e2bb(%rip), %rdi    # 0x1c2240
callq 0x269c0
movl %eax, %ecx
movl 0xbc(%rsp), %eax
cmpl %ecx, %eax
jge 0x242d4
movl $0x0, 0x2f0(%rsp)
movl 0x2f0(%rsp), %eax
movl %eax, 0xb8(%rsp)
movq 0x19e285(%rip), %rdi    # 0x1c2240
callq 0x269e0
movl %eax, %ecx
movl 0xb8(%rsp), %eax
cmpl %ecx, %eax
jge 0x242bc
movl $0x0, 0x2ec(%rsp)
movl 0x2ec(%rsp), %eax
movl %eax, 0xb4(%rsp)
movq 0x19e24f(%rip), %rdi    # 0x1c2240
callq 0x26a00
movl %eax, %ecx
movl 0xb4(%rsp), %eax
cmpl %ecx, %eax
jge 0x242a4
movq 0x19e232(%rip), %rdi    # 0x1c2240
movl 0x2f4(%rsp), %esi
movl 0x2f0(%rsp), %edx
movl 0x2ec(%rsp), %ecx
callq 0x26a20
movsd %xmm0, 0x2e0(%rsp)
movsd 0x2e0(%rsp), %xmm1
movss 0x18f88e(%rip), %xmm0   # 0x1b38d0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x24051
jmp 0x2428e
movsd 0x2f8(%rsp), %xmm0
movsd 0x2e0(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm1, %xmm0
movsd 0x13af9a(%rip), %xmm1   # 0x15f020
addsd %xmm1, %xmm0
movsd %xmm0, 0x2d8(%rsp)
movsd 0x2d8(%rsp), %xmm0
movsd 0x2d8(%rsp), %xmm1
movsd 0x2d8(%rsp), %xmm2
movsd 0x13af6a(%rip), %xmm4   # 0x15f020
subsd 0x2d8(%rsp), %xmm4
movsd 0x13af79(%rip), %xmm3   # 0x15f040
mulsd %xmm4, %xmm3
callq 0x26a70
cvtsi2sdl 0x2f4(%rsp), %xmm0
movsd 0x13af3f(%rip), %xmm1   # 0x15f020
addsd %xmm1, %xmm0
imull $0x7, 0x2f4(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13af37(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2f0(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13af13(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2ec(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13aeef(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x2d0(%rsp)
cvtsi2sdl 0x2f0(%rsp), %xmm0
movsd 0x13aeb5(%rip), %xmm1   # 0x15f020
addsd %xmm1, %xmm0
imull $0x7, 0x2f4(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13aead(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2f0(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13ae89(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2ec(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13ae65(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x2c8(%rsp)
cvtsi2sdl 0x2ec(%rsp), %xmm0
movsd 0x13ae2b(%rip), %xmm1   # 0x15f020
addsd %xmm1, %xmm0
imull $0x7, 0x2f4(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13ae23(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2f0(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13adff(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
imull $0x7, 0x2ec(%rsp), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cvtsi2sd %edx, %xmm1
movsd 0x13addb(%rip), %xmm2   # 0x15f038
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x2c0(%rsp)
movsd 0x2d0(%rsp), %xmm0
movsd 0x2c8(%rsp), %xmm1
movsd 0x2c0(%rsp), %xmm2
callq 0x26ab0
movl 0x2ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ec(%rsp)
jmp 0x23fdc
jmp 0x242a6
movl 0x2f0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f0(%rsp)
jmp 0x23fa6
jmp 0x242be
movl 0x2f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f4(%rsp)
jmp 0x23f70
callq 0x26ae0
movl $0xb71, %edi            # imm = 0xB71
callq 0x20740
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x201c0
movl $0x1, %edi
xorl %esi, %esi
callq 0x205f0
movl $0x1, %edi
callq 0x20470
movss 0x13ad75(%rip), %xmm0   # 0x15f080
callq 0x20090
cmpl $0x0, 0x19df31(%rip)    # 0x1c2248
je 0x244b6
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
xorps %xmm1, %xmm1
movsd 0x13acee(%rip), %xmm2   # 0x15f020
movaps %xmm1, %xmm0
callq 0x26af0
movl $0x0, 0x27c(%rsp)
movl 0x27c(%rsp), %eax
movl %eax, 0xb0(%rsp)
movq 0x19dee6(%rip), %rdi    # 0x1c2240
callq 0x269c0
movl %eax, %ecx
movl 0xb0(%rsp), %eax
cmpl %ecx, %eax
jge 0x244b4
movl $0x0, 0x278(%rsp)
movl 0x278(%rsp), %eax
movl %eax, 0xac(%rsp)
movq 0x19deb0(%rip), %rdi    # 0x1c2240
callq 0x269e0
movl %eax, %ecx
movl 0xac(%rsp), %eax
cmpl %ecx, %eax
jge 0x2449c
movl $0x0, 0x274(%rsp)
movl 0x274(%rsp), %eax
movl %eax, 0xa8(%rsp)
movq 0x19de7a(%rip), %rdi    # 0x1c2240
callq 0x26a00
movl %eax, %ecx
movl 0xa8(%rsp), %eax
cmpl %ecx, %eax
jge 0x24484
movq 0x19de5d(%rip), %rdi    # 0x1c2240
movl 0x27c(%rsp), %esi
movl 0x278(%rsp), %edx
movl 0x274(%rsp), %ecx
callq 0x26a20
movsd %xmm0, 0x268(%rsp)
movsd 0x268(%rsp), %xmm0
movss 0x18f4b9(%rip), %xmm1   # 0x1b38d0
cvtss2sd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x24423
jmp 0x2446e
leaq 0x280(%rsp), %rdi
movsd 0x268(%rsp), %xmm0
leaq 0x13ade9(%rip), %rsi    # 0x15f224
movb $0x1, %al
callq 0x20130
cvtsi2sdl 0x27c(%rsp), %xmm0
cvtsi2sdl 0x278(%rsp), %xmm1
cvtsi2sdl 0x274(%rsp), %xmm2
leaq 0x280(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x26b20
movl 0x274(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x274(%rsp)
jmp 0x243b1
jmp 0x24486
movl 0x278(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x278(%rsp)
jmp 0x2437b
jmp 0x2449e
movl 0x27c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x27c(%rsp)
jmp 0x24345
jmp 0x244b6
cmpl $0x0, 0x18f417(%rip)    # 0x1b38d4
je 0x24512
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
movsd 0x13ab4f(%rip), %xmm0   # 0x15f020
xorps %xmm2, %xmm2
movaps %xmm2, %xmm1
callq 0x26af0
movl $0x408, %edi            # imm = 0x408
movl $0x1b01, %esi           # imm = 0x1B01
callq 0x20640
movq 0x19dd4e(%rip), %rdi    # 0x1c2240
movss 0x18f3d6(%rip), %xmm0   # 0x1b38d0
cvtss2sd %xmm0, %xmm0
callq 0x5f570
movl $0x408, %edi            # imm = 0x408
movl $0x1b02, %esi           # imm = 0x1B02
callq 0x20640
cmpl $0x0, 0x19dd33(%rip)    # 0x1c224c
jne 0x2452d
cmpl $0x0, 0x19dd2e(%rip)    # 0x1c2250
jne 0x2452d
cmpl $0x0, 0x19dd29(%rip)    # 0x1c2254
je 0x245a9
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
movsd 0x13aae1(%rip), %xmm2   # 0x15f020
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x26af0
cmpl $0x0, 0x19dcfb(%rip)    # 0x1c224c
je 0x24567
movq 0x19dce6(%rip), %rdi    # 0x1c2240
movl 0x19dcf8(%rip), %edx    # 0x1c2258
xorl %esi, %esi
callq 0x5f7b0
cmpl $0x0, 0x19dce2(%rip)    # 0x1c2250
je 0x24587
movq 0x19dcc9(%rip), %rdi    # 0x1c2240
movl 0x19dcdf(%rip), %edx    # 0x1c225c
movl $0x1, %esi
callq 0x5f7b0
cmpl $0x0, 0x19dcc6(%rip)    # 0x1c2254
je 0x245a7
movq 0x19dca9(%rip), %rdi    # 0x1c2240
movl 0x19dcc3(%rip), %edx    # 0x1c2260
movl $0x2, %esi
callq 0x5f7b0
jmp 0x245a9
cmpl $0x0, 0x18f328(%rip)    # 0x1b38d8
je 0x2469b
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x26ba0
movq 0x19dc6e(%rip), %rdi    # 0x1c2240
callq 0x269c0
decl %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0x19dc53(%rip), %rdi    # 0x1c2240
callq 0x269e0
decl %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x19dc38(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x98(%rsp), %xmm3
movsd 0xa0(%rsp), %xmm4
decl %eax
cvtsi2sd %eax, %xmm5
leaq 0x230(%rsp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x37640
leaq 0x228(%rsp), %rdi
movl $0x1, %esi
callq 0x26bd0
jmp 0x2464f
movq 0x228(%rsp), %rsi
leaq 0x230(%rsp), %rdi
callq 0x3a860
jmp 0x24666
leaq 0x230(%rsp), %rdi
callq 0x26bf0
jmp 0x2469b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x26bf0
jmp 0x24ddf
cmpl $0x0, 0x19dbc2(%rip)    # 0x1c2264
je 0x249cc
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
movss 0x13a9ce(%rip), %xmm0   # 0x15f088
callq 0x20f60
movl $0x1, %edi
xorl %edx, %edx
movl %edx, %esi
callq 0x26ba0
callq 0x26c00
movq 0x19db67(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a946(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x19db45(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a924(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x19db23(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a8f6(%rip), %xmm3   # 0x15f030
divsd %xmm3, %xmm2
callq 0x26ab0
movq 0x19daf6(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a8c5(%rip), %xmm1   # 0x15f020
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x19dad4(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a8b3(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x19dab2(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a885(%rip), %xmm3   # 0x15f030
divsd %xmm3, %xmm2
callq 0x26ab0
callq 0x26c10
xorl %edx, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x26ba0
callq 0x26c00
movq 0x19da6d(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a84c(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x19da4b(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a82a(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x19da29(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x58(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a7fc(%rip), %xmm3   # 0x15f030
divsd %xmm3, %xmm2
callq 0x26ab0
movq 0x19d9fc(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a7db(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x19d9da(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a7a9(%rip), %xmm1   # 0x15f020
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x19d9b8(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a78b(%rip), %xmm3   # 0x15f030
divsd %xmm3, %xmm2
callq 0x26ab0
callq 0x26c10
xorl %esi, %esi
movl $0x1, %edx
movl %esi, %edi
callq 0x26ba0
callq 0x26c00
movq 0x19d973(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a752(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x19d951(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a730(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x19d92c(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x78(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a6fc(%rip), %xmm3   # 0x15f030
divsd %xmm3, %xmm2
callq 0x26ab0
movq 0x19d8fc(%rip), %rdi    # 0x1c2240
callq 0x269c0
cvtsi2sd %eax, %xmm0
movsd 0x13a6db(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x19d8d7(%rip), %rdi    # 0x1c2240
callq 0x269e0
cvtsi2sd %eax, %xmm0
movsd 0x13a6b6(%rip), %xmm1   # 0x15f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x19d8b2(%rip), %rdi    # 0x1c2240
callq 0x26a00
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
cvtsi2sd %eax, %xmm2
movsd 0x13a66f(%rip), %xmm3   # 0x15f020
divsd %xmm3, %xmm2
callq 0x26ab0
callq 0x26c10
movss 0x13a6b9(%rip), %xmm0   # 0x15f080
callq 0x20f60
cmpl $0x0, 0x19d895(%rip)    # 0x1c2268
je 0x24d4c
cmpb $0x0, 0x19d8e8(%rip)    # 0x1c22c8
jne 0x24a3c
leaq 0x19d8df(%rip), %rdi    # 0x1c22c8
callq 0x20f50
cmpl $0x0, %eax
je 0x24a3c
leaq 0x19d886(%rip), %rax    # 0x1c2280
movq %rax, 0x30(%rsp)
jmp 0x24a01
movq 0x30(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x64d20
jmp 0x24a12
movq 0x28(%rsp), %rax
addq $0x18, %rax
leaq 0x19d85e(%rip), %rcx    # 0x1c2280
addq $0x48, %rcx
cmpq %rcx, %rax
movq %rax, 0x30(%rsp)
jne 0x24a01
leaq 0x19d891(%rip), %rdi    # 0x1c22c8
callq 0x20500
cmpq $0x0, 0x19d82c(%rip)    # 0x1c2270
jne 0x24be0
movl $0x18, %edi
callq 0x207d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq 0x19d7da(%rip), %rsi    # 0x1c2240
callq 0x4c520
jmp 0x24a6d
movq 0x20(%rsp), %rax
movq %rax, 0x19d7f7(%rip)    # 0x1c2270
movq 0x19d7c0(%rip), %rsi    # 0x1c2240
movq 0x19d7e9(%rip), %rdx    # 0x1c2270
leaq 0x200(%rsp), %rcx
leaq 0x1b8(%rsp), %rdi
callq 0x4c6a0
movsd 0x200(%rsp), %xmm0
callq 0x205e0
movsd %xmm0, 0x8(%rsp)
leaq 0x1b8(%rsp), %rdi
xorl %esi, %esi
callq 0x26c60
movsd 0x8(%rsp), %xmm0
movq %rax, %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x26c20
leaq 0x19d7a4(%rip), %rdi    # 0x1c2280
leaq 0x1a0(%rsp), %rsi
callq 0x659f0
movsd 0x208(%rsp), %xmm0
callq 0x205e0
movsd %xmm0, 0x10(%rsp)
leaq 0x1b8(%rsp), %rdi
movl $0x1, %esi
callq 0x26c60
movsd 0x10(%rsp), %xmm0
movq %rax, %rsi
leaq 0x188(%rsp), %rdi
callq 0x26c20
leaq 0x19d754(%rip), %rdi    # 0x1c2280
addq $0x18, %rdi
leaq 0x188(%rsp), %rsi
callq 0x659f0
movsd 0x210(%rsp), %xmm0
callq 0x205e0
movsd %xmm0, 0x18(%rsp)
leaq 0x1b8(%rsp), %rdi
movl $0x2, %esi
callq 0x26c60
movsd 0x18(%rsp), %xmm0
movq %rax, %rsi
leaq 0x170(%rsp), %rdi
callq 0x26c20
leaq 0x19d700(%rip), %rdi    # 0x1c2280
addq $0x30, %rdi
leaq 0x170(%rsp), %rsi
callq 0x659f0
jmp 0x24be0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
leaq 0x19d71a(%rip), %rdi    # 0x1c22c8
callq 0x204e0
jmp 0x24ddf
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
movl $0x18, %esi
callq 0x207f0
jmp 0x24ddf
movl $0xb50, %edi            # imm = 0xB50
callq 0x201c0
movss 0x13a496(%rip), %xmm0   # 0x15f088
callq 0x20f60
movl $0x1, %edi
xorl %edx, %edx
movl %edx, %esi
callq 0x26ba0
callq 0x26c00
movq 0x19d65f(%rip), %rsi    # 0x1c2270
leaq 0x158(%rsp), %rdi
leaq 0x19d660(%rip), %rdx    # 0x1c2280
callq 0x64b30
leaq 0x158(%rsp), %rdi
callq 0x26c80
movq 0x19d637(%rip), %rsi    # 0x1c2270
leaq 0x140(%rsp), %rdi
leaq 0x19d638(%rip), %rdx    # 0x1c2280
callq 0x64190
leaq 0x140(%rsp), %rdi
callq 0x26c80
callq 0x26c10
xorl %edx, %edx
movl $0x1, %esi
movl %edx, %edi
callq 0x26ba0
callq 0x26c00
movq 0x19d5f7(%rip), %rsi    # 0x1c2270
leaq 0x128(%rsp), %rdi
leaq 0x19d5f8(%rip), %rdx    # 0x1c2280
addq $0x18, %rdx
callq 0x64b30
leaq 0x128(%rsp), %rdi
callq 0x26c80
movq 0x19d5cb(%rip), %rsi    # 0x1c2270
leaq 0x110(%rsp), %rdi
leaq 0x19d5cc(%rip), %rdx    # 0x1c2280
addq $0x18, %rdx
callq 0x64190
leaq 0x110(%rsp), %rdi
callq 0x26c80
callq 0x26c10
xorl %esi, %esi
movl $0x1, %edx
movl %esi, %edi
callq 0x26ba0
callq 0x26c00
movq 0x19d587(%rip), %rsi    # 0x1c2270
leaq 0xf8(%rsp), %rdi
leaq 0x19d588(%rip), %rdx    # 0x1c2280
addq $0x30, %rdx
callq 0x64b30
leaq 0xf8(%rsp), %rdi
callq 0x26c80
movq 0x19d55b(%rip), %rsi    # 0x1c2270
leaq 0xe0(%rsp), %rdi
leaq 0x19d55c(%rip), %rdx    # 0x1c2280
addq $0x30, %rdx
callq 0x64190
leaq 0xe0(%rsp), %rdi
callq 0x26c80
callq 0x26c10
movss 0x13a339(%rip), %xmm0   # 0x15f080
callq 0x20f60
cmpq $0x0, 0x19d57c(%rip)    # 0x1c22d0
je 0x24dd2
movl 0x18eb80(%rip), %esi    # 0x1b38dc
movl 0x18eb7e(%rip), %edx    # 0x1b38e0
leaq 0xc8(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x3, %ecx
callq 0xdd6a0
movq (%rsp), %rdi
callq 0xdeac0
jmp 0x24d83
movq 0x19d546(%rip), %rsi    # 0x1c22d0
leaq 0xc8(%rsp), %rdi
callq 0x26ca0
jmp 0x24d99
callq 0x23df0
jmp 0x24da0
leaq 0xc8(%rsp), %rdi
callq 0xddbc0
jmp 0x24dd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xddbc0
jmp 0x24ddf
callq 0xee060
addq $0x308, %rsp            # imm = 0x308
retq
movq 0x220(%rsp), %rdi
callq 0x20ee0
nopl (%rax)