// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movq 0x105219(%rip), %rdi    # 0x127790
addq $0x8, %rdi
xorl %esi, %esi
callq 0x267d0
cvtsd2ss 0x100296(%rip), %xmm0   # 0x122820
cvtsd2ss 0x10029e(%rip), %xmm1   # 0x122830
cvtsd2ss 0x1002a6(%rip), %xmm2   # 0x122840
movss 0xa2a62(%rip), %xmm3    # 0xc5004
callq 0x1fc10
movl $0x4100, %edi           # imm = 0x4100
callq 0x1f1a0
leaq 0x100298(%rip), %rdx    # 0x122850
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x1fe20
leaq 0x100292(%rip), %rdx    # 0x122860
movl $0x4001, %edi           # imm = 0x4001
movl $0x1203, %esi           # imm = 0x1203
callq 0x1fe20
cmpl $0x0, 0x1051b4(%rip)    # 0x127798
je 0x2290c
movss 0xa2a16(%rip), %xmm0    # 0xc5008
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 0x105167(%rip), %rbx    # 0x1277a0
cmpl $0x0, 0x24c(%rbx)
je 0x2265b
movq %rbx, %rdi
callq 0x33ef6
xorps %xmm1, %xmm1
cvtsi2sdl 0x24c(%rbx), %xmm1
divsd %xmm1, %xmm0
jmp 0x2265f
xorpd %xmm0, %xmm0
leaq 0x100952(%rip), %rax    # 0x122fb8
movsd (%rax), %xmm1
movapd 0xa29ae(%rip), %xmm2    # 0xc5020
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x22692
ucomisd %xmm0, %xmm1
jb 0x22692
movsd 0xa29b6(%rip), %xmm0    # 0xc5040
movapd %xmm0, 0x10(%rsp)
jmp 0x226d1
movq 0x105107(%rip), %rbx    # 0x1277a0
cmpl $0x0, 0x24c(%rbx)
je 0x226bb
movq %rbx, %rdi
callq 0x33ef6
xorps %xmm1, %xmm1
cvtsi2sdl 0x24c(%rbx), %xmm1
divsd %xmm1, %xmm0
jmp 0x226bf
xorpd %xmm0, %xmm0
movsd 0xa2981(%rip), %xmm1    # 0xc5048
divsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movq 0x1050c8(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x238(%rax)
jle 0x228d0
movapd 0x10(%rsp), %xmm0
xorpd 0xa292d(%rip), %xmm0    # 0xc5020
movapd %xmm0, 0x10(%rsp)
xorl %ebx, %ebx
movl $0xcccccccd, %r14d      # imm = 0xCCCCCCCD
movq 0x105098(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x23c(%rax)
jle 0x228bb
leal 0x1(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leal (,%rbx,8), %eax
subl %ebx, %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 0xa2909(%rip), %xmm1    # 0xc5050
movsd %xmm1, (%rsp)
subsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
xorl %r15d, %r15d
movq 0x105040(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x240(%rax)
jle 0x228a4
leal (,%r15,8), %ecx
subl %r15d, %ecx
movq %rcx, %rdx
imulq %r14, %rdx
shrq $0x22, %rdx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd 0xa28b9(%rip), %xmm0    # 0xc5050
movsd 0x68(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x78(%rsp)
leal 0x1(%r15), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
subsd (%rsp), %xmm1
movsd %xmm0, 0x8(%rsp)
subsd %xmm0, %xmm1
movsd %xmm1, 0x70(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x230(%rax), %rcx
movl 0x248(%rax), %edx
imull %r12d, %edx
movl 0x244(%rax), %eax
imull %r15d, %eax
addl %ebx, %edx
addl %eax, %edx
movslq %edx, %rax
movsd (%rcx,%rax,8), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x100072(%rip), %xmm1   # 0x122870
ucomisd %xmm0, %xmm1
jae 0x2288a
movl %ebp, %eax
imulq %r14, %rax
shrq $0x22, %rax
leal (%rax,%rax,4), %eax
movl %ebp, %r13d
subl %eax, %r13d
mulsd 0x10(%rsp), %xmm0
movsd 0xa2817(%rip), %xmm3    # 0xc5040
addsd %xmm3, %xmm0
subsd %xmm0, %xmm3
mulsd 0xa281f(%rip), %xmm3    # 0xc5058
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x1f2c0
xorps %xmm3, %xmm3
cvtsi2sd %r13d, %xmm3
divsd 0xa27fa(%rip), %xmm3    # 0xc5050
movsd 0x78(%rsp), %xmm0
subsd %xmm3, %xmm0
movsd 0x70(%rsp), %xmm1
leal 0x1(%r12), %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
subsd %xmm3, %xmm1
subsd (%rsp), %xmm2
subsd 0x8(%rsp), %xmm2
subsd %xmm3, %xmm2
callq 0x1fc50
incl %r12d
movq 0x104f0c(%rip), %rax    # 0x1277a0
addl $0x7, %ebp
cmpl 0x240(%rax), %r12d
jl 0x227cc
incl %r15d
movq 0x104ef2(%rip), %rax    # 0x1277a0
cmpl 0x23c(%rax), %r15d
jl 0x22759
incl %ebx
movq 0x104edc(%rip), %rax    # 0x1277a0
cmpl 0x238(%rax), %ebx
jl 0x22701
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 0xa26fd(%rip), %xmm0    # 0xc5004
callq 0x1f090
cmpl $0x0, 0x104e95(%rip)    # 0x1277a8
je 0x22a65
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa2715(%rip), %xmm2    # 0xc5040
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x1fc60
movq 0x104e63(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x238(%rax)
jle 0x22a65
xorl %ebp, %ebp
leaq 0x20(%rsp), %r14
leaq 0x507c90(%rip), %r15    # 0x52a5e8
movq 0x104e41(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x23c(%rax)
jle 0x22a50
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r13d, %r13d
movq 0x104e1d(%rip), %rax    # 0x1277a0
cmpl $0x0, 0x240(%rax)
jle 0x22a39
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, (%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 0xffe9e(%rip), %xmm1    # 0x122870
ucomisd %xmm1, %xmm0
jae 0x22a22
movq %r14, %rdi
leaq 0xa27a6(%rip), %rsi     # 0xc5188
movb $0x1, %al
callq 0x1f120
xorps %xmm2, %xmm2
cvtsi2sd %r12d, %xmm2
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x1f240
movb 0x20(%rsp), %al
testb %al, %al
je 0x22a22
leaq 0x21(%rsp), %rbx
movsbl %al, %esi
movq %r15, %rdi
callq 0x88afc
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x22a0e
incl %r12d
movq 0x104d74(%rip), %rax    # 0x1277a0
cmpl 0x240(%rax), %r12d
jl 0x229a0
incl %r13d
movq 0x104d5d(%rip), %rax    # 0x1277a0
cmpl 0x23c(%rax), %r13d
jl 0x2297c
incl %ebp
movq 0x104d47(%rip), %rax    # 0x1277a0
cmpl 0x238(%rax), %ebp
jl 0x22958
cmpl $0x0, 0xffe08(%rip)     # 0x122874
je 0x22ac0
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa25c0(%rip), %xmm0    # 0xc5040
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fc60
movl $0x408, %edi            # imm = 0x408
movl $0x1b01, %esi           # imm = 0x1B01
callq 0x1f5e0
movq 0x104cff(%rip), %rdi    # 0x1277a0
xorps %xmm0, %xmm0
cvtss2sd 0xffdc4(%rip), %xmm0    # 0x122870
callq 0x3fa40
movl $0x408, %edi            # imm = 0x408
movl $0x1b02, %esi           # imm = 0x1B02
callq 0x1f5e0
cmpl $0x0, 0x104ce5(%rip)    # 0x1277ac
jne 0x22adb
cmpl $0x0, 0x104ce0(%rip)    # 0x1277b0
jne 0x22adb
cmpl $0x0, 0x104cdb(%rip)    # 0x1277b4
je 0x22b55
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movsd 0xa2553(%rip), %xmm0    # 0xc5040
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x1fc60
cmpl $0x0, 0x104cad(%rip)    # 0x1277ac
je 0x22b15
movq 0x104c98(%rip), %rdi    # 0x1277a0
movl 0x104caa(%rip), %edx    # 0x1277b8
xorl %esi, %esi
callq 0x3fba8
cmpl $0x0, 0x104c94(%rip)    # 0x1277b0
je 0x22b35
movq 0x104c7b(%rip), %rdi    # 0x1277a0
movl 0x104c91(%rip), %edx    # 0x1277bc
movl $0x1, %esi
callq 0x3fba8
cmpl $0x0, 0x104c78(%rip)    # 0x1277b4
je 0x22b55
movq 0x104c5b(%rip), %rdi    # 0x1277a0
movl 0x104c75(%rip), %edx    # 0x1277c0
movl $0x2, %esi
callq 0x3fba8
cmpl $0x0, 0xffd1c(%rip)     # 0x122878
je 0x22bd1
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movq 0x104c23(%rip), %rax    # 0x1277a0
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 0x20(%rsp), %rbx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
callq 0x2c158
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2d3fc
leaq 0x20(%rsp), %rdi
callq 0x2cf10
cmpl $0x0, 0x104bec(%rip)    # 0x1277c4
je 0x22de6
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movss 0xa241c(%rip), %xmm0    # 0xc500c
callq 0x1fe90
movss 0xa2407(%rip), %xmm0    # 0xc5004
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x104b87(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa242c(%rip), %xmm3    # 0xc5058
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 0x104b46(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa23e0(%rip), %xmm3    # 0xc5058
mulsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
callq 0x1fa60
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movss 0xa235f(%rip), %xmm1    # 0xc5004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x104ae5(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa238a(%rip), %xmm3    # 0xc5058
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 0x104aa4(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa233e(%rip), %xmm3    # 0xc5058
mulsd %xmm3, %xmm0
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
mulsd %xmm3, %xmm2
callq 0x1fc50
callq 0x1fa60
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movss 0xa22bd(%rip), %xmm2    # 0xc5004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x104a43(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
movsd 0xa22e8(%rip), %xmm3    # 0xc5058
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 0x104a02(%rip), %rax    # 0x1277a0
xorps %xmm0, %xmm0
cvtsi2sdl 0x238(%rax), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x23c(%rax), %xmm1
movsd 0xa229c(%rip), %xmm2    # 0xc5058
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x240(%rax), %xmm2
callq 0x1fc50
callq 0x1fa60
movss 0xa2223(%rip), %xmm0    # 0xc5004
callq 0x1fe90
cmpl $0x0, 0x1049db(%rip)    # 0x1277c8
je 0x2306a
movb 0x104a2f(%rip), %al     # 0x127828
testb %al, %al
je 0x230d4
cmpq $0x0, 0x1049c7(%rip)    # 0x1277d0
jne 0x22f11
movl $0x18, %edi
callq 0x1f750
movq %rax, %r14
movq 0x10497d(%rip), %rsi    # 0x1277a0
movq %rax, %rdi
callq 0x345ae
movq %r14, 0x10499e(%rip)    # 0x1277d0
movq 0x104967(%rip), %rsi    # 0x1277a0
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rbx
movq %r14, %rdx
movq %rbx, %rcx
callq 0x346dc
movsd (%rbx), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x22e64
sqrtsd %xmm0, %xmm0
jmp 0x22e69
callq 0x1f590
leaq 0xa0(%rsp), %rbx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x42aae
leaq 0x10495b(%rip), %rdi    # 0x1277e0
movq %rbx, %rsi
callq 0x4288a
movsd 0x88(%rsp), %xmm0
ucomisd 0xa21c2(%rip), %xmm0    # 0xc5060
jb 0x22ea6
sqrtsd %xmm0, %xmm0
jmp 0x22eab
callq 0x1f590
leaq 0x38(%rsp), %rsi
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x42aae
leaq 0x104931(%rip), %rdi    # 0x1277f8
movq %rbx, %rsi
callq 0x4288a
movsd 0x90(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x22ee8
sqrtsd %xmm0, %xmm0
jmp 0x22eed
callq 0x1f590
leaq 0x50(%rsp), %rsi
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x42aae
leaq 0x104907(%rip), %rdi    # 0x127810
movq %rbx, %rsi
callq 0x4288a
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f1b0
movss 0xa20e9(%rip), %xmm0    # 0xc500c
callq 0x1fe90
movss 0xa20d4(%rip), %xmm0    # 0xc5004
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x104884(%rip), %rsi    # 0x1277d0
leaq 0x10488d(%rip), %rbx    # 0x1277e0
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4206d
movq %r14, %rdi
callq 0x1f180
movq 0x10485e(%rip), %rsi    # 0x1277d0
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41991
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
movss 0xa2067(%rip), %xmm1    # 0xc5004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x10481d(%rip), %rsi    # 0x1277d0
leaq 0x10483e(%rip), %rbx    # 0x1277f8
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4206d
movq %r14, %rdi
callq 0x1f180
movq 0x1047f7(%rip), %rsi    # 0x1277d0
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41991
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movss 0xa2000(%rip), %xmm2    # 0xc5004
callq 0x1fff0
movl $0x3, %edi
callq 0x1f160
movq 0x1047b6(%rip), %rsi    # 0x1277d0
leaq 0x1047ef(%rip), %rbx    # 0x127810
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4206d
movq %r14, %rdi
callq 0x1f180
movq 0x104790(%rip), %rsi    # 0x1277d0
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41991
movq %r14, %rdi
callq 0x1f180
callq 0x1fa60
movss 0xa1f9f(%rip), %xmm0    # 0xc5004
callq 0x1fe90
cmpq $0x0, 0x1047be(%rip)    # 0x127830
jne 0x2308b
callq 0x88a1c
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xff7eb(%rip), %esi     # 0x12287c
movl 0xff7e9(%rip), %edx     # 0x122880
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0x7f26e
movq %rbx, %rdi
callq 0x7fcf8
movq 0x104778(%rip), %rsi    # 0x127830
leaq 0x20(%rsp), %rdi
callq 0x810a8
movl 0x1046c0(%rip), %edi    # 0x127788
callq 0x8ed0c
xorl %edi, %edi
callq 0x1f930
leaq 0x10474d(%rip), %rdi    # 0x127828
callq 0x1fe80
testl %eax, %eax
je 0x22e01
xorl %ebx, %ebx
leaq 0x1046ef(%rip), %r14    # 0x1277e0
leaq (%r14,%rbx), %rdi
callq 0x420dc
addq $0x18, %rbx
cmpq $0x48, %rbx
jne 0x230f1
leaq 0x10471d(%rip), %rdi    # 0x127828
callq 0x1f4d0
jmp 0x22e01
movq %rax, %rbx
leaq 0x104709(%rip), %rdi    # 0x127828
callq 0x1f4b0
jmp 0x23154
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
callq 0x1f770
jmp 0x23154
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2cf10
jmp 0x23154
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7f4d6
movq %rbx, %rdi
callq 0x1fe30