#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 */
int /*<<< orphan*/ MatrixMulti3Rotate33(double *, double *, double *);
double cos(double);
double sin(double);
void MatrixRotateBank3(double *a, double theta, double *r) {
  double b[3 * 3];
  b[0] = cos(theta);
  b[1] = 0.0;
  b[2] = sin(theta);
  b[3] = 0.0;
  b[4] = 1.0;
  b[5] = 0.0;
  b[6] = -b[2];
  b[7] = 0.0;
  b[8] = b[0];
  MatrixMulti3Rotate33(a, b, r);
}


x86 assembly (clang, -O0):
<MatrixRotateBank3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <MatrixMulti3Rotate33@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixRotateBank3>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r14
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
xorps  %xmm1,%xmm1
movhps 0xe90(%rip),%xmm1
movsd  %xmm0,0x20(%rsp)
movups %xmm1,0x28(%rsp)
xorps  0xe8e(%rip),%xmm0
movq   $0x0,0x38(%rsp)
movlps %xmm0,0x40(%rsp)
movq   $0x0,0x48(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <MatrixMulti3Rotate33@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @MatrixRotateBank3(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
%7 = alloca [9 x double]
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%8 = load double, double* %5
%9 = call double @cos(double %8)
%10 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
store double %9, double* %10
%11 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 1
store double 0.000000e+00, double* %11
%12 = load double, double* %5
%13 = call double @sin(double %12)
%14 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 2
store double %13, double* %14
%15 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 3
store double 0.000000e+00, double* %15
%16 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 4
store double 1.000000e+00, double* %16
%17 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 5
store double 0.000000e+00, double* %17
%18 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 2
%19 = load double, double* %18
%20 = fneg double %19
%21 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 6
store double %20, double* %21
%22 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 7
store double 0.000000e+00, double* %22
%23 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%24 = load double, double* %23
%25 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 8
store double %24, double* %25
%26 = load double*, double** %4
%27 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%28 = load double*, double** %6
%29 = call i32 @MatrixMulti3Rotate33(double* %26, double* %27, double* %28)
ret void
}

LLVM IR (-O2):
define void @MatrixRotateBank3(double* %0, double %1, double* %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = tail call double @cos(double %1)
%7 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
store double %6, double* %7
%8 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 1
store double 0.000000e+00, double* %8
%9 = tail call double @sin(double %1)
%10 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 2
store double %9, double* %10
%11 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 3
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %12
%13 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 5
store double 0.000000e+00, double* %13
%14 = fneg double %9
%15 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 6
store double %14, double* %15
%16 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 7
store double 0.000000e+00, double* %16
%17 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 8
store double %6, double* %17
%18 = call i32 @MatrixMulti3Rotate33(double* %0, double* %7, double* %2)
ret void
}