#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*/ vec_normalize(double *, double *);
void get_inter_point_normal_vector(double *from, double *to, double *out) {
  double intermediate[] = {to[0] - from[0], to[1] - from[1], to[2] - from[2]};
  vec_normalize(intermediate, out);
}


x86 assembly (clang, -O0):
<get_inter_point_normal_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vec_normalize@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inter_point_normal_vector>:
sub    $0x18,%rsp
movupd (%rsi),%xmm0
movupd (%rdi),%xmm1
subpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %rsp,%rdi
mov    %rdx,%rsi
call   1030 <vec_normalize@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @get_inter_point_normal_vector(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fsub double %11, %14
store double %15, double* %8
%16 = getelementptr inbounds double, double* %8, i64 1
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fsub double %19, %22
store double %23, double* %16
%24 = getelementptr inbounds double, double* %16, i64 1
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
store double %31, double* %24
%32 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%33 = load double*, double** %6
%34 = call i32 @vec_normalize(double* %32, double* %33)
ret void
}

LLVM IR (-O2):
define void @get_inter_point_normal_vector(double* nocapture %0, double* nocapture %1, double* %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = bitcast double* %1 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = bitcast double* %0 to <2 x double>*
%10 = load <2 x double>, <2 x double>* %9
%11 = fsub <2 x double> %8, %10
%12 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %11, <2 x double>* %12
%13 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%14 = getelementptr inbounds double, double* %1, i64 2
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = fsub double %15, %17
store double %18, double* %13
%19 = call i32 @vec_normalize(double* %6, double* %2)
ret void
}