#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 equal_implies_zero(int *lhs, int *rhs) {
  clang_analyzer_eval(lhs == rhs);
  if (lhs == rhs) {
    clang_analyzer_eval(lhs != rhs);
    clang_analyzer_eval((rhs - lhs) == 0);
    return;
  }
  clang_analyzer_eval(lhs == rhs);
  clang_analyzer_eval(lhs != rhs);
  clang_analyzer_eval((rhs - lhs) == 0);
}


x86 assembly (clang, -O0):
<equal_implies_zero>:
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    117d <equal_implies_zero+0x6d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    11c7 <equal_implies_zero+0xb7>
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
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%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):
<equal_implies_zero>:
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>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
cmp    %r14,%rbx
je     114c <equal_implies_zero+0x3c>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @equal_implies_zero(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 %28
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = load i32*, i32** %4
%16 = icmp ne i32* %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
%19 = load i32*, i32** %4
%20 = load i32*, i32** %3
%21 = ptrtoint i32* %19 to i64
%22 = ptrtoint i32* %20 to i64
%23 = sub i64 %21, %22
%24 = sdiv exact i64 %23, 4
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @clang_analyzer_eval(i32 %26)
br label %48
28: ; preds = %2
%29 = load i32*, i32** %3
%30 = load i32*, i32** %4
%31 = icmp eq i32* %29, %30
%32 = zext i1 %31 to i32
%33 = call i32 @clang_analyzer_eval(i32 %32)
%34 = load i32*, i32** %3
%35 = load i32*, i32** %4
%36 = icmp ne i32* %34, %35
%37 = zext i1 %36 to i32
%38 = call i32 @clang_analyzer_eval(i32 %37)
%39 = load i32*, i32** %4
%40 = load i32*, i32** %3
%41 = ptrtoint i32* %39 to i64
%42 = ptrtoint i32* %40 to i64
%43 = sub i64 %41, %42
%44 = sdiv exact i64 %43, 4
%45 = icmp eq i64 %44, 0
%46 = zext i1 %45 to i32
%47 = call i32 @clang_analyzer_eval(i32 %46)
br label %48
48: ; preds = %28, %13
ret void
}

LLVM IR (-O2):
define void @equal_implies_zero(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)
%6 = tail call i32 @clang_analyzer_eval(i32 0)
%7 = tail call i32 @clang_analyzer_eval(i32 1)
br i1 %3, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @clang_analyzer_eval(i32 0)
br label %10
10: ; preds = %2, %8
ret void
}