#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 */
int /*<<< orphan*/ matrixmult(float **, float **, float **);
void yrotatemat(float mat[4][4], float rs, float rc) {
  float mmat[4][4];
  mmat[0][0] = rc;
  mmat[0][1] = 0.0;
  mmat[0][2] = -rs;
  mmat[0][3] = 0.0;
  mmat[1][0] = 0.0;
  mmat[1][1] = 1.0;
  mmat[1][2] = 0.0;
  mmat[1][3] = 0.0;
  mmat[2][0] = rs;
  mmat[2][1] = 0.0;
  mmat[2][2] = rc;
  mmat[2][3] = 0.0;
  mmat[3][0] = 0.0;
  mmat[3][1] = 0.0;
  mmat[3][2] = 0.0;
  mmat[3][3] = 1.0;
  matrixmult(mmat, mat, mat);
}


x86 assembly (clang, -O0):
<yrotatemat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  0xe99(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe40(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <matrixmult@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yrotatemat>:
sub    $0x48,%rsp
mov    %rdi,%rdx
movss  %xmm1,(%rsp)
movl   $0x0,0x4(%rsp)
movaps 0xed5(%rip),%xmm2
xorps  %xmm0,%xmm2
movss  %xmm2,0x8(%rsp)
movaps 0xed5(%rip),%xmm2
movups %xmm2,0xc(%rsp)
movl   $0x0,0x1c(%rsp)
movss  %xmm0,0x20(%rsp)
movl   $0x0,0x24(%rsp)
movss  %xmm1,0x28(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rsp)
movl   $0x3f800000,0x3c(%rsp)
3f
mov    %rsp,%rdi
mov    %rdx,%rsi
call   1030 <matrixmult@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @yrotatemat([4 x float]* %0, float %1, float %2) {
%4 = alloca [4 x float]*
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x [4 x float]]
store [4 x float]* %0, [4 x float]** %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
store float %8, float* %10
%11 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%12 = getelementptr inbounds [4 x float], [4 x float]* %11, i64 0, i64 1
store float 0.000000e+00, float* %12
%13 = load float, float* %5
%14 = fneg float %13
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%16 = getelementptr inbounds [4 x float], [4 x float]* %15, i64 0, i64 2
store float %14, float* %16
%17 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%18 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 3
store float 0.000000e+00, float* %18
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 1
%20 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 0
store float 0.000000e+00, float* %20
%21 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 1
%22 = getelementptr inbounds [4 x float], [4 x float]* %21, i64 0, i64 1
store float 1.000000e+00, float* %22
%23 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 1
%24 = getelementptr inbounds [4 x float], [4 x float]* %23, i64 0, i64 2
store float 0.000000e+00, float* %24
%25 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 1
%26 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 3
store float 0.000000e+00, float* %26
%27 = load float, float* %5
%28 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 2
%29 = getelementptr inbounds [4 x float], [4 x float]* %28, i64 0, i64 0
store float %27, float* %29
%30 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 2
%31 = getelementptr inbounds [4 x float], [4 x float]* %30, i64 0, i64 1
store float 0.000000e+00, float* %31
%32 = load float, float* %6
%33 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 2
%34 = getelementptr inbounds [4 x float], [4 x float]* %33, i64 0, i64 2
store float %32, float* %34
%35 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 2
%36 = getelementptr inbounds [4 x float], [4 x float]* %35, i64 0, i64 3
store float 0.000000e+00, float* %36
%37 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 3
%38 = getelementptr inbounds [4 x float], [4 x float]* %37, i64 0, i64 0
store float 0.000000e+00, float* %38
%39 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 3
%40 = getelementptr inbounds [4 x float], [4 x float]* %39, i64 0, i64 1
store float 0.000000e+00, float* %40
%41 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 3
%42 = getelementptr inbounds [4 x float], [4 x float]* %41, i64 0, i64 2
store float 0.000000e+00, float* %42
%43 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 3
%44 = getelementptr inbounds [4 x float], [4 x float]* %43, i64 0, i64 3
store float 1.000000e+00, float* %44
%45 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%46 = bitcast [4 x float]* %45 to float**
%47 = load [4 x float]*, [4 x float]** %4
%48 = bitcast [4 x float]* %47 to float**
%49 = load [4 x float]*, [4 x float]** %4
%50 = bitcast [4 x float]* %49 to float**
%51 = call i32 @matrixmult(float** %46, float** %48, float** %50)
ret void
}

LLVM IR (-O2):
define void @yrotatemat([4 x float]* %0, float %1, float %2) {
%4 = alloca [4 x [4 x float]]
%5 = bitcast [4 x [4 x float]]* %4 to i8*
%6 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 0
store float %2, float* %6
%7 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 1
store float 0.000000e+00, float* %7
%8 = fneg float %1
%9 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 3
%11 = bitcast float* %10 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00>, <4 x float>* %11
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 1, i64 3
store float 0.000000e+00, float* %12
%13 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 0
store float %1, float* %13
%14 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 1
store float 0.000000e+00, float* %14
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 2
store float %2, float* %15
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 3
%17 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 3, i64 3
%18 = bitcast float* %16 to i8*
store float 1.000000e+00, float* %17
%19 = bitcast [4 x [4 x float]]* %4 to float**
%20 = bitcast [4 x float]* %0 to float**
%21 = call i32 @matrixmult(float** %19, float** %20, float** %20)
ret void
}