#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);
void matrix_rotate_x(double *a, double degree) {
  double temp;
  temp = a[4];
  a[4] = (cos(degree) * a[4]) + (sin(degree) * a[8]);
  a[8] = (-sin(degree) * temp) + (cos(degree) * a[8]);
  temp = a[5];
  a[5] = (cos(degree) * a[5]) + (sin(degree) * a[9]);
  a[9] = (-sin(degree) * temp) + (cos(degree) * a[9]);
  temp = a[6];
  a[6] = (cos(degree) * a[6]) + (sin(degree) * a[10]);
  a[10] = (-sin(degree) * temp) + (cos(degree) * a[10]);
  temp = a[7];
  a[7] = (cos(degree) * a[7]) + (sin(degree) * a[11]);
  a[11] = (-sin(degree) * temp) + (cos(degree) * a[11]);
}


x86 assembly (clang, -O0):
<matrix_rotate_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x98(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mulsd  0x40(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x88(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x40(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x48(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x68(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x48(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x50(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x50(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x58(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x58(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x58(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_rotate_x>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%rbx
movsd  0x20(%rdi),%xmm1
movsd  %xmm1,0x18(%rsp)
call   1040 <cos@plt>
mulsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x40(%rbx),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x40(%rbx),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rbx)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x48(%rbx),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x48(%rbx),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x48(%rbx)
movsd  0x30(%rbx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x30(%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x50(%rbx),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x30(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x50(%rbx),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rbx)
movsd  0x38(%rbx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x38(%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x58(%rbx),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x38(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x58(%rbx),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x58(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @matrix_rotate_x(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 4
%4 = load double, double* %3
%5 = tail call double @cos(double %1)
%6 = load double, double* %3
%7 = tail call double @sin(double %1)
%8 = getelementptr inbounds double, double* %0, i64 8
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %10)
store double %11, double* %3
%12 = tail call double @sin(double %1)
%13 = fneg double %12
%14 = tail call double @cos(double %1)
%15 = load double, double* %8
%16 = fmul double %14, %15
%17 = tail call double @llvm.fmuladd.f64(double %13, double %4, double %16)
store double %17, double* %8
%18 = getelementptr inbounds double, double* %0, i64 5
%19 = load double, double* %18
%20 = tail call double @cos(double %1)
%21 = load double, double* %18
%22 = tail call double @sin(double %1)
%23 = getelementptr inbounds double, double* %0, i64 9
%24 = load double, double* %23
%25 = fmul double %22, %24
%26 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %25)
store double %26, double* %18
%27 = tail call double @sin(double %1)
%28 = fneg double %27
%29 = tail call double @cos(double %1)
%30 = load double, double* %23
%31 = fmul double %29, %30
%32 = tail call double @llvm.fmuladd.f64(double %28, double %19, double %31)
store double %32, double* %23
%33 = getelementptr inbounds double, double* %0, i64 6
%34 = load double, double* %33
%35 = tail call double @cos(double %1)
%36 = load double, double* %33
%37 = tail call double @sin(double %1)
%38 = getelementptr inbounds double, double* %0, i64 10
%39 = load double, double* %38
%40 = fmul double %37, %39
%41 = tail call double @llvm.fmuladd.f64(double %35, double %36, double %40)
store double %41, double* %33
%42 = tail call double @sin(double %1)
%43 = fneg double %42
%44 = tail call double @cos(double %1)
%45 = load double, double* %38
%46 = fmul double %44, %45
%47 = tail call double @llvm.fmuladd.f64(double %43, double %34, double %46)
store double %47, double* %38
%48 = getelementptr inbounds double, double* %0, i64 7
%49 = load double, double* %48
%50 = tail call double @cos(double %1)
%51 = load double, double* %48
%52 = tail call double @sin(double %1)
%53 = getelementptr inbounds double, double* %0, i64 11
%54 = load double, double* %53
%55 = fmul double %52, %54
%56 = tail call double @llvm.fmuladd.f64(double %50, double %51, double %55)
store double %56, double* %48
%57 = tail call double @sin(double %1)
%58 = fneg double %57
%59 = tail call double @cos(double %1)
%60 = load double, double* %53
%61 = fmul double %59, %60
%62 = tail call double @llvm.fmuladd.f64(double %58, double %49, double %61)
store double %62, double* %53
ret void
}