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

/* Variables and functions */
int /*<<< orphan*/
Cyc_Relations_check_logical_implication(struct Cyc_List_List *,
                                        struct Cyc_List_List *);
int Cyc_Unify_check_logical_equivalence(struct Cyc_List_List *r1,
                                        struct Cyc_List_List *r2) {
  if (r1 == r2)
    return 1;
  return ({ Cyc_Relations_check_logical_implication(r1, r2); }) &&
         ({ Cyc_Relations_check_logical_implication(r2, r1); });
}


x86 assembly (clang, -O0):
<Cyc_Unify_check_logical_equivalence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <Cyc_Unify_check_logical_equivalence+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    117e <Cyc_Unify_check_logical_equivalence+0x6e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Cyc_Relations_check_logical_implication@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x21(%rbp)
je     1173 <Cyc_Unify_check_logical_equivalence+0x63>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Relations_check_logical_implication@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Unify_check_logical_equivalence>:
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
je     113e <Cyc_Unify_check_logical_equivalence+0x2e>
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <Cyc_Relations_check_logical_implication@plt>
test   %eax,%eax
je     1145 <Cyc_Unify_check_logical_equivalence+0x35>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Cyc_Relations_check_logical_implication@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    1147 <Cyc_Unify_check_logical_equivalence+0x37>
mov    $0x1,%eax
jmp    1147 <Cyc_Unify_check_logical_equivalence+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_Unify_check_logical_equivalence(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
%6 = alloca i32
%7 = alloca i32
store %struct.Cyc_List_List* %0, %struct.Cyc_List_List** %4
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %5
%8 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%9 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
%10 = icmp eq %struct.Cyc_List_List* %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %27
12: ; preds = %2
%13 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%14 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
%15 = call i32 @Cyc_Relations_check_logical_implication(%struct.Cyc_List_List* %13, %struct.Cyc_List_List* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
%20 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%21 = call i32 @Cyc_Relations_check_logical_implication(%struct.Cyc_List_List* %19, %struct.Cyc_List_List* %20)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %18, %12
%25 = phi i1 [ false, %12 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %11
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_Unify_check_logical_equivalence(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1) {
%3 = icmp eq %struct.Cyc_List_List* %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i32 @Cyc_Relations_check_logical_implication(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @Cyc_Relations_check_logical_implication(%struct.Cyc_List_List* %1, %struct.Cyc_List_List* %0)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %2
%12 = phi i32 [ 1, %2 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}