#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 Point {
  int dummy;
};

/* Variables and functions */
scalar_t__ predicate_ahead(struct Point *, struct Point *, struct Point *);
double predicate_triArea(struct Point *, struct Point *, struct Point *);
int predicate_leftOrAhead(struct Point *p, struct Point *q, struct Point *r) {
  double tmp = predicate_triArea(p, q, r);
  return tmp > 0 || tmp == 0 && predicate_ahead(p, q, r);
}


x86 assembly (clang, -O0):
<predicate_leftOrAhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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 <predicate_triArea@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
ja     119f <predicate_leftOrAhead+0x7f>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x22(%rbp)
jne    1199 <predicate_leftOrAhead+0x79>
jp     1199 <predicate_leftOrAhead+0x79>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <predicate_ahead@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<predicate_leftOrAhead>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <predicate_triArea@plt>
mov    $0x1,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1167 <predicate_leftOrAhead+0x47>
ucomisd %xmm1,%xmm0
jne    1165 <predicate_leftOrAhead+0x45>
jp     1165 <predicate_leftOrAhead+0x45>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <predicate_ahead@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1167 <predicate_leftOrAhead+0x47>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Point = type { i32 }
define i32 @predicate_leftOrAhead(%struct.Point* %0, %struct.Point* %1, %struct.Point* %2) {
%4 = alloca %struct.Point*
%5 = alloca %struct.Point*
%6 = alloca %struct.Point*
%7 = alloca double
store %struct.Point* %0, %struct.Point** %4
store %struct.Point* %1, %struct.Point** %5
store %struct.Point* %2, %struct.Point** %6
%8 = load %struct.Point*, %struct.Point** %4
%9 = load %struct.Point*, %struct.Point** %5
%10 = load %struct.Point*, %struct.Point** %6
%11 = call double @predicate_triArea(%struct.Point* %8, %struct.Point* %9, %struct.Point* %10)
store double %11, double* %7
%12 = load double, double* %7
%13 = fcmp ogt double %12, 0.000000e+00
br i1 %13, label %25, label %14
14: ; preds = %3
%15 = load double, double* %7
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load %struct.Point*, %struct.Point** %4
%19 = load %struct.Point*, %struct.Point** %5
%20 = load %struct.Point*, %struct.Point** %6
%21 = call i64 @predicate_ahead(%struct.Point* %18, %struct.Point* %19, %struct.Point* %20)
%22 = icmp ne i64 %21, 0
br label %23
23: ; preds = %17, %14
%24 = phi i1 [ false, %14 ], [ %22, %17 ]
br label %25
25: ; preds = %23, %3
%26 = phi i1 [ true, %3 ], [ %24, %23 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
%struct.Point = type { i32 }
define i32 @predicate_leftOrAhead(%struct.Point* %0, %struct.Point* %1, %struct.Point* %2) {
%4 = tail call double @predicate_triArea(%struct.Point* %0, %struct.Point* %1, %struct.Point* %2)
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = fcmp oeq double %4, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = tail call i64 @predicate_ahead(%struct.Point* %0, %struct.Point* %1, %struct.Point* %2)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %8, %3
%13 = phi i32 [ 1, %3 ], [ 0, %6 ], [ %11, %8 ]
ret i32 %13
}