// File: /workspace/github_c_makefile_star2_O0/YunyiQian[P]multitel3/multisyn.c
// Function: main
int main(int argc, char **argv) {
  int	i,j,k,nn,ns,npt[3],npt1,npt2,error,intg,diff,src_type,filter,pt_shift;
  char	nam1[128],nam2[128],outnm[128],*ccc,*ddd,com[3]={'z','r','t'};
  int	dynamic=1,core=0;
  float	coef,rad[4][3],m0,az,*grn1,*grn2,*syn[3],*src,*pt,disp[3],mt[3][3];
  float cmpinc[3]={0,90.,90.}, cmpaz[3];
  float dt, dura, rise, tp, ts, tmp, dist, shift;
  float	*trapezoid(float, float, float, int *);
  float b[3],b1[3],b2[3],e[3],e1[3],e2[3];
  SACHEAD	hd,hd1,hd2;
#ifdef SAC_LIB
  char type[2] = {'B','P'}, proto[2] = {'B','U'};
  float	sn[30], sd[30];
  double f1, f2;
  long int order, nsects;
#endif
  void  fttq_(float *, float *, int *, int *, float *);
  int	mftm=2048, nftm;
  float	tstar=0., ftm[2048];

  /* input parameters */
  ns = 0;
  dura = 0.;
  src_type=0;
  intg=0;
  diff=0;
  filter=0;
  shift=0.;
  error = 0;
  for (i=1; !error && i < argc; i++) {
     if (argv[i][0] == '-') {
	switch(argv[i][1]) {

 	   case 'A':
	      sscanf(&argv[i][2], "%f",&az);
	      cmpaz[0] = 0.;
	      cmpaz[1] = az;
	      cmpaz[2] = az+90.;
	      if (cmpaz[2] > 360.) cmpaz[2] -= 360.;
	      break;
      
      case 'C':
         strcpy(nam2,&argv[i][2]);
         core = 1;
	      break;

 	   case 'D':
	      j = sscanf(&argv[i][2], "%f/%f",&dura,&rise);
	      if (j<2) rise = 0.5;
	      break;

#ifdef SAC_LIB
 	   case 'F':
	      filter = 1;
	      j = sscanf(&argv[i][2], "%lf/%lf/%ld",&f1,&f2,&order);
	      if (j<3) order = 4;
	      break;
#endif

 	   case 'G':
	      strcpy(nam1,&argv[i][2]);
	      break;

	   case 'I':
	      intg = 1;
	      break;

	   case 'J':
	      diff = 1;
	      break;

 	   case 'M':
	      src_type = sscanf(&argv[i][2], "%f/%f/%f/%f/%f/%f/%f",&m0,&mt[0][0],&mt[0][1],&mt[0][2],&mt[1][1],&mt[1][2],&mt[2][2]);
	      break;

 	   case 'O':
	      strcpy(outnm, &argv[i][2]);
	      break;

	   case 'P':
	      dynamic = 0;
	      break;

	   case 'Q':
	      sscanf(&argv[i][2], "%f",&tstar);
	      break;

 	   case 'S':
	      if ( (src=read_sac(&argv[i][2],&hd)) != NULL ) {
                 ns = hd.npts;
		 shift = -hd.b;
	      }
	      break;

	   default:
	      error = 1;
	      break;
	}
     }
        else error = 1;
  }

  switch (src_type) {
  case 1:
     nn = 1;
     m0 = m0*1.0e-20;
     break;
  case 3:
     nn = 2;
     sf_radiat(az-mt[0][0],mt[0][1],rad);
     m0 = m0*1.0e-15;
     break;
  case 4:
     nn = 3;
     dc_radiat(az-mt[0][0],mt[0][1],mt[0][2],rad);
     m0 = pow(10.,1.5*m0+16.1-20);
     break;
  case 7:
     nn = 4;
     mt_radiat(az,mt,rad);
     m0 = m0*1.0e-20;
     break;
  default:
     error = 1;
  }

  if (dynamic) ccc = strrchr(nam1, (int) '.') + 1;
  if (core) ddd = strrchr(nam2, (int) '.') + 1;

  if(argc == 1 || error || (dynamic && src_type == 1 && (*ccc) != 'a') ) {
     fprintf(stderr,"Usage: %s -Mmag([[/Strike/Dip]/Rake]|/Mxx/Mxy/Mxz/Myy/Myz/Mzz) -Aazimuth ([-SsrcFunctionName | -Ddura[/rise]] [-Ff1/f2[/n]] [-I | -J] -OoutName.z -GFirstCompOfGreen | -P)\n\
   Compute displacements in cm in the up, radial, and transverse (clockwise) directions produced by difference seismic sources\n\
   -M Specify source magnitude and orientation or moment-tensor\n\
      For double-couple, mag is Mw, strike/dip/rake are in A&R convention\n\
      For explosion; mag in in dyne-cm, no strike, dip, and rake needed\n\
      For single-force source; mag is in dyne, only strike and dip are needed\n\
      For moment-tensor; mag in dyne-cm, x=N,y=E,z=Down\n\
   -A Set station azimuth in degree measured from the North\n\
   -C Give the name of the first component of the core FK Green function\n\
   -D Specify the source time function as a trapezoid,\n\
      give the total duration and rise-time (0-0.5, default 0.5=triangle)\n\
   -F apply n-th order Butterworth band-pass filter, SAC lib required (off, n=4, must be < 10)\n\
   -G Give the name of the first component of the direct FK Green function\n\
   -I Integration once\n\
   -J Differentiate the synthetics\n\
   -O Output SAC file name\n\
   -P Compute static displacement, input Green functions from stdin in the form\n\
	distance Z45 R45 T45 ZDD RDD TDD ZSS RSS TSS [distance ZEX REX TEX]\n\
      The displacements will be output to stdout in the form of\n\
	distance azimuth z r t\n\
   -Q Convolve a Futterman Q operator of tstar (no)\n\
   -S Specify the SAC file name of the source time function (its sum. must be 1)\n\
   Examples:\n\
   * To compute three-component velocity at N33.5E azimuth from a Mw 4.5\n\
earthquake (strike 355, dip 80, rake -70), use:\n\
	multisyn -M4.5/355/80/-70 -D1 -A33.5 -OPAS.z -Gsp6direct_10/50.grn.0 -Csp6core_10/50.grn.0\n\
   * To compute the static displacements from the same earthquake, use:\n\
	nawk \'$1==50\' st.out | multisyn -M4.5/355/80/-70 -A33.5 -P\n\
   * To compute displacement from an explosion, use:\n\
   	multisyn -M3.3e20 -D1 -A33.5 -OPAS.z -Gsp6direct_10/50.grn.a -Csp6core_10/50.grn.a\n\
      or\n\
        multisyn -M3.3e20/1/0/0/1/0/1 -D1 -A33.5 -OPAS.z -Gsp6direct_10/50.grn.0 -Csp6core_10/50.grn.0\n\
	\n",argv[0]);
    return -1;
  }

  for(j=0; j<3; j++) disp[j] = 0.;
  for(i=0; i<nn; i++) {	/* sum up contribution from a DD, DS, SS, and EX */
//   for(i=0; i<1; i++) {	/* sum up contribution from a DD, DS, SS, and EX */
     for(j=0; j<3; j++) {
	coef = m0; if (nn>1) coef *= rad[i][j];
	if (!dynamic) {
	   if ((i==0||i==3) && j==0) scanf("%f",&dist);
	   scanf("%f",&tmp);
	   disp[j] += coef*tmp;
	   continue;
	}
        if ( (grn1=read_sac(nam1,&hd1)) == NULL ) continue;
        if (core) {
           if ( (grn2=read_sac(nam2,&hd2)) == NULL ) continue;
        }

	if ( i==0 ) {
      hd = hd1;
      dt = hd1.delta;
      npt1 = hd1.npts;
      npt[j] = npt1;
      b[j] = hd1.b;
      e[j] = hd1.e;
      if (core) {
         b1[j] = hd1.b;
         e1[j] = hd1.e;
         b2[j] = hd2.b;
         e2[j] = hd2.e;
         npt2 = hd2.npts;
         if ( b1[j]<=b2[j] ) b[j] = b1[j];
         if ( b1[j]>b2[j] ) b[j] = b2[j];
         if ( e1[j]>=e2[j] ) e[j] = e1[j];
         if ( e1[j]<e2[j] ) e[j] = e2[j];
         npt[j] = (int) ((e[j]-b[j])/dt+2);
         e[j] = b[j]+(npt[j]-1)*dt;
      }
	   tp = hd1.t1; ts = hd1.t2;
  	   syn[j]=(float *) calloc(npt[j], sizeof(float));
	   if (dura>0.&& j==0) src = trapezoid(dura,rise,dt,&ns);
	}
	else if (hd1.npts != npt1) {
	   fprintf(stderr,"number points in %s not agree with %d\n",nam1,npt1);
	}
   else if (core) {
	   if (hd2.npts != npt2) {
         fprintf(stderr,"number points in %s not agree with %d\n",nam2,npt2);
      }
   }
        for(pt=syn[j],k=0;k<npt1;k++,pt++) (*pt) += coef*grn1[k];
        free(grn1);
        (*ccc)++;
        if (core) {
           pt_shift = (int) (fabs(b1[j]-b2[j])/dt);
           for(pt=syn[j]+pt_shift,k=0;k<npt2;k++,pt++) (*pt) += coef*grn2[k];
           free(grn2);
           (*ddd)++;
        }
        
	if (*ccc == '9') {
      (*ccc)+=40;	/* explosion components start at 'a' instead of '0' */
      if (core) (*ddd)+=40;
   }
     }
  }

  if (!dynamic) {
     printf("%8.2f %8.2f %10.3e %10.3e %10.3e\n",dist,az,disp[0],disp[1],disp[2]);
     return 0;
  }

  /* convolve a source time function. integrate or filtering if needed */
#ifdef SAC_LIB
  if (filter) design(order, type, proto, 1., 1., f1, f2, (double) dt, sn, sd, &nsects);
#endif
  if (tstar>0.) fttq_(&dt,&tstar,&mftm,&nftm,ftm);
  for(j=0;j<3;j++) {
     if (ns > 0) conv(src,ns,syn[j],npt[j]);
     if (intg) cumsum(syn[j],npt[j],dt);
     if (diff) diffrt(syn[j],npt[j],dt);
#ifdef SAC_LIB
     if (filter) apply(syn[j],(long int)npt,0,sn,sd,nsects);
#endif
     if (tstar>0.) conv(ftm,nftm,syn[j],npt[j]);
  }

  /* output */
  ccc = outnm + strlen(outnm) - 1;
  if (ns == 0) strcat(outnm,"i");
//   hd.b -= shift;
//   hd.e -= shift;
  hd.t1 = tp; hd.t2 = ts;
  hd.az = az;
  for(j=0;j<3;j++) {
     *ccc = com[j];
     hd.b = b[j]-shift;
     hd.e = e[j]-shift;
     hd.npts = npt[j];
     hd.cmpinc = cmpinc[j];
     hd.cmpaz  = cmpaz[j];
     write_sac(outnm,hd,syn[j]);
  }

  return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d40, %rsp           # imm = 0x2D40
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw 0x6d98(%rip), %ax       # 0x80d8
movw %ax, -0x1e3(%rbp)
movb 0x6d8d(%rip), %al       # 0x80da
movb %al, -0x1e1(%rbp)
movl $0x1, -0x1e8(%rbp)
movl $0x0, -0x1ec(%rbp)
movq 0x6d6e(%rip), %rax      # 0x80dc
movq %rax, -0x29c(%rbp)
movl 0x6d69(%rip), %eax      # 0x80e4
movl %eax, -0x294(%rbp)
movl $0x800, -0xa7c(%rbp)    # imm = 0x800
xorps %xmm0, %xmm0
movss %xmm0, -0xa84(%rbp)
movl $0x0, -0x24(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x2b0(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x4c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x2c8(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x1, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x3c(%rbp)
movb %al, -0x2a91(%rbp)
jne 0x13fa
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
setl %al
movb %al, -0x2a91(%rbp)
movb -0x2a91(%rbp), %al
testb $0x1, %al
jne 0x1409
jmp 0x16fc
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x16e5
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x2aa0(%rbp)
subl $0x12, %eax
ja 0x16dc
movq -0x2aa0(%rbp), %rax
leaq 0x6c38(%rip), %rcx      # 0x808c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq 0x6c86(%rip), %rsi      # 0x80fa
leaq -0x228(%rbp), %rdx
movb $0x0, %al
callq 0x1140
xorps %xmm0, %xmm0
movss %xmm0, -0x2a8(%rbp)
movss -0x228(%rbp), %xmm0
movss %xmm0, -0x2a4(%rbp)
movss -0x228(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x6b8f(%rip), %xmm1     # 0x8040
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2a0(%rbp)
movss -0x2a0(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x6b63(%rip), %xmm1     # 0x8038
ucomisd %xmm1, %xmm0
jbe 0x14ff
movss -0x2a0(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x6b49(%rip), %xmm1     # 0x8038
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2a0(%rbp)
jmp 0x16e3
leaq -0x150(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x2, %rsi
callq 0x1050
movl $0x1, -0x1ec(%rbp)
jmp 0x16e3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq 0x6bb1(%rip), %rsi      # 0x80f7
leaq -0x2b0(%rbp), %rdx
leaq -0x2b4(%rbp), %rcx
movb $0x0, %al
callq 0x1140
movl %eax, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x1574
movss 0x6ae8(%rip), %xmm0     # 0x8054
movss %xmm0, -0x2b4(%rbp)
jmp 0x16e3
leaq -0xd0(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x2, %rsi
callq 0x1050
jmp 0x16e3
movl $0x1, -0x40(%rbp)
jmp 0x16e3
movl $0x1, -0x44(%rbp)
jmp 0x16e3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq -0x290(%rbp), %rcx
leaq -0x290(%rbp), %r8
addq $0x4, %r8
leaq -0x290(%rbp), %r9
addq $0x8, %r9
leaq -0x290(%rbp), %r11
addq $0xc, %r11
addq $0x4, %r11
leaq -0x290(%rbp), %r10
addq $0xc, %r10
addq $0x8, %r10
leaq -0x290(%rbp), %rax
addq $0x18, %rax
addq $0x8, %rax
leaq 0x6ad5(%rip), %rsi      # 0x80e8
leaq -0x224(%rbp), %rdx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x1140
movl %eax, -0x48(%rbp)
jmp 0x16e3
leaq -0x1d0(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x2, %rsi
callq 0x1050
jmp 0x16e3
movl $0x0, -0x1e8(%rbp)
jmp 0x16e3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq 0x6a7f(%rip), %rsi      # 0x80fa
leaq -0xa84(%rbp), %rdx
movb $0x0, %al
callq 0x1140
jmp 0x16e3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq -0x588(%rbp), %rsi
callq 0x4a40
movq %rax, -0x258(%rbp)
cmpq $0x0, %rax
je 0x16da
movl -0x44c(%rbp), %eax
movl %eax, -0x24(%rbp)
movss -0x574(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x2c8(%rbp)
jmp 0x16e3
movl $0x1, -0x3c(%rbp)
jmp 0x16ec
movl $0x1, -0x3c(%rbp)
jmp 0x16ee
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13dd
movl -0x48(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x2aa8(%rbp)
subl $0x6, %eax
ja 0x1874
movq -0x2aa8(%rbp), %rax
leaq 0x694f(%rip), %rcx      # 0x8070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x20(%rbp)
movss -0x224(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x68c3(%rip), %xmm1     # 0x8008
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x224(%rbp)
jmp 0x187b
movl $0x2, -0x20(%rbp)
movss -0x228(%rbp), %xmm0
subss -0x290(%rbp), %xmm0
movss -0x28c(%rbp), %xmm1
leaq -0x220(%rbp), %rdi
callq 0x5b50
movss -0x224(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x6897(%rip), %xmm1     # 0x8030
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x224(%rbp)
jmp 0x187b
movl $0x3, -0x20(%rbp)
movss -0x228(%rbp), %xmm0
subss -0x290(%rbp), %xmm0
movss -0x28c(%rbp), %xmm1
movss -0x288(%rbp), %xmm2
leaq -0x220(%rbp), %rdi
callq 0x5800
movss -0x224(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x682b(%rip), %xmm0     # 0x8020
mulsd %xmm0, %xmm1
movsd 0x6827(%rip), %xmm0     # 0x8028
addsd %xmm0, %xmm1
movsd 0x680b(%rip), %xmm0     # 0x8018
subsd %xmm0, %xmm1
movsd 0x67f7(%rip), %xmm0     # 0x8010
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x224(%rbp)
jmp 0x187b
movl $0x4, -0x20(%rbp)
movss -0x228(%rbp), %xmm0
leaq -0x290(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x5c80
movss -0x224(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x67a6(%rip), %xmm1     # 0x8008
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x224(%rbp)
jmp 0x187b
movl $0x1, -0x3c(%rbp)
cmpl $0x0, -0x1e8(%rbp)
je 0x18a0
leaq -0xd0(%rbp), %rdi
movl $0x2e, %esi
callq 0x10c0
addq $0x1, %rax
movq %rax, -0x1d8(%rbp)
cmpl $0x0, -0x1ec(%rbp)
je 0x18c5
leaq -0x150(%rbp), %rdi
movl $0x2e, %esi
callq 0x10c0
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
cmpl $0x1, -0x8(%rbp)
je 0x18ef
cmpl $0x0, -0x3c(%rbp)
jne 0x18ef
cmpl $0x0, -0x1e8(%rbp)
je 0x191a
cmpl $0x1, -0x48(%rbp)
jne 0x191a
movq -0x1d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
je 0x191a
movq 0x9702(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x67f6(%rip), %rsi      # 0x80fd
movb $0x0, %al
callq 0x1100
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x222b
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x1942
movslq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, -0x26c(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1921
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1f4f
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x1f3f
movss -0x224(%rbp), %xmm0
movss %xmm0, -0x1f0(%rbp)
cmpl $0x1, -0x20(%rbp)
jle 0x19a7
movslq -0x14(%rbp), %rcx
leaq -0x220(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
mulss -0x1f0(%rbp), %xmm0
movss %xmm0, -0x1f0(%rbp)
cmpl $0x0, -0x1e8(%rbp)
jne 0x1a1f
cmpl $0x0, -0x14(%rbp)
je 0x19bc
cmpl $0x3, -0x14(%rbp)
jne 0x19d7
cmpl $0x0, -0x18(%rbp)
jne 0x19d7
leaq 0x6731(%rip), %rdi      # 0x80fa
leaq -0x2c4(%rbp), %rsi
movb $0x0, %al
callq 0x11b0
leaq 0x671c(%rip), %rdi      # 0x80fa
leaq -0x2c0(%rbp), %rsi
movb $0x0, %al
callq 0x11b0
movss -0x1f0(%rbp), %xmm0
movss -0x2c0(%rbp), %xmm2
movslq -0x18(%rbp), %rax
movss -0x26c(%rbp,%rax,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x26c(%rbp,%rax,4)
jmp 0x1f31
leaq -0xd0(%rbp), %rdi
leaq -0x800(%rbp), %rsi
callq 0x4a40
movq %rax, -0x230(%rbp)
cmpq $0x0, %rax
jne 0x1a44
jmp 0x1f31
cmpl $0x0, -0x1ec(%rbp)
je 0x1a74
leaq -0x150(%rbp), %rdi
leaq -0xa78(%rbp), %rsi
callq 0x4a40
movq %rax, -0x238(%rbp)
cmpq $0x0, %rax
jne 0x1a72
jmp 0x1f31
jmp 0x1a74
cmpl $0x0, -0x14(%rbp)
jne 0x1d24
leaq -0x588(%rbp), %rdi
leaq -0x800(%rbp), %rsi
movl $0x278, %edx            # imm = 0x278
callq 0x1110
movss -0x800(%rbp), %xmm0
movss %xmm0, -0x2ac(%rbp)
movl -0x6c4(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movslq -0x18(%rbp), %rax
movl %ecx, -0x30(%rbp,%rax,4)
movss -0x7ec(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2d4(%rbp,%rax,4)
movss -0x7e8(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2f8(%rbp,%rax,4)
cmpl $0x0, -0x1ec(%rbp)
je 0x1c9d
movss -0x7ec(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2e0(%rbp,%rax,4)
movss -0x7e8(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x304(%rbp,%rax,4)
movss -0xa64(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2ec(%rbp,%rax,4)
movss -0xa60(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x310(%rbp,%rax,4)
movl -0x93c(%rbp), %eax
movl %eax, -0x38(%rbp)
movslq -0x18(%rbp), %rax
movss -0x2e0(%rbp,%rax,4), %xmm1
movslq -0x18(%rbp), %rax
movss -0x2ec(%rbp,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jb 0x1b87
movslq -0x18(%rbp), %rax
movss -0x2e0(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2d4(%rbp,%rax,4)
movslq -0x18(%rbp), %rax
movss -0x2e0(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
ucomiss -0x2ec(%rbp,%rax,4), %xmm0
jbe 0x1bbc
movslq -0x18(%rbp), %rax
movss -0x2ec(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2d4(%rbp,%rax,4)
movslq -0x18(%rbp), %rax
movss -0x304(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
ucomiss -0x310(%rbp,%rax,4), %xmm0
jb 0x1bf1
movslq -0x18(%rbp), %rax
movss -0x304(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2f8(%rbp,%rax,4)
movslq -0x18(%rbp), %rax
movss -0x304(%rbp,%rax,4), %xmm1
movslq -0x18(%rbp), %rax
movss -0x310(%rbp,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1c2a
movslq -0x18(%rbp), %rax
movss -0x310(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2f8(%rbp,%rax,4)
movslq -0x18(%rbp), %rax
movss -0x2f8(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
subss -0x2d4(%rbp,%rax,4), %xmm0
divss -0x2ac(%rbp), %xmm0
movss 0x63fc(%rip), %xmm1     # 0x8050
addss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movslq -0x18(%rbp), %rax
movl %ecx, -0x30(%rbp,%rax,4)
movslq -0x18(%rbp), %rax
movss -0x2d4(%rbp,%rax,4), %xmm1
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm0
movss -0x2ac(%rbp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x2f8(%rbp,%rax,4)
movss -0x7d4(%rbp), %xmm0
movss %xmm0, -0x2b8(%rbp)
movss -0x7d0(%rbp), %xmm0
movss %xmm0, -0x2bc(%rbp)
movslq -0x18(%rbp), %rax
movslq -0x30(%rbp,%rax,4), %rdi
movl $0x4, %esi
callq 0x10f0
movq %rax, %rcx
movslq -0x18(%rbp), %rax
movq %rcx, -0x250(%rbp,%rax,8)
movss -0x2b0(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1d22
cmpl $0x0, -0x18(%rbp)
jne 0x1d22
movss -0x2b0(%rbp), %xmm0
movss -0x2b4(%rbp), %xmm1
movss -0x2ac(%rbp), %xmm2
leaq -0x24(%rbp), %rdi
callq 0x2240
movq %rax, -0x258(%rbp)
jmp 0x1d8f
movl -0x6c4(%rbp), %eax
cmpl -0x34(%rbp), %eax
je 0x1d53
movq 0x92c2(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq -0xd0(%rbp), %rdx
movl -0x34(%rbp), %ecx
leaq 0x6c11(%rip), %rsi      # 0x895b
movb $0x0, %al
callq 0x1100
jmp 0x1d8d
cmpl $0x0, -0x1ec(%rbp)
je 0x1d8b
movl -0x93c(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0x1d89
movq 0x928a(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq -0x150(%rbp), %rdx
movl -0x38(%rbp), %ecx
leaq 0x6bd9(%rip), %rsi      # 0x895b
movb $0x0, %al
callq 0x1100
jmp 0x1d8b
jmp 0x1d8d
jmp 0x1d8f
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rax
movq %rax, -0x260(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x1dfd
movss -0x1f0(%rbp), %xmm0
movq -0x230(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
movq -0x260(%rbp), %rax
movss (%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x260(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x260(%rbp)
jmp 0x1da9
movq -0x230(%rbp), %rdi
callq 0x1040
movq -0x1d8(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
cmpl $0x0, -0x1ec(%rbp)
je 0x1ef7
movslq -0x18(%rbp), %rax
movss -0x2e0(%rbp,%rax,4), %xmm0
movslq -0x18(%rbp), %rax
subss -0x2ec(%rbp,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0x6217(%rip), %xmm1     # 0x8060
pand %xmm1, %xmm0
movss -0x2ac(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x50(%rbp)
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rax
movslq -0x50(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x260(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x1edd
movss -0x1f0(%rbp), %xmm0
movq -0x238(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
movq -0x260(%rbp), %rax
movss (%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x260(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x260(%rbp)
jmp 0x1e89
movq -0x238(%rbp), %rdi
callq 0x1040
movq -0x1e0(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
movq -0x1d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jne 0x1f2f
movq -0x1d8(%rbp), %rax
movsbl (%rax), %ecx
addl $0x28, %ecx
movb %cl, (%rax)
cmpl $0x0, -0x1ec(%rbp)
je 0x1f2d
movq -0x1e0(%rbp), %rax
movsbl (%rax), %ecx
addl $0x28, %ecx
movb %cl, (%rax)
jmp 0x1f2f
jmp 0x1f31
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x195c
jmp 0x1f41
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1949
cmpl $0x0, -0x1e8(%rbp)
jne 0x1fae
movss -0x2c4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x228(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movss -0x26c(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movss -0x268(%rbp), %xmm3
cvtss2sd %xmm3, %xmm3
movss -0x264(%rbp), %xmm4
cvtss2sd %xmm4, %xmm4
leaq 0x69e7(%rip), %rdi      # 0x8982
movb $0x5, %al
callq 0x10b0
movl $0x0, -0x4(%rbp)
jmp 0x222b
movss -0xa84(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1feb
leaq -0x2a90(%rbp), %r8
leaq -0x2ac(%rbp), %rdi
leaq -0xa84(%rbp), %rsi
leaq -0xa7c(%rbp), %rdx
leaq -0xa80(%rbp), %rcx
callq 0x71b9
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x20be
cmpl $0x0, -0x24(%rbp)
jle 0x2025
movq -0x258(%rbp), %rdi
movl -0x24(%rbp), %esi
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rdx
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %ecx
callq 0x2cf0
cmpl $0x0, -0x40(%rbp)
je 0x204c
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rdi
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %esi
movss -0x2ac(%rbp), %xmm0
callq 0x3650
cmpl $0x0, -0x44(%rbp)
je 0x2073
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rdi
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %esi
movss -0x2ac(%rbp), %xmm0
callq 0x3810
movss -0xa84(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x20ae
leaq -0x2a90(%rbp), %rdi
movl -0xa80(%rbp), %esi
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rdx
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %ecx
callq 0x2cf0
jmp 0x20b0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ff2
leaq -0x1d0(%rbp), %rax
movq %rax, -0x2ab0(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x2ab0(%rbp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x1d8(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x2109
leaq -0x1d0(%rbp), %rdi
leaq 0x68a0(%rip), %rsi      # 0x89a4
callq 0x11c0
movss -0x2b8(%rbp), %xmm0
movss %xmm0, -0x55c(%rbp)
movss -0x2bc(%rbp), %xmm0
movss %xmm0, -0x558(%rbp)
movss -0x228(%rbp), %xmm0
movss %xmm0, -0x4bc(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x2224
movslq -0x18(%rbp), %rax
movb -0x1e3(%rbp,%rax), %cl
movq -0x1d8(%rbp), %rax
movb %cl, (%rax)
movslq -0x18(%rbp), %rax
movss -0x2d4(%rbp,%rax,4), %xmm0
subss -0x2c8(%rbp), %xmm0
movss %xmm0, -0x574(%rbp)
movslq -0x18(%rbp), %rax
movss -0x2f8(%rbp,%rax,4), %xmm0
subss -0x2c8(%rbp), %xmm0
movss %xmm0, -0x570(%rbp)
movslq -0x18(%rbp), %rax
movl -0x30(%rbp,%rax,4), %eax
movl %eax, -0x44c(%rbp)
movslq -0x18(%rbp), %rax
movss -0x29c(%rbp,%rax,4), %xmm0
movss %xmm0, -0x4a0(%rbp)
movslq -0x18(%rbp), %rax
movss -0x2a8(%rbp,%rax,4), %xmm0
movss %xmm0, -0x4a4(%rbp)
leaq -0x1d0(%rbp), %rax
movq %rax, -0x2ab8(%rbp)
movslq -0x18(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rax
movq %rax, -0x2ac0(%rbp)
movq %rsp, %rdi
movl $0x4f, %ecx
leaq -0x588(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2ac0(%rbp), %rsi
movq -0x2ab8(%rbp), %rdi
callq 0x4b90
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2d40, %rsp           # imm = 0x2D40
popq %rbp
retq
nopw (%rax,%rax)