// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq 0x104249(%rip), %rdi    # 0x126790
addq $0x8, %rdi
xorl %esi, %esi
callq 0x267d4
cvtsd2ss 0xff2c6(%rip), %xmm0    # 0x121820
cvtsd2ss 0xff2ce(%rip), %xmm1    # 0x121830
cvtsd2ss 0xff2d6(%rip), %xmm2    # 0x121840
movss 0xa1a92(%rip), %xmm3    # 0xc4004
callq 0x1fc10
movl $0x4100, %edi           # imm = 0x4100
callq 0x1f1a0
leaq 0xff2c8(%rip), %rdx     # 0x121850
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x1fe20
leaq 0xff2c2(%rip), %rdx     # 0x121860
movl $0x4001, %edi           # imm = 0x4001
movl $0x1203, %esi           # imm = 0x1203
callq 0x1fe20
cmpl $0x0, 0x1041e4(%rip)    # 0x126798
je 0x228ee
movss 0xa1a46(%rip), %xmm0    # 0xc4008
callq 0x1f090
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
xorl %edi, %edi
callq 0x1f450
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq 0x1f5a0
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x1f6c0
movl $0xb71, %edi            # imm = 0xB71
callq 0x1f1b0
xorl %edi, %edi
callq 0x1f160
movq 0x104197(%rip), %rbx    # 0x1267a0
cmpl $0x0, 0x24c(%rbx)
je 0x22632
movq %rbx, %rdi
callq 0x33e14
xorps %xmm1, %xmm1
cvtsi2sdl 0x24c(%rbx), %xmm1
divsd %xmm1, %xmm0
movq 0x104170(%rip), %rbx    # 0x1267a0
jmp 0x22636
xorpd %xmm0, %xmm0
leaq 0xff97b(%rip), %rax     # 0x121fb8
movsd (%rax), %xmm1
movapd 0xa19d7(%rip), %xmm2    # 0xc4020
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x22669
ucomisd %xmm0, %xmm1
jb 0x22669
movsd 0xa19df(%rip), %xmm0    # 0xc4040
movapd %xmm0, 0x20(%rsp)
jmp 0x226a8
cmpl $0x0, 0x24c(%rbx)
je 0x22692
movq %rbx, %rdi
callq 0x33e14
xorps %xmm1, %xmm1
cvtsi2sdl 0x24c(%rbx), %xmm1
divsd %xmm1, %xmm0
movq 0x104110(%rip), %rbx    # 0x1267a0
jmp 0x22696
xorpd %xmm0, %xmm0
movsd 0xa19aa(%rip), %xmm1    # 0xc4048
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
cmpl $0x0, 0x238(%rbx)
jle 0x228b2
movapd 0x20(%rsp), %xmm0
xorpd 0xa195d(%rip), %xmm0    # 0xc4020
movapd %xmm0, 0x20(%rsp)
xorl %r15d, %r15d
movl $0xcccccccd, %r14d      # imm = 0xCCCCCCCD
leal 0x1(%r15), %eax
cmpl $0x0, 0x23c(%rbx)
movl %eax, 0x1c(%rsp)
jle 0x2289f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leal (,%r15,8), %eax
subl %r15d, %eax
movq %rax, %rcx
imulq %r14, %rcx
shrq $0x22, %rcx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd 0xa1938(%rip), %xmm1    # 0xc4050
movsd %xmm1, 0x8(%rsp)
subsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
xorl %r12d, %r12d
cmpl $0x0, 0x240(%rbx)
jle 0x22889
leal (,%r12,8), %eax
subl %r12d, %eax
movq %rax, %rcx
imulq %r14, %rcx
shrq $0x22, %rcx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xa18ee(%rip), %xmm0    # 0xc4050
movsd 0x78(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x88(%rsp)
leal 0x1(%r12), %r13d
xorps %xmm1, %xmm1
cvtsi2sd %r13, %xmm1
subsd 0x8(%rsp), %xmm1
movsd %xmm0, 0x10(%rsp)
subsd %xmm0, %xmm1
movsd %xmm1, 0x80(%rsp)
xorl %ebp, %ebp
movss 0xff0cb(%rip), %xmm1    # 0x121870
movq 0x230(%rbx), %rax
movl 0x248(%rbx), %ecx
imull %ebp, %ecx
movl 0x244(%rbx), %edx
imull %r12d, %edx
addl %r15d, %ecx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0x22879
mulsd 0x20(%rsp), %xmm0
movsd 0xa1855(%rip), %xmm3    # 0xc4040
addsd %xmm3, %xmm0
subsd %xmm0, %xmm3
mulsd 0xa185d(%rip), %xmm3    # 0xc4058
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x1f2c0
leal (,%rbp,8), %eax
subl %ebp, %eax
movq %rax, %rcx
imulq %r14, %rcx
shrq $0x22, %rcx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
divsd 0xa1820(%rip), %xmm3    # 0xc4050
movsd 0x88(%rsp), %xmm0
subsd %xmm3, %xmm0
movsd 0x80(%rsp), %xmm1
incl %ebp
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
subsd %xmm3, %xmm1
subsd 0x8(%rsp), %xmm2
subsd 0x10(%rsp), %xmm2
subsd %xmm3, %xmm2
callq 0x1fc50
movss 0xff000(%rip), %xmm1    # 0x121870
movq 0x103f29(%rip), %rbx    # 0x1267a0
jmp 0x2287b
incl %ebp
cmpl 0x240(%rbx), %ebp
jl 0x227a5
jmp 0x2288f
incl %r12d
movl %r12d, %r13d
movl %r13d, %r12d
cmpl 0x23c(%rbx), %r13d
jl 0x2272b
movl 0x1c(%rsp), %eax
movl %eax, %r15d
cmpl 0x238(%rbx), %eax
jl 0x226d2
callq 0x1fa60
movl $0xb71, %edi            # imm = 0xB71
callq 0x1f6c0
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x1f1b0
movl $0x1, %edi
xorl %esi, %esi
callq 0x1f5a0
movl $0x1, %edi
callq 0x1f450
movss 0xa171b(%rip), %xmm0    # 0xc4004
callq 0x1f090
cmpl $0x0, 0x103eb3(%rip)    # 0x1267a8
je 0x22a2d
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa1733(%rip), %xmm2    # 0xc4040
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x1fc60
movq 0x103e81(%rip), %rax    # 0x1267a0
cmpl $0x0, 0x238(%rax)
jle 0x22a2d
xorl %ebp, %ebp
leaq 0x30(%rsp), %r14
leaq 0x506cae(%rip), %r15    # 0x5295e8
cmpl $0x0, 0x23c(%rax)
jle 0x22a1f
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r13d, %r13d
cmpl $0x0, 0x240(%rax)
jle 0x22a0f
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq 0x230(%rax), %rcx
movl 0x248(%rax), %edx
imull %r12d, %edx
movl 0x244(%rax), %eax
imull %r13d, %eax
addl %ebp, %edx
addl %eax, %edx
movslq %edx, %rax
movsd (%rcx,%rax,8), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0xfeec9(%rip), %xmm1    # 0x121870
ucomisd %xmm1, %xmm0
jae 0x229f8
movq %r14, %rdi
leaq 0xa17d1(%rip), %rsi     # 0xc4188
movb $0x1, %al
callq 0x1f120
xorps %xmm2, %xmm2
cvtsi2sd %r12d, %xmm2
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x1f240
movb 0x30(%rsp), %al
testb %al, %al
je 0x229f8
leaq 0x31(%rsp), %rbx
movsbl %al, %esi
movq %r15, %rdi
callq 0x87afc
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x229e4
incl %r12d
movq 0x103d9e(%rip), %rax    # 0x1267a0
cmpl 0x240(%rax), %r12d
jl 0x22975
incl %r13d
cmpl 0x23c(%rax), %r13d
jl 0x22957
incl %ebp
cmpl 0x238(%rax), %ebp
jl 0x2293a
cmpl $0x0, 0xfee40(%rip)     # 0x121874
je 0x22a88
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa15f8(%rip), %xmm0    # 0xc4040
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fc60
movl $0x408, %edi            # imm = 0x408
movl $0x1b01, %esi           # imm = 0x1B01
callq 0x1f5e0
movq 0x103d37(%rip), %rdi    # 0x1267a0
xorps %xmm0, %xmm0
cvtss2sd 0xfedfc(%rip), %xmm0    # 0x121870
callq 0x3f776
movl $0x408, %edi            # imm = 0x408
movl $0x1b02, %esi           # imm = 0x1B02
callq 0x1f5e0
cmpl $0x0, 0x103d1d(%rip)    # 0x1267ac
jne 0x22aa3
cmpl $0x0, 0x103d18(%rip)    # 0x1267b0
jne 0x22aa3
cmpl $0x0, 0x103d13(%rip)    # 0x1267b4
je 0x22b1d
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa158b(%rip), %xmm0    # 0xc4040
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x1fc60
cmpl $0x0, 0x103ce5(%rip)    # 0x1267ac
je 0x22add
movq 0x103cd0(%rip), %rdi    # 0x1267a0
movl 0x103ce2(%rip), %edx    # 0x1267b8
xorl %esi, %esi
callq 0x3f8dc
cmpl $0x0, 0x103ccc(%rip)    # 0x1267b0
je 0x22afd
movq 0x103cb3(%rip), %rdi    # 0x1267a0
movl 0x103cc9(%rip), %edx    # 0x1267bc
movl $0x1, %esi
callq 0x3f8dc
cmpl $0x0, 0x103cb0(%rip)    # 0x1267b4
je 0x22b1d
movq 0x103c93(%rip), %rdi    # 0x1267a0
movl 0x103cad(%rip), %edx    # 0x1267c0
movl $0x2, %esi
callq 0x3f8dc
cmpl $0x0, 0xfed54(%rip)     # 0x121878
je 0x22b99
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movq 0x103c5b(%rip), %rax    # 0x1267a0
movl 0x238(%rax), %ecx
decl %ecx
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
movl 0x23c(%rax), %ecx
decl %ecx
cvtsi2sd %ecx, %xmm4
movl 0x240(%rax), %eax
decl %eax
cvtsi2sd %eax, %xmm5
leaq 0x30(%rsp), %rbx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
callq 0x2c140
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2d3ac
leaq 0x30(%rsp), %rdi
callq 0x2cec0
cmpl $0x0, 0x103c24(%rip)    # 0x1267c4
je 0x22dae
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movss 0xa1454(%rip), %xmm0    # 0xc400c
callq 0x1fe90
movss 0xa143f(%rip), %xmm0    # 0xc4004
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x103bbf(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa1464(%rip), %xmm3    # 0xc4058
mulsd %xmm3, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
mulsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
movq 0x103b7e(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa1418(%rip), %xmm3    # 0xc4058
mulsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
callq 0x1fa60
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movss 0xa1397(%rip), %xmm1    # 0xc4004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x103b1d(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa13c2(%rip), %xmm3    # 0xc4058
mulsd %xmm3, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
mulsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
movq 0x103adc(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa1376(%rip), %xmm3    # 0xc4058
mulsd %xmm3, %xmm0
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
callq 0x1fa60
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movss 0xa12f5(%rip), %xmm2    # 0xc4004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x103a7b(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa1320(%rip), %xmm3    # 0xc4058
mulsd %xmm3, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
mulsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
movq 0x103a3a(%rip), %rax    # 0x1267a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa12d4(%rip), %xmm2    # 0xc4058
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
callq 0x1fc50
callq 0x1fa60
movss 0xa125b(%rip), %xmm0    # 0xc4004
callq 0x1fe90
cmpl $0x0, 0x103a13(%rip)    # 0x1267c8
je 0x23032
movb 0x103a67(%rip), %al     # 0x126828
testb %al, %al
je 0x2309c
cmpq $0x0, 0x1039ff(%rip)    # 0x1267d0
jne 0x22ed9
movl $0x18, %edi
callq 0x1f750
movq %rax, %r14
movq 0x1039b5(%rip), %rsi    # 0x1267a0
movq %rax, %rdi
callq 0x344cc
movq %r14, 0x1039d6(%rip)    # 0x1267d0
movq 0x10399f(%rip), %rsi    # 0x1267a0
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rbx
movq %r14, %rdx
movq %rbx, %rcx
callq 0x34608
movsd (%rbx), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x22e2c
sqrtsd %xmm0, %xmm0
jmp 0x22e31
callq 0x1f590
leaq 0xb0(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x42786
leaq 0x103993(%rip), %rdi    # 0x1267e0
movq %rbx, %rsi
callq 0x42576
movsd 0x98(%rsp), %xmm0
ucomisd 0xa11fa(%rip), %xmm0    # 0xc4060
jb 0x22e6e
sqrtsd %xmm0, %xmm0
jmp 0x22e73
callq 0x1f590
leaq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x42786
leaq 0x103969(%rip), %rdi    # 0x1267f8
movq %rbx, %rsi
callq 0x42576
movsd 0xa0(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x22eb0
sqrtsd %xmm0, %xmm0
jmp 0x22eb5
callq 0x1f590
leaq 0x60(%rsp), %rsi
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x42786
leaq 0x10393f(%rip), %rdi    # 0x126810
movq %rbx, %rsi
callq 0x42576
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movss 0xa1121(%rip), %xmm0    # 0xc400c
callq 0x1fe90
movss 0xa110c(%rip), %xmm0    # 0xc4004
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x1038bc(%rip), %rsi    # 0x1267d0
leaq 0x1038c5(%rip), %rbx    # 0x1267e0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41d77
movq %r14, %rdi
callq 0x1f180
movq 0x103896(%rip), %rsi    # 0x1267d0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4169b
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
movss 0xa109f(%rip), %xmm1    # 0xc4004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x103855(%rip), %rsi    # 0x1267d0
leaq 0x103876(%rip), %rbx    # 0x1267f8
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41d77
movq %r14, %rdi
callq 0x1f180
movq 0x10382f(%rip), %rsi    # 0x1267d0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4169b
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movss 0xa1038(%rip), %xmm2    # 0xc4004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x1037ee(%rip), %rsi    # 0x1267d0
leaq 0x103827(%rip), %rbx    # 0x126810
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41d77
movq %r14, %rdi
callq 0x1f180
movq 0x1037c8(%rip), %rsi    # 0x1267d0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4169b
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
movss 0xa0fd7(%rip), %xmm0    # 0xc4004
callq 0x1fe90
cmpq $0x0, 0x1037f6(%rip)    # 0x126830
jne 0x23053
callq 0x87a1e
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xfe823(%rip), %esi     # 0x12187c
movl 0xfe821(%rip), %edx     # 0x121880
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0x7e4ce
movq %rbx, %rdi
callq 0x7ef58
movq 0x1037b0(%rip), %rsi    # 0x126830
leaq 0x30(%rsp), %rdi
callq 0x8034c
movl 0x1036f8(%rip), %edi    # 0x126788
callq 0x8dcc2
xorl %edi, %edi
callq 0x1f930
leaq 0x103785(%rip), %rdi    # 0x126828
callq 0x1fe80
testl %eax, %eax
je 0x22dc9
xorl %ebx, %ebx
leaq 0x103727(%rip), %r14    # 0x1267e0
leaq (%r14,%rbx), %rdi
callq 0x41de8
addq $0x18, %rbx
cmpq $0x48, %rbx
jne 0x230b9
leaq 0x103755(%rip), %rdi    # 0x126828
callq 0x1f4d0
jmp 0x22dc9
movq %rax, %rbx
leaq 0x103741(%rip), %rdi    # 0x126828
callq 0x1f4b0
jmp 0x2311c
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
callq 0x1f770
jmp 0x2311c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2cec0
jmp 0x2311c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x7e728
movq %rbx, %rdi
callq 0x1fe30