#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
double sin(double);
int /*<<< orphan*/ vecadds(int, double *, double *, double);
int /*<<< orphan*/ veccp(int, double *, double *);
void rotmx(double *rot, double *u, double phi) {
  double cphi = cos(phi);
  double sphi = sin(phi);
  double R[9] = {cphi, 0.0, 0.0, 0.0, cphi, 0.0, 0.0, 0.0, cphi};
  double ux[9] = {0.0, -u[2], u[1], u[2], 0.0, -u[0], -u[1], u[0], 0.0};
  double uu[9] = {u[0] * u[0], u[0] * u[1], u[0] * u[2],
                  u[0] * u[1], u[1] * u[1], u[1] * u[2],
                  u[0] * u[2], u[1] * u[2], u[2] * u[2]};
  vecadds(9, R, ux, sphi);
  vecadds(9, R, uu, 1.0 - cphi);
  veccp(9, rot, R);
  return;
}


x86 assembly (clang, -O0):
<rotmx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
lea    -0x70(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
movsd  -0x28(%rbp),%xmm0
mov    $0x9,%edi
call   1050 <vecadds@plt>
lea    -0x70(%rbp),%rsi
lea    -0x110(%rbp),%rdx
movsd  0xc64(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
mov    $0x9,%edi
call   1050 <vecadds@plt>
mov    -0x8(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    $0x9,%edi
call   1060 <veccp@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotmx>:
push   %r14
push   %rbx
sub    $0xf8,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  (%rsp),%xmm2
movsd  %xmm2,0xb0(%rsp)
xorps  %xmm1,%xmm1
movups %xmm1,0xb8(%rsp)
movq   $0x0,0xc8(%rsp)
movsd  %xmm2,0xd0(%rsp)
movups %xmm1,0xd8(%rsp)
movq   $0x0,0xe8(%rsp)
movsd  %xmm2,0xf0(%rsp)
movq   $0x0,0x10(%rsp)
movsd  0x10(%rbx),%xmm1
movapd 0xe34(%rip),%xmm2
movapd %xmm1,%xmm3
xorpd  %xmm2,%xmm3
movlpd %xmm3,0x18(%rsp)
movupd (%rbx),%xmm3
movhpd %xmm3,0x20(%rsp)
movsd  %xmm1,0x28(%rsp)
movq   $0x0,0x30(%rsp)
xorpd  %xmm3,%xmm2
movupd %xmm2,0x38(%rsp)
movlpd %xmm3,0x48(%rsp)
movq   $0x0,0x50(%rsp)
movapd %xmm3,%xmm2
unpcklpd %xmm3,%xmm2
mulpd  %xmm3,%xmm2
movapd %xmm2,0x60(%rsp)
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,0x70(%rsp)
movhpd %xmm2,0x78(%rsp)
movapd %xmm3,%xmm2
shufpd $0x1,%xmm1,%xmm2
unpckhpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm3,0x80(%rsp)
movsd  %xmm4,0x90(%rsp)
movhpd %xmm3,0x98(%rsp)
mulsd  %xmm1,%xmm1
movsd  %xmm1,0xa0(%rsp)
lea    0xb0(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    $0x9,%edi
mov    %rbx,%rsi
call   1050 <vecadds@plt>
movsd  0xd83(%rip),%xmm0
subsd  (%rsp),%xmm0
lea    0x60(%rsp),%rdx
mov    $0x9,%edi
mov    %rbx,%rsi
call   1050 <vecadds@plt>
mov    $0x9,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <veccp@plt>
add    $0xf8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @rotmx(double* %0, double* nocapture %1, double %2) {
%4 = alloca [9 x double]
%5 = alloca [9 x double]
%6 = alloca [9 x double]
%7 = tail call double @cos(double %2)
%8 = tail call double @sin(double %2)
%9 = bitcast [9 x double]* %4 to i8*
%10 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
store double %7, double* %10
%11 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 1
%12 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 4
%13 = bitcast double* %11 to i8*
store double %7, double* %12
%14 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 5
%15 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 8
%16 = bitcast double* %14 to i8*
store double %7, double* %15
%17 = bitcast [9 x double]* %5 to i8*
%18 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
store double 0.000000e+00, double* %18
%19 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 1
%20 = getelementptr inbounds double, double* %1, i64 2
%21 = load double, double* %20
%22 = fneg double %21
store double %22, double* %19
%23 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 2
%24 = bitcast double* %1 to <2 x double>*
%25 = load <2 x double>, <2 x double>* %24
%26 = extractelement <2 x double> %25, i64 1
store double %26, double* %23
%27 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 3
store double %21, double* %27
%28 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 4
store double 0.000000e+00, double* %28
%29 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 5
%30 = fneg <2 x double> %25
%31 = bitcast double* %29 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 7
%33 = extractelement <2 x double> %25, i64 0
store double %33, double* %32
%34 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 8
store double 0.000000e+00, double* %34
%35 = bitcast [9 x double]* %6 to i8*
%36 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%37 = shufflevector <2 x double> %25, <2 x double> undef, <2 x i32> zeroinitializer
%38 = fmul <2 x double> %25, %37
%39 = bitcast [9 x double]* %6 to <2 x double>*
store <2 x double> %38, <2 x double>* %39
%40 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 2
%41 = fmul double %21, %33
store double %41, double* %40
%42 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 3
%43 = extractelement <2 x double> %38, i64 1
store double %43, double* %42
%44 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 4
%45 = shufflevector <2 x double> %25, <2 x double> undef, <2 x i32> <i32 1, i32 undef>
%46 = insertelement <2 x double> %45, double %21, i64 1
%47 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%48 = fmul <2 x double> %46, %47
%49 = bitcast double* %44 to <2 x double>*
store <2 x double> %48, <2 x double>* %49
%50 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 6
store double %41, double* %50
%51 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 7
%52 = extractelement <2 x double> %48, i64 1
store double %52, double* %51
%53 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
%54 = fmul double %21, %21
store double %54, double* %53
%55 = call i32 @vecadds(i32 9, double* %10, double* %18, double %8)
%56 = fsub double 1.000000e+00, %7
%57 = call i32 @vecadds(i32 9, double* %10, double* %36, double %56)
%58 = call i32 @veccp(i32 9, double* %0, double* %10)
ret void
}