// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2ce8, %rsp           # imm = 0x2CE8
movq %rsi, %r14
movl $0x800, 0x31c(%rsp) # imm = 0x800
xorl %eax, %eax
movl %eax, 0x2b4(%rsp)
movl %eax, 0x2d4(%rsp)
cmpl $0x2, %edi
jl 0x2038
movl %edi, %ebx
xorps %xmm0, %xmm0
movl $0x1, %r13d
leaq 0x4cba(%rip), %r12      # 0x60d0
movl $0x0, 0x280(%rsp)
movl $0x1, 0x284(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x2cc(%rsp)
movl $0x0, 0x2c8(%rsp)
xorl %ebp, %ebp
movq (%r14,%r13,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1696
movzbl 0x1(%rsi), %eax
addl $-0x41, %eax
cmpl $0x12, %eax
ja 0x1696
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movaps %xmm0, 0x290(%rsp)
addq $0x2, %rsi
movq %rsi, %rdi
leaq 0x4cd7(%rip), %rsi      # 0x615a
leaq 0x28c(%rsp), %rdx
xorl %eax, %eax
callq 0x1180
movss 0x28c(%rsp), %xmm0
movss %xmm0, 0x308(%rsp)
addss 0x4bd4(%rip), %xmm0     # 0x6080
ucomiss 0x4bd1(%rip), %xmm0     # 0x6084
jbe 0x14bd
addss 0x4bcb(%rip), %xmm0     # 0x6088
movss %xmm0, 0x2b0(%rsp)
jmp 0x1630
addq $0x2, %rsi
leaq 0x4f0(%rsp), %rdi
jmp 0x1623
movaps %xmm0, 0x290(%rsp)
addq $0x2, %rsi
movq %rsi, %rdi
leaq 0x4c65(%rip), %rsi      # 0x6157
leaq 0x2d4(%rsp), %rdx
leaq 0x2d0(%rsp), %rcx
xorl %eax, %eax
callq 0x1180
cmpl $0x1, %eax
jg 0x1630
movl $0x3f000000, 0x2d0(%rsp) # imm = 0x3F000000
jmp 0x1630
addq $0x2, %rsi
leaq 0x470(%rsp), %rdi
movaps %xmm0, 0x290(%rsp)
callq 0x1050
movaps 0x290(%rsp), %xmm0
movl $0x1, 0x280(%rsp)
jmp 0x1638
movl $0x1, 0x2c8(%rsp)
jmp 0x1638
movl $0x0, 0x284(%rsp)
jmp 0x1638
addq $0x2, %rsi
leaq 0x350(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x344(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x340(%rsp), %rax
movq %rax, (%rsp)
movq %rsi, %rdi
leaq 0x4ba1(%rip), %rsi      # 0x6148
leaq 0x288(%rsp), %rdx
leaq 0x330(%rsp), %rcx
leaq 0x334(%rsp), %r8
leaq 0x338(%rsp), %r9
xorl %eax, %eax
movaps %xmm0, 0x290(%rsp)
callq 0x1180
movaps 0x290(%rsp), %xmm0
movl %eax, %r15d
jmp 0x1638
addq $0x2, %rsi
movq %rsi, %rdi
leaq 0x4b69(%rip), %rsi      # 0x615a
leaq 0x2b4(%rsp), %rdx
xorl %eax, %eax
movaps %xmm0, 0x290(%rsp)
callq 0x1180
jmp 0x1630
movl $0x1, 0x2cc(%rsp)
jmp 0x1638
addq $0x2, %rsi
leaq 0x3f0(%rsp), %rdi
movaps %xmm0, 0x290(%rsp)
callq 0x1050
movaps 0x290(%rsp), %xmm0
incq %r13
cmpq %rbx, %r13
jb 0x1447
jmp 0x169e
movaps %xmm0, 0x290(%rsp)
addq $0x2, %rsi
movq %rsi, %rdi
leaq 0x578(%rsp), %rsi
callq 0x3bd1
movq %rax, 0x300(%rsp)
testq %rax, %rax
je 0x1688
movl 0x6b4(%rsp), %ebp
movss 0x58c(%rsp), %xmm0
xorps 0x498a(%rip), %xmm0     # 0x6010
jmp 0x1638
movq $0x0, 0x300(%rsp)
jmp 0x1630
movl $0x1, %r13d
jmp 0x16a1
xorl %r13d, %r13d
movaps %xmm0, 0x290(%rsp)
movss 0x308(%rsp), %xmm0
movss %xmm0, 0x358(%rsp)
movss 0x2b0(%rsp), %xmm0
movss %xmm0, 0x35c(%rsp)
movl %ebp, 0x2bc(%rsp)
movl $0x0, 0x354(%rsp)
leal -0x1(%r15), %eax
cmpl $0x6, %eax
ja 0x186f
leaq 0x4a29(%rip), %rcx      # 0x611c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorps %xmm0, %xmm0
cvtss2sd 0x288(%rsp), %xmm0
mulsd 0x4988(%rip), %xmm0     # 0x6098
xorl %ebp, %ebp
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x288(%rsp)
movl $0x1, %r15d
movb $0x1, %r12b
movl $0x1, %eax
movq %rax, 0x2c0(%rsp)
jmp 0x188c
movss 0x28c(%rsp), %xmm0
subss 0x330(%rsp), %xmm0
movss 0x334(%rsp), %xmm1
movss 0x338(%rsp), %xmm2
leaq 0x3c0(%rsp), %rdi
callq 0x46f0
xorps %xmm1, %xmm1
cvtss2sd 0x288(%rsp), %xmm1
mulsd 0x4921(%rip), %xmm1     # 0x60a0
addsd 0x4921(%rip), %xmm1     # 0x60a8
addsd 0x4921(%rip), %xmm1     # 0x60b0
movsd 0x4921(%rip), %xmm0     # 0x60b8
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x288(%rsp)
movl $0x4, %r15d
movb $0x1, %r12b
movl $0x3, %eax
jmp 0x1862
movss 0x28c(%rsp), %xmm0
subss 0x330(%rsp), %xmm0
movss 0x334(%rsp), %xmm1
leaq 0x3c0(%rsp), %rdi
callq 0x48f2
xorps %xmm0, %xmm0
cvtss2sd 0x288(%rsp), %xmm0
mulsd 0x48c8(%rip), %xmm0     # 0x60c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x288(%rsp)
movl $0x3, %r15d
movb $0x1, %r12b
movl $0x2, %eax
jmp 0x1862
movss 0x28c(%rsp), %xmm0
leaq 0x330(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x49ae
xorps %xmm0, %xmm0
cvtss2sd 0x288(%rsp), %xmm0
mulsd 0x4851(%rip), %xmm0     # 0x6098
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x288(%rsp)
movl $0x7, %r15d
movb $0x1, %r12b
movl $0x4, %eax
movq %rax, 0x2c0(%rsp)
movb $0x1, %bpl
jmp 0x188c
movl $0x1, %r13d
movq $0x0, 0x2c0(%rsp)
movl $0x0, %r12d
movl $0x0, %ebp
cmpl $0x0, 0x284(%rsp)
je 0x18cc
leaq 0x4f0(%rsp), %rdi
movl $0x2e, %esi
callq 0x10c0
incq %rax
movq %rax, 0x2e0(%rsp)
movb $0x1, %bl
cmpl $0x0, 0x280(%rsp)
jne 0x18da
movb $0x1, %al
movl %eax, 0x280(%rsp)
movb $0x1, %bl
jmp 0x190d
xorl %ebx, %ebx
cmpl $0x0, 0x280(%rsp)
je 0x1904
xorl %ebx, %ebx
leaq 0x470(%rsp), %rdi
movl $0x2e, %esi
callq 0x10c0
incq %rax
movq %rax, 0x378(%rsp)
movl $0x0, 0x280(%rsp)
jmp 0x190d
movb $0x1, %al
movl %eax, 0x280(%rsp)
testl %r13d, %r13d
jne 0x2038
cmpl $0x1, %r15d
setne %al
movl %ebx, %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x1937
movq 0x2e0(%rsp), %rax
cmpb $0x61, (%rax)
jne 0x2038
movl $0x0, 0x2f0(%rsp)
movq $0x0, 0x2e8(%rsp)
testb %r12b, %r12b
je 0x1dac
xorl %ecx, %ecx
movq %rbp, 0x2d8(%rsp)
testq %rcx, %rcx
sete %al
cmpq $0x3, %rcx
sete %dl
orb %al, %dl
movq %rcx, 0x328(%rsp)
leaq (%rcx,%rcx,2), %rax
leaq (%rsp,%rax,4), %rax
addq $0x3c0, %rax            # imm = 0x3C0
movq %rax, 0x308(%rsp)
xorb $0x1, %dl
movb %dl, 0x2b0(%rsp)
xorl %r12d, %r12d
movss 0x288(%rsp), %xmm0
testb %bpl, %bpl
je 0x19b7
movq 0x308(%rsp), %rax
mulss (%rax,%r12,4), %xmm0
testb %bl, %bl
movss %xmm0, 0x284(%rsp)
je 0x1a74
leaq 0x4f0(%rsp), %rdi
leaq 0x7f0(%rsp), %rsi
callq 0x3bd1
testq %rax, %rax
je 0x1d84
movq %rax, %r15
cmpb $0x0, 0x280(%rsp)
jne 0x1a14
leaq 0x470(%rsp), %rdi
leaq 0xa68(%rsp), %rsi
callq 0x3bd1
movq %rax, %r13
testq %rax, %rax
je 0x1c42
cmpq $0x0, 0x328(%rsp)
je 0x1ada
cmpl %r14d, 0x92c(%rsp)
jne 0x1c4a
movl 0x2ac(%rsp), %eax
cmpl %eax, 0xba4(%rsp)
sete %al
orb 0x280(%rsp), %al
jne 0x1c6d
movq 0x85a2(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x4f5b(%rip), %rsi      # 0x69bb
leaq 0x470(%rsp), %rdx
movl 0x2ac(%rsp), %ecx
jmp 0x1c66
testq %r12, %r12
setne %al
orb 0x2b0(%rsp), %al
jne 0x1a99
leaq 0x46d0(%rip), %rdi      # 0x615a
leaq 0x320(%rsp), %rsi
xorl %eax, %eax
callq 0x11f0
leaq 0x46ba(%rip), %rdi      # 0x615a
leaq 0x324(%rsp), %rsi
xorl %eax, %eax
callq 0x11f0
movss 0x284(%rsp), %xmm0
mulss 0x324(%rsp), %xmm0
addss 0x2e8(%rsp,%r12,4), %xmm0
movss %xmm0, 0x2e8(%rsp,%r12,4)
jmp 0x1d84
movl $0x278, %edx            # imm = 0x278
leaq 0x578(%rsp), %rdi
leaq 0x7f0(%rsp), %rsi
callq 0x1130
movss 0x7f0(%rsp), %xmm4
movss 0x804(%rsp), %xmm0
movss %xmm4, 0x2b8(%rsp)
movl 0x92c(%rsp), %r14d
movl %r14d, 0x2f4(%rsp,%r12,4)
movss %xmm0, 0x38c(%rsp,%r12,4)
movss 0x808(%rsp), %xmm1
movss %xmm1, 0x380(%rsp,%r12,4)
movl %r14d, %eax
cmpb $0x0, 0x280(%rsp)
jne 0x1bd3
movss %xmm0, 0x3a4(%rsp,%r12,4)
movss 0xa7c(%rsp), %xmm3
movss 0xa80(%rsp), %xmm2
movss %xmm3, 0x398(%rsp,%r12,4)
ucomiss %xmm3, %xmm0
jp 0x1b89
minss %xmm0, %xmm3
movss %xmm3, 0x38c(%rsp,%r12,4)
movaps %xmm3, %xmm0
movl 0xba4(%rsp), %eax
movl %eax, 0x2ac(%rsp)
maxss %xmm1, %xmm2
subss %xmm0, %xmm2
divss %xmm4, %xmm2
addss 0x44e1(%rip), %xmm2     # 0x608c
cvttss2si %xmm2, %eax
leal -0x1(%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movl %eax, 0x2f4(%rsp,%r12,4)
mulss %xmm4, %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x380(%rsp,%r12,4)
movss %xmm4, 0x314(%rsp)
movsd 0x81c(%rsp), %xmm0
movaps %xmm0, 0x3b0(%rsp)
movslq %eax, %rdi
movl $0x4, %esi
callq 0x1110
movq %rax, 0x360(%rsp,%r12,8)
testq %r12, %r12
jne 0x1c6d
movss 0x2d4(%rsp), %xmm0
ucomiss 0x4479(%rip), %xmm0     # 0x6090
jbe 0x1c6d
movss 0x2d0(%rsp), %xmm1
movss 0x314(%rsp), %xmm2
leaq 0x2bc(%rsp), %rdi
callq 0x2047
movq %rax, 0x300(%rsp)
jmp 0x1c6d
xorl %r13d, %r13d
jmp 0x1d84
movq 0x83a7(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x4d60(%rip), %rsi      # 0x69bb
leaq 0x4f0(%rsp), %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x1120
movq 0x360(%rsp,%r12,8), %rbp
testl %r14d, %r14d
movss 0x284(%rsp), %xmm1
jle 0x1ca6
movl %r14d, %eax
xorl %ecx, %ecx
movss (%r15,%rcx,4), %xmm0
mulss %xmm1, %xmm0
addss (%rbp,%rcx,4), %xmm0
movss %xmm0, (%rbp,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x1c88
movq %r15, %rdi
callq 0x1040
movq 0x2e0(%rsp), %rcx
movb (%rcx), %al
incb %al
movb %al, (%rcx)
cmpb $0x0, 0x280(%rsp)
je 0x1cde
cmpb $0x39, %al
jne 0x1d7c
movq 0x2e0(%rsp), %rax
movb $0x61, (%rax)
jmp 0x1d7c
cmpl $0x0, 0x2ac(%rsp)
movss 0x284(%rsp), %xmm2
jle 0x1d57
movss 0x3a4(%rsp,%r12,4), %xmm0
subss 0x398(%rsp,%r12,4), %xmm0
andps 0x4314(%rip), %xmm0     # 0x6020
xorps %xmm1, %xmm1
cvtss2sd 0x2b8(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cltq
leaq (,%rax,4), %rax
addq %rbp, %rax
movl 0x2ac(%rsp), %ecx
xorl %edx, %edx
movss (%r13,%rdx,4), %xmm0
mulss %xmm2, %xmm0
addss (%rax,%rdx,4), %xmm0
movss %xmm0, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x1d3a
movq %r13, %rdi
callq 0x1040
movq 0x378(%rsp), %rcx
incb (%rcx)
movq 0x2e0(%rsp), %rax
cmpb $0x39, (%rax)
jne 0x1d7c
movb $0x61, (%rax)
addb $0x28, (%rcx)
movq 0x2d8(%rsp), %rbp
incq %r12
cmpq $0x3, %r12
jne 0x199b
movq 0x328(%rsp), %rcx
incq %rcx
cmpq 0x2c0(%rsp), %rcx
jne 0x1961
jmp 0x1dac
testb %bl, %bl
je 0x1fda
movss 0x2b4(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1df3
leaq 0x2b8(%rsp), %rdi
leaq 0x2b4(%rsp), %rsi
leaq 0x31c(%rsp), %rdx
leaq 0x318(%rsp), %rcx
leaq 0xce0(%rsp), %r8
callq 0x56d3
xorl %r14d, %r14d
leaq 0xce0(%rsp), %rbx
movl 0x2cc(%rsp), %ebp
movl 0x2c8(%rsp), %r15d
movq 0x300(%rsp), %r12
movl 0x2bc(%rsp), %esi
testl %esi, %esi
jle 0x1e38
movq 0x360(%rsp,%r14,8), %rdx
movl 0x2f4(%rsp,%r14,4), %ecx
movq %r12, %rdi
callq 0x2876
testl %r15d, %r15d
je 0x1e5b
movq 0x360(%rsp,%r14,8), %rdi
movl 0x2f4(%rsp,%r14,4), %esi
movss 0x2b8(%rsp), %xmm0
callq 0x2f2f
testl %ebp, %ebp
je 0x1e7d
movq 0x360(%rsp,%r14,8), %rdi
movl 0x2f4(%rsp,%r14,4), %esi
movss 0x2b8(%rsp), %xmm0
callq 0x3045
movss 0x2b4(%rsp), %xmm0
ucomiss 0x4203(%rip), %xmm0     # 0x6090
jbe 0x1eae
movl 0x318(%rsp), %esi
movq 0x360(%rsp,%r14,8), %rdx
movl 0x2f4(%rsp,%r14,4), %ecx
movq %rbx, %rdi
callq 0x2876
incq %r14
cmpq $0x3, %r14
jne 0x1e15
leaq 0x3f0(%rsp), %rdi
callq 0x10a0
movq %rax, %rbx
cmpl $0x0, 0x2bc(%rsp)
jne 0x1eec
leaq 0x3f0(%rsp), %rdi
callq 0x10a0
movw $0x69, 0x3f0(%rsp,%rax)
leaq 0x578(%rsp), %r15
movaps 0x3b0(%rsp), %xmm0
movlps %xmm0, 0x2c(%r15)
movss 0x28c(%rsp), %xmm0
movss %xmm0, 0xcc(%r15)
movaps 0x290(%rsp), %xmm2
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
leaq 0x4212(%rip), %r13      # 0x6138
leaq 0x420f(%rip), %rbp      # 0x613c
leaq 0x3f0(%rsp), %r12
xorl %r14d, %r14d
movaps %xmm2, 0x290(%rsp)
movb (%r13), %al
movb %al, 0x3ef(%rsp,%rbx)
movss 0x380(%rsp,%r14), %xmm0
movss 0x38c(%rsp,%r14), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
subps %xmm2, %xmm1
movlps %xmm1, 0x58c(%rsp)
movl 0x2f4(%rsp,%r14), %eax
movl %eax, 0x6b4(%rsp)
movss (%r14,%rbp), %xmm0
movss %xmm0, 0x660(%rsp)
movss 0x354(%rsp,%r14), %xmm0
movss %xmm0, 0x65c(%rsp)
movq 0x360(%rsp,%r14,2), %rax
movl $0x4f, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movq %rax, %rsi
callq 0x3cb2
movaps 0x290(%rsp), %xmm2
addq $0x4, %r14
incq %r13
cmpq $0xc, %r14
jne 0x1f40
jmp 0x2024
xorps %xmm0, %xmm0
cvtss2sd 0x320(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x28c(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x2e8(%rsp), %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x2ec(%rsp), %xmm3
xorps %xmm4, %xmm4
cvtss2sd 0x2f0(%rsp), %xmm4
leaq 0x49c5(%rip), %rdi      # 0x69e2
movb $0x5, %al
callq 0x10b0
xorl %eax, %eax
addq $0x2ce8, %rsp           # imm = 0x2CE8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1250
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2026