#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*/ assert(double **);
double cos(double);
int /*<<< orphan*/ matrix3_initialize(double **);
double sin(double);
void matrix3_x_rotation(double m[4][4], double radians) {
  register double d;
  assert(m);
  matrix3_initialize(m);
  d = cos(radians);
  m[1][1] = d;
  m[2][2] = d;
  d = sin(radians);
  m[1][2] = d;
  m[2][1] = -d;
}


x86 assembly (clang, -O0):
<matrix3_x_rotation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <matrix3_initialize@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix3_x_rotation>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1050 <matrix3_initialize@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x28(%rbx)
movsd  %xmm0,0x50(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x30(%rbx)
xorps  0xe79(%rip),%xmm0
movlps %xmm0,0x48(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @matrix3_x_rotation([4 x double]* %0, double %1) {
%3 = bitcast [4 x double]* %0 to double**
%4 = tail call i32 @assert(double** %3)
%5 = tail call i32 @matrix3_initialize(double** %3)
%6 = tail call double @cos(double %1)
%7 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 1, i64 1
store double %6, double* %7
%8 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 2, i64 2
store double %6, double* %8
%9 = tail call double @sin(double %1)
%10 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 1, i64 2
store double %9, double* %10
%11 = fneg double %9
%12 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 2, i64 1
store double %11, double* %12
ret void
}