#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_y(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 + 2] = s;
  out[2 * 4 + 0] = -s;
  out[2 * 4 + 2] = c;
}


x86 assembly (clang, -O0):
<floats_mat44_rotate_y>:
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
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x20(%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_y>:
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 0x10(%rsp),%xmm1
movss  %xmm1,0x8(%rbx)
xorps  0xe7d(%rip),%xmm1
movss  %xmm1,0x20(%rbx)
movss  %xmm0,0x28(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @floats_mat44_rotate_y(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 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
%21 = load float, float* %5
%22 = fneg float %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 8
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_y(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 = getelementptr inbounds float, float* %1, i64 2
store float %5, float* %8
%9 = fneg float %5
%10 = getelementptr inbounds float, float* %1, i64 8
store float %9, float* %10
%11 = getelementptr inbounds float, float* %1, i64 10
store float %7, float* %11
ret void
}