// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1748, %rsp           # imm = 0x1748
movq %rsi, %rbx
cmpl $0x2, %edi
jl 0x127c
movl %edi, %ebp
movq 0x8(%rbx), %rdi
leaq 0x198(%rsp), %rsi
callq 0x1e60
testl %eax, %eax
je 0x12a3
movq (%rbx), %rsi
leaq 0x1dee(%rip), %rdi      # 0x3074
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10c0
movl %ebx, %eax
addq $0x1748, %rsp           # imm = 0x1748
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, %ebp
jb 0x15f3
decl %ebp
leaq 0x1dde(%rip), %r14      # 0x3093
movl $0x2, %r15d
movslq %r15d, %r13
movq (%rbx,%r13,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x1dba(%rip), %rsi      # 0x3096
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x1da9(%rip), %rsi      # 0x3099
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x1d98(%rip), %rsi      # 0x309c
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x1d87(%rip), %rsi      # 0x309f
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x2438(%rip), %rsi      # 0x3764
callq 0x1140
testq %rax, %rax
jne 0x134a
movq %r12, %rdi
leaq 0x1d62(%rip), %rsi      # 0x30a2
callq 0x1140
testq %rax, %rax
je 0x135e
incl %r15d
incl %r15d
cmpl %ebp, %r15d
jl 0x12bb
jmp 0x15f3
movq %r12, %rdi
leaq 0x1d3d(%rip), %rsi      # 0x30a5
callq 0x1140
testq %rax, %rax
je 0x1e2c
leaq 0x1d2b(%rip), %rdi      # 0x30a8
movl %r13d, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10c0
movq (%rbx,%r13,8), %rdx
movb 0x2(%rdx), %al
leal -0x61(%rax), %ecx
cmpb $0x19, %cl
movq %rdx, 0x8(%rsp)
ja 0x13f6
xorl %r12d, %r12d
cmpb $0x77, %al
setne %r12b
negl %r12d
cmpb $0x67, %al
movl $0x1, %ecx
cmovel %ecx, %r12d
cmpb $0x68, %al
movl $0x2, %ecx
cmovel %ecx, %r12d
cmpb $0x74, %al
movl $0x3, %ecx
cmovel %ecx, %r12d
cmpb $0x61, %al
movl $0x4, %ecx
cmovel %ecx, %r12d
cmpb $0x6c, %al
movl $0x5, %ecx
cmovel %ecx, %r12d
cmpb $0x72, %al
movl $0x6, %ecx
cmovel %ecx, %r12d
cmpb $0x7a, %al
je 0x134a
jmp 0x1402
leaq 0x2(%rdx), %rdi
callq 0x1130
movl %eax, %r12d
movq 0x8(%rbx,%r13,8), %rdi
callq 0x1070
cmpl $0x7, %r12d
ja 0x1e42
cvtsd2ss %xmm0, %xmm2
incl %r15d
movl %r12d, %eax
leaq 0x1c2d(%rip), %rcx      # 0x3054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movss %xmm2, 0x1ac(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1c70(%rip), %rdi      # 0x30b7
xorl %esi, %esi
jmp 0x1536
movss %xmm2, 0x1cc(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1d0b(%rip), %rdi      # 0x3170
movl $0x3, %esi
jmp 0x1536
movss 0x19c(%rsp), %xmm1
subss %xmm2, %xmm1
movss %xmm1, 0x1bc(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
cvtss2sd %xmm1, %xmm1
leaq 0x1c4a(%rip), %rdi      # 0x30e1
movl $0x1, %esi
movb $0x2, %al
callq 0x10c0
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x134d
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1c4a(%rip), %rdi      # 0x311c
movb $0x1, %al
callq 0x10c0
jmp 0x134d
movss %xmm2, 0x1c0(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1c58(%rip), %rdi      # 0x314d
movl $0x2, %esi
jmp 0x1536
movss %xmm2, 0x1a0(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1cf7(%rip), %rdi      # 0x320a
movl $0x6, %esi
jmp 0x1536
movss %xmm2, 0x1c8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1c69(%rip), %rdi      # 0x319a
movl $0x4, %esi
movb $0x1, %al
callq 0x10c0
jmp 0x134d
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x1c6d(%rip), %rdi      # 0x31bd
movl $0x5, %esi
movb $0x1, %al
movss %xmm2, 0x8(%rsp)
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss 0x19c(%rsp), %xmm0
ucomiss %xmm2, %xmm0
jne 0x1578
jnp 0x15e5
subss %xmm2, %xmm0
movss 0x1bc(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x1bc(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x1c40(%rip), %rdi      # 0x31e0
movb $0x1, %al
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x15e5
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1b44(%rip), %rdi      # 0x311c
movb $0x1, %al
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss %xmm2, 0x19c(%rsp)
jmp 0x134d
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x1637
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1c40(%rip), %rdi      # 0x325e
movb $0x1, %al
callq 0x10c0
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
subss 0x1e0(%rsp), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x1651
movss %xmm0, 0x1cc(%rsp)
movaps %xmm0, %xmm1
movss 0x1c4(%rsp), %xmm0
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jbe 0x16ac
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x1c8(%rsp), %xmm0
mulsd 0x1988(%rip), %xmm0     # 0x3008
divsd 0x1988(%rip), %xmm0     # 0x3010
callq 0x1100
xorps %xmm2, %xmm2
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d0(%rsp)
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x1709
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x1c8(%rsp), %xmm0
mulsd 0x1936(%rip), %xmm0     # 0x3008
divsd 0x1936(%rip), %xmm0     # 0x3010
callq 0x1100
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movss %xmm0, 0x1d4(%rsp)
movss 0x1cc(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x171e
movss 0x1d4(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss %xmm1, 0x14(%rsp)
movss 0x19c(%rsp), %xmm3
movss %xmm3, 0x5c(%rsp)
movss 0x1a0(%rsp), %xmm1
movss %xmm1, 0x20(%rsp)
movss 0x1a4(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x1a8(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x1ac(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x1b0(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x1b4(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x1b8(%rsp), %xmm2
movss 0x1bc(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x1c0(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x1c4(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x1d0(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1d8(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x1dc(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
movss %xmm2, 0x58(%rsp)
cvtss2sd %xmm2, %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x1e0(%rsp), %xmm3
movsd %xmm3, 0x48(%rsp)
leaq 0x1a7f(%rip), %rdi      # 0x329a
movsd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x88(%rsp)
movsd %xmm2, 0x68(%rsp)
movb $0x3, %al
callq 0x10c0
xorps %xmm0, %xmm0
cvtss2sd 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x18(%rsp), %xmm2
movsd %xmm2, 0x60(%rsp)
xorps %xmm3, %xmm3
cvtss2sd 0x14(%rsp), %xmm3
cvtss2sd 0x1c8(%rsp), %xmm4
leaq 0x1a72(%rip), %rdi      # 0x32e3
movsd %xmm0, 0x78(%rsp)
movsd %xmm1, 0x80(%rsp)
movsd %xmm3, 0x70(%rsp)
movsd 0x48(%rsp), %xmm5
movb $0x6, %al
callq 0x10c0
xorps %xmm0, %xmm0
cvtss2sd 0x1c(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x24(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x1c8(%rsp), %xmm2
leaq 0x1a97(%rip), %rdi      # 0x334f
movb $0x3, %al
callq 0x10c0
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rsp), %xmm1
leaq 0x1aa8(%rip), %rdi      # 0x3380
movb $0x2, %al
callq 0x10c0
xorps %xmm0, %xmm0
cvtss2sd 0x28(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x2c(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x3c(%rsp), %xmm2
leaq 0x1aaf(%rip), %rdi      # 0x33b0
movsd %xmm0, 0x48(%rsp)
movb $0x3, %al
callq 0x10c0
movss 0x20(%rsp), %xmm1
mulss %xmm1, %xmm1
movss 0x40(%rsp), %xmm0
mulss %xmm0, %xmm0
mulss 0x8(%rsp), %xmm0
mulss 0x5c(%rsp), %xmm1
subss %xmm0, %xmm1
mulss 0x170e(%rip), %xmm1     # 0x3048
movss %xmm1, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd 0x16c9(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1a94(%rip), %rdi      # 0x33ee
movb $0x2, %al
callq 0x10c0
movsd 0x60(%rsp), %xmm0
ucomisd 0x16b1(%rip), %xmm0     # 0x3020
jbe 0x1a08
movss 0x30(%rsp), %xmm5
movaps %xmm5, %xmm0
movss 0x18(%rsp), %xmm2
addss %xmm2, %xmm0
movaps %xmm5, %xmm1
movss 0x14(%rsp), %xmm3
mulss %xmm3, %xmm1
divss %xmm2, %xmm1
movaps %xmm3, %xmm2
addss %xmm1, %xmm2
movss 0x16a0(%rip), %xmm3     # 0x3048
movaps %xmm0, %xmm4
mulss %xmm3, %xmm4
mulss %xmm0, %xmm4
mulss %xmm2, %xmm4
movss 0x168d(%rip), %xmm0     # 0x304c
divss %xmm0, %xmm4
mulss %xmm5, %xmm3
mulss %xmm5, %xmm3
mulss %xmm1, %xmm3
divss %xmm0, %xmm3
subss %xmm3, %xmm4
movss 0x8(%rsp), %xmm0
subss %xmm4, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm4, %xmm0
movsd 0x1622(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1a17(%rip), %rdi      # 0x3418
movb $0x2, %al
callq 0x10c0
xorps %xmm0, %xmm0
movss 0x30(%rsp), %xmm3
ucomiss %xmm0, %xmm3
movss 0x44(%rsp), %xmm2
jbe 0x1a70
movss 0x14(%rsp), %xmm1
ucomiss %xmm1, %xmm2
jbe 0x1a70
movss 0x1619(%rip), %xmm0     # 0x3048
mulss %xmm3, %xmm0
mulss %xmm3, %xmm0
subss %xmm1, %xmm2
mulss %xmm0, %xmm2
movss 0x8(%rsp), %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd 0x15ba(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x19d9(%rip), %rdi      # 0x3442
movb $0x2, %al
callq 0x10c0
movsd 0x68(%rsp), %xmm0
ucomisd 0x15a2(%rip), %xmm0     # 0x3020
jbe 0x1b07
movss 0x20(%rsp), %xmm3
movaps %xmm3, %xmm0
movss 0x58(%rsp), %xmm4
subss %xmm4, %xmm0
movss 0x15a9(%rip), %xmm1     # 0x3048
movaps %xmm3, %xmm2
mulss %xmm1, %xmm2
mulss %xmm3, %xmm2
mulss %xmm2, %xmm3
mulss %xmm0, %xmm1
mulss %xmm0, %xmm1
mulss %xmm0, %xmm1
divss 0x158a(%rip), %xmm1     # 0x304c
divss 0x1586(%rip), %xmm3     # 0x3050
mulss %xmm4, %xmm2
addss %xmm3, %xmm2
addss %xmm1, %xmm2
movss 0x8(%rsp), %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd 0x1523(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x196c(%rip), %rdi      # 0x346c
movb $0x2, %al
callq 0x10c0
movss 0x24(%rsp), %xmm5
movss 0x1c(%rsp), %xmm2
movaps %xmm5, %xmm0
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x14fa(%rip), %xmm0     # 0x3020
jbe 0x1bbb
movss 0x20(%rsp), %xmm4
movaps %xmm4, %xmm0
subss %xmm2, %xmm0
movaps %xmm4, %xmm1
mulss %xmm5, %xmm1
divss %xmm2, %xmm1
movss 0x14fc(%rip), %xmm2     # 0x3048
movaps %xmm4, %xmm3
mulss %xmm2, %xmm3
mulss %xmm4, %xmm3
movaps %xmm3, %xmm4
mulss %xmm1, %xmm4
subss %xmm5, %xmm1
mulss %xmm0, %xmm2
mulss %xmm0, %xmm2
mulss %xmm1, %xmm2
divss 0x14d6(%rip), %xmm2     # 0x304c
divss 0x14d2(%rip), %xmm4     # 0x3050
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rsp), %xmm0
subss %xmm3, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
movsd 0x146f(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x18e2(%rip), %rdi      # 0x3496
movb $0x2, %al
callq 0x10c0
movss 0x34(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x1453(%rip), %xmm0     # 0x3020
jbe 0x1c1a
movsd 0x1451(%rip), %xmm1     # 0x3028
mulsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0x8(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd 0x1410(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x18ad(%rip), %rdi      # 0x34c0
movb $0x2, %al
callq 0x10c0
movss 0x38(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x13f4(%rip), %xmm0     # 0x3020
jbe 0x1c79
movsd 0x13f2(%rip), %xmm1     # 0x3028
mulsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0x8(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd 0x13b1(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1878(%rip), %rdi      # 0x34ea
movb $0x2, %al
callq 0x10c0
movss 0x2c(%rsp), %xmm1
movss 0x28(%rsp), %xmm2
movaps %xmm2, %xmm0
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x1388(%rip), %xmm0     # 0x3020
jbe 0x1cec
movaps %xmm2, %xmm0
subss 0x3c(%rsp), %xmm0
mulss %xmm2, %xmm2
subss %xmm0, %xmm2
addss %xmm0, %xmm2
mulss 0x1391(%rip), %xmm2     # 0x3048
mulss %xmm2, %xmm1
movss 0x8(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd 0x133e(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x182f(%rip), %rdi      # 0x3514
movb $0x2, %al
callq 0x10c0
movss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movaps %xmm0, %xmm1
divsd 0x1329(%rip), %xmm1     # 0x3030
leaq 0x1830(%rip), %rdi      # 0x353e
movb $0x2, %al
callq 0x10c0
movsd 0x131b(%rip), %xmm0     # 0x3038
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1301(%rip), %xmm2     # 0x3030
divsd %xmm2, %xmm0
mulsd 0x1305(%rip), %xmm1     # 0x3040
divsd %xmm2, %xmm1
leaq 0x1821(%rip), %rdi      # 0x3567
movsd %xmm1, 0x8(%rsp)
movb $0x2, %al
callq 0x10c0
movq 0x8(%rbx), %rsi
leaq 0x90(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x1030
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x10b0
testq %rax, %rax
je 0x1dab
leaq 0x90(%rsp), %rbx
incq %rax
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1030
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x10b0
testq %rax, %rax
jne 0x1d86
leaq 0x17ec(%rip), %rsi      # 0x359e
leaq 0x90(%rsp), %rdi
callq 0x1140
testq %rax, %rax
je 0x1dc7
movb $0x0, (%rax)
movsd 0x50(%rsp), %xmm1
addsd %xmm1, %xmm1
xorps %xmm3, %xmm3
cvtss2sd 0x20c(%rsp), %xmm3
movsd 0x78(%rsp), %xmm4
addsd %xmm4, %xmm4
movsd 0x48(%rsp), %xmm7
addsd %xmm7, %xmm7
leaq 0x17ab(%rip), %rdi      # 0x35a3
leaq 0x90(%rsp), %rsi
movsd 0x88(%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
movsd 0x80(%rsp), %xmm5
movsd 0x70(%rsp), %xmm6
movb $0x8, %al
callq 0x10c0
xorl %ebx, %ebx
jmp 0x128f
leaq 0x17e9(%rip), %rdi      # 0x361c
callq 0x1060
movl $0x1, %ebx
jmp 0x128f
leaq 0x13e4(%rip), %rdi      # 0x322d
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x128f
nop