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

/* Variables and functions */
int *Cyc_PrattProver_lookup_dist(struct Cyc_PrattProver_Node *,
                                 struct Cyc_PrattProver_Node *, int);
int Cyc_PrattProver_eq_nodes(struct Cyc_PrattProver_Node *r,
                             struct Cyc_PrattProver_Node *t, int is_signed) {
  int _T0;
  int *_T1;
  int _T2;
  int *_T3;
  int _T4;
  if (r != t)
    goto _TL56;
  return 1;
_TL56 : {
  int *rt_dist = Cyc_PrattProver_lookup_dist(r, t, is_signed);
  int *tr_dist = Cyc_PrattProver_lookup_dist(t, r, is_signed);
  if (rt_dist == 0)
    goto _TL58;
  _T1 = rt_dist;
  _T2 = *_T1;
  if (_T2 != 0)
    goto _TL58;
  if (tr_dist == 0)
    goto _TL58;
  _T3 = tr_dist;
  _T4 = *_T3;
  _T0 = _T4 == 0;
  goto _TL59;
_TL58:
  _T0 = 0;
_TL59:
  return _T0;
}
}


x86 assembly (clang, -O0):
<Cyc_PrattProver_eq_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1136 <Cyc_PrattProver_eq_nodes+0x26>
jmp    1142 <Cyc_PrattProver_eq_nodes+0x32>
movl   $0x1,-0x4(%rbp)
jmp    11dc <Cyc_PrattProver_eq_nodes+0xcc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <Cyc_PrattProver_lookup_dist@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <Cyc_PrattProver_lookup_dist@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    117a <Cyc_PrattProver_eq_nodes+0x6a>
jmp    11cf <Cyc_PrattProver_eq_nodes+0xbf>
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     119a <Cyc_PrattProver_eq_nodes+0x8a>
jmp    11cf <Cyc_PrattProver_eq_nodes+0xbf>
cmpq   $0x0,-0x50(%rbp)
jne    11aa <Cyc_PrattProver_eq_nodes+0x9a>
jmp    11cf <Cyc_PrattProver_eq_nodes+0xbf>
mov    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
jmp    11d6 <Cyc_PrattProver_eq_nodes+0xc6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_PrattProver_eq_nodes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
je     115a <Cyc_PrattProver_eq_nodes+0x4a>
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <Cyc_PrattProver_lookup_dist@plt>
mov    %rax,%r15
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <Cyc_PrattProver_lookup_dist@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %r15,%r15
je     115f <Cyc_PrattProver_eq_nodes+0x4f>
cmpl   $0x0,(%r15)
jne    115f <Cyc_PrattProver_eq_nodes+0x4f>
test   %rcx,%rcx
je     115f <Cyc_PrattProver_eq_nodes+0x4f>
xor    %eax,%eax
cmpl   $0x0,(%rcx)
sete   %al
jmp    115f <Cyc_PrattProver_eq_nodes+0x4f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Cyc_PrattProver_Node = type { i32 }
define i32 @Cyc_PrattProver_eq_nodes(%struct.Cyc_PrattProver_Node* %0, %struct.Cyc_PrattProver_Node* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.Cyc_PrattProver_Node*
%6 = alloca %struct.Cyc_PrattProver_Node*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
store %struct.Cyc_PrattProver_Node* %0, %struct.Cyc_PrattProver_Node** %5
store %struct.Cyc_PrattProver_Node* %1, %struct.Cyc_PrattProver_Node** %6
store i32 %2, i32* %7
%15 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %5
%16 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %6
%17 = icmp ne %struct.Cyc_PrattProver_Node* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %3
br label %20
19: ; preds = %3
store i32 1, i32* %4
br label %53
20: ; preds = %18
%21 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %5
%22 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %6
%23 = load i32, i32* %7
%24 = call i32* @Cyc_PrattProver_lookup_dist(%struct.Cyc_PrattProver_Node* %21, %struct.Cyc_PrattProver_Node* %22, i32 %23)
store i32* %24, i32** %13
%25 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %6
%26 = load %struct.Cyc_PrattProver_Node*, %struct.Cyc_PrattProver_Node** %5
%27 = load i32, i32* %7
%28 = call i32* @Cyc_PrattProver_lookup_dist(%struct.Cyc_PrattProver_Node* %25, %struct.Cyc_PrattProver_Node* %26, i32 %27)
store i32* %28, i32** %14
%29 = load i32*, i32** %13
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %32
31: ; preds = %20
br label %50
32: ; preds = %20
%33 = load i32*, i32** %13
store i32* %33, i32** %9
%34 = load i32*, i32** %9
%35 = load i32, i32* %34
store i32 %35, i32* %10
%36 = load i32, i32* %10
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %32
br label %50
39: ; preds = %32
%40 = load i32*, i32** %14
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %43
42: ; preds = %39
br label %50
43: ; preds = %39
%44 = load i32*, i32** %14
store i32* %44, i32** %11
%45 = load i32*, i32** %11
%46 = load i32, i32* %45
store i32 %46, i32* %12
%47 = load i32, i32* %12
%48 = icmp eq i32 %47, 0
%49 = zext i1 %48 to i32
store i32 %49, i32* %8
br label %51
50: ; preds = %42, %38, %31
store i32 0, i32* %8
br label %51
51: ; preds = %50, %43
%52 = load i32, i32* %8
store i32 %52, i32* %4
br label %53
53: ; preds = %51, %19
%54 = load i32, i32* %4
ret i32 %54
}

LLVM IR (-O2):
%struct.Cyc_PrattProver_Node = type { i32 }
define i32 @Cyc_PrattProver_eq_nodes(%struct.Cyc_PrattProver_Node* %0, %struct.Cyc_PrattProver_Node* %1, i32 %2) {
%4 = icmp eq %struct.Cyc_PrattProver_Node* %0, %1
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = tail call i32* @Cyc_PrattProver_lookup_dist(%struct.Cyc_PrattProver_Node* %0, %struct.Cyc_PrattProver_Node* %1, i32 %2)
%7 = tail call i32* @Cyc_PrattProver_lookup_dist(%struct.Cyc_PrattProver_Node* %1, %struct.Cyc_PrattProver_Node* %0, i32 %2)
%8 = icmp eq i32* %6, null
br i1 %8, label %18, label %9
9: ; preds = %5
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
%12 = icmp eq i32* %7, null
%13 = select i1 %11, i1 true, i1 %12
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %14, %9, %5, %3
%19 = phi i32 [ 1, %3 ], [ %17, %14 ], [ 0, %9 ], [ 0, %5 ]
ret i32 %19
}