#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 */
void *Cyc_Tcutil_normalize_effect(void *);
int Cyc_Tcutil_subset_effect(int, void *, void *);
int Cyc_Unify_unify_effect(void *e1, void *e2) {
  int _T0;
  int _T1;
  int _T2;
  int _T3;
  e1 = Cyc_Tcutil_normalize_effect(e1);
  e2 = Cyc_Tcutil_normalize_effect(e2);
  _T0 = Cyc_Tcutil_subset_effect(0, e1, e2);
  if (!_T0)
    goto _TL7C;
  _T1 = Cyc_Tcutil_subset_effect(0, e2, e1);
  if (!_T1)
    goto _TL7C;
  return 1;
_TL7C:
  _T2 = Cyc_Tcutil_subset_effect(1, e1, e2);
  if (!_T2)
    goto _TL7E;
  _T3 = Cyc_Tcutil_subset_effect(1, e2, e1);
  if (!_T3)
    goto _TL7E;
  return 1;
_TL7E:
  return 0;
}


x86 assembly (clang, -O0):
<Cyc_Unify_unify_effect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Tcutil_normalize_effect@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <Cyc_Tcutil_normalize_effect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1040 <Cyc_Tcutil_subset_effect@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    116b <Cyc_Unify_unify_effect+0x4b>
jmp    1198 <Cyc_Unify_unify_effect+0x78>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1040 <Cyc_Tcutil_subset_effect@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    118c <Cyc_Unify_unify_effect+0x6c>
jmp    1198 <Cyc_Unify_unify_effect+0x78>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <Cyc_Unify_unify_effect+0xd3>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%edi
call   1040 <Cyc_Tcutil_subset_effect@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    11bc <Cyc_Unify_unify_effect+0x9c>
jmp    11ec <Cyc_Unify_unify_effect+0xcc>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1040 <Cyc_Tcutil_subset_effect@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    11e0 <Cyc_Unify_unify_effect+0xc0>
jmp    11ec <Cyc_Unify_unify_effect+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <Cyc_Unify_unify_effect+0xd3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Unify_unify_effect>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
call   1030 <Cyc_Tcutil_normalize_effect@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <Cyc_Tcutil_normalize_effect@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <Cyc_Tcutil_subset_effect@plt>
test   %eax,%eax
je     1161 <Cyc_Unify_unify_effect+0x41>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <Cyc_Tcutil_subset_effect@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    1190 <Cyc_Unify_unify_effect+0x70>
mov    $0x1,%ebp
mov    $0x1,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <Cyc_Tcutil_subset_effect@plt>
test   %eax,%eax
je     118e <Cyc_Unify_unify_effect+0x6e>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <Cyc_Tcutil_subset_effect@plt>
test   %eax,%eax
jne    1190 <Cyc_Unify_unify_effect+0x70>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Cyc_Unify_unify_effect(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @Cyc_Tcutil_normalize_effect(i8* %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %5
%13 = call i8* @Cyc_Tcutil_normalize_effect(i8* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @Cyc_Tcutil_subset_effect(i32 0, i8* %14, i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %2
br label %28
20: ; preds = %2
%21 = load i8*, i8** %5
%22 = load i8*, i8** %4
%23 = call i32 @Cyc_Tcutil_subset_effect(i32 0, i8* %21, i8* %22)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %20
br label %28
27: ; preds = %20
store i32 1, i32* %3
br label %44
28: ; preds = %26, %19
%29 = load i8*, i8** %4
%30 = load i8*, i8** %5
%31 = call i32 @Cyc_Tcutil_subset_effect(i32 1, i8* %29, i8* %30)
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %28
br label %43
35: ; preds = %28
%36 = load i8*, i8** %5
%37 = load i8*, i8** %4
%38 = call i32 @Cyc_Tcutil_subset_effect(i32 1, i8* %36, i8* %37)
store i32 %38, i32* %9
%39 = load i32, i32* %9
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %35
br label %43
42: ; preds = %35
store i32 1, i32* %3
br label %44
43: ; preds = %41, %34
store i32 0, i32* %3
br label %44
44: ; preds = %43, %42, %27
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
define i32 @Cyc_Unify_unify_effect(i8* %0, i8* %1) {
%3 = tail call i8* @Cyc_Tcutil_normalize_effect(i8* %0)
%4 = tail call i8* @Cyc_Tcutil_normalize_effect(i8* %1)
%5 = tail call i32 @Cyc_Tcutil_subset_effect(i32 0, i8* %3, i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @Cyc_Tcutil_subset_effect(i32 0, i8* %4, i8* %3)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7, %2
%11 = tail call i32 @Cyc_Tcutil_subset_effect(i32 1, i8* %3, i8* %4)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i32 @Cyc_Tcutil_subset_effect(i32 1, i8* %4, i8* %3)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13, %10
br label %17
17: ; preds = %13, %7, %16
%18 = phi i32 [ 0, %16 ], [ 1, %7 ], [ 1, %13 ]
ret i32 %18
}