// File: /workspace/github_c_makefile_star2_O2/YunyiQian[P]multitel3/radiats.c
// Function: nmtensor
void nmtensor(float iso, float clvd, float str, float dip, float rake, float tensor[3][3]) {
  float cstr,cdip,crak,sstr,sdip,srak,sstr2,cstr2,sdip2,cdip2,dum,dev;
  float n[3], v[3], N[3];
  dum = 0.8164966*iso;
  tensor[0][0] = tensor[1][1] = tensor[2][2] = dum;
  tensor[0][1] = tensor[0][2] = tensor[1][2] = 0.;
  dev = 1.-iso*iso;
  if (dev>0.) {
     dev = sqrt(dev);
     dum = dev*sqrt(1.-clvd*clvd);
     str  *= DEG2RAD; dip  *= DEG2RAD; rake *= DEG2RAD;
     sstr=sin(str);cstr=cos(str);sstr2=2*sstr*cstr;cstr2=1-2*sstr*sstr;
     sdip=sin(dip);cdip=cos(dip);sdip2=2*sdip*cdip;cdip2=1-2*sdip*sdip;
     crak=cos(rake);srak=sin(rake);
     tensor[0][0] += -dum*(sdip*crak*sstr2+sdip2*srak*sstr*sstr);
     tensor[0][1] +=  dum*(sdip*crak*cstr2+0.5*sdip2*srak*sstr2);
     tensor[0][2] += -dum*(cdip*crak*cstr+cdip2*srak*sstr);
     tensor[1][1] +=  dum*(sdip*crak*sstr2-sdip2*srak*cstr*cstr);
     tensor[1][2] +=  dum*(cdip2*srak*cstr-cdip*crak*sstr);
     tensor[2][2] +=  dum*sdip2*srak;
     if (clvd>0.0001 || clvd<-0.0001) {
        n[0] = -sdip*sstr; n[1] = sdip*cstr; n[2] = -cdip;
        v[0] =  crak*cstr+srak*cdip*sstr; v[1] = crak*sstr-srak*cdip*cstr; v[2] = -srak*sdip;
        N[0] = n[1]*v[2]-n[2]*v[1]; N[1] = n[2]*v[0]-n[0]*v[2]; N[2] = n[0]*v[1]-n[1]*v[0];
        //fprintf(stderr," n= %f %f %f  v = %f %f %f\n",n[0],n[1],n[2],v[0],v[1],v[2]);
        dum = dev*clvd/sqrt(3.);
        tensor[0][0] += dum*(2*N[0]*N[0]-n[0]*n[0]-v[0]*v[0]);
        tensor[0][1] += dum*(2*N[0]*N[1]-n[0]*n[1]-v[0]*v[1]);
        tensor[0][2] += dum*(2*N[0]*N[2]-n[0]*n[2]-v[0]*v[2]);
        tensor[1][1] += dum*(2*N[1]*N[1]-n[1]*n[1]-v[1]*v[1]);
        tensor[1][2] += dum*(2*N[1]*N[2]-n[1]*n[2]-v[1]*v[2]);
        tensor[2][2] += dum*(2*N[2]*N[2]-n[2]*n[2]-v[2]*v[2]);
     }
  }
  tensor[1][0] = tensor[0][1];
  tensor[2][0] = tensor[0][2];
  tensor[2][1] = tensor[1][2];
}

