#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_z(float *matrix, float angle) {
  warp_mat4_fill_identity(matrix);
  const float sine = sinf(-angle);
  const float cosine = cosf(-angle);
  matrix[0] = cosine;
  matrix[1] = -sine;
  matrix[4] = sine;
  matrix[5] = cosine;
}


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

x86 assembly (clang, -O2):
<warp_mat4_fill_rotation_z>:
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,0x10(%rsp)
movaps 0xea6(%rip),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,(%rbx)
movaps 0x10(%rsp),%xmm1
movss  %xmm1,0x4(%rbx)
movaps 0x20(%rsp),%xmm1
movss  %xmm1,0x10(%rbx)
movss  %xmm0,0x14(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

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

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