#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);
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
float sinf(float);
void mtxRotateXY(float *_result, float _ax, float _ay) {
  float sx = sinf(_ax);
  float cx = cosf(_ax);
  float sy = sinf(_ay);
  float cy = cosf(_ay);
  memset(_result, 0, sizeof(float) * 16);
  _result[0] = cy;
  _result[2] = -sy;
  _result[4] = -sx * sy;
  _result[5] = cx;
  _result[6] = -sx * cy;
  _result[8] = cx * sy;
  _result[9] = sx;
  _result[10] = cx * cy;
  _result[15] = 1.0f;
}


x86 assembly (clang, -O0):
<mtxRotateXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x24(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movss  0xdb8(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtxRotateXY>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
call   1030 <sinf@plt>
movaps %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
movss  0x8(%rsp),%xmm4
movss  %xmm4,(%rbx)
movaps 0xe60(%rip),%xmm0
movaps 0x10(%rsp),%xmm5
movaps %xmm5,%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x8(%rbx)
movaps 0x20(%rsp),%xmm2
xorps  %xmm2,%xmm0
movss  0xc(%rsp),%xmm3
movaps %xmm3,%xmm1
mulss  %xmm5,%xmm1
mulss  %xmm0,%xmm5
movss  %xmm5,0x10(%rbx)
movss  %xmm3,0x14(%rbx)
mulss  %xmm4,%xmm0
movss  %xmm0,0x18(%rbx)
movss  %xmm1,0x20(%rbx)
movss  %xmm2,0x24(%rbx)
mulss  %xmm4,%xmm3
movss  %xmm3,0x28(%rbx)
movl   $0x3f800000,0x3c(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mtxRotateXY(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%11 = load float, float* %5
%12 = call float @sinf(float %11)
store float %12, float* %7
%13 = load float, float* %5
%14 = call float @cosf(float %13)
store float %14, float* %8
%15 = load float, float* %6
%16 = call float @sinf(float %15)
store float %16, float* %9
%17 = load float, float* %6
%18 = call float @cosf(float %17)
store float %18, float* %10
%19 = load float*, float** %4
%20 = call i32 @memset(float* %19, i32 0, i32 64)
%21 = load float, float* %10
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 0
store float %21, float* %23
%24 = load float, float* %9
%25 = fneg float %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
%28 = load float, float* %7
%29 = fneg float %28
%30 = load float, float* %9
%31 = fmul float %29, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 4
store float %31, float* %33
%34 = load float, float* %8
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 5
store float %34, float* %36
%37 = load float, float* %7
%38 = fneg float %37
%39 = load float, float* %10
%40 = fmul float %38, %39
%41 = load float*, float** %4
%42 = getelementptr inbounds float, float* %41, i64 6
store float %40, float* %42
%43 = load float, float* %8
%44 = load float, float* %9
%45 = fmul float %43, %44
%46 = load float*, float** %4
%47 = getelementptr inbounds float, float* %46, i64 8
store float %45, float* %47
%48 = load float, float* %7
%49 = load float*, float** %4
%50 = getelementptr inbounds float, float* %49, i64 9
store float %48, float* %50
%51 = load float, float* %8
%52 = load float, float* %10
%53 = fmul float %51, %52
%54 = load float*, float** %4
%55 = getelementptr inbounds float, float* %54, i64 10
store float %53, float* %55
%56 = load float*, float** %4
%57 = getelementptr inbounds float, float* %56, i64 15
store float 1.000000e+00, float* %57
ret void
}

LLVM IR (-O2):
define void @mtxRotateXY(float* %0, float %1, float %2) {
%4 = tail call float @sinf(float %1)
%5 = tail call float @cosf(float %1)
%6 = tail call float @sinf(float %2)
%7 = tail call float @cosf(float %2)
%8 = tail call i32 @memset(float* %0, i32 0, i32 64)
store float %7, float* %0
%9 = fneg float %6
%10 = getelementptr inbounds float, float* %0, i64 2
store float %9, float* %10
%11 = fneg float %4
%12 = fmul float %6, %11
%13 = getelementptr inbounds float, float* %0, i64 4
store float %12, float* %13
%14 = getelementptr inbounds float, float* %0, i64 5
store float %5, float* %14
%15 = fmul float %7, %11
%16 = getelementptr inbounds float, float* %0, i64 6
store float %15, float* %16
%17 = fmul float %5, %6
%18 = getelementptr inbounds float, float* %0, i64 8
store float %17, float* %18
%19 = getelementptr inbounds float, float* %0, i64 9
store float %4, float* %19
%20 = fmul float %5, %7
%21 = getelementptr inbounds float, float* %0, i64 10
store float %20, float* %21
%22 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %22
ret void
}