#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 */
struct vec {
  int dummy;
};

/* Variables and functions */
double acos(double);
double dot_vec(struct vec *, struct vec *);
double mod_vec(struct vec *);
double ang_vec(struct vec *one, struct vec *two) {
  double dot;
  double cos_;
  dot = dot_vec(one, two);
  cos_ = (acos(dot / (mod_vec(one) * mod_vec(two))) / (3.1415026)) * 180.0;
  return cos_;
}


x86 assembly (clang, -O0):
<ang_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <dot_vec@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mod_vec@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mod_vec@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <acos@plt>
movsd  0xe73(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ang_vec>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <dot_vec@plt>
movsd  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
call   1050 <mod_vec@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
call   1050 <mod_vec@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <acos@plt>
divsd  0xe81(%rip),%xmm0
mulsd  0xe81(%rip),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.vec = type { i32 }
define double @ang_vec(%struct.vec* %0, %struct.vec* %1) {
%3 = alloca %struct.vec*
%4 = alloca %struct.vec*
%5 = alloca double
%6 = alloca double
store %struct.vec* %0, %struct.vec** %3
store %struct.vec* %1, %struct.vec** %4
%7 = load %struct.vec*, %struct.vec** %3
%8 = load %struct.vec*, %struct.vec** %4
%9 = call double @dot_vec(%struct.vec* %7, %struct.vec* %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = load %struct.vec*, %struct.vec** %3
%12 = call double @mod_vec(%struct.vec* %11)
%13 = load %struct.vec*, %struct.vec** %4
%14 = call double @mod_vec(%struct.vec* %13)
%15 = fmul double %12, %14
%16 = fdiv double %10, %15
%17 = call double @acos(double %16)
%18 = fdiv double %17, 0x400921CC1D7A644A
%19 = fmul double %18, 1.800000e+02
store double %19, double* %6
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
%struct.vec = type { i32 }
define double @ang_vec(%struct.vec* %0, %struct.vec* %1) {
%3 = tail call double @dot_vec(%struct.vec* %0, %struct.vec* %1)
%4 = tail call double @mod_vec(%struct.vec* %0)
%5 = tail call double @mod_vec(%struct.vec* %1)
%6 = fmul double %4, %5
%7 = fdiv double %3, %6
%8 = tail call double @acos(double %7)
%9 = fdiv double %8, 0x400921CC1D7A644A
%10 = fmul double %9, 1.800000e+02
ret double %10
}