// File: /workspace/github_c_makefile_star2_O0/radforddc[P]icpc_siggen/mjd_fieldgen.c
// Function: main
int main(int argc, char **argv)
{

  MJD_Siggen_Setup setup, setup1, setup2;

  float BV;      // bias voltage
  int   WV = 0;  // 0: do not write the V and E values to ppc_ev.dat
                 // 1: write the V and E values to ppc_ev.dat
                 // 2: write the V and E values for both +r, -r (for gnuplot, NOT for siggen)
  int   WD = 0;  // 0: do not write out depletion surface
                 // 1: write out depletion surface to depl_<HV>.dat

  int   i, j, k;
  FILE  *fp;


  if (argc < 2 || argc%2 != 0 || read_config(argv[1], &setup)) {
    printf("Usage: %s <config_file_name> [options]\n"
           "   Possible options:\n"
	   "      -b bias_volts\n"
	   "      -w {0,1}  (do_not/do write the field file)\n"
	   "      -d {0,1}  (do_not/do write the depletion surface)\n"
	   "      -p {0,1}  (do_not/do write the WP file)\n"
           "      -r rho_spectrum_file_name\n"
           "      -z <rho_spectrum_offset_mm>\n", argv[0]);
    return 1;
  }
  strncpy(setup.config_file_name, argv[1], sizeof(setup.config_file_name));

  if (setup.xtal_grid < 0.001) setup.xtal_grid = 0.5;
  BV = setup.xtal_HV;
  WV = setup.write_field;
  setup.rho_z_spe[0] = 0;

  for (i=2; i<argc-1; i++) {
    if (strstr(argv[i], "-b")) {
      BV = setup.xtal_HV = atof(argv[++i]);   // bias volts
    } else if (strstr(argv[i], "-w")) {
      WV = atoi(argv[++i]);               // write-out options
    } else if (strstr(argv[i], "-d")) {
      WD = atoi(argv[++i]);               // write-out options
    } else if (strstr(argv[i], "-p")) {
      setup.write_WP = atoi(argv[++i]);   // weighting-potential options
    } else if (strstr(argv[i], "-r")) {
      if (!(fp = fopen(argv[++i], "r"))) {   // impurity-profile-spectrum file name
        printf("\nERROR: cannot open impurity profile spectrum file %s\n\n", argv[i]);
        return 1;
      }
      if (strstr(argv[i], ".spe")) fread(setup.rho_z_spe, 36, 1, fp); // skip over .spe-format header
      for (j=0; j<1024; j++) setup.rho_z_spe[j] = 0;
      fread(setup.rho_z_spe, sizeof(setup.rho_z_spe), 1, fp);
      fclose(fp);
    } else if (strstr(argv[i], "-z")) {
      j = atoi(argv[++i]);
      if (j >= 199) {
        printf("Error; rho_spectrum_offset_mm = %d is too large! max = 200\n", j);
        return 1;
      }
      for (k=j; k <200; k++) setup.rho_z_spe[k-j] = setup.rho_z_spe[k];
    } else if (strstr(argv[i], "-g") || strstr(argv[i], "-o")) { // ignore these
      continue;
    } else {
      printf("Possible options:\n"
	     "      -b bias_volts\n"
	     "      -w {0,1,2} (for WV options)\n"
	     "      -p {0,1}   (for WP options)\n"
             "      -r rho_spectrum_file_name\n"
             "      -z <rho_spectrum_offset_mm>\n");
      return 1;
    }
  }

  if (setup.inner_taper_length > setup.hole_length) {
    setup.inner_taper_length = setup.hole_length;
    printf(" Warning: inner_taper_length limited to hole_length = %.1f\n", setup.hole_length);
  }

  if (setup.verbosity >= CHATTY && setup.rho_z_spe[0] != 0) {
    printf(" z(mm)   rho\n");
    for (j=0; j < (int) setup.xtal_length; j++)
      printf(" %3d  %7.3f\n", j, setup.rho_z_spe[j]);
  }

  if (setup.xtal_length/setup.xtal_grid * setup.xtal_radius/setup.xtal_grid > 2500*2500) {
    printf("Error: Crystal size divided by grid size is too large!\n");
    return 1;
  }
  if (WV < 0 || WV > 2) WV = 0;

  /* -------------- give details of detector geometry */
  if (setup.verbosity >= CHATTY) {
    printf("\n\n"
           "      Crystal: Radius x Length: %.1f x %.1f mm\n",
	   setup.xtal_radius, setup.xtal_length);
    if (setup.hole_length > 0) {
      if (setup.inner_taper_length > 0)
        printf("    Core hole: Radius x length: %.1f x %.1f mm,"
               " taper %.1f x %.1f mm (%2.f degrees)\n",
               setup.hole_radius, setup.hole_length,
               setup.inner_taper_width, setup.inner_taper_length, setup.taper_angle);
      else
        printf("    Core hole: Radius x length: %.1f x %.1f mm\n",
               setup.hole_radius, setup.hole_length);
    }
    printf("Point contact: Radius x length: %.1f x %.1f mm\n",
           setup.pc_radius, setup.pc_length);
    if (setup.ditch_depth > 0) {
      printf("  Wrap-around: Radius x ditch x gap:  %.1f x %.1f x %.1f mm\n",
             setup.wrap_around_radius, setup.ditch_depth, setup.ditch_thickness);
    }
    printf("         Bias: %.0f V\n", BV);
  }
    
  if ((BV < 0 && setup.impurity_z0 < 0) || (BV > 0 && setup.impurity_z0 > 0)) {
    printf("ERROR: Expect bias and impurity to be opposite sign!\n");
    return 1;
  } 
  if (setup.impurity_z0 > 0) {
    // swap polarity for n-type material; this lets me assume all voltages are positive
    BV = -BV;
    setup.xtal_HV *= -1.0;
    setup.impurity_z0         *= -1.0;
    setup.impurity_gradient   *= -1.0;
    setup.impurity_quadratic  *= -1.0;
    setup.impurity_surface    *= -1.0;
    setup.impurity_radial_add *= -1.0;
  }
  /* use an adaptive grid; start out coarse and then refine the grid */
  memcpy(&setup1, &setup, sizeof(setup));
  memcpy(&setup2, &setup, sizeof(setup));
  setup1.xtal_grid *= 9.0;
  setup2.xtal_grid *= 3.0;
  if (grid_init(&setup1) != 0 ||
      grid_init(&setup2) != 0 ||
      grid_init(&setup)  != 0) {
    printf("failed to init field calculations\n");
    return 1;
  }

  /* -------------- calculate electric potential/field */
  if (setup.write_field) {
    setup1.write_field = 0; // no need to save intermediate calculations
    setup2.write_field = 0;
    if (setup.xtal_grid > 0.4) {
      ev_calc(&setup2, NULL);
    } else {
      ev_calc(&setup1, NULL);
      ev_calc(&setup2, &setup1);
    }
    ev_calc(&setup, &setup2);
  }

  /* -------------- calculate weighting potential */
  if (setup.write_WP) {
    setup1.write_WP = 0; // no need to save intermediate calculations
    setup2.write_WP = 0;
    if (setup.xtal_grid > 0.4) {
      wp_calc(&setup2, NULL);
    } else {
      wp_calc(&setup1, NULL);
      wp_calc(&setup2, &setup1);
    }
    wp_calc(&setup, &setup2);
  }

  /* -------------- calculate capacitance
     1/2 * epsilon * integral(E^2) = 1/2 * C * V^2
     so    C = epsilon * integral(E^2) / V^2    V = 1 volt
  */
  double esum, esum2, pi=3.14159, Epsilon=(8.85*16.0/1000.0);  // permittivity of Ge in pF/mm
  float  E_r, E_z;
  float  grid = setup.xtal_grid;
  int    r, z, test;
  int    L  = lrint(setup.xtal_length/grid)+1;
  int    R  = lrint(setup.xtal_radius/grid)+1;
  int    LC = lrint(setup.pc_length/grid)+1;
  int    RC = lrint(setup.pc_radius/grid)+1;

  if (setup.write_WP) {
    esum = esum2 = test = 0;
    for (z=1; z<L; z++) {
      for (r=2; r<R; r++) {
        E_r = setup.eps_dr[z][r]/16.0 * (setup.v[1][z][r] - setup.v[1][z][r+1])/(0.1*grid);
        E_z = setup.eps_dz[z][r]/16.0 * (setup.v[1][z][r] - setup.v[1][z+1][r])/(0.1*grid);
        esum += (E_r*E_r + E_z*E_z) * (double) (r-1);
        if ((r == RC   && z <= LC)   || (r <= RC   && z == LC)   ||
            (r == RC+1 && z <= LC+1) || (r <= RC+1 && z == LC+1)) { // average over two different surfaces
          if (setup.point_type[z+1][r+1] == PC) test = 1;
          esum2 += 0.5 * sqrt(E_r*E_r + E_z*E_z) * (double) (r-1);  // 0.5 since averaging over 2 surfaces
        }
      }
    }
    esum  *= 2.0 * pi * 0.01 * Epsilon * pow(grid, 3.0);
    // Epsilon is in pF/mm
    // 0.01 converts (V/cm)^2 to (V/mm)^2, pow() converts to grid^3 to mm3
    esum2 *= 2.0 * pi * 0.1 * Epsilon * pow(grid, 2.0);
    // 0.1 converts (V/cm) to (V/mm),  grid^2 to  mm2
    printf("  >>  Calculated capacitance at %.0f V: %.3lf pF\n", BV, esum);
    if (!test)
      printf("  >>  Alternative calculation of capacitance: %.3lf pF\n", esum2);
  }

  /* -------------- estimate depletion voltage */
  double min = BV, min2 = BV, dV, dW, testv;
  int    vminr=0, vminz=0;
  int    dz[4] = {1, -1, 0, 0}, dr[4] = {0, 0, 1, -1};
  if (setup.write_WP) {
    if (setup.fully_depleted) {
      // find minimum potential
      for (z=1; z<LC+2; z++) {
        for (r=1; r<RC+2; r++) {
          if (setup.vsave[z][r] > 0 &&
              min > setup.vsave[z][r] / (1.0 - setup.v[1][z][r])) {
            min = setup.vsave[z][r] / (1.0 - setup.v[1][z][r]);
          }
        }
      }
      /* check for bubble depletion / pinch-off by seeing how much the bias
         must be reduced for any pixel to be in a local potential minimum  */
      for (z=LC+2; z<L-2; z++) {
        for (r=1; r<R-2; r++) {
          if (setup.point_type[z][r] == INSIDE && setup.v[1][z][r] > 0.0001) {
            testv = -1;
            for (i=0; i<4; i++) {
              if (r==1 && i==2) break;  // do not check dr for r=1 (=0.0)
              dV = setup.vsave[z+dz[i]][r+dr[i]]  - setup.vsave[z][r];  // potential
              dW = setup.v[1][z+dz[i]][r+dr[i]]   - setup.v[1][z][r];   // WP
              if (dW*grid > 0.00001 && dV < 0 && testv < -dV/dW) testv = -dV/dW;
            }
            if (testv >= 0 && min2 > testv) {
              min2 = testv;
              vminr = r; vminz = z;
            }
          }
        }
      }
      if (min2 < min) {
        printf("Estimated pinch-off voltage = %.0f V\n", BV - min);
        printf(" min2 = %.1f at (r,z) = (%.1f, %.1f), so\n",
               min2, (vminr-1)*grid, (vminz-1)*grid);
        printf("   Full depletion (max pinch-off voltage) = %.0f\n", BV - min2);
        min = min2;
      } else {
        printf("Estimated depletion voltage = %.0f V\n", BV - min);
      }
    }

    printf("Minimum bulk field = %.2f V/cm at (r,z) = (%.1f, %.1f) mm\n\n",
           setup.Emin, setup.rmin, setup.zmin);
  }

#ifdef EMIN_OVERBIAS
  // calculate a new minimum electric field at a specified bias above depletion (usually 500 V)

  if (min > 0) {
    double db = EMIN_OVERBIAS - min;
    int k = 3.0/grid;
    float E, ez, er, r, z;
    // adjust potential
    for (j = 1; j < R; j++) {
      for (i = 1; i < L; i++) {
        setup.vsave[i][j] -= db * setup.v[1][i][j];
      }
    }
    setup.Emin = 99999.9;
    setup.rmin = setup.zmin = 999.9;
    /* calculate new field */
    for (j = 1; j < R-k-1; j++) {
      r = (j-1) * grid;
      for (i = k+1; i < L-k-1; i++) {
        z = (i-1) * grid;
        if (setup.point_type[i][j]     != INSIDE ||
            setup.point_type[i + k][j] != INSIDE ||  // point is at least 3 mm from a boundary
            setup.point_type[i - k][j] != INSIDE ||
            setup.point_type[i][j + k] != INSIDE ||
            (j > k+1 && setup.point_type[i][j - k] != INSIDE)) continue;
        // calc E
        er = 0;
        if (j>1) er = (setup.vsave[i][j-1] - setup.vsave[i][j+1])/(0.2*grid);
        ez = (setup.vsave[i-1][j] - setup.vsave[i+1][j])/(0.2*grid);
        E = sqrt(er*er + ez*ez);
        /* check for minimum field inside bulk of detector */
        if (E > 0.1 && E < setup.Emin) {
          setup.Emin = E;
          setup.rmin = r;
          setup.zmin = z;
        }
      }
    }
    printf("Minimum bulk field at %.0fV (%dV overbias) is %.2f V/cm at (r,z) = (%.1f, %.1f) mm\n\n",
           BV-min+EMIN_OVERBIAS, EMIN_OVERBIAS, setup.Emin, setup.rmin, setup.zmin);
  }
#endif
 
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x41f0, %rsp           # imm = 0x41F0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x4128(%rbp)
movl $0x0, -0x412c(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0x132c
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x132c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x15c0(%rbp), %rsi
callq 0x9200
cmpl $0x0, %eax
je 0x134d
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0xae26(%rip), %rdi      # 0xc160
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
leaq -0x15c0(%rbp), %rdi
addq $0x1480, %rdi           # imm = 0x1480
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1040
movss -0x156c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0xac87(%rip), %xmm0     # 0xc008
ucomisd %xmm1, %xmm0
jbe 0x1397
movss 0xad81(%rip), %xmm0     # 0xc110
movss %xmm0, -0x156c(%rbp)
movss -0x154c(%rbp), %xmm0
movss %xmm0, -0x4124(%rbp)
movl -0x1544(%rbp), %eax
movl %eax, -0x4128(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x1174(%rbp)
movl $0x2, -0x4130(%rbp)
movl -0x4130(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1791
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xae98(%rip), %rsi      # 0xc28a
callq 0x11c0
cmpq $0x0, %rax
je 0x1435
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x154c(%rbp)
movss %xmm0, -0x4124(%rbp)
jmp 0x177b
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xae42(%rip), %rsi      # 0xc28d
callq 0x11c0
cmpq $0x0, %rax
je 0x1480
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1190
movl %eax, -0x4128(%rbp)
jmp 0x1779
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xadfa(%rip), %rsi      # 0xc290
callq 0x11c0
cmpq $0x0, %rax
je 0x14cb
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1190
movl %eax, -0x412c(%rbp)
jmp 0x1777
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xadb2(%rip), %rsi      # 0xc293
callq 0x11c0
cmpq $0x0, %rax
je 0x1516
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1190
movl %eax, -0x1540(%rbp)
jmp 0x1775
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xad6a(%rip), %rsi      # 0xc296
callq 0x11c0
cmpq $0x0, %rax
je 0x164b
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xad3b(%rip), %rsi      # 0xc297
callq 0x1180
movq %rax, -0x4140(%rbp)
cmpq $0x0, %rax
jne 0x1597
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xad15(%rip), %rdi      # 0xc299
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xad24(%rip), %rsi      # 0xc2d1
callq 0x11c0
cmpq $0x0, %rax
je 0x15dc
leaq -0x15c0(%rbp), %rdi
addq $0x44c, %rdi            # imm = 0x44C
movq -0x4140(%rbp), %rcx
movl $0x24, %esi
movl $0x1, %edx
callq 0x1070
movl $0x0, -0x4134(%rbp)
cmpl $0x400, -0x4134(%rbp)   # imm = 0x400
jge 0x1616
movslq -0x4134(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, -0x1174(%rbp,%rax,4)
movl -0x4134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4134(%rbp)
jmp 0x15e6
leaq -0x15c0(%rbp), %rdi
addq $0x44c, %rdi            # imm = 0x44C
movq -0x4140(%rbp), %rcx
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
callq 0x1070
movq -0x4140(%rbp), %rdi
callq 0x10b0
jmp 0x1773
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xac75(%rip), %rsi      # 0xc2d6
callq 0x11c0
cmpq $0x0, %rax
je 0x1713
movq -0x10(%rbp), %rax
movl -0x4130(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x4130(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1190
movl %eax, -0x4134(%rbp)
cmpl $0xc7, -0x4134(%rbp)
jl 0x16c1
movl -0x4134(%rbp), %esi
leaq 0xac2b(%rip), %rdi      # 0xc2d9
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
movl -0x4134(%rbp), %eax
movl %eax, -0x4138(%rbp)
cmpl $0xc8, -0x4138(%rbp)
jge 0x1711
movslq -0x4138(%rbp), %rax
movss -0x1174(%rbp,%rax,4), %xmm0
movl -0x4138(%rbp), %eax
subl -0x4134(%rbp), %eax
cltq
movss %xmm0, -0x1174(%rbp,%rax,4)
movl -0x4138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4138(%rbp)
jmp 0x16cd
jmp 0x1771
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xabec(%rip), %rsi      # 0xc315
callq 0x11c0
cmpq $0x0, %rax
jne 0x1755
movq -0x10(%rbp), %rax
movslq -0x4130(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xabce(%rip), %rsi      # 0xc318
callq 0x11c0
cmpq $0x0, %rax
je 0x1757
jmp 0x177d
leaq 0xabbd(%rip), %rdi      # 0xc31b
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
jmp 0x1773
jmp 0x1775
jmp 0x1777
jmp 0x1779
jmp 0x177b
jmp 0x177d
movl -0x4130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4130(%rbp)
jmp 0x13c8
movss -0x158c(%rbp), %xmm0
ucomiss -0x159c(%rbp), %xmm0
jbe 0x17cc
movss -0x159c(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movss -0x159c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xac03(%rip), %rdi      # 0xc3c8
movb $0x1, %al
callq 0x10e0
cmpl $0x2, -0x15c0(%rbp)
jl 0x184e
movss -0x1174(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x17e9
jp 0x17e9
jmp 0x184e
leaq 0xac14(%rip), %rdi      # 0xc404
movb $0x0, %al
callq 0x10e0
movl $0x0, -0x4134(%rbp)
movl -0x4134(%rbp), %eax
cvttss2si -0x15bc(%rbp), %ecx
cmpl %ecx, %eax
jge 0x184c
movl -0x4134(%rbp), %esi
movslq -0x4134(%rbp), %rax
movss -0x1174(%rbp,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xabde(%rip), %rdi      # 0xc412
movb $0x1, %al
callq 0x10e0
movl -0x4134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4134(%rbp)
jmp 0x1801
jmp 0x184e
movss -0x15bc(%rbp), %xmm0
divss -0x156c(%rbp), %xmm0
mulss -0x15b8(%rbp), %xmm0
divss -0x156c(%rbp), %xmm0
movss 0xa89e(%rip), %xmm1     # 0xc114
ucomiss %xmm1, %xmm0
jbe 0x1895
leaq 0xab9d(%rip), %rdi      # 0xc41f
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
cmpl $0x0, -0x4128(%rbp)
jl 0x18a7
cmpl $0x2, -0x4128(%rbp)
jle 0x18b1
movl $0x0, -0x4128(%rbp)
cmpl $0x2, -0x15c0(%rbp)
jl 0x19fe
movss -0x15b8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15bc(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0xab7a(%rip), %rdi      # 0xc457
movb $0x2, %al
callq 0x10e0
movss -0x159c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x197c
movss -0x158c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1954
movss -0x1598(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x159c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x1584(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movss -0x158c(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movss -0x1590(%rbp), %xmm4
cvtss2sd %xmm4, %xmm4
leaq 0xab3e(%rip), %rdi      # 0xc489
movb $0x5, %al
callq 0x10e0
jmp 0x197a
movss -0x1598(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x159c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0xab6b(%rip), %rdi      # 0xc4de
movb $0x2, %al
callq 0x10e0
jmp 0x197c
movss -0x15b0(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15b4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0xab73(%rip), %rdi      # 0xc50e
movb $0x2, %al
callq 0x10e0
movss -0x15a8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x19e4
movss -0x15ac(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15a8(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x15a4(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0xab61(%rip), %rdi      # 0xc53e
movb $0x3, %al
callq 0x10e0
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xab84(%rip), %rdi      # 0xc57b
movb $0x1, %al
callq 0x10e0
xorps %xmm0, %xmm0
ucomiss -0x4124(%rbp), %xmm0
jbe 0x1a16
xorps %xmm0, %xmm0
ucomiss -0x1568(%rbp), %xmm0
ja 0x1a36
movss -0x4124(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1a50
movss -0x1568(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1a50
leaq 0xab55(%rip), %rdi      # 0xc592
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
movss -0x1568(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1b59
movss -0x4124(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x4124(%rbp)
movss -0x154c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa57b(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x154c(%rbp)
movss -0x1568(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa557(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1568(%rbp)
movss -0x1564(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa533(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1564(%rbp)
movss -0x1560(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa50f(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1560(%rbp)
movss -0x155c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa4eb(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x155c(%rbp)
movss -0x1558(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa4c7(%rip), %xmm1     # 0xc010
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1558(%rbp)
leaq -0x2b70(%rbp), %rdi
leaq -0x15c0(%rbp), %rsi
movl $0x15b0, %edx           # imm = 0x15B0
callq 0x1140
leaq -0x4120(%rbp), %rdi
leaq -0x15c0(%rbp), %rsi
movl $0x15b0, %edx           # imm = 0x15B0
callq 0x1140
movss -0x2b1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa483(%rip), %xmm1     # 0xc020
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2b1c(%rbp)
movss -0x40cc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa457(%rip), %xmm1     # 0xc018
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x40cc(%rbp)
leaq -0x2b70(%rbp), %rdi
callq 0x27e0
cmpl $0x0, %eax
jne 0x1c04
leaq -0x4120(%rbp), %rdi
callq 0x27e0
cmpl $0x0, %eax
jne 0x1c04
leaq -0x15c0(%rbp), %rdi
callq 0x27e0
cmpl $0x0, %eax
je 0x1c1e
leaq 0xa9bd(%rip), %rdi      # 0xc5c8
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x27c5
cmpl $0x0, -0x1544(%rbp)
je 0x1c9d
movl $0x0, -0x2af4(%rbp)
movl $0x0, -0x40a4(%rbp)
movss -0x156c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa3d9(%rip), %xmm1     # 0xc028
ucomisd %xmm1, %xmm0
jbe 0x1c67
leaq -0x4120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4280
jmp 0x1c8a
leaq -0x2b70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4280
leaq -0x4120(%rbp), %rdi
leaq -0x2b70(%rbp), %rsi
callq 0x4280
leaq -0x15c0(%rbp), %rdi
leaq -0x4120(%rbp), %rsi
callq 0x4280
cmpl $0x0, -0x1540(%rbp)
je 0x1d1c
movl $0x0, -0x2af0(%rbp)
movl $0x0, -0x40a0(%rbp)
movss -0x156c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xa35a(%rip), %xmm1     # 0xc028
ucomisd %xmm1, %xmm0
jbe 0x1ce6
leaq -0x4120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4670
jmp 0x1d09
leaq -0x2b70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4670
leaq -0x4120(%rbp), %rdi
leaq -0x2b70(%rbp), %rsi
callq 0x4670
leaq -0x15c0(%rbp), %rdi
leaq -0x4120(%rbp), %rsi
callq 0x4670
movsd 0xa314(%rip), %xmm0     # 0xc038
movsd %xmm0, -0x4158(%rbp)
movsd 0xa2fc(%rip), %xmm0     # 0xc030
movsd %xmm0, -0x4160(%rbp)
movss -0x156c(%rbp), %xmm0
movss %xmm0, -0x416c(%rbp)
movss -0x15bc(%rbp), %xmm0
divss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x10f0
addq $0x1, %rax
movl %eax, -0x417c(%rbp)
movss -0x15b8(%rbp), %xmm0
divss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x10f0
addq $0x1, %rax
movl %eax, -0x4180(%rbp)
movss -0x15b4(%rbp), %xmm0
divss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x10f0
addq $0x1, %rax
movl %eax, -0x4184(%rbp)
movss -0x15b0(%rbp), %xmm0
divss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x10f0
addq $0x1, %rax
movl %eax, -0x4188(%rbp)
cmpl $0x0, -0x1540(%rbp)
je 0x221a
movl $0x0, -0x4178(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x4150(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x4148(%rbp)
movl $0x1, -0x4174(%rbp)
movl -0x4174(%rbp), %eax
cmpl -0x417c(%rbp), %eax
jge 0x210f
movl $0x2, -0x4170(%rbp)
movl -0x4170(%rbp), %eax
cmpl -0x4180(%rbp), %eax
jge 0x20f9
movq -0x11c8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xa20d(%rip), %xmm1     # 0xc070
divsd %xmm1, %xmm0
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x4170(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm0
movss -0x416c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0xa188(%rip), %xmm1     # 0xc048
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4164(%rbp)
movq -0x11c0(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xa176(%rip), %xmm1     # 0xc070
divsd %xmm1, %xmm0
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x11d8(%rbp), %rax
movl -0x4174(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
mulsd %xmm1, %xmm0
movss -0x416c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0xa0f1(%rip), %xmm1     # 0xc048
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4168(%rbp)
movss -0x4164(%rbp), %xmm0
movss -0x4164(%rbp), %xmm2
movss -0x4168(%rbp), %xmm1
mulss -0x4168(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movl -0x4170(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm2
movsd -0x4148(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x4148(%rbp)
movl -0x4170(%rbp), %eax
cmpl -0x4188(%rbp), %eax
jne 0x1fd8
movl -0x4174(%rbp), %eax
cmpl -0x4184(%rbp), %eax
jle 0x2048
movl -0x4170(%rbp), %eax
cmpl -0x4188(%rbp), %eax
jg 0x1ff4
movl -0x4174(%rbp), %eax
cmpl -0x4184(%rbp), %eax
je 0x2048
movl -0x4170(%rbp), %eax
movl -0x4188(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x201a
movl -0x4174(%rbp), %eax
movl -0x4184(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2048
movl -0x4170(%rbp), %eax
movl -0x4188(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x20e3
movl -0x4174(%rbp), %eax
movl -0x4184(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x20e3
movq -0x1190(%rbp), %rax
movl -0x4174(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x4170(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x207e
movl $0x1, -0x4178(%rbp)
movss -0x4164(%rbp), %xmm0
movss -0x4164(%rbp), %xmm2
movss -0x4168(%rbp), %xmm1
mulss -0x4168(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x11b0
movaps %xmm0, %xmm1
movsd 0x9fbe(%rip), %xmm0     # 0xc078
mulsd %xmm1, %xmm0
movl -0x4170(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm2
movsd -0x4150(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x4150(%rbp)
jmp 0x20e5
movl -0x4170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4170(%rbp)
jmp 0x1e2b
jmp 0x20fb
movl -0x4174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4174(%rbp)
jmp 0x1e0f
movsd 0x9f29(%rip), %xmm0     # 0xc040
mulsd -0x4158(%rbp), %xmm0
movsd 0x9f29(%rip), %xmm1     # 0xc050
mulsd %xmm1, %xmm0
mulsd -0x4160(%rbp), %xmm0
movsd %xmm0, -0x41f0(%rbp)
movss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x9ec9(%rip), %xmm1     # 0xc018
callq 0x10a0
movaps %xmm0, %xmm1
movsd -0x41f0(%rbp), %xmm0
mulsd %xmm1, %xmm0
mulsd -0x4148(%rbp), %xmm0
movsd %xmm0, -0x4148(%rbp)
movsd 0x9ec5(%rip), %xmm0     # 0xc040
mulsd -0x4158(%rbp), %xmm0
movsd 0x9ebd(%rip), %xmm1     # 0xc048
mulsd %xmm1, %xmm0
mulsd -0x4160(%rbp), %xmm0
movsd %xmm0, -0x41e8(%rbp)
movss -0x416c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x9e8d(%rip), %xmm1     # 0xc040
callq 0x10a0
movaps %xmm0, %xmm1
movsd -0x41e8(%rbp), %xmm0
mulsd %xmm1, %xmm0
mulsd -0x4150(%rbp), %xmm0
movsd %xmm0, -0x4150(%rbp)
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd -0x4148(%rbp), %xmm1
leaq 0xa3f9(%rip), %rdi      # 0xc5eb
movb $0x2, %al
callq 0x10e0
cmpl $0x0, -0x4178(%rbp)
jne 0x2218
movsd -0x4150(%rbp), %xmm0
leaq 0xa40c(%rip), %rdi      # 0xc61d
movb $0x1, %al
callq 0x10e0
jmp 0x221a
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x4190(%rbp)
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x4198(%rbp)
movl $0x0, -0x41b4(%rbp)
movl $0x0, -0x41b8(%rbp)
movq 0x9ee3(%rip), %rax      # 0xc140
movq %rax, -0x41d0(%rbp)
movq 0x9edd(%rip), %rax      # 0xc148
movq %rax, -0x41c8(%rbp)
movq 0x9ed7(%rip), %rax      # 0xc150
movq %rax, -0x41e0(%rbp)
movq 0x9ed1(%rip), %rax      # 0xc158
movq %rax, -0x41d8(%rbp)
cmpl $0x0, -0x1540(%rbp)
je 0x27be
cmpl $0x0, -0x1180(%rbp)
je 0x278c
movl $0x1, -0x4174(%rbp)
movl -0x4174(%rbp), %eax
movl -0x4184(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x23e7
movl $0x1, -0x4170(%rbp)
movl -0x4170(%rbp), %eax
movl -0x4188(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x23d1
movq -0x1198(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x23bb
movsd -0x4190(%rbp), %xmm0
movq -0x1198(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd 0x9d0c(%rip), %xmm2     # 0xc068
subsd (%rax,%rcx,8), %xmm2
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x23bb
movq -0x1198(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd 0x9cbe(%rip), %xmm1     # 0xc068
subsd (%rax,%rcx,8), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x4190(%rbp)
jmp 0x23bd
movl -0x4170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4170(%rbp)
jmp 0x22d3
jmp 0x23d3
movl -0x4174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4174(%rbp)
jmp 0x22b2
movl -0x4184(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4174(%rbp)
movl -0x4174(%rbp), %eax
movl -0x417c(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x26b0
movl $0x1, -0x4170(%rbp)
movl -0x4170(%rbp), %eax
movl -0x4180(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x269a
movq -0x1190(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x2684
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x9bde(%rip), %xmm1     # 0xc058
ucomisd %xmm1, %xmm0
jbe 0x2684
movsd 0x9b84(%rip), %xmm0     # 0xc010
movsd %xmm0, -0x41b0(%rbp)
movl $0x0, -0x4130(%rbp)
cmpl $0x4, -0x4130(%rbp)
jge 0x2637
cmpl $0x1, -0x4170(%rbp)
jne 0x24c2
cmpl $0x2, -0x4130(%rbp)
jne 0x24c2
jmp 0x2637
movq -0x1198(%rbp), %rax
movl -0x4174(%rbp), %ecx
movslq -0x4130(%rbp), %rdx
addl -0x41d0(%rbp,%rdx,4), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x4170(%rbp), %ecx
movslq -0x4130(%rbp), %rdx
addl -0x41e0(%rbp,%rdx,4), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x1198(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x41a0(%rbp)
movq -0x11d8(%rbp), %rax
movl -0x4174(%rbp), %ecx
movslq -0x4130(%rbp), %rdx
addl -0x41d0(%rbp,%rdx,4), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x4170(%rbp), %ecx
movslq -0x4130(%rbp), %rdx
addl -0x41e0(%rbp,%rdx,4), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x11d8(%rbp), %rax
movslq -0x4174(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4170(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x41a8(%rbp)
movsd -0x41a8(%rbp), %xmm0
movss -0x416c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movsd 0x9ab6(%rip), %xmm1     # 0xc060
ucomisd %xmm1, %xmm0
jbe 0x2621
xorps %xmm0, %xmm0
ucomisd -0x41a0(%rbp), %xmm0
jbe 0x2621
movsd -0x41b0(%rbp), %xmm1
movsd -0x41a0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x41a8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2621
movsd -0x41a0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x41a8(%rbp), %xmm0
movsd %xmm0, -0x41b0(%rbp)
jmp 0x2623
movl -0x4130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4130(%rbp)
jmp 0x249e
movsd -0x41b0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2682
movsd -0x4198(%rbp), %xmm0
ucomisd -0x41b0(%rbp), %xmm0
jbe 0x2682
movsd -0x41b0(%rbp), %xmm0
movsd %xmm0, -0x4198(%rbp)
movl -0x4170(%rbp), %eax
movl %eax, -0x41b4(%rbp)
movl -0x4174(%rbp), %eax
movl %eax, -0x41b8(%rbp)
jmp 0x2684
jmp 0x2686
movl -0x4170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4170(%rbp)
jmp 0x2417
jmp 0x269c
movl -0x4174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4174(%rbp)
jmp 0x23f6
movsd -0x4198(%rbp), %xmm1
movsd -0x4190(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2768
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
subsd -0x4190(%rbp), %xmm0
leaq 0x9f70(%rip), %rdi      # 0xc655
movb $0x1, %al
callq 0x10e0
movsd -0x4198(%rbp), %xmm0
movl -0x41b4(%rbp), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm1
mulss -0x416c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movl -0x41b8(%rbp), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm2
mulss -0x416c(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x9f4e(%rip), %rdi      # 0xc67b
movb $0x3, %al
callq 0x10e0
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
subsd -0x4198(%rbp), %xmm0
leaq 0x9f56(%rip), %rdi      # 0xc6a5
movb $0x1, %al
callq 0x10e0
movsd -0x4198(%rbp), %xmm0
movsd %xmm0, -0x4190(%rbp)
jmp 0x278a
movss -0x4124(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
subsd -0x4190(%rbp), %xmm0
leaq 0x9f54(%rip), %rdi      # 0xc6d7
movb $0x1, %al
callq 0x10e0
jmp 0x278c
movss -0x1178(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x1210(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x1204(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0xa224(%rip), %rdi      # 0xc9db
movb $0x3, %al
callq 0x10e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x41f0, %rsp           # imm = 0x41F0
popq %rbp
retq
nopw %cs:(%rax,%rax)