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


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    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%rax
je     1188 <main+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    11b3 <main+0x83>
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    -0x10(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%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,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
movl   $0x0,(%rbx)
movl   $0x0,(%rax)
xor    %eax,%eax
call   1030 <nondet@plt>
test   %rax,%rax
cmovne %r14,%rbx
mov    (%rbx),%eax
cmp    (%r14),%eax
jne    1179 <main+0x49>
mov    $0x1,%edi
call   1050 <csolve_assert@plt>
movl   $0x1,(%rbx)
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 i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %2
store i32 0, i32* %8
%9 = load i32*, i32** %3
store i32 0, i32* %9
%10 = call i64 (...) @nondet()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = load i32*, i32** %3
store i32* %13, i32** %2
br label %14
14: ; preds = %12, %0
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = icmp eq i32 %16, %18
br i1 %19, label %20, label %28
20: ; preds = %14
%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, %14
%29 = load i32*, i32** %2
store i32 1, i32* %29
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32 0, i32* %2
store i32 0, i32* %4
%5 = tail call i64 (...) @nondet()
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32* %2, i32* %4
%8 = load i32, i32* %7
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
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
store i32 1, i32* %7
ret i32 0
}