#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];
  do {
    (z)[0] = (p)[0] - (c)[0];
    (z)[1] = (p)[1] - (c)[1];
    (z)[2] = (p)[2] - (c)[2];
  } while (0);
  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
br label %12
12: ; preds = %4
%13 = load float*, float** %7
%14 = getelementptr inbounds float, float* %13, i64 0
%15 = load float, float* %14
%16 = load float*, float** %6
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float, float* %17
%19 = fsub float %15, %18
%20 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
store float %19, float* %20
%21 = load float*, float** %7
%22 = getelementptr inbounds float, float* %21, i64 1
%23 = load float, float* %22
%24 = load float*, float** %6
%25 = getelementptr inbounds float, float* %24, i64 1
%26 = load float, float* %25
%27 = fsub float %23, %26
%28 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 1
store float %27, float* %28
%29 = load float*, float** %7
%30 = getelementptr inbounds float, float* %29, i64 2
%31 = load float, float* %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
%34 = load float, float* %33
%35 = fsub float %31, %34
%36 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 2
store float %35, float* %36
br label %37
37: ; preds = %12
%38 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%39 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%40 = call i32 @v_nrm(float* %38, float* %39)
%41 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%42 = load float*, float** %8
%43 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%44 = call i32 @v_crs(float* %41, float* %42, float* %43)
%45 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%46 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%47 = call i32 @v_nrm(float* %45, float* %46)
%48 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%49 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%50 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%51 = call i32 @v_crs(float* %48, float* %49, float* %50)
%52 = load float*, float** %5
%53 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%54 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%55 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%56 = call i32 @m_basis(float* %52, float* %53, float* %54, float* %55)
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
}