#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 cosf(float);
int /*<<< orphan*/ matrix3_mul_3fo(float *, float const *, float *);
int sinf(float);
void rotatex_3fo(float rx, const float *v, float *result) {
  float m[] = {
      1, 0, 0, 0, cosf(rx), -sinf(rx), 0, sinf(rx), cosf(rx),
  };
  matrix3_mul_3fo(m, v, result);
}


x86 assembly (clang, -O0):
<rotatex_3fo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <matrix3_mul_3fo@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotatex_3fo>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
movss  0xeb5(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x24(%rsp)
movl   $0x0,0x28(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x30(%rsp)
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <matrix3_mul_3fo@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rotatex_3fo(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca [9 x float]
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%8 = getelementptr inbounds [9 x float], [9 x float]* %7, i64 0, i64 0
store float 1.000000e+00, float* %8
%9 = getelementptr inbounds float, float* %8, i64 1
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds float, float* %9, i64 1
store float 0.000000e+00, float* %10
%11 = getelementptr inbounds float, float* %10, i64 1
store float 0.000000e+00, float* %11
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %4
%14 = call i32 @cosf(float %13)
%15 = sitofp i32 %14 to float
store float %15, float* %12
%16 = getelementptr inbounds float, float* %12, i64 1
%17 = load float, float* %4
%18 = call i32 @sinf(float %17)
%19 = sub nsw i32 0, %18
%20 = sitofp i32 %19 to float
store float %20, float* %16
%21 = getelementptr inbounds float, float* %16, i64 1
store float 0.000000e+00, float* %21
%22 = getelementptr inbounds float, float* %21, i64 1
%23 = load float, float* %4
%24 = call i32 @sinf(float %23)
%25 = sitofp i32 %24 to float
store float %25, float* %22
%26 = getelementptr inbounds float, float* %22, i64 1
%27 = load float, float* %4
%28 = call i32 @cosf(float %27)
%29 = sitofp i32 %28 to float
store float %29, float* %26
%30 = getelementptr inbounds [9 x float], [9 x float]* %7, i64 0, i64 0
%31 = load float*, float** %5
%32 = load float*, float** %6
%33 = call i32 @matrix3_mul_3fo(float* %30, float* %31, float* %32)
ret void
}

LLVM IR (-O2):
define void @rotatex_3fo(float %0, float* %1, float* %2) {
%4 = alloca [9 x float]
%5 = bitcast [9 x float]* %4 to i8*
%6 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 0
%7 = bitcast [9 x float]* %4 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %7
%8 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 4
%9 = tail call i32 @cosf(float %0)
%10 = sitofp i32 %9 to float
store float %10, float* %8
%11 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 5
%12 = tail call i32 @sinf(float %0)
%13 = sub nsw i32 0, %12
%14 = sitofp i32 %13 to float
store float %14, float* %11
%15 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 6
store float 0.000000e+00, float* %15
%16 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 7
%17 = tail call i32 @sinf(float %0)
%18 = sitofp i32 %17 to float
store float %18, float* %16
%19 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 8
%20 = tail call i32 @cosf(float %0)
%21 = sitofp i32 %20 to float
store float %21, float* %19
%22 = call i32 @matrix3_mul_3fo(float* %6, float* %1, float* %2)
ret void
}