#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*/ acos(double);
double dotProduct(double *, double *);
double pow(double, double);
double radToDeg(int /*<<< orphan*/);
double fAng(double *Vo, double *Vl, double angleMax, double a0) {
  if (angleMax == 0) {
    return 1;
  }
  double dot = dotProduct(Vo, Vl);
  if (radToDeg(acos(dot)) > angleMax) {
    return 0;
  }
  return pow(dot, a0);
}


x86 assembly (clang, -O0):
<fAng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1184 <fAng+0x44>
jp     1184 <fAng+0x44>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11d3 <fAng+0x93>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <dotProduct@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <acos@plt>
mov    %eax,%edi
call   1040 <radToDeg@plt>
ucomisd -0x20(%rbp),%xmm0
jbe    11bf <fAng+0x7f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11d3 <fAng+0x93>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fAng>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    115d <fAng+0x1d>
jp     115d <fAng+0x1d>
movsd  0xea8(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1050 <dotProduct@plt>
movsd  %xmm0,(%rsp)
call   1030 <acos@plt>
mov    %eax,%edi
call   1040 <radToDeg@plt>
ucomisd 0x10(%rsp),%xmm0
xorpd  %xmm0,%xmm0
jbe    1190 <fAng+0x50>
add    $0x18,%rsp
ret
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
add    $0x18,%rsp
jmp    1060 <pow@plt>

LLVM IR (-O0):
define double @fAng(double* %0, double* %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double %2, double* %8
store double %3, double* %9
%11 = load double, double* %8
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %4
store double 1.000000e+00, double* %5
br label %28
14: ; preds = %4
%15 = load double*, double** %6
%16 = load double*, double** %7
%17 = call double @dotProduct(double* %15, double* %16)
store double %17, double* %10
%18 = load double, double* %10
%19 = call i32 @acos(double %18)
%20 = call double @radToDeg(i32 %19)
%21 = load double, double* %8
%22 = fcmp ogt double %20, %21
br i1 %22, label %23, label %24
23: ; preds = %14
store double 0.000000e+00, double* %5
br label %28
24: ; preds = %14
%25 = load double, double* %10
%26 = load double, double* %9
%27 = call double @pow(double %25, double %26)
store double %27, double* %5
br label %28
28: ; preds = %24, %23, %13
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
define double @fAng(double* %0, double* %1, double %2, double %3) {
%5 = fcmp oeq double %2, 0.000000e+00
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = tail call double @dotProduct(double* %0, double* %1)
%8 = tail call i32 @acos(double %7)
%9 = tail call double @radToDeg(i32 %8)
%10 = fcmp ogt double %9, %2
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call double @pow(double %7, double %3)
br label %13
13: ; preds = %11, %6, %4
%14 = phi double [ 1.000000e+00, %4 ], [ %12, %11 ], [ 0.000000e+00, %6 ]
ret double %14
}