#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*/ __VERIFIER_atomic_acquire();
int /*<<< orphan*/ __VERIFIER_atomic_release();
int /*<<< orphan*/ __VERIFIER_error();
int __VERIFIER_nondet_int();
void *thr1(void *arg) {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  int z;
  __VERIFIER_atomic_acquire();
  if (x == y) {
    z = 0;
  } else {
    z = 1;
  }
  if (z == 0) {
    {
      if (!(x == y)) {
        goto ERROR;
      }
    };
  } else {
    {
      if (!(x != y)) {
      ERROR:
        __VERIFIER_error();
        (void)0;
      }
    };
  }
  __VERIFIER_atomic_release();
  return 0;
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <__VERIFIER_atomic_acquire@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    117f <thr1+0x3f>
movl   $0x0,-0x14(%rbp)
jmp    1186 <thr1+0x46>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11a6 <thr1+0x66>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11a1 <thr1+0x61>
jmp    11b7 <thr1+0x77>
jmp    11c3 <thr1+0x83>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11be <thr1+0x7e>
jmp    11b7 <thr1+0x77>
mov    $0x0,%al
call   1050 <__VERIFIER_error@plt>
jmp    11c3 <thr1+0x83>
mov    $0x0,%al
call   1030 <__VERIFIER_atomic_release@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr1>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1050 <__VERIFIER_atomic_acquire@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_atomic_release@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %4
%8 = call i32 (...) @__VERIFIER_atomic_acquire()
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %5
br label %14
13: ; preds = %1
store i32 1, i32* %5
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %22, label %21
21: ; preds = %17
br label %28
22: ; preds = %17
br label %31
23: ; preds = %14
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = icmp ne i32 %24, %25
br i1 %26, label %30, label %27
27: ; preds = %23
br label %28
28: ; preds = %27, %21
%29 = call i32 (...) @__VERIFIER_error()
br label %30
30: ; preds = %28, %23
br label %31
31: ; preds = %30, %22
%32 = call i32 (...) @__VERIFIER_atomic_release()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = tail call i32 (...) @__VERIFIER_atomic_acquire()
%5 = tail call i32 (...) @__VERIFIER_atomic_release()
ret i8* null
}