#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 */
scalar_t__ __VERIFIER_nondet_int();
int *__VERIFIER_nondet_pointer();
void __Main(int flag) {
  int *p1 = 0, *p2;
  if (flag) {
    if (__VERIFIER_nondet_int()) {
      p2 = p1;
      p1 = 0;
    } else {
      p1 = 0;
    }
  } else {
    p1 = __VERIFIER_nondet_pointer();
  }
  p2 = __VERIFIER_nondet_pointer();
  if (p1 != p2) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<__Main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1170 <__Main+0x50>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1163 <__Main+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
jmp    116b <__Main+0x4b>
movq   $0x0,-0x10(%rbp)
jmp    117b <__Main+0x5b>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_pointer@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_pointer@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     119e <__Main+0x7e>
jmp    1199 <__Main+0x79>
jmp    1199 <__Main+0x79>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__Main>:
push   %rbx
test   %edi,%edi
je     1130 <__Main+0x10>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
jmp    113a <__Main+0x1a>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_pointer@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_pointer@plt>
cmp    %rax,%rbx
je     1152 <__Main+0x32>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <__Main+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @__Main(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = call i64 (...) @__VERIFIER_nondet_int()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32*, i32** %3
store i32* %11, i32** %4
store i32* null, i32** %3
br label %13
12: ; preds = %7
store i32* null, i32** %3
br label %13
13: ; preds = %12, %10
br label %16
14: ; preds = %1
%15 = call i32* (...) @__VERIFIER_nondet_pointer()
store i32* %15, i32** %3
br label %16
16: ; preds = %14, %13
%17 = call i32* (...) @__VERIFIER_nondet_pointer()
store i32* %17, i32** %4
%18 = load i32*, i32** %3
%19 = load i32*, i32** %4
%20 = icmp ne i32* %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @__Main(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 (...) @__VERIFIER_nondet_int()
br label %7
5: ; preds = %1
%6 = tail call i32* (...) @__VERIFIER_nondet_pointer()
br label %7
7: ; preds = %3, %5
%8 = phi i32* [ %6, %5 ], [ null, %3 ]
%9 = tail call i32* (...) @__VERIFIER_nondet_pointer()
%10 = icmp eq i32* %8, %9
br i1 %10, label %12, label %11
11: ; preds = %7, %11
br label %11
12: ; preds = %7
ret void
}