#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 */
int /*<<< orphan*/ clang_analyzer_eval(int);
void canonical_equal(int *lhs, int *rhs) {
  clang_analyzer_eval(lhs == rhs);
  if (lhs == rhs) {
    clang_analyzer_eval(rhs == lhs);
    return;
  }
  clang_analyzer_eval(lhs == rhs);
  clang_analyzer_eval(rhs == lhs);
}


x86 assembly (clang, -O0):
<canonical_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    115d <canonical_equal+0x4d>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    1187 <canonical_equal+0x77>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonical_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %rsi,%rbx
sete   %dil
call   1030 <clang_analyzer_eval@plt>
cmp    %r14,%rbx
je     1138 <canonical_equal+0x28>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    113d <canonical_equal+0x2d>
mov    $0x1,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @canonical_equal(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = icmp eq i32* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = icmp eq i32* %10, %11
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32*, i32** %3
%16 = icmp eq i32* %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
br label %30
19: ; preds = %2
%20 = load i32*, i32** %3
%21 = load i32*, i32** %4
%22 = icmp eq i32* %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @clang_analyzer_eval(i32 %23)
%25 = load i32*, i32** %4
%26 = load i32*, i32** %3
%27 = icmp eq i32* %25, %26
%28 = zext i1 %27 to i32
%29 = call i32 @clang_analyzer_eval(i32 %28)
br label %30
30: ; preds = %19, %13
ret void
}

LLVM IR (-O2):
define void @canonical_equal(i32* readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
br i1 %3, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @clang_analyzer_eval(i32 0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
%10 = tail call i32 @clang_analyzer_eval(i32 %9)
ret void
}