offsetmat(mat, roffset, goffset, boffset) float mat[4][4];
float roffset, goffset, boffset;
{
  float mmat[4][4];
  mmat[0][0] = 1.0;
  mmat[0][1] = 0.0;
  mmat[0][2] = 0.0;
  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] = 0.0;
  mmat[2][1] = 0.0;
  mmat[2][2] = 1.0;
  mmat[2][3] = 0.0;
  mmat[3][0] = roffset;
  mmat[3][1] = goffset;
  mmat[3][2] = boffset;
  mmat[3][3] = 1.0;
  matrixmult(mmat, mat, mat);
}


x86 assembly (clang, -O0):
<offsetmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm2,-0x68(%rbp)
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  0xe87(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0xe5a(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe27(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <matrixmult@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offsetmat>:
sub    $0x48,%rsp
mov    %rdi,%rdx
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm2
movl   $0x3f800000,(%rsp)
xorps  %xmm3,%xmm3
movups %xmm3,0x4(%rsp)
movl   $0x3f800000,0x14(%rsp)
3f
movups %xmm3,0x18(%rsp)
movq   $0x3f800000,0x28(%rsp)
80 3f
movss  %xmm0,0x30(%rsp)
movss  %xmm1,0x34(%rsp)
movss  %xmm2,0x38(%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 @offsetmat([4 x float]* %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca [4 x float]*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca [4 x [4 x float]]
%11 = fptrunc double %1 to float
%12 = fptrunc double %2 to float
%13 = fptrunc double %3 to float
store [4 x float]* %0, [4 x float]** %6
store float %11, float* %7
store float %12, float* %8
store float %13, float* %9
%14 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 0
%15 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 0
store float 1.000000e+00, float* %15
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 0
%17 = getelementptr inbounds [4 x float], [4 x float]* %16, i64 0, i64 1
store float 0.000000e+00, float* %17
%18 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 0
%19 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 2
store float 0.000000e+00, float* %19
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 0
%21 = getelementptr inbounds [4 x float], [4 x float]* %20, i64 0, i64 3
store float 0.000000e+00, float* %21
%22 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 1
%23 = getelementptr inbounds [4 x float], [4 x float]* %22, i64 0, i64 0
store float 0.000000e+00, float* %23
%24 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 1
%25 = getelementptr inbounds [4 x float], [4 x float]* %24, i64 0, i64 1
store float 1.000000e+00, float* %25
%26 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 1
%27 = getelementptr inbounds [4 x float], [4 x float]* %26, i64 0, i64 2
store float 0.000000e+00, float* %27
%28 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, 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 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 2
%31 = getelementptr inbounds [4 x float], [4 x float]* %30, i64 0, i64 0
store float 0.000000e+00, float* %31
%32 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 2
%33 = getelementptr inbounds [4 x float], [4 x float]* %32, i64 0, i64 1
store float 0.000000e+00, float* %33
%34 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 2
%35 = getelementptr inbounds [4 x float], [4 x float]* %34, i64 0, i64 2
store float 1.000000e+00, float* %35
%36 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 2
%37 = getelementptr inbounds [4 x float], [4 x float]* %36, i64 0, i64 3
store float 0.000000e+00, float* %37
%38 = load float, float* %7
%39 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 3
%40 = getelementptr inbounds [4 x float], [4 x float]* %39, i64 0, i64 0
store float %38, float* %40
%41 = load float, float* %8
%42 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 3
%43 = getelementptr inbounds [4 x float], [4 x float]* %42, i64 0, i64 1
store float %41, float* %43
%44 = load float, float* %9
%45 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, i64 0, i64 3
%46 = getelementptr inbounds [4 x float], [4 x float]* %45, i64 0, i64 2
store float %44, float* %46
%47 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %10, 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]]* %10, i64 0, i64 0
%50 = load [4 x float]*, [4 x float]** %6
%51 = load [4 x float]*, [4 x float]** %6
%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* %5
ret i32 %53
}

LLVM IR (-O2):
define i32 @offsetmat([4 x float]* %0, double %1, double %2, double %3) {
%5 = alloca [4 x [4 x float]]
%6 = fptrunc double %1 to float
%7 = fptrunc double %2 to float
%8 = fptrunc double %3 to float
%9 = bitcast [4 x [4 x float]]* %5 to i8*
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 0
%11 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 0, i64 0
store float 1.000000e+00, float* %11
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 0, i64 1
%13 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 1, i64 1
%14 = bitcast float* %12 to i8*
store float 1.000000e+00, float* %13
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 1, i64 2
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 2, i64 2
%17 = bitcast float* %15 to i8*
store float 1.000000e+00, float* %16
%18 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 2, i64 3
store float 0.000000e+00, float* %18
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 3, i64 0
store float %6, float* %19
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 3, i64 1
store float %7, float* %20
%21 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 3, i64 2
store float %8, float* %21
%22 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 3, i64 3
store float 1.000000e+00, float* %22
%23 = 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]* %10, [4 x float]* %0, [4 x float]* %0)
ret i32 undef
}