// File: /workspace/github_c_makefile_star2_O2/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 0x1d88
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
decl %ebp
pushq $0x2
popq %r15
leaq 0x1de3(%rip), %r12      # 0x3093
cmpl %ebp, %r15d
jge 0x159d
movslq %r15d, %r14
movq (%rbx,%r14,8), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x1dbc(%rip), %rsi      # 0x3096
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x1dab(%rip), %rsi      # 0x3099
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x1d9a(%rip), %rsi      # 0x309c
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x1d89(%rip), %rsi      # 0x309f
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x243a(%rip), %rsi      # 0x3764
callq 0x1140
testq %rax, %rax
jne 0x1348
movq %r13, %rdi
leaq 0x1d64(%rip), %rsi      # 0x30a2
callq 0x1140
testq %rax, %rax
je 0x1353
incl %r15d
incl %r15d
jmp 0x12b0
movq %r13, %rdi
leaq 0x1d48(%rip), %rsi      # 0x30a5
callq 0x1140
testq %rax, %rax
je 0x1d5c
leaq 0x1d36(%rip), %rdi      # 0x30a8
movl %r15d, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x10c0
movq (%rbx,%r14,8), %rdx
movb 0x2(%rdx), %al
leal -0x61(%rax), %ecx
cmpb $0x19, %cl
movq %rdx, 0x8(%rsp)
ja 0x13df
xorl %r13d, %r13d
cmpb $0x77, %al
setne %r13b
negl %r13d
cmpb $0x67, %al
pushq $0x1
popq %rcx
cmovel %ecx, %r13d
cmpb $0x68, %al
pushq $0x2
popq %rcx
cmovel %ecx, %r13d
cmpb $0x74, %al
pushq $0x3
popq %rcx
cmovel %ecx, %r13d
cmpb $0x61, %al
pushq $0x4
popq %rcx
cmovel %ecx, %r13d
cmpb $0x6c, %al
pushq $0x5
popq %rcx
cmovel %ecx, %r13d
cmpb $0x72, %al
pushq $0x6
popq %rcx
cmovel %ecx, %r13d
cmpb $0x7a, %al
je 0x1348
jmp 0x13eb
leaq 0x2(%rdx), %rdi
callq 0x1130
movl %eax, %r13d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x1070
cmpl $0x7, %r13d
ja 0x1d70
incl %r15d
cvtsd2ss %xmm0, %xmm2
movl %r13d, %eax
leaq 0x1c44(%rip), %rcx      # 0x3054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
cvtss2sd %xmm2, %xmm0
jmpq *%rax
movss %xmm2, 0x1ac(%rsp)
leaq 0x1c8a(%rip), %rdi      # 0x30b7
xorl %esi, %esi
jmp 0x14ec
movss %xmm2, 0x1cc(%rsp)
leaq 0x1d2c(%rip), %rdi      # 0x3170
pushq $0x3
jmp 0x14eb
movss 0x19c(%rsp), %xmm1
subss %xmm2, %xmm1
movss %xmm1, 0x1bc(%rsp)
cvtss2sd %xmm1, %xmm1
leaq 0x1c75(%rip), %rdi      # 0x30e1
pushq $0x1
popq %rsi
movb $0x2, %al
callq 0x10c0
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x134b
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1c77(%rip), %rdi      # 0x311c
movb $0x1, %al
callq 0x10c0
jmp 0x134b
movss %xmm2, 0x1c0(%rsp)
leaq 0x1c8c(%rip), %rdi      # 0x314d
pushq $0x2
jmp 0x14eb
movss %xmm2, 0x1a0(%rsp)
leaq 0x1d35(%rip), %rdi      # 0x320a
pushq $0x6
jmp 0x14eb
movss %xmm2, 0x1c8(%rsp)
leaq 0x1cb1(%rip), %rdi      # 0x319a
pushq $0x4
popq %rsi
movb $0x1, %al
callq 0x10c0
jmp 0x134b
leaq 0x1cbe(%rip), %rdi      # 0x31bd
pushq $0x5
popq %rsi
movb $0x1, %al
movss %xmm2, 0x8(%rsp)
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss 0x19c(%rsp), %xmm0
ucomiss %xmm2, %xmm0
jne 0x1525
jnp 0x158f
subss %xmm2, %xmm0
movss 0x1bc(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x1bc(%rsp)
cvtss2sd %xmm1, %xmm0
leaq 0x1c96(%rip), %rdi      # 0x31e0
movb $0x1, %al
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x158f
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1b9a(%rip), %rdi      # 0x311c
movb $0x1, %al
callq 0x10c0
movss 0x8(%rsp), %xmm2
movss %xmm2, 0x19c(%rsp)
jmp 0x134b
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x15e1
movss %xmm0, 0x1cc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x1c96(%rip), %rdi      # 0x325e
movb $0x1, %al
callq 0x10c0
movss 0x1bc(%rsp), %xmm0
movss 0x1cc(%rsp), %xmm1
subss 0x1e0(%rsp), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x15fb
movss %xmm0, 0x1cc(%rsp)
movaps %xmm0, %xmm1
movss 0x1c4(%rsp), %xmm0
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jbe 0x1653
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cvtss2sd 0x1c8(%rsp), %xmm0
mulsd 0x19e1(%rip), %xmm0     # 0x3008
divsd 0x19e1(%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 0x16aa
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
cvtss2sd 0x1c8(%rsp), %xmm0
mulsd 0x1995(%rip), %xmm0     # 0x3008
divsd 0x1995(%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 0x16bf
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)
cvtss2sd %xmm1, %xmm0
cvtss2sd %xmm3, %xmm1
movss %xmm2, 0x58(%rsp)
cvtss2sd %xmm2, %xmm2
cvtss2sd 0x1e0(%rsp), %xmm3
movsd %xmm3, 0x48(%rsp)
leaq 0x1ae7(%rip), %rdi      # 0x329a
movsd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x88(%rsp)
movsd %xmm2, 0x68(%rsp)
movb $0x3, %al
callq 0x10c0
cvtss2sd 0x30(%rsp), %xmm0
cvtss2sd 0x44(%rsp), %xmm1
cvtss2sd 0x18(%rsp), %xmm2
movsd %xmm2, 0x60(%rsp)
cvtss2sd 0x14(%rsp), %xmm3
cvtss2sd 0x1c8(%rsp), %xmm4
leaq 0x1ae6(%rip), %rdi      # 0x32e3
movsd %xmm0, 0x78(%rsp)
movsd %xmm1, 0x80(%rsp)
movsd %xmm3, 0x70(%rsp)
movsd 0x48(%rsp), %xmm5
movb $0x6, %al
callq 0x10c0
cvtss2sd 0x1c(%rsp), %xmm0
cvtss2sd 0x24(%rsp), %xmm1
cvtss2sd 0x1c8(%rsp), %xmm2
leaq 0x1b14(%rip), %rdi      # 0x334f
movb $0x3, %al
callq 0x10c0
cvtss2sd 0x40(%rsp), %xmm0
cvtss2sd 0x8(%rsp), %xmm1
leaq 0x1b2b(%rip), %rdi      # 0x3380
movb $0x2, %al
callq 0x10c0
cvtss2sd 0x28(%rsp), %xmm0
cvtss2sd 0x2c(%rsp), %xmm1
cvtss2sd 0x3c(%rsp), %xmm2
leaq 0x1b3b(%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 0x179a(%rip), %xmm1     # 0x3048
movss %xmm1, 0x8(%rsp)
cvtss2sd %xmm1, %xmm0
movsd 0x1758(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1b23(%rip), %rdi      # 0x33ee
movb $0x2, %al
callq 0x10c0
movsd 0x60(%rsp), %xmm0
ucomisd 0x1740(%rip), %xmm0     # 0x3020
jbe 0x1976
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 0x172f(%rip), %xmm3     # 0x3048
movaps %xmm0, %xmm4
mulss %xmm3, %xmm4
mulss %xmm0, %xmm4
mulss %xmm2, %xmm4
movss 0x171c(%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)
cvtss2sd %xmm4, %xmm0
movsd 0x16b4(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1aa9(%rip), %rdi      # 0x3418
movb $0x2, %al
callq 0x10c0
xorps %xmm0, %xmm0
movss 0x30(%rsp), %xmm3
ucomiss %xmm0, %xmm3
movss 0x44(%rsp), %xmm2
jbe 0x19db
movss 0x14(%rsp), %xmm1
ucomiss %xmm1, %xmm2
jbe 0x19db
movss 0x16ab(%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)
cvtss2sd %xmm2, %xmm0
movsd 0x164f(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1a6e(%rip), %rdi      # 0x3442
movb $0x2, %al
callq 0x10c0
movsd 0x68(%rsp), %xmm0
ucomisd 0x1637(%rip), %xmm0     # 0x3020
jbe 0x1a6f
movss 0x20(%rsp), %xmm3
movaps %xmm3, %xmm0
movss 0x58(%rsp), %xmm4
subss %xmm4, %xmm0
movss 0x163e(%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 0x161f(%rip), %xmm1     # 0x304c
divss 0x161b(%rip), %xmm3     # 0x3050
mulss %xmm4, %xmm2
addss %xmm3, %xmm2
addss %xmm1, %xmm2
movss 0x8(%rsp), %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0x8(%rsp)
cvtss2sd %xmm2, %xmm0
movsd 0x15bb(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1a04(%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 0x1592(%rip), %xmm0     # 0x3020
jbe 0x1b20
movss 0x20(%rsp), %xmm4
movaps %xmm4, %xmm0
subss %xmm2, %xmm0
movaps %xmm4, %xmm1
mulss %xmm5, %xmm1
divss %xmm2, %xmm1
movss 0x1594(%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 0x156e(%rip), %xmm2     # 0x304c
divss 0x156a(%rip), %xmm4     # 0x3050
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rsp), %xmm0
subss %xmm3, %xmm0
movss %xmm0, 0x8(%rsp)
cvtss2sd %xmm3, %xmm0
movsd 0x150a(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x197d(%rip), %rdi      # 0x3496
movb $0x2, %al
callq 0x10c0
movss 0x34(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x14ee(%rip), %xmm0     # 0x3020
jbe 0x1b7c
movsd 0x14ec(%rip), %xmm1     # 0x3028
mulsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss 0x8(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd 0x14ae(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x194b(%rip), %rdi      # 0x34c0
movb $0x2, %al
callq 0x10c0
movss 0x38(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x1492(%rip), %xmm0     # 0x3020
jbe 0x1bd8
movsd 0x1490(%rip), %xmm1     # 0x3028
mulsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss 0x8(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd 0x1452(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x1919(%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 0x1429(%rip), %xmm0     # 0x3020
jbe 0x1c48
movaps %xmm2, %xmm0
subss 0x3c(%rsp), %xmm0
mulss %xmm2, %xmm2
subss %xmm0, %xmm2
addss %xmm0, %xmm2
mulss 0x1432(%rip), %xmm2     # 0x3048
mulss %xmm2, %xmm1
movss 0x8(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
cvtss2sd %xmm1, %xmm0
movsd 0x13e2(%rip), %xmm1     # 0x3018
mulsd %xmm0, %xmm1
leaq 0x18d3(%rip), %rdi      # 0x3514
movb $0x2, %al
callq 0x10c0
movss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movaps %xmm0, %xmm1
divsd 0x13cd(%rip), %xmm1     # 0x3030
leaq 0x18d4(%rip), %rdi      # 0x353e
movb $0x2, %al
callq 0x10c0
movsd 0x13bf(%rip), %xmm0     # 0x3038
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x13a5(%rip), %xmm2     # 0x3030
divsd %xmm2, %xmm0
mulsd 0x13a9(%rip), %xmm1     # 0x3040
divsd %xmm2, %xmm1
leaq 0x18c5(%rip), %rdi      # 0x3567
movsd %xmm1, 0x8(%rsp)
movb $0x2, %al
callq 0x10c0
movq 0x8(%rbx), %rsi
leaq 0x90(%rsp), %rbx
pushq $0x2f
popq %rbp
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x1030
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10b0
leaq 0x1(%rax), %rsi
testq %rax, %rax
jne 0x1cbe
leaq 0x18b9(%rip), %rsi      # 0x359e
leaq 0x90(%rsp), %rdi
callq 0x1140
testq %rax, %rax
je 0x1cfa
movb $0x0, (%rax)
movsd 0x50(%rsp), %xmm1
addsd %xmm1, %xmm1
cvtss2sd 0x20c(%rsp), %xmm3
movsd 0x78(%rsp), %xmm4
addsd %xmm4, %xmm4
movsd 0x48(%rsp), %xmm7
addsd %xmm7, %xmm7
leaq 0x187b(%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 0x18b9(%rip), %rdi      # 0x361c
callq 0x1060
pushq $0x1
popq %rbx
jmp 0x128f
leaq 0x14b6(%rip), %rdi      # 0x322d
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
jmp 0x1d6a
nop