#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_x(float rad, float out[16]) {
  floats_mat44_identity(out);
  float s = (float)sin(rad), c = (float)cos(rad);
  out[1 * 4 + 1] = c;
  out[1 * 4 + 2] = -s;
  out[2 * 4 + 1] = s;
  out[2 * 4 + 2] = c;
}


x86 assembly (clang, -O0):
<floats_mat44_rotate_x>:
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,0x14(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x24(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x28(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat44_rotate_x>:
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,0x14(%rbx)
movaps 0xe86(%rip),%xmm1
movaps 0x10(%rsp),%xmm2
xorps  %xmm2,%xmm1
movss  %xmm1,0x18(%rbx)
movss  %xmm2,0x24(%rbx)
movss  %xmm0,0x28(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @floats_mat44_rotate_x(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 5
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 6
store float %19, float* %21
%22 = load float, float* %5
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 9
store float %22, float* %24
%25 = load float, float* %6
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 10
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @floats_mat44_rotate_x(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
%8 = getelementptr inbounds float, float* %1, i64 5
store float %7, float* %8
%9 = fneg float %5
%10 = getelementptr inbounds float, float* %1, i64 6
store float %9, float* %10
%11 = getelementptr inbounds float, float* %1, i64 9
store float %5, float* %11
%12 = getelementptr inbounds float, float* %1, i64 10
store float %7, float* %12
ret void
}