#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*/ csolve_assert(int);
scalar_t__ malloc(int);
int nondet();
int main() {
  int *x = (int *)malloc(sizeof(int));
  *x = nondet();
  int *y = (int *)malloc(sizeof(int));
  *y = nondet();
  if (nondet()) {
    x = y;
  }
  if (x == y) {
    csolve_assert(*x == *y);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%eax
je     1191 <main+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    11b8 <main+0x88>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <csolve_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <nondet@plt>
mov    %eax,(%r14)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <nondet@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <nondet@plt>
test   %eax,%eax
cmovne %rbx,%r14
cmp    %rbx,%r14
jne    117d <main+0x4d>
mov    $0x1,%edi
call   1050 <csolve_assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 (...) @nondet()
store i32 %3, i32* %2
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 (...) @nondet()
store i32 %6, i32* %5
%7 = tail call i32 (...) @nondet()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32* %2, i32* %5
%10 = icmp eq i32* %9, %5
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @csolve_assert(i32 1)
br label %13
13: ; preds = %11, %0
ret i32 0
}