#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);
float sinf(float);
int /*<<< orphan*/ warp_mat4_fill_identity(float *);
extern void warp_mat4_fill_rotation_y(float *matrix, float angle) {
  warp_mat4_fill_identity(matrix);
  const float sine = sinf(-angle);
  const float cosine = cosf(-angle);
  matrix[0] = cosine;
  matrix[2] = sine;
  matrix[8] = -sine;
  matrix[10] = cosine;
}


x86 assembly (clang, -O0):
<warp_mat4_fill_rotation_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <warp_mat4_fill_identity@plt>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_mat4_fill_rotation_y>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
call   1050 <warp_mat4_fill_identity@plt>
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,0x20(%rsp)
movaps 0xea6(%rip),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,(%rbx)
movaps 0x10(%rsp),%xmm1
movss  %xmm1,0x8(%rbx)
movaps 0x20(%rsp),%xmm1
movss  %xmm1,0x20(%rbx)
movss  %xmm0,0x28(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @warp_mat4_fill_rotation_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** %3
%8 = call i32 @warp_mat4_fill_identity(float* %7)
%9 = load float, float* %4
%10 = fneg float %9
%11 = call float @sinf(float %10)
store float %11, float* %5
%12 = load float, float* %4
%13 = fneg float %12
%14 = call float @cosf(float %13)
store float %14, float* %6
%15 = load float, float* %6
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 0
store float %15, float* %17
%18 = load float, float* %5
%19 = load float*, float** %3
%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** %3
%24 = getelementptr inbounds float, float* %23, i64 8
store float %22, float* %24
%25 = load float, float* %6
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 10
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @warp_mat4_fill_rotation_y(float* %0, float %1) {
%3 = tail call i32 @warp_mat4_fill_identity(float* %0)
%4 = tail call float @sinf(float %1)
%5 = fneg float %4
%6 = tail call float @cosf(float %1)
store float %6, float* %0
%7 = getelementptr inbounds float, float* %0, i64 2
store float %5, float* %7
%8 = getelementptr inbounds float, float* %0, i64 8
store float %4, float* %8
%9 = getelementptr inbounds float, float* %0, i64 10
store float %6, float* %9
ret void
}