// File: tomfunkhouser[P]gaps/apps/conf2img/conf2img.cpp
// Function: Redraw()
static void
Redraw(void)
{
  // Statistics variables
  static RNTime start_time;
  if (current_image_index == -1) start_time.Read(); 
  char output_image_filename[4096];

  // Get camera and name for next image
  R3Point target_viewpoint;
  R3Vector target_towards, target_up;
  if (!LoadNextCamera(target_viewpoint, target_towards, target_up)) {
    if (print_verbose) {
      printf("  Time = %.2f seconds\n", start_time.Elapsed());
      printf("  # Images = %d\n", current_image_index);
      fflush(stdout);
    }
    exit(0);
  }

  // Get image name
  char image_name_buffer[2048];
  char *name = image_name_buffer;
  if (configuration.NImages() > 0) {
    RGBDImage *image = configuration.Image(current_image_index);
    const char *filename = image->DepthFilename();
    if (!filename) filename = image->ColorFilename();
    if (!filename) filename = "default";
    strncpy(image_name_buffer, filename, 2047);
    if (strrchr(image_name_buffer, '/')) name = strrchr(image_name_buffer, '/')+1;
    char *endp = strrchr(name, '.');
    if (endp) *endp = '\0';
  }
  else {
    sprintf(image_name_buffer, "%06d", current_image_index);
  }

  // Print debug statement
  if (print_debug) {
    printf("  Rendering %s ...\n", name);
    fflush(stdout);
  }

  // Create mask image
  R2Grid *mask_image = NULL;
  if (mask_by_filled_depth && !mesh.IsEmpty()) {
    // Get filled depth image
    RGBDImage *image = configuration.Image(current_image_index);
    if (!image->ReadDepthChannel()) RNAbort("Unable to read depth channel for %s", name);
    R2Grid filled_depth_image(*image->DepthChannel());
    if (!image->ReleaseDepthChannel()) RNAbort("Unable to release depth channel for %s", name);
    filled_depth_image.Substitute(0.0, R2_GRID_UNKNOWN_VALUE);
    filled_depth_image.FillHoles();

    // Get rendered depth image
    R2Grid rendered_depth_image(width, height);
    RenderMesh(mesh, BLACK_RENDERING, target_viewpoint, target_towards, target_up);
    if (!CaptureDepth(rendered_depth_image)) RNAbort("Unable to capture depth for %s", name);

    // Create mask
    mask_image = new R2Grid(width, height);
    for (int i = 0; i < width*height; i++) {
      RNScalar filled_depth_value = filled_depth_image.GridValue(i);
      if (filled_depth_value == R2_GRID_UNKNOWN_VALUE) continue;
      if (filled_depth_value == 0) continue;
      RNScalar rendered_depth_value = rendered_depth_image.GridValue(i);
      if (rendered_depth_value == R2_GRID_UNKNOWN_VALUE) continue;
      if (rendered_depth_value == 0) continue;
      RNScalar ratio = filled_depth_value / rendered_depth_value;
      if ((ratio < 0.8) || (ratio > 1.25)) continue;
      mask_image->SetGridValue(i, 1);
    }
  }

  // Capture and write depth image
  sprintf(output_image_filename, "%s/%s_depth.png", output_image_directory, name);
  if (capture_depth_images && !RNFileExists(output_image_filename)) {
    R2Grid depth_image(width, height);
    RenderConfiguration(configuration, target_viewpoint, target_towards, target_up);
    if (CaptureDepth(depth_image)) {
      depth_image.Multiply(png_distance_scale);
      depth_image.Threshold(65535, R2_GRID_KEEP_VALUE, 0);
      if (mask_image) depth_image.Mask(*mask_image);
      depth_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write color image
  sprintf(output_image_filename, "%s/%s_color.jpg", output_image_directory, name);
  if (capture_color_images && !RNFileExists(output_image_filename)) {
    R2Image color_image(width, height, 3);
    RenderConfiguration(configuration, target_viewpoint, target_towards, target_up);
    if (CaptureColor(color_image)) {
      sprintf(output_image_filename, "%s/%s_color.jpg", output_image_directory, name);
      color_image.Write(output_image_filename);
    }
  }

  // Capture and write mesh color image
  sprintf(output_image_filename, "%s/%s_mesh_color.jpg", output_image_directory, name);
  if (capture_mesh_color_images && !RNFileExists(output_image_filename)) {
    R2Image color_image(width, height, 3);
    RenderMesh(mesh, COLOR_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureColor(color_image)) {
      sprintf(output_image_filename, "%s/%s_mesh_color.jpg", output_image_directory, name);
      color_image.Write(output_image_filename);
    }
  }

  // Capture and write mesh depth image
  sprintf(output_image_filename, "%s/%s_mesh_depth.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_depth_images && !RNFileExists(output_image_filename)) {
    R2Grid depth_image(width, height);
    RenderMesh(mesh, BLACK_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureDepth(depth_image)) {
      depth_image.Multiply(png_distance_scale);
      depth_image.Threshold(65535, R2_GRID_KEEP_VALUE, 0);
      if (mask_image) depth_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_depth.png", output_image_directory, name);
      depth_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh position images (in camera coordinates)
  sprintf(output_image_filename, "%s/%s_mesh_pz.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_position_images && !RNFileExists(output_image_filename)) {
    R2Grid position_image(width, height);
    RenderMesh(mesh, CAMERA_PX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_px.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, CAMERA_PY_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_py.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, CAMERA_PZ_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_pz.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh position images (in world coordinates)
  sprintf(output_image_filename, "%s/%s_mesh_wpz.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_wposition_images && !RNFileExists(output_image_filename)) {
    R2Grid position_image(width, height);
    RenderMesh(mesh, WORLD_PX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wpx.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, WORLD_PY_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wpy.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, WORLD_PZ_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(position_image)) {
      if (mask_image) position_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wpz.png", output_image_directory, name);
      position_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh normal images (in camera coordinates)
  sprintf(output_image_filename, "%s/%s_mesh_nd.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_normal_images && !RNFileExists(output_image_filename)) {
    R2Grid normal_image(width, height);
    RenderMesh(mesh, CAMERA_NX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_nx.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, CAMERA_NY_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_ny.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, CAMERA_NZ_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_nz.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, CAMERA_ND_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_nd.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh normal images (in world coordinates)
  sprintf(output_image_filename, "%s/%s_mesh_wnd.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_wnormal_images && !RNFileExists(output_image_filename)) {
    R2Grid normal_image(width, height);
    RenderMesh(mesh, WORLD_NX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wnx.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, WORLD_NY_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wny.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, WORLD_NZ_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wnz.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
    RenderMesh(mesh, WORLD_ND_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(normal_image)) {
      if (mask_image) normal_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_wnd.png", output_image_directory, name);
      normal_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh ndotv image
  sprintf(output_image_filename, "%s/%s_mesh_ndotv.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_ndotv_images && !RNFileExists(output_image_filename)) {
    R2Grid ndotv_image(width, height);
    RenderMesh(mesh, NDOTV_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(ndotv_image)) {
      if (mask_image) ndotv_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_ndotv.png", output_image_directory, name);
      ndotv_image.WriteFile(output_image_filename);
    }
  }
  
  // Capture and write mesh face ID image
  sprintf(output_image_filename, "%s/%s_mesh_face.pfm", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_face_images && !RNFileExists(output_image_filename)) {
    R2Grid face_image(width, height);
    RenderMesh(mesh, FACE_INDEX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(face_image)) {
      if (mask_image) face_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_face.pfm", output_image_directory, name);
      face_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh material ID image
  sprintf(output_image_filename, "%s/%s_mesh_material.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_material_images && !RNFileExists(output_image_filename)) {
    R2Grid material_image(width, height);
    RenderMesh(mesh, FACE_MATERIAL_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(material_image)) {
      if (mask_image) material_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_material.png", output_image_directory, name);
      material_image.WriteFile(output_image_filename);
    }
  }

  // Capture and write mesh segment ID image
  sprintf(output_image_filename, "%s/%s_mesh_segment.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_segment_images && !RNFileExists(output_image_filename)) {
    R2Grid face_image(width, height);
    RenderMesh(mesh, FACE_INDEX_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(face_image)) {
      if (mask_image) face_image.Mask(*mask_image);
      R2Image segment_image(width, height, 3);
      for (int ix = 0; ix < width; ix++) {
        for (int iy = 0; iy < height; iy++) { 
          RNScalar face_value = face_image.GridValue(ix, iy);
          if ((face_value == R2_GRID_UNKNOWN_VALUE) || (face_value == 0)) continue;
          int face_index = (int) (face_value - 1.0 + 0.5);
          assert((face_index >= 0) && (face_index < mesh.NFaces()));
          R3MeshFace *face = mesh.Face(face_index);
          int segment = mesh.FaceSegment(face);
          if (segment < 0) continue;
          int region_index = (segment / 1000000) + 1;
          assert(region_index < 256);
          int object_index = (segment % 1000000) + 1;
          assert((object_index >> 8) < 256);
          unsigned char pixel[4];
          pixel[0] = region_index;
          pixel[1] = (object_index>>8) & 0xFF;
          pixel[2] = object_index & 0xFF;
          segment_image.SetPixel(ix, iy, pixel);
        }
      }
      segment_image.Write(output_image_filename);
    }
  }

  // Capture and write mesh category ID image
  sprintf(output_image_filename, "%s/%s_mesh_category.png", output_image_directory, name);
  if (!mesh.IsEmpty() && capture_mesh_category_images && !RNFileExists(output_image_filename)) {
    R2Grid category_image(width, height);
    RenderMesh(mesh, FACE_CATEGORY_RENDERING, target_viewpoint, target_towards, target_up);
    if (CaptureInteger(category_image)) {
      if (mask_image) category_image.Mask(*mask_image);
      sprintf(output_image_filename, "%s/%s_mesh_category.png", output_image_directory, name);
      category_image.WriteFile(output_image_filename);
    }
  }

  // Delete mask image
  if (mask_image) delete mask_image;
    
#ifdef USE_GLUT
  // Redraw
  glutPostRedisplay();
#endif
}

// Assembly:
subq $0x2548, %rsp           # imm = 0x2548
cmpb $0x0, 0x22985a(%rip)    # 0x255e18
jne 0x2c5eb
leaq 0x229851(%rip), %rdi    # 0x255e18
callq 0x25310
cmpl $0x0, %eax
je 0x2c5eb
leaq 0x229830(%rip), %rdi    # 0x255e08
callq 0x13fe80
jmp 0x2c5df
leaq 0x229832(%rip), %rdi    # 0x255e18
callq 0x24670
cmpl $-0x1, 0x2234c2(%rip)   # 0x24fab4
jne 0x2c627
leaq 0x22980d(%rip), %rdi    # 0x255e08
callq 0x30490
jmp 0x2c627
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x2297fb(%rip), %rdi    # 0x255e18
callq 0x24650
jmp 0x2e6e9
leaq 0x1518(%rsp), %rdi
callq 0x1058f0
leaq 0x1500(%rsp), %rdi
callq 0x106a50
leaq 0x14e8(%rsp), %rdi
callq 0x106a50
leaq 0x1518(%rsp), %rdi
leaq 0x1500(%rsp), %rsi
leaq 0x14e8(%rsp), %rdx
callq 0x2e700
cmpl $0x0, %eax
jne 0x2c6bd
cmpl $0x0, 0x229711(%rip)    # 0x255d88
je 0x2c6b6
leaq 0x229788(%rip), %rdi    # 0x255e08
callq 0x13ff40
leaq 0x1b2d51(%rip), %rdi    # 0x1df3dd
movb $0x1, %al
callq 0x24090
movl 0x22341b(%rip), %esi    # 0x24fab4
leaq 0x1b2d54(%rip), %rdi    # 0x1df3f4
movb $0x0, %al
callq 0x24090
movq 0x2228e2(%rip), %rax    # 0x24ef90
movq (%rax), %rdi
callq 0x24c10
xorl %edi, %edi
callq 0x24c70
leaq 0xce0(%rsp), %rax
movq %rax, 0xcd8(%rsp)
leaq 0x2294b4(%rip), %rdi    # 0x255b88
callq 0x304b0
cmpl $0x0, %eax
jle 0x2c7cd
movl 0x2233cc(%rip), %esi    # 0x24fab4
leaq 0x229499(%rip), %rdi    # 0x255b88
callq 0x304d0
movq %rax, 0xcd0(%rsp)
movq 0xcd0(%rsp), %rdi
callq 0x306c0
movq %rax, 0xcc8(%rsp)
cmpq $0x0, 0xcc8(%rsp)
jne 0x2c731
movq 0xcd0(%rsp), %rdi
callq 0x306e0
movq %rax, 0xcc8(%rsp)
cmpq $0x0, 0xcc8(%rsp)
jne 0x2c74b
leaq 0x1b2d89(%rip), %rax    # 0x1df4cc
movq %rax, 0xcc8(%rsp)
leaq 0xce0(%rsp), %rdi
movq 0xcc8(%rsp), %rsi
movl $0x7ff, %edx            # imm = 0x7FF
callq 0x244a0
leaq 0xce0(%rsp), %rdi
movl $0x2f, %esi
callq 0x24b20
cmpq $0x0, %rax
je 0x2c79b
leaq 0xce0(%rsp), %rdi
movl $0x2f, %esi
callq 0x24b20
addq $0x1, %rax
movq %rax, 0xcd8(%rsp)
movq 0xcd8(%rsp), %rdi
movl $0x2e, %esi
callq 0x24b20
movq %rax, 0xcc0(%rsp)
cmpq $0x0, 0xcc0(%rsp)
je 0x2c7cb
movq 0xcc0(%rsp), %rax
movb $0x0, (%rax)
jmp 0x2c7e9
leaq 0xce0(%rsp), %rdi
movl 0x2232d9(%rip), %edx    # 0x24fab4
leaq 0x1b2eaf(%rip), %rsi    # 0x1df691
movb $0x0, %al
callq 0x24160
cmpl $0x0, 0x22959c(%rip)    # 0x255d8c
je 0x2c817
movq 0xcd8(%rsp), %rsi
leaq 0x1b2e95(%rip), %rdi    # 0x1df696
movb $0x0, %al
callq 0x24090
movq 0x222781(%rip), %rax    # 0x24ef90
movq (%rax), %rdi
callq 0x24c10
movq $0x0, 0xcb8(%rsp)
cmpl $0x0, 0x22956e(%rip)    # 0x255d98
je 0x2cbd8
leaq 0x2293f9(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2cbd8
movl 0x223269(%rip), %esi    # 0x24fab4
leaq 0x229336(%rip), %rdi    # 0x255b88
callq 0x304d0
movq %rax, 0xcb0(%rsp)
movq 0xcb0(%rsp), %rdi
movq (%rdi), %rax
callq *0x108(%rax)
cmpl $0x0, %eax
jne 0x2c88b
movq 0xcd8(%rsp), %rsi
leaq 0x1b2e26(%rip), %rdi    # 0x1df6aa
movb $0x0, %al
callq 0x144cf0
movq 0xcb0(%rsp), %rdi
callq 0x30700
movq %rax, %rsi
leaq 0xbe0(%rsp), %rdi
callq 0x118550
movq 0xcb0(%rsp), %rdi
movq (%rdi), %rax
movq 0x158(%rax), %rax
callq *%rax
movl %eax, 0x184(%rsp)
jmp 0x2c8c5
movl 0x184(%rsp), %eax
cmpl $0x0, %eax
jne 0x2c904
movq 0xcd8(%rsp), %rsi
leaq 0x1b2dee(%rip), %rdi    # 0x1df6ce
xorl %eax, %eax
callq 0x144cf0
jmp 0x2c8e9
jmp 0x2c904
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
jmp 0x2cbc6
leaq 0xbe0(%rsp), %rdi
xorps %xmm0, %xmm0
movsd 0x1b2739(%rip), %xmm1   # 0x1df050
callq 0x11f600
jmp 0x2c91e
leaq 0xbe0(%rsp), %rdi
callq 0x119e10
jmp 0x2c92d
movl 0x229469(%rip), %esi    # 0x255d9c
movl 0x229467(%rip), %edx    # 0x255da0
leaq 0xb10(%rsp), %rdi
callq 0x117390
jmp 0x2c948
leaq 0x2292e1(%rip), %rdi    # 0x255c30
xorl %esi, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2c970
leaq 0xb10(%rsp), %rdi
callq 0x2f780
movl %eax, 0x180(%rsp)
jmp 0x2c986
movl 0x180(%rsp), %eax
cmpl $0x0, %eax
jne 0x2c9c5
movq 0xcd8(%rsp), %rsi
leaq 0x1b2d54(%rip), %rdi    # 0x1df6f5
xorl %eax, %eax
callq 0x144cf0
jmp 0x2c9aa
jmp 0x2c9c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
jmp 0x2cbb9
movl $0xd0, %edi
callq 0x249f0
movq %rax, 0x178(%rsp)
jmp 0x2c9d9
movq 0x178(%rsp), %rdi
movl 0x2293b5(%rip), %esi    # 0x255d9c
movl 0x2293b3(%rip), %edx    # 0x255da0
callq 0x117390
jmp 0x2c9f4
movq 0x178(%rsp), %rax
movq %rax, 0xcb8(%rsp)
movl $0x0, 0xb0c(%rsp)
movl 0xb0c(%rsp), %eax
movl 0x229380(%rip), %ecx    # 0x255d9c
imull 0x22937d(%rip), %ecx    # 0x255da0
cmpl %ecx, %eax
jge 0x2cb9d
movl 0xb0c(%rsp), %esi
leaq 0xbe0(%rsp), %rdi
callq 0x309d0
movsd %xmm0, 0x170(%rsp)
jmp 0x2ca4a
movsd 0x170(%rsp), %xmm0
movsd %xmm0, 0xb00(%rsp)
movsd 0xb00(%rsp), %xmm0
movsd 0x1b25e3(%rip), %xmm1   # 0x1df050
ucomisd %xmm1, %xmm0
jne 0x2caa5
jp 0x2caa5
jmp 0x2cb87
movq 0x178(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
movl $0xd0, %esi
callq 0x24a10
jmp 0x2cbb9
movsd 0xb00(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2cabe
jp 0x2cabe
jmp 0x2cb87
movl 0xb0c(%rsp), %esi
leaq 0xb10(%rsp), %rdi
callq 0x309d0
movsd %xmm0, 0x168(%rsp)
jmp 0x2cadd
movsd 0x168(%rsp), %xmm0
movsd %xmm0, 0xaf8(%rsp)
movsd 0xaf8(%rsp), %xmm0
movsd 0x1b2550(%rip), %xmm1   # 0x1df050
ucomisd %xmm1, %xmm0
jne 0x2cb0a
jp 0x2cb0a
jmp 0x2cb87
movsd 0xaf8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2cb20
jp 0x2cb20
jmp 0x2cb87
movsd 0xb00(%rsp), %xmm0
divsd 0xaf8(%rsp), %xmm0
movsd %xmm0, 0xaf0(%rsp)
movsd 0x1b2515(%rip), %xmm0   # 0x1df058
ucomisd 0xaf0(%rsp), %xmm0
ja 0x2cb65
movsd 0xaf0(%rsp), %xmm0
movsd 0x1b2501(%rip), %xmm1   # 0x1df060
ucomisd %xmm1, %xmm0
jbe 0x2cb67
jmp 0x2cb87
movq 0xcb8(%rsp), %rdi
movl 0xb0c(%rsp), %esi
movsd 0x1b24aa(%rip), %xmm0   # 0x1df028
callq 0x309f0
jmp 0x2cb85
jmp 0x2cb87
movl 0xb0c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0c(%rsp)
jmp 0x2ca0f
leaq 0xb10(%rsp), %rdi
callq 0x118840
leaq 0xbe0(%rsp), %rdi
callq 0x118840
jmp 0x2cbd8
leaq 0xb10(%rsp), %rdi
callq 0x118840
leaq 0xbe0(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
leaq 0x1530(%rsp), %rdi
movq 0x229199(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b28de(%rip), %rsi    # 0x1df4d4
movb $0x0, %al
callq 0x24160
cmpl $0x0, 0x2291d4(%rip)    # 0x255dd8
je 0x2cd3e
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2cd3e
movl 0x229176(%rip), %esi    # 0x255d9c
movl 0x229174(%rip), %edx    # 0x255da0
leaq 0xa20(%rsp), %rdi
callq 0x117390
leaq 0x228f48(%rip), %rdi    # 0x255b88
leaq 0x1518(%rsp), %rsi
leaq 0x1500(%rsp), %rdx
leaq 0x14e8(%rsp), %rcx
movsd 0x1b23b0(%rip), %xmm0   # 0x1df010
movsd 0x1b2400(%rip), %xmm1   # 0x1df068
callq 0x2fa10
jmp 0x2cc6f
leaq 0xa20(%rsp), %rdi
callq 0x2f780
movl %eax, 0x164(%rsp)
jmp 0x2cc85
movl 0x164(%rsp), %eax
cmpl $0x0, %eax
je 0x2cd31
movsd 0x222e0b(%rip), %xmm0   # 0x24faa8
leaq 0xa20(%rsp), %rdi
callq 0x11f930
jmp 0x2ccac
leaq 0xa20(%rsp), %rdi
movsd 0x1b2384(%rip), %xmm0   # 0x1df040
movsd 0x1b2374(%rip), %xmm1   # 0x1df038
xorps %xmm2, %xmm2
callq 0x11b730
jmp 0x2ccce
cmpq $0x0, 0xcb8(%rsp)
je 0x2cd18
movq 0xcb8(%rsp), %rsi
leaq 0xa20(%rsp), %rdi
callq 0x11fd10
jmp 0x2ccf0
jmp 0x2cd18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0xa20(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
leaq 0xa20(%rsp), %rdi
leaq 0x1530(%rsp), %rsi
callq 0x128850
jmp 0x2cd2f
jmp 0x2cd31
leaq 0xa20(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x229033(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b29b8(%rip), %rsi    # 0x1df714
movb $0x0, %al
callq 0x24160
cmpl $0x0, 0x22906a(%rip)    # 0x255dd4
je 0x2ce75
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2ce75
movl 0x229010(%rip), %esi    # 0x255d9c
movl 0x22900e(%rip), %edx    # 0x255da0
leaq 0xa08(%rsp), %rdi
movl $0x3, %ecx
callq 0x137050
leaq 0x228ddd(%rip), %rdi    # 0x255b88
leaq 0x1518(%rsp), %rsi
leaq 0x1500(%rsp), %rdx
leaq 0x14e8(%rsp), %rcx
movsd 0x1b2245(%rip), %xmm0   # 0x1df010
movsd 0x1b2295(%rip), %xmm1   # 0x1df068
callq 0x2fa10
jmp 0x2cdda
leaq 0xa08(%rsp), %rdi
callq 0x30130
movl %eax, 0x160(%rsp)
jmp 0x2cdf0
movl 0x160(%rsp), %eax
cmpl $0x0, %eax
je 0x2ce68
movq 0x228f7d(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b2902(%rip), %rsi    # 0x1df714
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0x24160
movq 0x158(%rsp), %rsi
leaq 0xa08(%rsp), %rdi
callq 0x30a20
jmp 0x2ce40
jmp 0x2ce68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0xa08(%rsp), %rdi
callq 0x137570
jmp 0x2e6e9
leaq 0xa08(%rsp), %rdi
callq 0x137570
leaq 0x1530(%rsp), %rdi
movq 0x228efc(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b2891(%rip), %rsi    # 0x1df724
movb $0x0, %al
callq 0x24160
cmpl $0x0, 0x228f3b(%rip)    # 0x255ddc
je 0x2cfa1
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2cfa1
movl 0x228ed9(%rip), %esi    # 0x255d9c
movl 0x228ed7(%rip), %edx    # 0x255da0
leaq 0x9f0(%rsp), %rdi
movl $0x3, %ecx
callq 0x137050
leaq 0x228d4e(%rip), %rdi    # 0x255c30
movl $0x1, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2cf06
leaq 0x9f0(%rsp), %rdi
callq 0x30130
movl %eax, 0x154(%rsp)
jmp 0x2cf1c
movl 0x154(%rsp), %eax
cmpl $0x0, %eax
je 0x2cf94
movq 0x228e51(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b27e6(%rip), %rsi    # 0x1df724
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x148(%rsp)
callq 0x24160
movq 0x148(%rsp), %rsi
leaq 0x9f0(%rsp), %rdi
callq 0x30a20
jmp 0x2cf6c
jmp 0x2cf94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x9f0(%rsp), %rdi
callq 0x137570
jmp 0x2e6e9
leaq 0x9f0(%rsp), %rdi
callq 0x137570
leaq 0x1530(%rsp), %rdi
movq 0x228dd0(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b277a(%rip), %rsi    # 0x1df739
movb $0x0, %al
callq 0x24160
leaq 0x228c63(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2d13b
cmpl $0x0, 0x228dfe(%rip)    # 0x255de0
je 0x2d13b
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2d13b
movl 0x228d98(%rip), %esi    # 0x255d9c
movl 0x228d96(%rip), %edx    # 0x255da0
leaq 0x920(%rsp), %rdi
callq 0x117390
leaq 0x228c12(%rip), %rdi    # 0x255c30
xorl %esi, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d03f
leaq 0x920(%rsp), %rdi
callq 0x2f780
movl %eax, 0x144(%rsp)
jmp 0x2d055
movl 0x144(%rsp), %eax
cmpl $0x0, %eax
je 0x2d12e
movsd 0x222a3b(%rip), %xmm0   # 0x24faa8
leaq 0x920(%rsp), %rdi
callq 0x11f930
jmp 0x2d07c
leaq 0x920(%rsp), %rdi
movsd 0x1b1fb4(%rip), %xmm0   # 0x1df040
movsd 0x1b1fa4(%rip), %xmm1   # 0x1df038
xorps %xmm2, %xmm2
callq 0x11b730
jmp 0x2d09e
cmpq $0x0, 0xcb8(%rsp)
je 0x2d0e8
movq 0xcb8(%rsp), %rsi
leaq 0x920(%rsp), %rdi
callq 0x11fd10
jmp 0x2d0c0
jmp 0x2d0e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x920(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x228c91(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b263b(%rip), %rsi    # 0x1df739
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x138(%rsp)
callq 0x24160
movq 0x138(%rsp), %rsi
leaq 0x920(%rsp), %rdi
callq 0x128850
jmp 0x2d12c
jmp 0x2d12e
leaq 0x920(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x228c36(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b25f5(%rip), %rsi    # 0x1df74e
movb $0x0, %al
callq 0x24160
leaq 0x228ac9(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2d40d
cmpl $0x0, 0x228c68(%rip)    # 0x255de4
je 0x2d40d
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2d40d
movl 0x228bfe(%rip), %esi    # 0x255d9c
movl 0x228bfc(%rip), %edx    # 0x255da0
leaq 0x850(%rsp), %rdi
callq 0x117390
leaq 0x228a78(%rip), %rdi    # 0x255c30
movl $0x6, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d1dc
leaq 0x850(%rsp), %rdi
callq 0x30150
movl %eax, 0x134(%rsp)
jmp 0x2d1f2
movl 0x134(%rsp), %eax
cmpl $0x0, %eax
je 0x2d292
cmpq $0x0, 0xcb8(%rsp)
je 0x2d24c
movq 0xcb8(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x11fd10
jmp 0x2d224
jmp 0x2d24c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x850(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x228b2d(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b24fe(%rip), %rsi    # 0x1df760
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x128(%rsp)
callq 0x24160
movq 0x128(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x128850
jmp 0x2d290
jmp 0x2d292
leaq 0x228997(%rip), %rdi    # 0x255c30
movl $0x7, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d2bd
leaq 0x850(%rsp), %rdi
callq 0x30150
movl %eax, 0x124(%rsp)
jmp 0x2d2d3
movl 0x124(%rsp), %eax
cmpl $0x0, %eax
je 0x2d349
cmpq $0x0, 0xcb8(%rsp)
je 0x2d303
movq 0xcb8(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x11fd10
jmp 0x2d301
jmp 0x2d303
movq 0x228a76(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b2459(%rip), %rsi    # 0x1df772
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x24160
movq 0x118(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x128850
jmp 0x2d347
jmp 0x2d349
leaq 0x2288e0(%rip), %rdi    # 0x255c30
movl $0x8, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d374
leaq 0x850(%rsp), %rdi
callq 0x30150
movl %eax, 0x114(%rsp)
jmp 0x2d38a
movl 0x114(%rsp), %eax
cmpl $0x0, %eax
je 0x2d400
cmpq $0x0, 0xcb8(%rsp)
je 0x2d3ba
movq 0xcb8(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x11fd10
jmp 0x2d3b8
jmp 0x2d3ba
movq 0x2289bf(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b237e(%rip), %rsi    # 0x1df74e
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x24160
movq 0x108(%rsp), %rsi
leaq 0x850(%rsp), %rdi
callq 0x128850
jmp 0x2d3fe
jmp 0x2d400
leaq 0x850(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x228964(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b2359(%rip), %rsi    # 0x1df784
movb $0x0, %al
callq 0x24160
leaq 0x2287f7(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2d6df
cmpl $0x0, 0x22899a(%rip)    # 0x255de8
je 0x2d6df
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2d6df
movl 0x22892c(%rip), %esi    # 0x255d9c
movl 0x22892a(%rip), %edx    # 0x255da0
leaq 0x780(%rsp), %rdi
callq 0x117390
leaq 0x2287a6(%rip), %rdi    # 0x255c30
movl $0x9, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d4ae
leaq 0x780(%rsp), %rdi
callq 0x30150
movl %eax, 0x104(%rsp)
jmp 0x2d4c4
movl 0x104(%rsp), %eax
cmpl $0x0, %eax
je 0x2d564
cmpq $0x0, 0xcb8(%rsp)
je 0x2d51e
movq 0xcb8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x11fd10
jmp 0x2d4f6
jmp 0x2d51e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x780(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x22885b(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b2263(%rip), %rsi    # 0x1df797
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x24160
movq 0xf8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x128850
jmp 0x2d562
jmp 0x2d564
leaq 0x2286c5(%rip), %rdi    # 0x255c30
movl $0xa, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d58f
leaq 0x780(%rsp), %rdi
callq 0x30150
movl %eax, 0xf4(%rsp)
jmp 0x2d5a5
movl 0xf4(%rsp), %eax
cmpl $0x0, %eax
je 0x2d61b
cmpq $0x0, 0xcb8(%rsp)
je 0x2d5d5
movq 0xcb8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x11fd10
jmp 0x2d5d3
jmp 0x2d5d5
movq 0x2287a4(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b21bf(%rip), %rsi    # 0x1df7aa
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x24160
movq 0xe8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x128850
jmp 0x2d619
jmp 0x2d61b
leaq 0x22860e(%rip), %rdi    # 0x255c30
movl $0xb, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d646
leaq 0x780(%rsp), %rdi
callq 0x30150
movl %eax, 0xe4(%rsp)
jmp 0x2d65c
movl 0xe4(%rsp), %eax
cmpl $0x0, %eax
je 0x2d6d2
cmpq $0x0, 0xcb8(%rsp)
je 0x2d68c
movq 0xcb8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x11fd10
jmp 0x2d68a
jmp 0x2d68c
movq 0x2286ed(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b20e2(%rip), %rsi    # 0x1df784
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x24160
movq 0xd8(%rsp), %rsi
leaq 0x780(%rsp), %rdi
callq 0x128850
jmp 0x2d6d0
jmp 0x2d6d2
leaq 0x780(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x228692(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b20c0(%rip), %rsi    # 0x1df7bd
movb $0x0, %al
callq 0x24160
leaq 0x228525(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2da68
cmpl $0x0, 0x2286cc(%rip)    # 0x255dec
je 0x2da68
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2da68
movl 0x22865a(%rip), %esi    # 0x255d9c
movl 0x228658(%rip), %edx    # 0x255da0
leaq 0x6b0(%rsp), %rdi
callq 0x117390
leaq 0x2284d4(%rip), %rdi    # 0x255c30
movl $0xc, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d780
leaq 0x6b0(%rsp), %rdi
callq 0x30150
movl %eax, 0xd4(%rsp)
jmp 0x2d796
movl 0xd4(%rsp), %eax
cmpl $0x0, %eax
je 0x2d836
cmpq $0x0, 0xcb8(%rsp)
je 0x2d7f0
movq 0xcb8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x11fd10
jmp 0x2d7c8
jmp 0x2d7f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x6b0(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x228589(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1fc9(%rip), %rsi    # 0x1df7cf
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x24160
movq 0xc8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x128850
jmp 0x2d834
jmp 0x2d836
leaq 0x2283f3(%rip), %rdi    # 0x255c30
movl $0xd, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d861
leaq 0x6b0(%rsp), %rdi
callq 0x30150
movl %eax, 0xc4(%rsp)
jmp 0x2d877
movl 0xc4(%rsp), %eax
cmpl $0x0, %eax
je 0x2d8ed
cmpq $0x0, 0xcb8(%rsp)
je 0x2d8a7
movq 0xcb8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x11fd10
jmp 0x2d8a5
jmp 0x2d8a7
movq 0x2284d2(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1f24(%rip), %rsi    # 0x1df7e1
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x24160
movq 0xb8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x128850
jmp 0x2d8eb
jmp 0x2d8ed
leaq 0x22833c(%rip), %rdi    # 0x255c30
movl $0xe, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d918
leaq 0x6b0(%rsp), %rdi
callq 0x30150
movl %eax, 0xb4(%rsp)
jmp 0x2d92e
movl 0xb4(%rsp), %eax
cmpl $0x0, %eax
je 0x2d9a4
cmpq $0x0, 0xcb8(%rsp)
je 0x2d95e
movq 0xcb8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x11fd10
jmp 0x2d95c
jmp 0x2d95e
movq 0x22841b(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1e7f(%rip), %rsi    # 0x1df7f3
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x24160
movq 0xa8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x128850
jmp 0x2d9a2
jmp 0x2d9a4
leaq 0x228285(%rip), %rdi    # 0x255c30
movl $0xf, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2d9cf
leaq 0x6b0(%rsp), %rdi
callq 0x30150
movl %eax, 0xa4(%rsp)
jmp 0x2d9e5
movl 0xa4(%rsp), %eax
cmpl $0x0, %eax
je 0x2da5b
cmpq $0x0, 0xcb8(%rsp)
je 0x2da15
movq 0xcb8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x11fd10
jmp 0x2da13
jmp 0x2da15
movq 0x228364(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1d92(%rip), %rsi    # 0x1df7bd
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x24160
movq 0x98(%rsp), %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x128850
jmp 0x2da59
jmp 0x2da5b
leaq 0x6b0(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x228309(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1d7f(%rip), %rsi    # 0x1df805
movb $0x0, %al
callq 0x24160
leaq 0x22819c(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2ddd3
cmpl $0x0, 0x228347(%rip)    # 0x255df0
je 0x2ddd3
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2ddd3
movl 0x2282d1(%rip), %esi    # 0x255d9c
movl 0x2282cf(%rip), %edx    # 0x255da0
leaq 0x5e0(%rsp), %rdi
callq 0x117390
leaq 0x22814b(%rip), %rdi    # 0x255c30
movl $0x10, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2db09
leaq 0x5e0(%rsp), %rdi
callq 0x30150
movl %eax, 0x94(%rsp)
jmp 0x2db1f
movl 0x94(%rsp), %eax
cmpl $0x0, %eax
je 0x2dbbf
cmpq $0x0, 0xcb8(%rsp)
je 0x2db79
movq 0xcb8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x11fd10
jmp 0x2db51
jmp 0x2db79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x228200(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1c89(%rip), %rsi    # 0x1df818
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x24160
movq 0x88(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x128850
jmp 0x2dbbd
jmp 0x2dbbf
leaq 0x22806a(%rip), %rdi    # 0x255c30
movl $0x11, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2dbea
leaq 0x5e0(%rsp), %rdi
callq 0x30150
movl %eax, 0x84(%rsp)
jmp 0x2dc00
movl 0x84(%rsp), %eax
cmpl $0x0, %eax
je 0x2dc70
cmpq $0x0, 0xcb8(%rsp)
je 0x2dc30
movq 0xcb8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x11fd10
jmp 0x2dc2e
jmp 0x2dc30
movq 0x228149(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1be5(%rip), %rsi    # 0x1df82b
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x24160
movq 0x78(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x128850
jmp 0x2dc6e
jmp 0x2dc70
leaq 0x227fb9(%rip), %rdi    # 0x255c30
movl $0x12, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2dc9b
leaq 0x5e0(%rsp), %rdi
callq 0x30150
movl %eax, 0x74(%rsp)
jmp 0x2dcae
movl 0x74(%rsp), %eax
cmpl $0x0, %eax
je 0x2dd1b
cmpq $0x0, 0xcb8(%rsp)
je 0x2dcdb
movq 0xcb8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x11fd10
jmp 0x2dcd9
jmp 0x2dcdb
movq 0x22809e(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1b4d(%rip), %rsi    # 0x1df83e
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x24160
movq 0x68(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x128850
jmp 0x2dd19
jmp 0x2dd1b
leaq 0x227f0e(%rip), %rdi    # 0x255c30
movl $0x13, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2dd46
leaq 0x5e0(%rsp), %rdi
callq 0x30150
movl %eax, 0x64(%rsp)
jmp 0x2dd59
movl 0x64(%rsp), %eax
cmpl $0x0, %eax
je 0x2ddc6
cmpq $0x0, 0xcb8(%rsp)
je 0x2dd86
movq 0xcb8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x11fd10
jmp 0x2dd84
jmp 0x2dd86
movq 0x227ff3(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1a69(%rip), %rsi    # 0x1df805
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x24160
movq 0x58(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x128850
jmp 0x2ddc4
jmp 0x2ddc6
leaq 0x5e0(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x227f9e(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1a60(%rip), %rsi    # 0x1df851
movb $0x0, %al
callq 0x24160
leaq 0x227e31(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2df2b
cmpl $0x0, 0x227fe0(%rip)    # 0x255df4
je 0x2df2b
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2df2b
movl 0x227f66(%rip), %esi    # 0x255d9c
movl 0x227f64(%rip), %edx    # 0x255da0
leaq 0x510(%rsp), %rdi
callq 0x117390
leaq 0x227de0(%rip), %rdi    # 0x255c30
movl $0x14, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2de74
leaq 0x510(%rsp), %rdi
callq 0x30150
movl %eax, 0x54(%rsp)
jmp 0x2de87
movl 0x54(%rsp), %eax
cmpl $0x0, %eax
je 0x2df1e
cmpq $0x0, 0xcb8(%rsp)
je 0x2dede
movq 0xcb8(%rsp), %rsi
leaq 0x510(%rsp), %rdi
callq 0x11fd10
jmp 0x2deb6
jmp 0x2dede
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x510(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x227e9b(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b195d(%rip), %rsi    # 0x1df851
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x24160
movq 0x48(%rsp), %rsi
leaq 0x510(%rsp), %rdi
callq 0x128850
jmp 0x2df1c
jmp 0x2df1e
leaq 0x510(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x227e46(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b191d(%rip), %rsi    # 0x1df866
movb $0x0, %al
callq 0x24160
leaq 0x227cd9(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2e083
cmpl $0x0, 0x227e8c(%rip)    # 0x255df8
je 0x2e083
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2e083
movl 0x227e0e(%rip), %esi    # 0x255d9c
movl 0x227e0c(%rip), %edx    # 0x255da0
leaq 0x440(%rsp), %rdi
callq 0x117390
leaq 0x227c88(%rip), %rdi    # 0x255c30
movl $0x2, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2dfcc
leaq 0x440(%rsp), %rdi
callq 0x30150
movl %eax, 0x44(%rsp)
jmp 0x2dfdf
movl 0x44(%rsp), %eax
cmpl $0x0, %eax
je 0x2e076
cmpq $0x0, 0xcb8(%rsp)
je 0x2e036
movq 0xcb8(%rsp), %rsi
leaq 0x440(%rsp), %rdi
callq 0x11fd10
jmp 0x2e00e
jmp 0x2e036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x440(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x227d43(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b181a(%rip), %rsi    # 0x1df866
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x24160
movq 0x38(%rsp), %rsi
leaq 0x440(%rsp), %rdi
callq 0x128850
jmp 0x2e074
jmp 0x2e076
leaq 0x440(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x227cee(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b17d9(%rip), %rsi    # 0x1df87a
movb $0x0, %al
callq 0x24160
leaq 0x227b81(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2e1db
cmpl $0x0, 0x227d38(%rip)    # 0x255dfc
je 0x2e1db
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2e1db
movl 0x227cb6(%rip), %esi    # 0x255d9c
movl 0x227cb4(%rip), %edx    # 0x255da0
leaq 0x370(%rsp), %rdi
callq 0x117390
leaq 0x227b30(%rip), %rdi    # 0x255c30
movl $0x3, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2e124
leaq 0x370(%rsp), %rdi
callq 0x30150
movl %eax, 0x34(%rsp)
jmp 0x2e137
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
je 0x2e1ce
cmpq $0x0, 0xcb8(%rsp)
je 0x2e18e
movq 0xcb8(%rsp), %rsi
leaq 0x370(%rsp), %rdi
callq 0x11fd10
jmp 0x2e166
jmp 0x2e18e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x370(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x227beb(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b16d6(%rip), %rsi    # 0x1df87a
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x24160
movq 0x28(%rsp), %rsi
leaq 0x370(%rsp), %rdi
callq 0x128850
jmp 0x2e1cc
jmp 0x2e1ce
leaq 0x370(%rsp), %rdi
callq 0x118840
leaq 0x1530(%rsp), %rdi
movq 0x227b96(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b1699(%rip), %rsi    # 0x1df892
movb $0x0, %al
callq 0x24160
leaq 0x227a29(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2e54e
cmpl $0x0, 0x227be4(%rip)    # 0x255e00
je 0x2e54e
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2e54e
movl 0x227b5e(%rip), %esi    # 0x255d9c
movl 0x227b5c(%rip), %edx    # 0x255da0
leaq 0x2a0(%rsp), %rdi
callq 0x117390
leaq 0x2279d8(%rip), %rdi    # 0x255c30
movl $0x2, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2e27c
leaq 0x2a0(%rsp), %rdi
callq 0x30150
movl %eax, 0x24(%rsp)
jmp 0x2e28f
movl 0x24(%rsp), %eax
cmpl $0x0, %eax
je 0x2e52d
cmpq $0x0, 0xcb8(%rsp)
je 0x2e2d9
movq 0xcb8(%rsp), %rsi
leaq 0x2a0(%rsp), %rdi
callq 0x11fd10
jmp 0x2e2be
jmp 0x2e2d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
jmp 0x2e53c
movl 0x227abd(%rip), %esi    # 0x255d9c
movl 0x227abb(%rip), %edx    # 0x255da0
leaq 0x288(%rsp), %rdi
movl $0x3, %ecx
callq 0x137050
jmp 0x2e2f9
movl $0x0, 0x284(%rsp)
movl 0x284(%rsp), %eax
cmpl 0x227a8b(%rip), %eax    # 0x255d9c
jge 0x2e509
movl $0x0, 0x280(%rsp)
movl 0x280(%rsp), %eax
cmpl 0x227a71(%rip), %eax    # 0x255da0
jge 0x2e4f1
movl 0x284(%rsp), %esi
movl 0x280(%rsp), %edx
leaq 0x2a0(%rsp), %rdi
callq 0x30830
movsd %xmm0, 0x278(%rsp)
movsd 0x278(%rsp), %xmm0
movsd 0x1b0ce6(%rip), %xmm1   # 0x1df050
ucomisd %xmm1, %xmm0
jne 0x2e374
jp 0x2e374
jmp 0x2e388
movsd 0x278(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2e38d
jp 0x2e38d
jmp 0x2e4db
movsd 0x278(%rsp), %xmm0
movsd 0x1b0cd2(%rip), %xmm1   # 0x1df070
addsd %xmm1, %xmm0
movsd 0x1b0c6e(%rip), %xmm1   # 0x1df018
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x274(%rsp)
movl 0x274(%rsp), %esi
leaq 0x227869(%rip), %rdi    # 0x255c30
callq 0x30a50
movq %rax, 0x18(%rsp)
jmp 0x2e3d3
movq 0x18(%rsp), %rax
movq %rax, 0x268(%rsp)
movq 0x268(%rsp), %rsi
leaq 0x227841(%rip), %rdi    # 0x255c30
callq 0x30930
movl %eax, 0x264(%rsp)
cmpl $0x0, 0x264(%rsp)
jge 0x2e430
jmp 0x2e4db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x288(%rsp), %rdi
callq 0x137570
jmp 0x2e53c
movslq 0x264(%rsp), %rax
imulq $0x431bde83, %rax, %rax # imm = 0x431BDE83
movq %rax, %rcx
sarq $0x32, %rcx
movl %ecx, %edx
shrq $0x3f, %rax
movl %eax, %ecx
movl %edx, %eax
leal 0x1(%rax,%rcx), %eax
movl %eax, 0x260(%rsp)
movslq 0x264(%rsp), %rcx
movl %ecx, %eax
imulq $0x431bde83, %rcx, %rcx # imm = 0x431BDE83
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x32, %rcx
addl %edx, %ecx
imull $0xf4240, %ecx, %ecx    # imm = 0xF4240
subl %ecx, %eax
incl %eax
movl %eax, 0x25c(%rsp)
movb 0x260(%rsp), %al
movb %al, 0x258(%rsp)
movb 0x25d(%rsp), %al
movb %al, 0x259(%rsp)
movb 0x25c(%rsp), %al
movb %al, 0x25a(%rsp)
movl 0x284(%rsp), %esi
movl 0x280(%rsp), %edx
leaq 0x288(%rsp), %rdi
leaq 0x258(%rsp), %rcx
callq 0x1383e0
jmp 0x2e4d9
jmp 0x2e4db
movl 0x280(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x280(%rsp)
jmp 0x2e322
jmp 0x2e4f3
movl 0x284(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x284(%rsp)
jmp 0x2e304
leaq 0x288(%rsp), %rdi
leaq 0x1530(%rsp), %rsi
callq 0x30a20
jmp 0x2e520
leaq 0x288(%rsp), %rdi
callq 0x137570
leaq 0x2a0(%rsp), %rdi
callq 0x118840
jmp 0x2e54e
leaq 0x2a0(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
leaq 0x1530(%rsp), %rdi
movq 0x227823(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b133d(%rip), %rsi    # 0x1df8a9
movb $0x0, %al
callq 0x24160
leaq 0x2276b6(%rip), %rdi    # 0x255c30
callq 0x309b0
cmpl $0x0, %eax
jne 0x2e6a6
cmpl $0x0, 0x227875(%rip)    # 0x255e04
je 0x2e6a6
leaq 0x1530(%rsp), %rdi
callq 0x143be0
cmpl $0x0, %eax
jne 0x2e6a6
movl 0x2277eb(%rip), %esi    # 0x255d9c
movl 0x2277e9(%rip), %edx    # 0x255da0
leaq 0x188(%rsp), %rdi
callq 0x117390
leaq 0x227665(%rip), %rdi    # 0x255c30
movl $0x5, %esi
leaq 0x1518(%rsp), %rdx
leaq 0x1500(%rsp), %rcx
leaq 0x14e8(%rsp), %r8
callq 0x2e9a0
jmp 0x2e5ef
leaq 0x188(%rsp), %rdi
callq 0x30150
movl %eax, 0x14(%rsp)
jmp 0x2e602
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
je 0x2e699
cmpq $0x0, 0xcb8(%rsp)
je 0x2e659
movq 0xcb8(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x11fd10
jmp 0x2e631
jmp 0x2e659
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2540(%rsp)
movl %eax, 0x253c(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x118840
jmp 0x2e6e9
movq 0x227720(%rip), %rdx    # 0x255d80
movq 0xcd8(%rsp), %rcx
leaq 0x1b123a(%rip), %rsi    # 0x1df8a9
xorl %eax, %eax
leaq 0x1530(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x24160
movq 0x8(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x128850
jmp 0x2e697
jmp 0x2e699
leaq 0x188(%rsp), %rdi
callq 0x118840
cmpq $0x0, 0xcb8(%rsp)
je 0x2e6dc
movq 0xcb8(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x2e6da
movq (%rsp), %rdi
callq 0x118840
movq (%rsp), %rdi
movl $0xd0, %esi
callq 0x24a10
jmp 0x2e6dc
callq 0x1cb230
addq $0x2548, %rsp           # imm = 0x2548
retq
movq 0x2540(%rsp), %rdi
callq 0x25290
nopw %cs:(%rax,%rax)