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

/* Variables and functions */
struct Edge *edge_lNext(struct Edge *);
struct Edge *edge_lPrev(struct Edge *);
int /*<<< orphan*/ edge_orig(struct Edge *);
scalar_t__ point_compare(int /*<<< orphan*/, int /*<<< orphan*/);
int quadEdge_isWall(struct Edge *edge) {
  return point_compare(edge_orig(edge), edge_orig(edge_lNext(edge))) >= 0 &&
         point_compare(edge_orig(edge_lNext(edge)),
                       edge_orig(edge_lPrev(edge))) > 0;
}


x86 assembly (clang, -O0):
<quadEdge_isWall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <edge_orig@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <edge_lNext@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1050 <point_compare@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jl     11be <quadEdge_isWall+0x7e>
mov    -0x8(%rbp),%rdi
call   1060 <edge_lNext@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <edge_lPrev@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <point_compare@plt>
cmp    $0x0,%rax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadEdge_isWall>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <edge_orig@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <edge_lNext@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <point_compare@plt>
test   %rax,%rax
js     11a3 <quadEdge_isWall+0x63>
mov    %rbx,%rdi
call   1060 <edge_lNext@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <edge_lPrev@plt>
mov    %rax,%rdi
call   1030 <edge_orig@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <point_compare@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
jmp    11a5 <quadEdge_isWall+0x65>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Edge = type { i32 }
define i32 @quadEdge_isWall(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call i32 @edge_orig(%struct.Edge* %3)
%5 = load %struct.Edge*, %struct.Edge** %2
%6 = call %struct.Edge* @edge_lNext(%struct.Edge* %5)
%7 = call i32 @edge_orig(%struct.Edge* %6)
%8 = call i64 @point_compare(i32 %4, i32 %7)
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %1
%11 = load %struct.Edge*, %struct.Edge** %2
%12 = call %struct.Edge* @edge_lNext(%struct.Edge* %11)
%13 = call i32 @edge_orig(%struct.Edge* %12)
%14 = load %struct.Edge*, %struct.Edge** %2
%15 = call %struct.Edge* @edge_lPrev(%struct.Edge* %14)
%16 = call i32 @edge_orig(%struct.Edge* %15)
%17 = call i64 @point_compare(i32 %13, i32 %16)
%18 = icmp sgt i64 %17, 0
br label %19
19: ; preds = %10, %1
%20 = phi i1 [ false, %1 ], [ %18, %10 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define i32 @quadEdge_isWall(%struct.Edge* %0) {
%2 = tail call i32 @edge_orig(%struct.Edge* %0)
%3 = tail call %struct.Edge* @edge_lNext(%struct.Edge* %0)
%4 = tail call i32 @edge_orig(%struct.Edge* %3)
%5 = tail call i64 @point_compare(i32 %2, i32 %4)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = tail call %struct.Edge* @edge_lNext(%struct.Edge* %0)
%9 = tail call i32 @edge_orig(%struct.Edge* %8)
%10 = tail call %struct.Edge* @edge_lPrev(%struct.Edge* %0)
%11 = tail call i32 @edge_orig(%struct.Edge* %10)
%12 = tail call i64 @point_compare(i32 %9, i32 %11)
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %7, %1
%16 = phi i32 [ 0, %1 ], [ %14, %7 ]
ret i32 %16
}