#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 */
float cosf(float);
int /*<<< orphan*/ genIdentityMatrix(float *);
int sinf(float);
void genRotateMatrixY(float radians, float matrix[16]) {
  genIdentityMatrix(matrix);
  matrix[0] = cosf(radians);
  matrix[2] = -1 * sinf(radians);
  matrix[8] = sinf(radians);
  matrix[10] = cosf(radians);
}


x86 assembly (clang, -O0):
<genRotateMatrixY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <genIdentityMatrix@plt>
movss  -0x4(%rbp),%xmm0
call   1050 <cosf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x4(%rbp),%xmm0
call   1050 <cosf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x28(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genRotateMatrixY>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
call   1040 <genIdentityMatrix@plt>
movss  0xc(%rsp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x8(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x20(%rbx)
movss  0xc(%rsp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,0x28(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @genRotateMatrixY(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = call i32 @genIdentityMatrix(float* %5)
%7 = load float, float* %3
%8 = call float @cosf(float %7)
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float, float* %3
%12 = call i32 @sinf(float %11)
%13 = mul nsw i32 -1, %12
%14 = sitofp i32 %13 to float
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
store float %14, float* %16
%17 = load float, float* %3
%18 = call i32 @sinf(float %17)
%19 = sitofp i32 %18 to float
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 8
store float %19, float* %21
%22 = load float, float* %3
%23 = call float @cosf(float %22)
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 10
store float %23, float* %25
ret void
}

LLVM IR (-O2):
define void @genRotateMatrixY(float %0, float* %1) {
%3 = tail call i32 @genIdentityMatrix(float* %1)
%4 = tail call float @cosf(float %0)
store float %4, float* %1
%5 = tail call i32 @sinf(float %0)
%6 = sub nsw i32 0, %5
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds float, float* %1, i64 2
store float %7, float* %8
%9 = tail call i32 @sinf(float %0)
%10 = sitofp i32 %9 to float
%11 = getelementptr inbounds float, float* %1, i64 8
store float %10, float* %11
%12 = tail call float @cosf(float %0)
%13 = getelementptr inbounds float, float* %1, i64 10
store float %12, float* %13
ret void
}