#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 */
double acos(int /*<<< orphan*/);
int /*<<< orphan*/ p5glove_dot(double *, double *);
int /*<<< orphan*/ p5glove_normal(double *, double *);
double p5glove_angle(const double p1[3], const double p2[3],
                     const double p3[3]) {
  double v1[3], v2[3];
  v1[0] = p1[0] - p2[0];
  v1[1] = p1[1] - p2[1];
  v1[2] = p1[2] - p2[2];
  v2[0] = p3[0] - p2[0];
  v2[1] = p3[1] - p2[1];
  v2[2] = p3[2] - p2[2];
  p5glove_normal(v1, v1);
  p5glove_normal(v2, v2);
  return acos(p5glove_dot(v1, v2));
}


x86 assembly (clang, -O0):
<p5glove_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <p5glove_normal@plt>
lea    -0x50(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <p5glove_normal@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <p5glove_dot@plt>
mov    %eax,%edi
call   1030 <acos@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p5glove_angle>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movupd (%rdi),%xmm0
movupd (%rsi),%xmm1
subpd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  0x10(%rsi),%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
movupd (%rdx),%xmm0
subpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rdx),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %r14,%rsi
call   1040 <p5glove_normal@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <p5glove_normal@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <p5glove_dot@plt>
mov    %eax,%edi
call   1030 <acos@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @p5glove_angle(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
%8 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fsub double %11, %14
%16 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %15, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fsub double %19, %22
%24 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %23, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %31, double* %32
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = fsub double %35, %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
store double %39, double* %40
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %5
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = fsub double %43, %46
%48 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 1
store double %47, double* %48
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = load double*, double** %5
%53 = getelementptr inbounds double, double* %52, i64 2
%54 = load double, double* %53
%55 = fsub double %51, %54
%56 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 2
store double %55, double* %56
%57 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%58 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%59 = call i32 @p5glove_normal(double* %57, double* %58)
%60 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%61 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%62 = call i32 @p5glove_normal(double* %60, double* %61)
%63 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%64 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%65 = call i32 @p5glove_dot(double* %63, double* %64)
%66 = call double @acos(i32 %65)
ret double %66
}

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