#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*/ assert(int);
scalar_t__ nondet();
void main() {
  int x, y;
  x = 0;
  y = 0;
  while (nondet()) {
    x++;
    y++;
  }
  while (x > 0 || x < 0) {
    x--;
    y--;
  }
  assert(y >= 0 && y <= 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
jmp    1163 <main+0x43>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jg     117c <main+0x5c>
cmpl   $0x0,-0x4(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    118c <main+0x6c>
jmp    11a3 <main+0x83>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x43>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jl     11bc <main+0x9c>
cmpl   $0x0,-0x8(%rbp)
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nondet@plt>
test   %rax,%rax
jne    1130 <main+0x10>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = call i64 (...) @nondet()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 0
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ true, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i32, i32* %1
%22 = add nsw i32 %21, -1
store i32 %22, i32* %1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, -1
store i32 %24, i32* %2
br label %12
25: ; preds = %18
%26 = load i32, i32* %2
%27 = icmp sge i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %2
%30 = icmp sle i32 %29, 0
br label %31
31: ; preds = %28, %25
%32 = phi i1 [ false, %25 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @nondet()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @nondet()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3, %0
%7 = tail call i32 @assert(i32 1)
ret void
}