#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 genRotateMatrixX(float radians, float matrix[16]) {
  genIdentityMatrix(matrix);
  matrix[5] = cosf(radians);
  matrix[6] = -1 * sinf(radians);
  matrix[9] = sinf(radians);
  matrix[10] = cosf(radians);
}


x86 assembly (clang, -O0):
<genRotateMatrixX>:
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,0x14(%rax)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x24(%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):
<genRotateMatrixX>:
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,0x14(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x18(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x24(%rbx)
movss  0xc(%rsp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,0x28(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @genRotateMatrixX(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 5
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 6
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 9
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 @genRotateMatrixX(float %0, float* %1) {
%3 = tail call i32 @genIdentityMatrix(float* %1)
%4 = tail call float @cosf(float %0)
%5 = getelementptr inbounds float, float* %1, i64 5
store float %4, float* %5
%6 = tail call i32 @sinf(float %0)
%7 = sub nsw i32 0, %6
%8 = sitofp i32 %7 to float
%9 = getelementptr inbounds float, float* %1, i64 6
store float %8, float* %9
%10 = tail call i32 @sinf(float %0)
%11 = sitofp i32 %10 to float
%12 = getelementptr inbounds float, float* %1, i64 9
store float %11, float* %12
%13 = tail call float @cosf(float %0)
%14 = getelementptr inbounds float, float* %1, i64 10
store float %13, float* %14
ret void
}