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


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

x86 assembly (clang, -O2):
<genRotateMatrixZ>:
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>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rbx)
movss  0xc(%rsp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,0x14(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @genRotateMatrixZ(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 = sitofp i32 %12 to float
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load float, float* %3
%17 = call i32 @sinf(float %16)
%18 = mul nsw i32 -1, %17
%19 = sitofp i32 %18 to float
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 4
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 5
store float %23, float* %25
ret void
}

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