#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(double);
double forward_oop_cos_low(double *, double *, double *);
double forward_oop_angle_low(double *delta0, double *delta1, double *delta2) {
  double c;
  c = forward_oop_cos_low(delta0, delta1, delta2);
  if (c > 1) {
    c = 1;
  } else if (c < -1) {
    c = -1;
  }
  return acos(c);
}


x86 assembly (clang, -O0):
<forward_oop_angle_low>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <forward_oop_cos_low@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1173 <forward_oop_angle_low+0x53>
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1198 <forward_oop_angle_low+0x78>
movsd  0xe8d(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1193 <forward_oop_angle_low+0x73>
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1198 <forward_oop_angle_low+0x78>
movsd  -0x20(%rbp),%xmm0
call   1030 <acos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward_oop_angle_low>:
push   %rax
call   1040 <forward_oop_cos_low@plt>
movapd %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
ucomisd %xmm0,%xmm1
ja     114e <forward_oop_angle_low+0x2e>
movsd  0xec8(%rip),%xmm2
ucomisd %xmm1,%xmm2
movapd %xmm1,%xmm0
jbe    114e <forward_oop_angle_low+0x2e>
movapd %xmm2,%xmm0
pop    %rax
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @forward_oop_angle_low(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = call double @forward_oop_cos_low(double* %8, double* %9, double* %10)
store double %11, double* %7
%12 = load double, double* %7
%13 = fcmp ogt double %12, 1.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %3
store double 1.000000e+00, double* %7
br label %20
15: ; preds = %3
%16 = load double, double* %7
%17 = fcmp olt double %16, -1.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %15
store double -1.000000e+00, double* %7
br label %19
19: ; preds = %18, %15
br label %20
20: ; preds = %19, %14
%21 = load double, double* %7
%22 = call double @acos(double %21)
ret double %22
}

LLVM IR (-O2):
define double @forward_oop_angle_low(double* %0, double* %1, double* %2) {
%4 = tail call double @forward_oop_cos_low(double* %0, double* %1, double* %2)
%5 = fcmp ogt double %4, 1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = fcmp olt double %4, -1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %6
br label %9
9: ; preds = %3, %6, %8
%10 = phi double [ -1.000000e+00, %8 ], [ %4, %6 ], [ 1.000000e+00, %3 ]
%11 = tail call double @acos(double %10)
ret double %11
}