#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 lummat(float mat[4][4]) {
  float mmat[4][4];
  float rwgt, gwgt, bwgt;
  rwgt = (0.2126);
  gwgt = (0.7152);
  bwgt = (0.0722);
  mmat[0][0] = rwgt;
  mmat[0][1] = rwgt;
  mmat[0][2] = rwgt;
  mmat[0][3] = 0.0;
  mmat[1][0] = gwgt;
  mmat[1][1] = gwgt;
  mmat[1][2] = gwgt;
  mmat[1][3] = 0.0;
  mmat[2][0] = bwgt;
  mmat[2][1] = bwgt;
  mmat[2][2] = bwgt;
  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):
<lummat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x5c(%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  0xe2b(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <matrixmult@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lummat>:
sub    $0x48,%rsp
mov    %rdi,%rdx
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x3d93dd983d93dd98,%rax
dd 93 3d
mov    %rax,0x20(%rsp)
movl   $0x3d93dd98,0x28(%rsp)
3d
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 @lummat([4 x float]* %0) {
%2 = alloca [4 x float]*
%3 = alloca [4 x [4 x float]]
%4 = alloca float
%5 = alloca float
%6 = alloca float
store [4 x float]* %0, [4 x float]** %2
store float 0x3FCB367A00000000, float* %4
store float 0x3FE6E2EB20000000, float* %5
store float 0x3FB27BB300000000, float* %6
%7 = load float, float* %4
%8 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%9 = getelementptr inbounds [4 x float], [4 x float]* %8, i64 0, i64 0
store float %7, float* %9
%10 = load float, float* %4
%11 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%12 = getelementptr inbounds [4 x float], [4 x float]* %11, i64 0, i64 1
store float %10, float* %12
%13 = load float, float* %4
%14 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%15 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 2
store float %13, float* %15
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%17 = getelementptr inbounds [4 x float], [4 x float]* %16, i64 0, i64 3
store float 0.000000e+00, float* %17
%18 = load float, float* %5
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%20 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 0
store float %18, float* %20
%21 = load float, float* %5
%22 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%23 = getelementptr inbounds [4 x float], [4 x float]* %22, i64 0, i64 1
store float %21, float* %23
%24 = load float, float* %5
%25 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%26 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 2
store float %24, float* %26
%27 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%28 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 3
store float 0.000000e+00, float* %28
%29 = load float, float* %6
%30 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%31 = getelementptr inbounds [4 x float], [4 x float]* %30, i64 0, i64 0
store float %29, float* %31
%32 = load float, float* %6
%33 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%34 = getelementptr inbounds [4 x float], [4 x float]* %33, i64 0, i64 1
store float %32, float* %34
%35 = load float, float* %6
%36 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%37 = getelementptr inbounds [4 x float], [4 x float]* %36, i64 0, i64 2
store float %35, float* %37
%38 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%39 = getelementptr inbounds [4 x float], [4 x float]* %38, i64 0, i64 3
store float 0.000000e+00, float* %39
%40 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%41 = getelementptr inbounds [4 x float], [4 x float]* %40, i64 0, i64 0
store float 0.000000e+00, float* %41
%42 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%43 = getelementptr inbounds [4 x float], [4 x float]* %42, i64 0, i64 1
store float 0.000000e+00, float* %43
%44 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%45 = getelementptr inbounds [4 x float], [4 x float]* %44, i64 0, i64 2
store float 0.000000e+00, float* %45
%46 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%47 = getelementptr inbounds [4 x float], [4 x float]* %46, i64 0, i64 3
store float 1.000000e+00, float* %47
%48 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%49 = bitcast [4 x float]* %48 to float**
%50 = load [4 x float]*, [4 x float]** %2
%51 = bitcast [4 x float]* %50 to float**
%52 = load [4 x float]*, [4 x float]** %2
%53 = bitcast [4 x float]* %52 to float**
%54 = call i32 @matrixmult(float** %49, float** %51, float** %53)
ret void
}

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