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


x86 assembly (clang, -O0):
<zero_implies_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
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>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
jne    1188 <zero_implies_equal+0x78>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    11d2 <zero_implies_equal+0xc2>
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>
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>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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