// Assembly:
pushq %rbx
subq $0xb0, %rsp
movq %rdi, %rbx
movaps %xmm0, %xmm5
cvtss2sd %xmm0, %xmm0
mulsd 0x28ee(%rip), %xmm0     # 0x6ea0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rdi)
movss %xmm0, 0x10(%rdi)
movss %xmm0, (%rdi)
andl $0x0, 0x14(%rdi)
andq $0x0, 0x4(%rdi)
mulss %xmm5, %xmm5
movss 0x240b(%rip), %xmm0     # 0x69e4
subss %xmm5, %xmm0
xorps %xmm15, %xmm15
xorps %xmm6, %xmm6
ucomiss %xmm6, %xmm0
jbe 0x4b03
xorps %xmm5, %xmm5
ucomiss %xmm5, %xmm0
movaps %xmm1, 0x40(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm3, (%rsp)
movss %xmm2, 0x30(%rsp)
jb 0x4611
sqrtss %xmm0, %xmm0
jmp 0x461b
callq 0x1130
movaps 0x40(%rsp), %xmm1
movss %xmm0, 0x2c(%rsp)
cvtss2sd %xmm0, %xmm2
movaps %xmm1, %xmm0
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1a00(%rip), %xmm0     # 0x6038
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x464c
sqrtsd %xmm0, %xmm0
jmp 0x465d
movsd %xmm2, 0x60(%rsp)
callq 0x1210
movsd 0x60(%rsp), %xmm2
movss 0x10(%rsp), %xmm3
movss 0x30(%rsp), %xmm1
mulsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
cvtss2sd %xmm1, %xmm0
movsd 0x280e(%rip), %xmm1     # 0x6e90
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd (%rsp), %xmm2
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, (%rsp)
cvtss2sd %xmm3, %xmm2
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm1
movss %xmm1, 0x50(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x11d0
movaps %xmm0, 0xa0(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x10d0
movaps %xmm0, 0x90(%rsp)
cvtss2sd (%rsp), %xmm0
movsd %xmm0, (%rsp)
callq 0x11d0
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
callq 0x10d0
cvtsd2ss %xmm0, %xmm1
movaps %xmm1, (%rsp)
movaps 0x10(%rsp), %xmm2
movaps %xmm2, %xmm0
addss %xmm2, %xmm0
movaps %xmm0, %xmm3
mulss %xmm1, %xmm3
movaps %xmm3, 0x80(%rsp)
mulss %xmm2, %xmm0
movss 0x22bb(%rip), %xmm1     # 0x69e4
subss %xmm0, %xmm1
movaps %xmm1, 0x30(%rsp)
cvtss2sd 0x50(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
callq 0x10d0
movaps %xmm0, 0x50(%rsp)
movsd 0x78(%rsp), %xmm0
callq 0x11d0
movaps 0x80(%rsp), %xmm14
cvtss2sd %xmm14, %xmm5
mulsd 0x2297(%rip), %xmm5     # 0x6a00
movss (%rbx), %xmm12
movapd 0x90(%rsp), %xmm1
unpcklpd 0xa0(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm7
movapd %xmm7, %xmm4
shufps $0x55, %xmm7, %xmm4     # xmm4 = xmm4[1,1],xmm7[1,1]
movaps %xmm4, %xmm2
addss %xmm4, %xmm2
movaps %xmm2, %xmm6
mulss %xmm7, %xmm6
mulss %xmm4, %xmm2
movss 0x223e(%rip), %xmm1     # 0x69e4
subss %xmm2, %xmm1
movapd 0x50(%rsp), %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
cvtpd2ps %xmm2, %xmm2
movapd %xmm2, %xmm3
shufps $0x55, %xmm2, %xmm3     # xmm3 = xmm3[1,1],xmm2[1,1]
movaps %xmm2, %xmm0
mulss 0x10(%rsp), %xmm0
movaps %xmm14, %xmm9
mulss %xmm3, %xmm9
movaps %xmm9, %xmm8
mulss %xmm4, %xmm8
mulss %xmm4, %xmm8
mulss %xmm0, %xmm1
mulss %xmm6, %xmm0
addss %xmm0, %xmm8
movaps 0x60(%rsp), %xmm13
mulss %xmm13, %xmm8
subss %xmm8, %xmm12
cvtss2sd %xmm3, %xmm8
mulsd %xmm5, %xmm8
movaps 0x1862(%rip), %xmm5     # 0x6070
cvtss2sd %xmm6, %xmm6
mulsd %xmm8, %xmm6
cvtss2sd %xmm13, %xmm8
cvtss2sd %xmm1, %xmm10
addsd %xmm10, %xmm6
cvtss2sd 0x4(%rbx), %xmm10
mulsd %xmm8, %xmm6
addsd %xmm10, %xmm6
movaps (%rsp), %xmm8
movaps %xmm8, %xmm1
unpcklps 0x30(%rsp), %xmm8       # xmm8 = xmm8[0],mem[0],xmm8[1],mem[1]
movaps %xmm8, %xmm10
mulps %xmm2, %xmm10
movaps %xmm10, %xmm11
xorps %xmm5, %xmm11
shufps $0xd4, %xmm10, %xmm11   # xmm11 = xmm11[0,1],xmm10[1,3]
shufps $0x52, %xmm10, %xmm11   # xmm11 = xmm11[2,0],xmm10[1,1]
mulps %xmm4, %xmm11
movaps %xmm7, %xmm4
shufps $0x0, %xmm7, %xmm4      # xmm4 = xmm4[0,0],xmm7[0,0]
mulps %xmm10, %xmm4
movaps %xmm13, %xmm10
xorps %xmm5, %xmm10
movss %xmm12, (%rbx)
cvtsd2ss %xmm6, %xmm6
movss %xmm6, 0x4(%rbx)
addps %xmm11, %xmm4
unpcklps %xmm13, %xmm10          # xmm10 = xmm10[0],xmm13[0],xmm10[1],xmm13[1]
mulps %xmm4, %xmm10
movss 0x14(%rbx), %xmm11
movss 0x8(%rbx), %xmm15
unpcklps %xmm11, %xmm15          # xmm15 = xmm15[0],xmm11[0],xmm15[1],xmm11[1]
addps %xmm10, %xmm15
mulss %xmm7, %xmm9
mulss %xmm7, %xmm9
subss %xmm9, %xmm0
movaps %xmm15, %xmm9
shufps $0x55, %xmm15, %xmm9    # xmm9 = xmm9[1,1],xmm15[1,1]
movss %xmm15, 0x8(%rbx)
mulss %xmm13, %xmm0
addss 0x10(%rbx), %xmm0
movss %xmm0, 0x10(%rbx)
movss %xmm9, 0x14(%rbx)
mulss %xmm13, %xmm14
movaps 0x177c(%rip), %xmm9     # 0x6060
movaps 0x40(%rsp), %xmm13
andps %xmm13, %xmm9
cvtss2sd %xmm9, %xmm9
ucomisd 0x25ac(%rip), %xmm9     # 0x6ea8
mulss %xmm3, %xmm14
addss 0x20(%rbx), %xmm14
movss %xmm14, 0x20(%rbx)
jbe 0x4b03
movaps %xmm14, %xmm4
movaps 0x10(%rsp), %xmm14
movaps %xmm14, %xmm9
xorps %xmm5, %xmm9
movaps %xmm1, %xmm11
xorps %xmm5, %xmm11
movaps %xmm3, %xmm10
mulss %xmm1, %xmm10
movss 0x2c(%rsp), %xmm1
mulss %xmm13, %xmm1
movaps %xmm12, 0x40(%rsp)
movaps %xmm10, %xmm12
xorps %xmm5, %xmm12
xorps %xmm5, %xmm3
mulss %xmm14, %xmm3
unpcklps %xmm9, %xmm14           # xmm14 = xmm14[0],xmm9[0],xmm14[1],xmm9[1]
mulps %xmm7, %xmm14
unpcklps %xmm10, %xmm12          # xmm12 = xmm12[0],xmm10[0],xmm12[1],xmm10[1]
shufps $0xe1, %xmm12, %xmm12   # xmm12 = xmm12[1,0,2,3]
movaps %xmm7, %xmm9
shufps $0xe1, %xmm7, %xmm9     # xmm9 = xmm9[1,0],xmm7[2,3]
mulps %xmm12, %xmm9
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
mulps %xmm7, %xmm2
addps %xmm9, %xmm2
movaps %xmm14, %xmm9
shufps $0x55, %xmm14, %xmm9    # xmm9 = xmm9[1,1],xmm14[1,1]
movaps %xmm9, %xmm10
xorps %xmm5, %xmm10
movaps %xmm2, %xmm7
shufps $0x55, %xmm2, %xmm7     # xmm7 = xmm7[1,1],xmm2[1,1]
pshufd $0x0, %xmm10, %xmm12    # xmm12 = xmm10[0,0,0,0]
movaps %xmm10, %xmm13
movlhps %xmm8, %xmm13           # xmm13 = xmm13[0],xmm8[0]
shufps $0xe2, %xmm8, %xmm13    # xmm13 = xmm13[2,0],xmm8[2,3]
movaps %xmm3, %xmm8
shufps $0xd4, %xmm2, %xmm8     # xmm8 = xmm8[0,1],xmm2[1,3]
shufps $0x52, %xmm2, %xmm8     # xmm8 = xmm8[2,0],xmm2[1,1]
mulps %xmm8, %xmm13
movlhps %xmm14, %xmm11          # xmm11 = xmm11[0],xmm14[0]
shufps $0xe2, %xmm14, %xmm11   # xmm11 = xmm11[2,0],xmm14[2,3]
movaps %xmm2, %xmm10
movlhps %xmm3, %xmm10           # xmm10 = xmm10[0],xmm3[0]
shufps $0x52, %xmm2, %xmm10    # xmm10 = xmm10[2,0],xmm2[1,1]
mulps %xmm11, %xmm10
addps %xmm13, %xmm10
movaps %xmm2, %xmm8
mulss %xmm14, %xmm8
mulss %xmm7, %xmm9
subss %xmm8, %xmm9
movaps %xmm10, %xmm11
addps %xmm10, %xmm11
movaps %xmm14, %xmm8
shufps $0xe1, %xmm14, %xmm8    # xmm8 = xmm8[1,0],xmm14[2,3]
mulps %xmm8, %xmm12
movaps 0x40(%rsp), %xmm13
unpcklps %xmm6, %xmm13           # xmm13 = xmm13[0],xmm6[0],xmm13[1],xmm6[1]
movaps %xmm11, %xmm6
shufps $0x0, %xmm11, %xmm6     # xmm6 = xmm6[0,0],xmm11[0,0]
mulps %xmm10, %xmm6
addps %xmm12, %xmm6
movaps %xmm2, %xmm12
shufps $0x0, %xmm2, %xmm12     # xmm12 = xmm12[0,0],xmm2[0,0]
mulps %xmm2, %xmm12
subps %xmm12, %xmm6
movaps %xmm9, %xmm12
addss %xmm9, %xmm12
mulss %xmm9, %xmm12
shufps $0x0, %xmm9, %xmm9      # xmm9 = xmm9[0,0,0,0]
mulps %xmm11, %xmm9
shufps $0x55, %xmm11, %xmm11   # xmm11 = xmm11[1,1,1,1]
shufps $0x55, %xmm10, %xmm10   # xmm10 = xmm10[1,1,1,1]
mulss %xmm11, %xmm10
mulss %xmm14, %xmm14
subss %xmm14, %xmm10
xorps %xmm2, %xmm5
pshufd $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
mulss %xmm7, %xmm5
cvtss2sd %xmm1, %xmm7
divsd 0x2439(%rip), %xmm7     # 0x6eb0
addss %xmm10, %xmm5
movaps (%rsp), %xmm1
movaps %xmm1, %xmm10
mulss %xmm1, %xmm1
subss %xmm1, %xmm12
movaps %xmm3, %xmm11
mulss %xmm3, %xmm3
subss %xmm3, %xmm12
cvtsd2ss %xmm7, %xmm3
mulss %xmm3, %xmm5
mulss %xmm3, %xmm12
shufps $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0]
mulps %xmm3, %xmm6
addps %xmm13, %xmm6
shufps $0x0, %xmm10, %xmm10    # xmm10 = xmm10[0,0,0,0]
mulps %xmm8, %xmm10
addps %xmm10, %xmm9
shufps $0x0, %xmm11, %xmm11    # xmm11 = xmm11[0,0,0,0]
mulps %xmm2, %xmm11
subps %xmm11, %xmm9
mulps %xmm3, %xmm9
addps %xmm9, %xmm15
addss %xmm0, %xmm5
movlps %xmm6, (%rbx)
movss %xmm15, 0x8(%rbx)
movss %xmm5, 0x10(%rbx)
movaps %xmm15, %xmm0
shufps $0x55, %xmm15, %xmm0    # xmm0 = xmm0[1,1],xmm15[1,1]
movss %xmm0, 0x14(%rbx)
addss %xmm4, %xmm12
movss %xmm12, 0x20(%rbx)
shufps $0x55, %xmm6, %xmm6     # xmm6 = xmm6[1,1,1,1]
movss %xmm6, 0xc(%rbx)
movlps %xmm15, 0x18(%rbx)
addq $0xb0, %rsp
popq %rbx
retq