void irotate(mata, x, y, z, angle) double mata[4][4], x, y, z, angle;
{
  double absval, x1, y1, z1, cosang, sinang;
  absval = sqrt((x * x) + (y * y) + (z * z));
  x1 = x / absval;
  y1 = y / absval;
  z1 = z / absval;
  cosang = cos(angle);
  sinang = sin(angle);
  mata[1][1] = (x1 * x1) + ((1 - (x1 * x1)) * cosang);
  mata[1][2] = (x1 * y1 * (1 - cosang)) + (z1 * sinang);
  mata[1][3] = (x1 * z1 * (1 - cosang)) - (y1 * sinang);
  mata[2][1] = (x1 * y1 * (1 - cosang)) - (z1 * sinang);
  mata[2][2] = (y1 * y1) + ((1 - (y1 * y1)) * cosang);
  mata[2][3] = (y1 * z1 * (1 - cosang)) + (x1 * sinang);
  mata[3][1] = (x1 * z1 * (1 - cosang)) + (y1 * sinang);
  mata[3][2] = (y1 * z1 * (1 - cosang)) - (x1 * sinang);
  mata[3][3] = (z1 * z1) + ((1 - (z1 * z1)) * cosang);
}


x86 assembly (clang, -O0):
<irotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xdf6(%rip),%xmm3
addsd  %xmm3,%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xdca(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xd98(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xd4f(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xce1(%rip),%xmm3
addsd  %xmm3,%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xcb5(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x58(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xc83(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x68(%rax)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xc51(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x70(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xbe3(%rip),%xmm3
addsd  %xmm3,%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x78(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irotate>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm3,0x8(%rsp)
mov    %rdi,%rbx
movapd %xmm1,0x20(%rsp)
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,0x30(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117a <irotate+0x4a>
sqrtsd %xmm0,%xmm0
jmp    118b <irotate+0x5b>
movapd %xmm2,0x10(%rsp)
call   1050 <sqrt@plt>
movapd 0x10(%rsp),%xmm2
movapd 0x30(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm2,%xmm1
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm13
movapd %xmm13,%xmm2
mulsd  %xmm13,%xmm2
movsd  0xe18(%rip),%xmm1
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
movsd  0x10(%rsp),%xmm11
mulsd  %xmm11,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x28(%rbx)
movapd %xmm1,%xmm4
subsd  %xmm11,%xmm4
movapd 0x20(%rsp),%xmm7
movapd %xmm7,%xmm12
unpckhpd %xmm7,%xmm12
movapd %xmm12,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm13,%xmm3
unpcklpd %xmm13,%xmm3
mulpd  %xmm7,%xmm3
movapd %xmm7,%xmm10
mulsd  %xmm0,%xmm10
movapd 0xdc8(%rip),%xmm8
movapd %xmm10,%xmm5
xorpd  %xmm8,%xmm5
movapd %xmm4,%xmm9
unpcklpd %xmm4,%xmm9
movapd %xmm2,%xmm6
unpcklpd %xmm5,%xmm6
movapd %xmm3,%xmm5
mulpd  %xmm9,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,0x30(%rbx)
xorpd  %xmm8,%xmm2
movapd %xmm7,%xmm5
mulsd  %xmm7,%xmm5
movapd %xmm1,%xmm6
subsd  %xmm5,%xmm6
mulsd  %xmm11,%xmm6
unpcklpd %xmm6,%xmm2
movapd %xmm3,%xmm5
unpcklpd %xmm7,%xmm5
movapd %xmm4,%xmm6
unpcklpd %xmm7,%xmm6
mulpd  %xmm5,%xmm6
addpd  %xmm2,%xmm6
movupd %xmm6,0x48(%rbx)
mulsd  %xmm12,%xmm7
movapd %xmm13,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm7,%xmm4
addsd  %xmm2,%xmm4
movsd  %xmm4,0x58(%rbx)
xorpd  %xmm8,%xmm2
shufpd $0x1,%xmm7,%xmm3
unpcklpd %xmm2,%xmm10
mulpd  %xmm9,%xmm3
addpd  %xmm10,%xmm3
movupd %xmm3,0x68(%rbx)
mulsd  %xmm12,%xmm12
subsd  %xmm12,%xmm1
mulsd  %xmm11,%xmm1
addsd  %xmm12,%xmm1
movsd  %xmm1,0x78(%rbx)
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @irotate([4 x double]* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [4 x double]*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store [4 x double]* %0, [4 x double]** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%17 = load double, double* %7
%18 = load double, double* %7
%19 = load double, double* %8
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
%23 = load double, double* %9
%24 = load double, double* %9
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double %22)
%26 = call double @sqrt(double %25)
store double %26, double* %11
%27 = load double, double* %7
%28 = load double, double* %11
%29 = fdiv double %27, %28
store double %29, double* %12
%30 = load double, double* %8
%31 = load double, double* %11
%32 = fdiv double %30, %31
store double %32, double* %13
%33 = load double, double* %9
%34 = load double, double* %11
%35 = fdiv double %33, %34
store double %35, double* %14
%36 = load double, double* %10
%37 = call double @cos(double %36)
store double %37, double* %15
%38 = load double, double* %10
%39 = call double @sin(double %38)
store double %39, double* %16
%40 = load double, double* %12
%41 = load double, double* %12
%42 = load double, double* %12
%43 = load double, double* %12
%44 = fneg double %42
%45 = call double @llvm.fmuladd.f64(double %44, double %43, double 1.000000e+00)
%46 = load double, double* %15
%47 = fmul double %45, %46
%48 = call double @llvm.fmuladd.f64(double %40, double %41, double %47)
%49 = load [4 x double]*, [4 x double]** %6
%50 = getelementptr inbounds [4 x double], [4 x double]* %49, i64 1
%51 = getelementptr inbounds [4 x double], [4 x double]* %50, i64 0, i64 1
store double %48, double* %51
%52 = load double, double* %12
%53 = load double, double* %13
%54 = fmul double %52, %53
%55 = load double, double* %15
%56 = fsub double 1.000000e+00, %55
%57 = load double, double* %14
%58 = load double, double* %16
%59 = fmul double %57, %58
%60 = call double @llvm.fmuladd.f64(double %54, double %56, double %59)
%61 = load [4 x double]*, [4 x double]** %6
%62 = getelementptr inbounds [4 x double], [4 x double]* %61, i64 1
%63 = getelementptr inbounds [4 x double], [4 x double]* %62, i64 0, i64 2
store double %60, double* %63
%64 = load double, double* %12
%65 = load double, double* %14
%66 = fmul double %64, %65
%67 = load double, double* %15
%68 = fsub double 1.000000e+00, %67
%69 = load double, double* %13
%70 = load double, double* %16
%71 = fmul double %69, %70
%72 = fneg double %71
%73 = call double @llvm.fmuladd.f64(double %66, double %68, double %72)
%74 = load [4 x double]*, [4 x double]** %6
%75 = getelementptr inbounds [4 x double], [4 x double]* %74, i64 1
%76 = getelementptr inbounds [4 x double], [4 x double]* %75, i64 0, i64 3
store double %73, double* %76
%77 = load double, double* %12
%78 = load double, double* %13
%79 = fmul double %77, %78
%80 = load double, double* %15
%81 = fsub double 1.000000e+00, %80
%82 = load double, double* %14
%83 = load double, double* %16
%84 = fmul double %82, %83
%85 = fneg double %84
%86 = call double @llvm.fmuladd.f64(double %79, double %81, double %85)
%87 = load [4 x double]*, [4 x double]** %6
%88 = getelementptr inbounds [4 x double], [4 x double]* %87, i64 2
%89 = getelementptr inbounds [4 x double], [4 x double]* %88, i64 0, i64 1
store double %86, double* %89
%90 = load double, double* %13
%91 = load double, double* %13
%92 = load double, double* %13
%93 = load double, double* %13
%94 = fneg double %92
%95 = call double @llvm.fmuladd.f64(double %94, double %93, double 1.000000e+00)
%96 = load double, double* %15
%97 = fmul double %95, %96
%98 = call double @llvm.fmuladd.f64(double %90, double %91, double %97)
%99 = load [4 x double]*, [4 x double]** %6
%100 = getelementptr inbounds [4 x double], [4 x double]* %99, i64 2
%101 = getelementptr inbounds [4 x double], [4 x double]* %100, i64 0, i64 2
store double %98, double* %101
%102 = load double, double* %13
%103 = load double, double* %14
%104 = fmul double %102, %103
%105 = load double, double* %15
%106 = fsub double 1.000000e+00, %105
%107 = load double, double* %12
%108 = load double, double* %16
%109 = fmul double %107, %108
%110 = call double @llvm.fmuladd.f64(double %104, double %106, double %109)
%111 = load [4 x double]*, [4 x double]** %6
%112 = getelementptr inbounds [4 x double], [4 x double]* %111, i64 2
%113 = getelementptr inbounds [4 x double], [4 x double]* %112, i64 0, i64 3
store double %110, double* %113
%114 = load double, double* %12
%115 = load double, double* %14
%116 = fmul double %114, %115
%117 = load double, double* %15
%118 = fsub double 1.000000e+00, %117
%119 = load double, double* %13
%120 = load double, double* %16
%121 = fmul double %119, %120
%122 = call double @llvm.fmuladd.f64(double %116, double %118, double %121)
%123 = load [4 x double]*, [4 x double]** %6
%124 = getelementptr inbounds [4 x double], [4 x double]* %123, i64 3
%125 = getelementptr inbounds [4 x double], [4 x double]* %124, i64 0, i64 1
store double %122, double* %125
%126 = load double, double* %13
%127 = load double, double* %14
%128 = fmul double %126, %127
%129 = load double, double* %15
%130 = fsub double 1.000000e+00, %129
%131 = load double, double* %12
%132 = load double, double* %16
%133 = fmul double %131, %132
%134 = fneg double %133
%135 = call double @llvm.fmuladd.f64(double %128, double %130, double %134)
%136 = load [4 x double]*, [4 x double]** %6
%137 = getelementptr inbounds [4 x double], [4 x double]* %136, i64 3
%138 = getelementptr inbounds [4 x double], [4 x double]* %137, i64 0, i64 2
store double %135, double* %138
%139 = load double, double* %14
%140 = load double, double* %14
%141 = load double, double* %14
%142 = load double, double* %14
%143 = fneg double %141
%144 = call double @llvm.fmuladd.f64(double %143, double %142, double 1.000000e+00)
%145 = load double, double* %15
%146 = fmul double %144, %145
%147 = call double @llvm.fmuladd.f64(double %139, double %140, double %146)
%148 = load [4 x double]*, [4 x double]** %6
%149 = getelementptr inbounds [4 x double], [4 x double]* %148, i64 3
%150 = getelementptr inbounds [4 x double], [4 x double]* %149, i64 0, i64 3
store double %147, double* %150
ret void
}

LLVM IR (-O2):
define void @irotate([4 x double]* nocapture writeonly %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %2, %2
%7 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %7)
%9 = tail call double @sqrt(double %8)
%10 = fdiv double %1, %9
%11 = insertelement <2 x double> poison, double %2, i64 0
%12 = insertelement <2 x double> %11, double %3, i64 1
%13 = insertelement <2 x double> poison, double %9, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = fdiv <2 x double> %12, %14
%16 = tail call double @cos(double %4)
%17 = tail call double @sin(double %4)
%18 = fneg double %10
%19 = tail call double @llvm.fmuladd.f64(double %18, double %10, double 1.000000e+00)
%20 = fmul double %16, %19
%21 = tail call double @llvm.fmuladd.f64(double %10, double %10, double %20)
%22 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 1, i64 1
store double %21, double* %22
%23 = fsub double 1.000000e+00, %16
%24 = extractelement <2 x double> %15, i64 1
%25 = fmul double %24, %17
%26 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 1, i64 2
%27 = insertelement <2 x double> poison, double %10, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = fmul <2 x double> %28, %15
%30 = extractelement <2 x double> %15, i64 0
%31 = fmul double %30, %17
%32 = fneg double %31
%33 = insertelement <2 x double> poison, double %23, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = insertelement <2 x double> poison, double %25, i64 0
%36 = insertelement <2 x double> %35, double %32, i64 1
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %34, <2 x double> %36)
%38 = bitcast double* %26 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
%39 = fneg double %25
%40 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 2, i64 1
%41 = fneg double %30
%42 = tail call double @llvm.fmuladd.f64(double %41, double %30, double 1.000000e+00)
%43 = fmul double %16, %42
%44 = shufflevector <2 x double> %29, <2 x double> %15, <2 x i32> <i32 0, i32 2>
%45 = shufflevector <2 x double> %33, <2 x double> %15, <2 x i32> <i32 0, i32 2>
%46 = insertelement <2 x double> poison, double %39, i64 0
%47 = insertelement <2 x double> %46, double %43, i64 1
%48 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %44, <2 x double> %45, <2 x double> %47)
%49 = bitcast double* %40 to <2 x double>*
store <2 x double> %48, <2 x double>* %49
%50 = fmul double %30, %24
%51 = fmul double %10, %17
%52 = tail call double @llvm.fmuladd.f64(double %50, double %23, double %51)
%53 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 2, i64 3
store double %52, double* %53
%54 = extractelement <2 x double> %29, i64 1
%55 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 3, i64 1
%56 = fneg double %51
%57 = insertelement <2 x double> poison, double %54, i64 0
%58 = insertelement <2 x double> %57, double %50, i64 1
%59 = insertelement <2 x double> poison, double %31, i64 0
%60 = insertelement <2 x double> %59, double %56, i64 1
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %34, <2 x double> %60)
%62 = bitcast double* %55 to <2 x double>*
store <2 x double> %61, <2 x double>* %62
%63 = fneg double %24
%64 = tail call double @llvm.fmuladd.f64(double %63, double %24, double 1.000000e+00)
%65 = fmul double %16, %64
%66 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %65)
%67 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 3, i64 3
store double %66, double* %67
ret void
}