#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 rotatey_3fo(float ry, const float *v, float *result) {
  float m[] = {
      cosf(ry), 0, sinf(ry), 0, 1, 0, -sinf(ry), 0, cosf(ry),
  };
  matrix3_mul_3fo(m, v, result);
}


x86 assembly (clang, -O0):
<rotatey_3fo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  0xe7d(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
xorps  %xmm0,%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):
<rotatey_3fo>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x18(%rsp)
movabs $0x3f80000000000000,%rax
mov    %rax,0x1c(%rsp)
movl   $0x0,0x24(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x28(%rsp)
movl   $0x0,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 @rotatey_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
%9 = load float, float* %4
%10 = call i32 @cosf(float %9)
%11 = sitofp i32 %10 to float
store float %11, float* %8
%12 = getelementptr inbounds float, float* %8, i64 1
store float 0.000000e+00, float* %12
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %4
%15 = call i32 @sinf(float %14)
%16 = sitofp i32 %15 to float
store float %16, float* %13
%17 = getelementptr inbounds float, float* %13, i64 1
store float 0.000000e+00, float* %17
%18 = getelementptr inbounds float, float* %17, i64 1
store float 1.000000e+00, float* %18
%19 = getelementptr inbounds float, float* %18, i64 1
store float 0.000000e+00, float* %19
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %4
%22 = call i32 @sinf(float %21)
%23 = sub nsw i32 0, %22
%24 = sitofp i32 %23 to float
store float %24, float* %20
%25 = getelementptr inbounds float, float* %20, i64 1
store float 0.000000e+00, float* %25
%26 = getelementptr inbounds float, float* %25, 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 @rotatey_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 = tail call i32 @cosf(float %0)
%8 = sitofp i32 %7 to float
store float %8, float* %6
%9 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 1
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 2
%11 = tail call i32 @sinf(float %0)
%12 = sitofp i32 %11 to float
store float %12, float* %10
%13 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 3
store float 0.000000e+00, float* %13
%14 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 4
store float 1.000000e+00, float* %14
%15 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 5
store float 0.000000e+00, float* %15
%16 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 6
%17 = tail call i32 @sinf(float %0)
%18 = sub nsw i32 0, %17
%19 = sitofp i32 %18 to float
store float %19, float* %16
%20 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 7
store float 0.000000e+00, float* %20
%21 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 8
%22 = tail call i32 @cosf(float %0)
%23 = sitofp i32 %22 to float
store float %23, float* %21
%24 = call i32 @matrix3_mul_3fo(float* %6, float* %1, float* %2)
ret void
}