#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 */
double cos(float);
int /*<<< orphan*/ floats_mat44_identity(float *);
double sin(float);
void floats_mat44_rotate_y(float rad, float out[16]) {
  floats_mat44_identity(out);
  double s = sin(rad), c = 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>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x20(%rax)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%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    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0x4(%rsp)
call   1040 <floats_mat44_identity@plt>
movss  0x4(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <cos@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x8(%rbx)
xorps  0xe83(%rip),%xmm1
movss  %xmm1,0x20(%rbx)
movss  %xmm0,0x28(%rbx)
add    $0x10,%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 double
%6 = alloca double
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 double @sin(float %9)
store double %10, double* %5
%11 = load float, float* %3
%12 = call double @cos(float %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = fptrunc double %13 to float
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 0
store float %14, float* %16
%17 = load double, double* %5
%18 = fptrunc double %17 to float
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
%21 = load double, double* %5
%22 = fneg double %21
%23 = fptrunc double %22 to float
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 8
store float %23, float* %25
%26 = load double, double* %6
%27 = fptrunc double %26 to float
%28 = load float*, float** %4
%29 = getelementptr inbounds float, float* %28, i64 10
store float %27, float* %29
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 double @sin(float %0)
%5 = tail call double @cos(float %0)
%6 = fptrunc double %5 to float
store float %6, float* %1
%7 = fptrunc double %4 to float
%8 = getelementptr inbounds float, float* %1, i64 2
store float %7, float* %8
%9 = fneg float %7
%10 = getelementptr inbounds float, float* %1, i64 8
store float %9, float* %10
%11 = getelementptr inbounds float, float* %1, i64 10
store float %6, float* %11
ret void
}