lummat(mat) float mat[4][4];
{
  float mmat[4][4];
  float rwgt, gwgt, bwgt;
  rwgt = (0.3086);
  gwgt = (0.6094);
  bwgt = (0.0820);
  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,-0x10(%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    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <matrixmult@plt>
mov    -0x4(%rbp),%eax
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 $0x3da7ef9e3da7ef9e,%rax
ef a7 3d
mov    %rax,0x20(%rsp)
movl   $0x3da7ef9e,0x28(%rsp)
3d
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rsp)
movl   $0x3f800000,0x3c(%rsp)
3f
mov    %rsp,%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <matrixmult@plt>
add    $0x48,%rsp
ret

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

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