#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*/ m_basis(float *, float *, float *, float *);
int /*<<< orphan*/ v_crs(float *, float const *, float *);
int /*<<< orphan*/ v_nrm(float *, float *);
void m_view(float *M, const float *c, const float *p, const float *u) {
  float x[3];
  float y[3];
  float z[3];
  {
    (z)[0] = (p)[0] - (c)[0];
    (z)[1] = (p)[1] - (c)[1];
    (z)[2] = (p)[2] - (c)[2];
  };
  v_nrm(z, z);
  v_crs(x, u, z);
  v_nrm(x, x);
  v_crs(y, z, x);
  m_basis(M, x, y, z);
}


x86 assembly (clang, -O0):
<m_view>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
lea    -0x44(%rbp),%rdi
lea    -0x44(%rbp),%rsi
call   1030 <v_nrm@plt>
lea    -0x2c(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1050 <v_crs@plt>
lea    -0x2c(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <v_nrm@plt>
lea    -0x38(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1050 <v_crs@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x44(%rbp),%rcx
call   1040 <m_basis@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_view>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r15
mov    %rdi,%r14
movss  (%rdx),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x4(%rdx),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x8(%rdx),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x4(%rsp),%r12
mov    %r12,%rdi
mov    %r12,%rsi
call   1030 <v_nrm@plt>
lea    0x1c(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <v_crs@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <v_nrm@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <v_crs@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <m_basis@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @m_view(float* %0, float* nocapture %1, float* nocapture %2, float* %3) {
%5 = alloca [3 x float]
%6 = alloca [3 x float]
%7 = alloca [3 x float]
%8 = bitcast [3 x float]* %5 to i8*
%9 = bitcast [3 x float]* %6 to i8*
%10 = bitcast [3 x float]* %7 to i8*
%11 = load float, float* %2
%12 = load float, float* %1
%13 = fsub float %11, %12
%14 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
store float %13, float* %14
%15 = getelementptr inbounds float, float* %2, i64 1
%16 = load float, float* %15
%17 = getelementptr inbounds float, float* %1, i64 1
%18 = load float, float* %17
%19 = fsub float %16, %18
%20 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
store float %19, float* %20
%21 = getelementptr inbounds float, float* %2, i64 2
%22 = load float, float* %21
%23 = getelementptr inbounds float, float* %1, i64 2
%24 = load float, float* %23
%25 = fsub float %22, %24
%26 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
store float %25, float* %26
%27 = call i32 @v_nrm(float* %14, float* %14)
%28 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%29 = call i32 @v_crs(float* %28, float* %3, float* %14)
%30 = call i32 @v_nrm(float* %28, float* %28)
%31 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%32 = call i32 @v_crs(float* %31, float* %14, float* %28)
%33 = call i32 @m_basis(float* %0, float* %28, float* %31, float* %14)
ret void
}