#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_z(double *a, double degree) {
  double temp;
  temp = a[0];
  a[0] = (cos(degree) * a[0]) + (sin(degree) * a[4]);
  a[4] = (-sin(degree) * temp) + (cos(degree) * a[4]);
  temp = a[1];
  a[1] = (cos(degree) * a[1]) + (sin(degree) * a[5]);
  a[5] = (-sin(degree) * temp) + (cos(degree) * a[5]);
  temp = a[2];
  a[2] = (cos(degree) * a[2]) + (sin(degree) * a[6]);
  a[6] = (-sin(degree) * temp) + (cos(degree) * a[6]);
  temp = a[3];
  a[3] = (cos(degree) * a[3]) + (sin(degree) * a[7]);
  a[7] = (-sin(degree) * temp) + (cos(degree) * a[7]);
}


x86 assembly (clang, -O0):
<matrix_rotate_z>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  (%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  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%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  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%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  0x28(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%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  0x28(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%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  0x30(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%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  0x30(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%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  0x38(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%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  0x38(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @matrix_rotate_z(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 0
%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 0
%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 4
%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 0
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 4
%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 4
store double %33, double* %35
%36 = load double*, double** %3
%37 = getelementptr inbounds double, double* %36, i64 1
%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 1
%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 5
%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 1
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 5
%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 5
store double %63, double* %65
%66 = load double*, double** %3
%67 = getelementptr inbounds double, double* %66, i64 2
%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 2
%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 6
%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 2
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 6
%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 6
store double %93, double* %95
%96 = load double*, double** %3
%97 = getelementptr inbounds double, double* %96, i64 3
%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 3
%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 7
%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 3
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 7
%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 7
store double %123, double* %125
ret void
}

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