#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 */
scalar_t__ acos(float const);
float const sqrt(float const);
float mvVecAngleBetween2(const float *a, const float *b) {
  return (float)acos(((a[0] * b[0]) + (a[1] * b[1])) /
                     (sqrt((a[0] * a[0]) + (a[1] * a[1])) *
                      sqrt((b[0] * b[0]) + (b[1] * b[1]))));
}


x86 assembly (clang, -O0):
<mvVecAngleBetween2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
movss  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <acos@plt>
cvtsi2ss %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecAngleBetween2>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x4(%rsi),%xmm4
mulss  %xmm1,%xmm4
movss  (%rsi),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm5,%xmm5
ucomiss %xmm5,%xmm0
jb     115c <mvVecAngleBetween2+0x3c>
sqrtss %xmm0,%xmm3
jmp    117f <mvVecAngleBetween2+0x5f>
movss  %xmm2,0xc(%rsp)
movss  %xmm4,0x8(%rsp)
call   1040 <sqrt@plt>
xorps  %xmm5,%xmm5
movss  0x8(%rsp),%xmm4
movss  0xc(%rsp),%xmm2
movaps %xmm0,%xmm3
addss  %xmm4,%xmm2
movss  (%rbx),%xmm0
movss  0x4(%rbx),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ucomiss %xmm5,%xmm0
jb     11a3 <mvVecAngleBetween2+0x83>
sqrtss %xmm0,%xmm0
jmp    11c0 <mvVecAngleBetween2+0xa0>
movss  %xmm2,0xc(%rsp)
movss  %xmm3,0x8(%rsp)
call   1040 <sqrt@plt>
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm2
mulss  %xmm0,%xmm3
divss  %xmm3,%xmm2
movaps %xmm2,%xmm0
call   1030 <acos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @mvVecAngleBetween2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 0
%24 = load float, float* %23
%25 = load float*, float** %3
%26 = getelementptr inbounds float, float* %25, i64 1
%27 = load float, float* %26
%28 = load float*, float** %3
%29 = getelementptr inbounds float, float* %28, i64 1
%30 = load float, float* %29
%31 = fmul float %27, %30
%32 = call float @llvm.fmuladd.f32(float %21, float %24, float %31)
%33 = call float @sqrt(float %32)
%34 = load float*, float** %4
%35 = getelementptr inbounds float, float* %34, i64 0
%36 = load float, float* %35
%37 = load float*, float** %4
%38 = getelementptr inbounds float, float* %37, i64 0
%39 = load float, float* %38
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 1
%42 = load float, float* %41
%43 = load float*, float** %4
%44 = getelementptr inbounds float, float* %43, i64 1
%45 = load float, float* %44
%46 = fmul float %42, %45
%47 = call float @llvm.fmuladd.f32(float %36, float %39, float %46)
%48 = call float @sqrt(float %47)
%49 = fmul float %33, %48
%50 = fdiv float %18, %49
%51 = call i64 @acos(float %50)
%52 = sitofp i64 %51 to float
ret float %52
}

LLVM IR (-O2):
define float @mvVecAngleBetween2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = fmul float %6, %6
%12 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %11)
%13 = tail call float @sqrt(float %12)
%14 = load float, float* %1
%15 = load float, float* %7
%16 = fmul float %15, %15
%17 = tail call float @llvm.fmuladd.f32(float %14, float %14, float %16)
%18 = tail call float @sqrt(float %17)
%19 = fmul float %13, %18
%20 = fdiv float %10, %19
%21 = tail call i64 @acos(float %20)
%22 = sitofp i64 %21 to float
ret float %22
}