#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 */
scalar_t__ cos(float);
int /*<<< orphan*/ floats_mat44_identity(float *);
scalar_t__ sin(float);
void floats_mat44_rotate_z(float rad, float out[16]) {
  floats_mat44_identity(out);
  float s = (float)sin(rad), c = (float)cos(rad);
  out[0 * 4 + 0] = c;
  out[0 * 4 + 1] = -s;
  out[1 * 4 + 0] = s;
  out[1 * 4 + 1] = c;
}


x86 assembly (clang, -O0):
<floats_mat44_rotate_z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <floats_mat44_identity@plt>
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <cos@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat44_rotate_z>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
call   1040 <floats_mat44_identity@plt>
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%rbx)
movaps 0xe87(%rip),%xmm1
movaps 0x10(%rsp),%xmm2
xorps  %xmm2,%xmm1
movss  %xmm1,0x4(%rbx)
movss  %xmm2,0x10(%rbx)
movss  %xmm0,0x14(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @floats_mat44_rotate_z(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float* %1, float** %4
%7 = load float*, float** %4
%8 = call i32 @floats_mat44_identity(float* %7)
%9 = load float, float* %3
%10 = call i64 @sin(float %9)
%11 = sitofp i64 %10 to float
store float %11, float* %5
%12 = load float, float* %3
%13 = call i64 @cos(float %12)
%14 = sitofp i64 %13 to float
store float %14, float* %6
%15 = load float, float* %6
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 0
store float %15, float* %17
%18 = load float, float* %5
%19 = fneg float %18
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 1
store float %19, float* %21
%22 = load float, float* %5
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 4
store float %22, float* %24
%25 = load float, float* %6
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 5
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @floats_mat44_rotate_z(float %0, float* %1) {
%3 = tail call i32 @floats_mat44_identity(float* %1)
%4 = tail call i64 @sin(float %0)
%5 = sitofp i64 %4 to float
%6 = tail call i64 @cos(float %0)
%7 = sitofp i64 %6 to float
store float %7, float* %1
%8 = fneg float %5
%9 = getelementptr inbounds float, float* %1, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 4
store float %5, float* %10
%11 = getelementptr inbounds float, float* %1, i64 5
store float %7, float* %11
ret void
}