#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;
  }
  *x = 1;
  if (*x == *y) {
    csolve_assert(*x == *y);
  }
  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
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    11bd <main+0x8d>
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>
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
movl   $0x1,(%rbx)
cmpl   $0x1,(%r14)
jne    117e <main+0x4e>
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 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
store i32 1, i32* %15
%16 = load i32*, i32** %2
%17 = load i32, i32* %16
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %29
21: ; preds = %14
%22 = load i32*, i32** %2
%23 = load i32, i32* %22
%24 = load i32*, i32** %3
%25 = load i32, i32* %24
%26 = icmp eq i32 %23, %25
%27 = zext i1 %26 to i32
%28 = call i32 @csolve_assert(i32 %27)
br label %29
29: ; preds = %21, %14
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
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = tail call i32 @csolve_assert(i32 1)
br label %12
12: ; preds = %10, %0
ret i32 0
}