#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 DotProd3fv(float const *, float const *);
float *Viewing16fv(float *M, const float X[3], const float Y[3],
                   const float Z[3], const float O[3]) {
  M[0] = X[0];
  M[4] = X[1];
  M[8] = X[2];
  M[12] = -DotProd3fv(X, O);
  M[1] = Y[0];
  M[5] = Y[1];
  M[9] = Y[2];
  M[13] = -DotProd3fv(Y, O);
  M[2] = Z[0];
  M[6] = Z[1];
  M[10] = Z[2];
  M[14] = -DotProd3fv(Z, O);
  M[3] = 0;
  M[7] = 0;
  M[11] = 0;
  M[15] = 1;
  return (M);
}


x86 assembly (clang, -O0):
<Viewing16fv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <DotProd3fv@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x30(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x24(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <DotProd3fv@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x34(%rax)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <DotProd3fv@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rax)
mov    -0x8(%rbp),%rax
movss  0xd9d(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Viewing16fv>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rbx
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x10(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x20(%rdi)
mov    %rsi,%rdi
mov    %r8,%rsi
call   1030 <DotProd3fv@plt>
xorps  0xeae(%rip),%xmm0
movss  %xmm0,0x30(%rbx)
movss  (%r12),%xmm0
movss  %xmm0,0x4(%rbx)
movss  0x4(%r12),%xmm0
movss  %xmm0,0x14(%rbx)
movss  0x8(%r12),%xmm0
movss  %xmm0,0x24(%rbx)
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <DotProd3fv@plt>
xorps  0xe74(%rip),%xmm0
movss  %xmm0,0x34(%rbx)
movss  (%r15),%xmm0
movss  %xmm0,0x8(%rbx)
movss  0x4(%r15),%xmm0
movss  %xmm0,0x18(%rbx)
movss  0x8(%r15),%xmm0
movss  %xmm0,0x28(%rbx)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <DotProd3fv@plt>
xorps  0xe3d(%rip),%xmm0
movss  %xmm0,0x38(%rbx)
movl   $0x0,0xc(%rbx)
movl   $0x0,0x1c(%rbx)
movl   $0x0,0x2c(%rbx)
movl   $0x3f800000,0x3c(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @Viewing16fv(float* %0, float* %1, float* %2, float* %3, float* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load float*, float** %7
%12 = getelementptr inbounds float, float* %11, i64 0
%13 = load float, float* %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %7
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 4
store float %18, float* %20
%21 = load float*, float** %7
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float*, float** %6
%25 = getelementptr inbounds float, float* %24, i64 8
store float %23, float* %25
%26 = load float*, float** %7
%27 = load float*, float** %10
%28 = call float @DotProd3fv(float* %26, float* %27)
%29 = fneg float %28
%30 = load float*, float** %6
%31 = getelementptr inbounds float, float* %30, i64 12
store float %29, float* %31
%32 = load float*, float** %8
%33 = getelementptr inbounds float, float* %32, i64 0
%34 = load float, float* %33
%35 = load float*, float** %6
%36 = getelementptr inbounds float, float* %35, i64 1
store float %34, float* %36
%37 = load float*, float** %8
%38 = getelementptr inbounds float, float* %37, i64 1
%39 = load float, float* %38
%40 = load float*, float** %6
%41 = getelementptr inbounds float, float* %40, i64 5
store float %39, float* %41
%42 = load float*, float** %8
%43 = getelementptr inbounds float, float* %42, i64 2
%44 = load float, float* %43
%45 = load float*, float** %6
%46 = getelementptr inbounds float, float* %45, i64 9
store float %44, float* %46
%47 = load float*, float** %8
%48 = load float*, float** %10
%49 = call float @DotProd3fv(float* %47, float* %48)
%50 = fneg float %49
%51 = load float*, float** %6
%52 = getelementptr inbounds float, float* %51, i64 13
store float %50, float* %52
%53 = load float*, float** %9
%54 = getelementptr inbounds float, float* %53, i64 0
%55 = load float, float* %54
%56 = load float*, float** %6
%57 = getelementptr inbounds float, float* %56, i64 2
store float %55, float* %57
%58 = load float*, float** %9
%59 = getelementptr inbounds float, float* %58, i64 1
%60 = load float, float* %59
%61 = load float*, float** %6
%62 = getelementptr inbounds float, float* %61, i64 6
store float %60, float* %62
%63 = load float*, float** %9
%64 = getelementptr inbounds float, float* %63, i64 2
%65 = load float, float* %64
%66 = load float*, float** %6
%67 = getelementptr inbounds float, float* %66, i64 10
store float %65, float* %67
%68 = load float*, float** %9
%69 = load float*, float** %10
%70 = call float @DotProd3fv(float* %68, float* %69)
%71 = fneg float %70
%72 = load float*, float** %6
%73 = getelementptr inbounds float, float* %72, i64 14
store float %71, float* %73
%74 = load float*, float** %6
%75 = getelementptr inbounds float, float* %74, i64 3
store float 0.000000e+00, float* %75
%76 = load float*, float** %6
%77 = getelementptr inbounds float, float* %76, i64 7
store float 0.000000e+00, float* %77
%78 = load float*, float** %6
%79 = getelementptr inbounds float, float* %78, i64 11
store float 0.000000e+00, float* %79
%80 = load float*, float** %6
%81 = getelementptr inbounds float, float* %80, i64 15
store float 1.000000e+00, float* %81
%82 = load float*, float** %6
ret float* %82
}

LLVM IR (-O2):
define float* @Viewing16fv(float* returned writeonly %0, float* %1, float* %2, float* %3, float* %4) {
%6 = load float, float* %1
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 4
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 8
store float %11, float* %12
%13 = tail call float @DotProd3fv(float* %1, float* %4)
%14 = fneg float %13
%15 = getelementptr inbounds float, float* %0, i64 12
store float %14, float* %15
%16 = load float, float* %2
%17 = getelementptr inbounds float, float* %0, i64 1
store float %16, float* %17
%18 = getelementptr inbounds float, float* %2, i64 1
%19 = load float, float* %18
%20 = getelementptr inbounds float, float* %0, i64 5
store float %19, float* %20
%21 = getelementptr inbounds float, float* %2, i64 2
%22 = load float, float* %21
%23 = getelementptr inbounds float, float* %0, i64 9
store float %22, float* %23
%24 = tail call float @DotProd3fv(float* %2, float* %4)
%25 = fneg float %24
%26 = getelementptr inbounds float, float* %0, i64 13
store float %25, float* %26
%27 = load float, float* %3
%28 = getelementptr inbounds float, float* %0, i64 2
store float %27, float* %28
%29 = getelementptr inbounds float, float* %3, i64 1
%30 = load float, float* %29
%31 = getelementptr inbounds float, float* %0, i64 6
store float %30, float* %31
%32 = getelementptr inbounds float, float* %3, i64 2
%33 = load float, float* %32
%34 = getelementptr inbounds float, float* %0, i64 10
store float %33, float* %34
%35 = tail call float @DotProd3fv(float* %3, float* %4)
%36 = fneg float %35
%37 = getelementptr inbounds float, float* %0, i64 14
store float %36, float* %37
%38 = getelementptr inbounds float, float* %0, i64 3
store float 0.000000e+00, float* %38
%39 = getelementptr inbounds float, float* %0, i64 7
store float 0.000000e+00, float* %39
%40 = getelementptr inbounds float, float* %0, i64 11
store float 0.000000e+00, float* %40
%41 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %41
ret float* %0
}