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


x86 assembly (clang, -O0):
<MatrixRotatePitch3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x40(%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):
<MatrixRotatePitch3>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r14
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
xorps  %xmm1,%xmm1
movups %xmm1,0x18(%rsp)
movq   $0x0,0x28(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,0x30(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movaps 0xe7c(%rip),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,0x38(%rsp)
movq   $0x0,0x40(%rsp)
movsd  %xmm0,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 @MatrixRotatePitch3(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 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
store double 1.000000e+00, double* %8
%9 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 1
store double 0.000000e+00, double* %9
%10 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 2
store double 0.000000e+00, double* %10
%11 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 3
store double 0.000000e+00, double* %11
%12 = load double, double* %5
%13 = call double @cos(double %12)
%14 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 4
store double %13, double* %14
%15 = load double, double* %5
%16 = call double @sin(double %15)
%17 = fneg double %16
%18 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 5
store double %17, double* %18
%19 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 6
store double 0.000000e+00, double* %19
%20 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 5
%21 = load double, double* %20
%22 = fneg double %21
%23 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 7
store double %22, double* %23
%24 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 4
%25 = load double, double* %24
%26 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 8
store double %25, double* %26
%27 = load double*, double** %4
%28 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%29 = load double*, double** %6
%30 = call i32 @MatrixMulti3Rotate33(double* %27, double* %28, double* %29)
ret void
}

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