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

  MJD_Siggen_Setup setup;

  /* --- default values, normally over-ridden by values in a *.conf file --- */
  /* all dimensions are in mm */
  float   r  = 0;  // radius of detector
  float   l  = 0;  // length of detector
  float   rc = 0;  // radius of central contact
  float   lc = 0;  // length of central contact
  float   lt = 0;  // length of taper
  float   ro = 0;  // radius of wrap-around outer (li) contact
  float   lo = 0;  // length of ditch next to wrap-around outer (li) contact
  float   wo = 0;  // width of ditch next to wrap-around outer (li) contact

  float   rh  = 10; // radius of core hole in outer (li) contact
  
  float   lh  = 80; // length of core hole in outer (li) contact
  float   hb  = 5;  // bulletization radius at bottom of hole
  float   otl = 80; // length of outer radial taper of crystal
  float   otw = 10; // width/amount of outer radial taper (decrease in radius)
  float   htl = 0;  // length of radial tapered part of core hole
  float   htw = 0;  // width/amount of radial taper (increase in radius) of hole
  float   tbr = 0;  // top bullet radius
  float   bbr = 0;  // bottom bullet radius
  /* ---  ---  ---  ---  ---  ---  ---  ---  ---  ---  ---  ---  ---  --- */

  float  v, r1, r2, h1, h2, v1, v2, value;
  float  pi = 3.141593;
  int    i, j;


  if (argc < 2 || read_config(argv[1], &setup)) {
    printf("Usage: %s <config_file_name>\n\n", argv[0]);
    return 0;
  }

  // handle same command line pararmeters at fieldgen geometry optimization code...
  for (i=2; i<argc-1; i++) {
    if (strstr(argv[i], "-b") ||
        strstr(argv[i], "-w") ||
        strstr(argv[i], "-d") ||
        strstr(argv[i], "-p") ||
        strstr(argv[i], "-r") ||
        strstr(argv[i], "-z") ||
        strstr(argv[i], "-o")) {
      i++; continue;

    } else if (strstr(argv[i], "-g")) {
      printf("argv[%d] = %s\n", i, argv[i]);
      if (*(argv[i]+2) >= 'a' && *(argv[i]+2) <= 'z') {
        j = -1;
        if (*(argv[i]+2) == 'w') j = 0; //   wrap_around_radius
        if (*(argv[i]+2) == 'g') j = 1; //   hole_length_gap
        if (*(argv[i]+2) == 'h') j = 2; //   hole_radius
        if (*(argv[i]+2) == 't') j = 3; //   inner_taper_length
        if (*(argv[i]+2) == 'a') j = 4; //   taper_angle
        if (*(argv[i]+2) == 'l') j = 5; //   xtal length
        if (*(argv[i]+2) == 'r') j = 6; //   xtal radius
        if (*(argv[i]+2) == 'z') j = 7; //   z-cut position in mm (changes the -z input)
      } else {
        j = atoi(argv[i]+2);
      }
      value = atof(argv[++i]);
      if (j==0) {
        setup.wrap_around_radius = value;
        printf(" g%d override: wrap_around_radius = %.1f\n", j, value);
      } else if (j==1) {
        setup.hole_length = setup.xtal_length - value;
        printf(" g%d override: hole_length_gap = %.1f, hole_length = %.1f\n", j, value, setup.hole_length);
        if (setup.inner_taper_length > setup.hole_length) {
          setup.inner_taper_length = setup.hole_length;
          printf("              ... and inner_taper_length = %.1f\n", setup.inner_taper_length);
        }
      } else if (j==2) {
        setup.hole_radius = value;
        printf(" g%d override: hole_radius = %.1f\n", j, value);
      } else if (j==3) {
        setup.inner_taper_length = value;
        printf(" g%d override: inner_taper_length = %.1f\n", j, value);
      } else if (j==4) {
        setup.taper_angle = value;
        printf(" g%d override: taper_angle = %.1f\n", j, value);
      } else if (j==5) {
        printf(" g%d override: xtal_length = %.1f\n", j, value);
        if (setup.xtal_length != value) {
          // maintain hole_length_gap by adjusting hole_length
          setup.hole_length -= setup.xtal_length - value;
          printf("              ... and hole_length = %.1f\n", setup.hole_length);
          if (setup.inner_taper_length > setup.hole_length) {
            setup.inner_taper_length = setup.hole_length;
            printf("              ... and inner_taper_length = %.1f\n", setup.inner_taper_length);
          }
        }
        setup.xtal_length = value;
      } else if (j==6) {
        setup.xtal_radius = value;
        printf(" g%d override: xtal_radius = %.1f\n", j, value);
      } else if (j==7) {
      } else {
        printf("\nERROR: illegal geometry parameter override %s\n\n", argv[i-1]);
        return -1;
      }
    } else {
      printf("Possible options:\n"
             "      -g<n> <value>   override geometry spec from config file with <value>\n"
             "          n = 0 : wrap_around_radius;   n = 1: hole_length_gap;     n = 2: hole_radius\n"
             "          n = 3 : inner_taper_length;   n = 4: taper_angle\n"
             "          n = 5 : xtal_length;          n = 6: xtal_radius\n"
             "      ignored: -b -w -p -d -r -z\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);
  }
  /* a consistency check */
  if (setup.inner_taper_length > setup.hole_length - setup.hole_bullet_radius)
    setup.inner_taper_length = setup.hole_length - setup.hole_bullet_radius;
  /* convert taper angle to taper widths */
  if (setup.outer_taper_length > 0) {
    setup.outer_taper_width =
      setup.outer_taper_length * tan(setup.taper_angle * 3.14159/180.0);
  }
  if (setup.inner_taper_length > 0) {
    setup.inner_taper_width =
      setup.inner_taper_length * tan(setup.taper_angle * 3.14159/180.0);
  }
 

  l  =  setup.xtal_length;
  r  =  setup.xtal_radius;
  lc =  setup.pc_length;
  rc =  setup.pc_radius;
  ro =  setup.wrap_around_radius;
  lo =  setup.ditch_depth;
  wo =  setup.ditch_thickness;
  lt =  setup.bottom_taper_length;
  lh =  setup.hole_length;
  rh =  setup.hole_radius;
  hb =  setup.hole_bullet_radius;
  otl = setup.outer_taper_length;
  otw = setup.outer_taper_width;
  htl = setup.inner_taper_length;
  htw = setup.inner_taper_width;
  tbr = setup.top_bullet_radius;
  bbr = setup.bottom_bullet_radius;


  printf("\n\n"
         "      Crystal: Radius x Length: %.1f x %.1f mm\n"
         " Bottom taper: %.1f mm\n", r, l, lt);
  printf("    Core hole: Radius x length: %.1f x %.1f mm, taper %.1f x %.1f mm (%2.f degrees),"
         " bullet radius %.1f mm\n", rh, lh, htw, htl, setup.taper_angle, hb);
  printf("Outside taper: %.1f mm x %.1f mm (%.2f degrees)\n", otw, otl, setup.taper_angle);
  printf("      Contact: Radius x length: %.1f x %.1f mm\n", rc, lc);
  printf("  Wrap-around: Radius x ditch x gap:  %.1f x %.1f x %.1f mm\n\n", ro, lo, wo);

  v  = pi * (r*r * l - rc*rc * lc);
  printf("         cylinder: %7.0f mm3  =  %4.0f g\n", v, v*0.005323);

  // hole (with optional taper)
  if (htw > 0.1) {
    r1 = rh + htw;
    r2 = rh;
    h2 = htl * rh / htw;
    h1 = h2 + htl;
    v1 = pi * r1*r1 * h1 / 3.0;
    v2 = pi * r2*r2 * h2 / 3.0;
    v -= v1 - v2;
    printf("     tapered hole: %7.0f mm3  =  %4.0f g\n", v1-v2, (v1-v2)*0.005323);
  }
  if (rh > 0 && lh > htl) {
    v1 = pi * rh*rh * (lh - htl);
    v -= v1;
    printf("    straight hole: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }

  // bottom taper
  if (lt > 0.1) {
    r1 = h1 = r;
    r2 = h2 = r - lt;
    v1 = pi * r1*r1 * h1 / 3.0;
    v2 = pi * r2*r2 * h2 / 3.0;
    v1 = pi * r*r * lt - v1 + v2;
    v -= v1;
    printf("     bottom taper: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }

  // outer (top) taper
  if (otl * otw > 0.1) {
    r1 = r;
    r2 = r - otw;
    h1 = otl * r / otw;
    h2 = h1 - otl;
    v1 = pi * r1*r1 * h1 / 3.0;
    v2 = pi * r2*r2 * h2 / 3.0;
    v1 = pi * r*r * otl - v1 + v2;
    v -= v1;
    printf("outer (top) taper: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }

  // top and bottom bullet radius
  if (tbr > 0.1) {
    v1 = 1.35 * r * tbr*tbr;
    v -= v1;
    printf("top bullet radius: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }
  if (bbr > 0.1) {
    v1 = 1.35 * r * bbr*bbr;
    v -= v1;
    printf("  bottom bullet r: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }

  // ditch
  if (ro * lo > 0.1) {
    r1 = ro;
    r2 = r1 - wo;
    v1 = pi * (r1*r1 - r2+r2) * lo;
    v -= v1;
    printf("            ditch: %7.0f mm3  =  %4.0f g\n", v1, v1*0.005323);
  }

  printf("\n  final volume:  %.0f mm3  =  %.1f cm3\n", v, v/1000.0);
  printf("  final   mass:  %.0f g   [%.0f g for enriched 76Ge]\n\n", v * 5.323/1000.0, v * 5.544/1000.0);

  /* summarize geometry and mass for enriched detectors */
  if (1) {
    char *c, name[256];
    strncpy(name, argv[1], 256);
    while ((c = strstr(name, "/"))) strncpy(name, c+1, 256);
    if ((c = strstr(name, ".con"))) *c = 0;
    printf(" detector  len  diam  enr_mass Vop  well_diamxlen taper ditchOD\n"
           " %8s %5.1f %5.1f %6.0f  %4.0f  %4.1fx%.1f   %4.1f %4.1f\n",
           name, l, 2.0*r, v * 5.544/1000.0, setup.xtal_HV, 2.0*rh, lh, htl, 2.0*ro);
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1750, %rsp           # imm = 0x1750
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15c4(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15c8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15cc(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15d0(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15d4(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15d8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15dc(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15e0(%rbp)
movss 0x2d5f(%rip), %xmm0     # 0x4008
movss %xmm0, -0x15e4(%rbp)
movss 0x2d53(%rip), %xmm0     # 0x400c
movss %xmm0, -0x15e8(%rbp)
movss 0x2d47(%rip), %xmm0     # 0x4010
movss %xmm0, -0x15ec(%rbp)
movss 0x2d33(%rip), %xmm0     # 0x400c
movss %xmm0, -0x15f0(%rbp)
movss 0x2d1f(%rip), %xmm0     # 0x4008
movss %xmm0, -0x15f4(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15f8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x15fc(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x1600(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x1604(%rbp)
movss 0x2cdf(%rip), %xmm0     # 0x4004
movss %xmm0, -0x1628(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0x134c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x15c0(%rbp), %rsi
callq 0x26a0
cmpl $0x0, %eax
je 0x136d
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x2d0e(%rip), %rdi      # 0x4068
movb $0x0, %al
callq 0x10a0
movl $0x0, -0x4(%rbp)
jmp 0x268b
movl $0x2, -0x162c(%rbp)
movl -0x162c(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1985
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2ce6(%rip), %rsi      # 0x4087
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2cc4(%rip), %rsi      # 0x408a
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2ca2(%rip), %rsi      # 0x408d
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c80(%rip), %rsi      # 0x4090
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c62(%rip), %rsi      # 0x4093
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c44(%rip), %rsi      # 0x4096
callq 0x1120
cmpq $0x0, %rax
jne 0x147e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c26(%rip), %rsi      # 0x4099
callq 0x1120
cmpq $0x0, %rax
je 0x1492
movl -0x162c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x162c(%rbp)
jmp 0x1971
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2bf4(%rip), %rsi      # 0x409c
callq 0x1120
cmpq $0x0, %rax
je 0x1953
movl -0x162c(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x2bcc(%rip), %rdi      # 0x409f
movb $0x0, %al
callq 0x10a0
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x61, %eax
jl 0x162e
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x7a, %eax
jg 0x162e
movl $0xffffffff, -0x1630(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x77, %eax
jne 0x153e
movl $0x0, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x67, %eax
jne 0x1560
movl $0x1, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x68, %eax
jne 0x1582
movl $0x2, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x74, %eax
jne 0x15a4
movl $0x3, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x61, %eax
jne 0x15c6
movl $0x4, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x6c, %eax
jne 0x15e8
movl $0x5, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x72, %eax
jne 0x160a
movl $0x6, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x7a, %eax
jne 0x162c
movl $0x7, -0x1630(%rbp)
jmp 0x164c
movq -0x10(%rbp), %rax
movslq -0x162c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
callq 0x1110
movl %eax, -0x1630(%rbp)
movq -0x10(%rbp), %rax
movl -0x162c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x162c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1624(%rbp)
cmpl $0x0, -0x1630(%rbp)
jne 0x16b5
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x15ac(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a05(%rip), %rdi      # 0x40ae
movb $0x1, %al
callq 0x10a0
jmp 0x1951
cmpl $0x1, -0x1630(%rbp)
jne 0x1746
movss -0x15bc(%rbp), %xmm0
subss -0x1624(%rbp), %xmm0
movss %xmm0, -0x159c(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x159c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x29d9(%rip), %rdi      # 0x40d8
movb $0x2, %al
callq 0x10a0
movss -0x158c(%rbp), %xmm0
ucomiss -0x159c(%rbp), %xmm0
jbe 0x1741
movss -0x159c(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movss -0x158c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29d9(%rip), %rdi      # 0x4113
movb $0x1, %al
callq 0x10a0
jmp 0x194f
cmpl $0x2, -0x1630(%rbp)
jne 0x1784
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x1598(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29cc(%rip), %rdi      # 0x4144
movb $0x1, %al
callq 0x10a0
jmp 0x194d
cmpl $0x3, -0x1630(%rbp)
jne 0x17c2
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29b1(%rip), %rdi      # 0x4167
movb $0x1, %al
callq 0x10a0
jmp 0x194b
cmpl $0x4, -0x1630(%rbp)
jne 0x1800
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x1590(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x299d(%rip), %rdi      # 0x4191
movb $0x1, %al
callq 0x10a0
jmp 0x1949
cmpl $0x5, -0x1630(%rbp)
jne 0x18cf
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x298e(%rip), %rdi      # 0x41b4
movb $0x1, %al
callq 0x10a0
movss -0x15bc(%rbp), %xmm0
ucomiss -0x1624(%rbp), %xmm0
jne 0x1842
jp 0x1842
jmp 0x18bd
movss -0x15bc(%rbp), %xmm1
subss -0x1624(%rbp), %xmm1
movss -0x159c(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x159c(%rbp)
movss -0x159c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x295e(%rip), %rdi      # 0x41d7
movb $0x1, %al
callq 0x10a0
movss -0x158c(%rbp), %xmm0
ucomiss -0x159c(%rbp), %xmm0
jbe 0x18bb
movss -0x159c(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movss -0x158c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x285f(%rip), %rdi      # 0x4113
movb $0x1, %al
callq 0x10a0
jmp 0x18bd
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x15bc(%rbp)
jmp 0x1947
cmpl $0x6, -0x1630(%rbp)
jne 0x190a
movss -0x1624(%rbp), %xmm0
movss %xmm0, -0x15b8(%rbp)
movl -0x1630(%rbp), %esi
movss -0x1624(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2900(%rip), %rdi      # 0x4201
movb $0x1, %al
callq 0x10a0
jmp 0x1945
cmpl $0x7, -0x1630(%rbp)
jne 0x1915
jmp 0x1943
movq -0x10(%rbp), %rax
movl -0x162c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x28f4(%rip), %rdi      # 0x4224
movb $0x0, %al
callq 0x10a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x268b
jmp 0x1945
jmp 0x1947
jmp 0x1949
jmp 0x194b
jmp 0x194d
jmp 0x194f
jmp 0x1951
jmp 0x196d
leaq 0x28fb(%rip), %rdi      # 0x4255
movb $0x0, %al
callq 0x10a0
movl $0x1, -0x4(%rbp)
jmp 0x268b
jmp 0x196f
jmp 0x1971
movl -0x162c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x162c(%rbp)
jmp 0x1377
movss -0x158c(%rbp), %xmm0
ucomiss -0x159c(%rbp), %xmm0
jbe 0x19c0
movss -0x159c(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movss -0x159c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29e8(%rip), %rdi      # 0x43a1
movb $0x1, %al
callq 0x10a0
movss -0x158c(%rbp), %xmm0
movss -0x159c(%rbp), %xmm1
subss -0x1578(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x19f5
movss -0x159c(%rbp), %xmm0
subss -0x1578(%rbp), %xmm0
movss %xmm0, -0x158c(%rbp)
movss -0x1594(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1a5d
movss -0x1594(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x1748(%rbp)
movss -0x1590(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x25f3(%rip), %xmm1     # 0x4020
mulsd %xmm1, %xmm0
movsd 0x25df(%rip), %xmm1     # 0x4018
divsd %xmm1, %xmm0
callq 0x10e0
movaps %xmm0, %xmm1
movsd -0x1748(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1588(%rbp)
movss -0x158c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1ac5
movss -0x158c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x1750(%rbp)
movss -0x1590(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x258b(%rip), %xmm1     # 0x4020
mulsd %xmm1, %xmm0
movsd 0x2577(%rip), %xmm1     # 0x4018
divsd %xmm1, %xmm0
callq 0x10e0
movaps %xmm0, %xmm1
movsd -0x1750(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1584(%rbp)
movss -0x15bc(%rbp), %xmm0
movss %xmm0, -0x15c8(%rbp)
movss -0x15b8(%rbp), %xmm0
movss %xmm0, -0x15c4(%rbp)
movss -0x15b4(%rbp), %xmm0
movss %xmm0, -0x15d0(%rbp)
movss -0x15b0(%rbp), %xmm0
movss %xmm0, -0x15cc(%rbp)
movss -0x15ac(%rbp), %xmm0
movss %xmm0, -0x15d8(%rbp)
movss -0x15a8(%rbp), %xmm0
movss %xmm0, -0x15dc(%rbp)
movss -0x15a4(%rbp), %xmm0
movss %xmm0, -0x15e0(%rbp)
movss -0x15a0(%rbp), %xmm0
movss %xmm0, -0x15d4(%rbp)
movss -0x159c(%rbp), %xmm0
movss %xmm0, -0x15e8(%rbp)
movss -0x1598(%rbp), %xmm0
movss %xmm0, -0x15e4(%rbp)
movss -0x1578(%rbp), %xmm0
movss %xmm0, -0x15ec(%rbp)
movss -0x1594(%rbp), %xmm0
movss %xmm0, -0x15f0(%rbp)
movss -0x1588(%rbp), %xmm0
movss %xmm0, -0x15f4(%rbp)
movss -0x158c(%rbp), %xmm0
movss %xmm0, -0x15f8(%rbp)
movss -0x1584(%rbp), %xmm0
movss %xmm0, -0x15fc(%rbp)
movss -0x1580(%rbp), %xmm0
movss %xmm0, -0x1600(%rbp)
movss -0x157c(%rbp), %xmm0
movss %xmm0, -0x1604(%rbp)
movss -0x15c4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15c8(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x15d4(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x27dd(%rip), %rdi      # 0x43dd
movb $0x3, %al
callq 0x10a0
movss -0x15e4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15e8(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x15fc(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movss -0x15f8(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movss -0x1590(%rbp), %xmm4
cvtss2sd %xmm4, %xmm4
movss -0x15ec(%rbp), %xmm5
cvtss2sd %xmm5, %xmm5
leaq 0x27d0(%rip), %rdi      # 0x4426
movb $0x6, %al
callq 0x10a0
movss -0x15f4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15f0(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x1590(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x280a(%rip), %rdi      # 0x4492
movb $0x3, %al
callq 0x10a0
movss -0x15cc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15d0(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x2815(%rip), %rdi      # 0x44c3
movb $0x2, %al
callq 0x10a0
movss -0x15d8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15dc(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x15e0(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x2813(%rip), %rdi      # 0x44f3
movb $0x3, %al
callq 0x10a0
movss -0x1628(%rbp), %xmm0
movss -0x15c4(%rbp), %xmm1
mulss -0x15c4(%rbp), %xmm1
movss -0x15c8(%rbp), %xmm3
movss -0x15cc(%rbp), %xmm2
mulss -0x15cc(%rbp), %xmm2
mulss -0x15d0(%rbp), %xmm2
movd %xmm2, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x1608(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x1608(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x22d0(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x27c6(%rip), %rdi      # 0x4531
movb $0x2, %al
callq 0x10a0
movss -0x15fc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x22a2(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x1ece
movss -0x15e4(%rbp), %xmm0
addss -0x15fc(%rbp), %xmm0
movss %xmm0, -0x160c(%rbp)
movss -0x15e4(%rbp), %xmm0
movss %xmm0, -0x1610(%rbp)
movss -0x15f8(%rbp), %xmm0
mulss -0x15e4(%rbp), %xmm0
divss -0x15fc(%rbp), %xmm0
movss %xmm0, -0x1618(%rbp)
movss -0x1618(%rbp), %xmm0
addss -0x15f8(%rbp), %xmm0
movss %xmm0, -0x1614(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x1614(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x221c(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1618(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x21e0(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1620(%rbp)
movss -0x161c(%rbp), %xmm1
subss -0x1620(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
subss -0x1620(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
subss -0x1620(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x2174(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x2694(%rip), %rdi      # 0x455b
movb $0x2, %al
callq 0x10a0
movss -0x15e4(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1f79
movss -0x15e8(%rbp), %xmm0
ucomiss -0x15f8(%rbp), %xmm0
jbe 0x1f79
movss -0x1628(%rbp), %xmm0
mulss -0x15e4(%rbp), %xmm0
mulss -0x15e4(%rbp), %xmm0
movss -0x15e8(%rbp), %xmm1
subss -0x15f8(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x20c9(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x2613(%rip), %rdi      # 0x4585
movb $0x2, %al
callq 0x10a0
movss -0x15d4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x209b(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x20e2
movss -0x15c4(%rbp), %xmm0
movss %xmm0, -0x1614(%rbp)
movss %xmm0, -0x160c(%rbp)
movss -0x15c4(%rbp), %xmm0
subss -0x15d4(%rbp), %xmm0
movss %xmm0, -0x1618(%rbp)
movss %xmm0, -0x1610(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x1614(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x203d(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1618(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x2001(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1620(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x15c4(%rbp), %xmm0
mulss -0x15c4(%rbp), %xmm0
movss -0x15d4(%rbp), %xmm2
movss -0x161c(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
addss -0x1620(%rbp), %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1f60(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x24d4(%rip), %rdi      # 0x45af
movb $0x2, %al
callq 0x10a0
movss -0x15f0(%rbp), %xmm0
mulss -0x15f4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1f2a(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x227b
movss -0x15c4(%rbp), %xmm0
movss %xmm0, -0x160c(%rbp)
movss -0x15c4(%rbp), %xmm0
subss -0x15f4(%rbp), %xmm0
movss %xmm0, -0x1610(%rbp)
movss -0x15f0(%rbp), %xmm0
mulss -0x15c4(%rbp), %xmm0
divss -0x15f4(%rbp), %xmm0
movss %xmm0, -0x1614(%rbp)
movss -0x1614(%rbp), %xmm0
subss -0x15f0(%rbp), %xmm0
movss %xmm0, -0x1618(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x160c(%rbp), %xmm0
mulss -0x1614(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1ea4(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1610(%rbp), %xmm0
mulss -0x1618(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1e68(%rip), %xmm1     # 0x4038
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1620(%rbp)
movss -0x1628(%rbp), %xmm0
mulss -0x15c4(%rbp), %xmm0
mulss -0x15c4(%rbp), %xmm0
movss -0x15f0(%rbp), %xmm2
movss -0x161c(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
addss -0x1620(%rbp), %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1dc7(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x2365(%rip), %rdi      # 0x45d9
movb $0x2, %al
callq 0x10a0
movss -0x1600(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1d99(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x232b
movss -0x15c4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1d93(%rip), %xmm0     # 0x4040
mulsd %xmm1, %xmm0
movss -0x1600(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movss -0x1600(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1d17(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x22df(%rip), %rdi      # 0x4603
movb $0x2, %al
callq 0x10a0
movss -0x1604(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1ce9(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x23db
movss -0x15c4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1ce3(%rip), %xmm0     # 0x4040
mulsd %xmm1, %xmm0
movss -0x1604(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movss -0x1604(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1c67(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x2259(%rip), %rdi      # 0x462d
movb $0x2, %al
callq 0x10a0
movss -0x15d8(%rbp), %xmm0
mulss -0x15dc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1c31(%rip), %xmm1     # 0x4028
ucomisd %xmm1, %xmm0
jbe 0x24c8
movss -0x15d8(%rbp), %xmm0
movss %xmm0, -0x160c(%rbp)
movss -0x160c(%rbp), %xmm0
subss -0x15e0(%rbp), %xmm0
movss %xmm0, -0x1610(%rbp)
movss -0x1628(%rbp), %xmm0
movss -0x160c(%rbp), %xmm1
movss -0x160c(%rbp), %xmm3
movss -0x1610(%rbp), %xmm2
movd %xmm2, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
addss -0x1610(%rbp), %xmm1
mulss %xmm1, %xmm0
mulss -0x15dc(%rbp), %xmm0
movss %xmm0, -0x161c(%rbp)
movss -0x161c(%rbp), %xmm1
movss -0x1608(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x1608(%rbp)
movss -0x161c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x161c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1b7a(%rip), %xmm2     # 0x4030
mulsd %xmm2, %xmm1
leaq 0x2196(%rip), %rdi      # 0x4657
movb $0x2, %al
callq 0x10a0
movss -0x1608(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x1608(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1b60(%rip), %xmm2     # 0x4048
divsd %xmm2, %xmm1
leaq 0x218e(%rip), %rdi      # 0x4681
movb $0x2, %al
callq 0x10a0
movss -0x1608(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1b4a(%rip), %xmm1     # 0x4058
mulsd %xmm1, %xmm0
movsd 0x1b2e(%rip), %xmm1     # 0x4048
divsd %xmm1, %xmm0
movss -0x1608(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1b1e(%rip), %xmm2     # 0x4050
mulsd %xmm2, %xmm1
movsd 0x1b0a(%rip), %xmm2     # 0x4048
divsd %xmm2, %xmm1
leaq 0x2161(%rip), %rdi      # 0x46aa
movb $0x2, %al
callq 0x10a0
leaq -0x1740(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1030
leaq -0x1740(%rbp), %rdi
leaq 0x216a(%rip), %rsi      # 0x46e1
callq 0x1120
movq %rax, -0x1638(%rbp)
cmpq $0x0, %rax
je 0x25a7
leaq -0x1740(%rbp), %rdi
movq -0x1638(%rbp), %rsi
addq $0x1, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1030
jmp 0x2569
leaq -0x1740(%rbp), %rdi
leaq 0x212e(%rip), %rsi      # 0x46e3
callq 0x1120
movq %rax, -0x1638(%rbp)
cmpq $0x0, %rax
je 0x25d1
movq -0x1638(%rbp), %rax
movb $0x0, (%rax)
leaq -0x1740(%rbp), %rsi
movss -0x15c8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x15c4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x1a68(%rip), %xmm1     # 0x4060
mulsd %xmm2, %xmm1
movss -0x1608(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movsd 0x1a40(%rip), %xmm3     # 0x4050
mulsd %xmm3, %xmm2
movsd 0x1a2c(%rip), %xmm3     # 0x4048
divsd %xmm3, %xmm2
movss -0x154c(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movss -0x15e4(%rbp), %xmm4
cvtss2sd %xmm4, %xmm5
movsd 0x1a20(%rip), %xmm4     # 0x4060
mulsd %xmm5, %xmm4
movss -0x15e8(%rbp), %xmm5
cvtss2sd %xmm5, %xmm5
movss -0x15f8(%rbp), %xmm6
cvtss2sd %xmm6, %xmm6
movss -0x15d8(%rbp), %xmm7
cvtss2sd %xmm7, %xmm8
movsd 0x19ef(%rip), %xmm7     # 0x4060
mulsd %xmm8, %xmm7
leaq 0x206b(%rip), %rdi      # 0x46e8
movb $0x8, %al
callq 0x10a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1750, %rsp           # imm = 0x1750
popq %rbp
retq
nopw (%rax,%rax)