#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 __VERIFIER_nondet_int();
int main() {
  int x, y, tx;
  tx = __VERIFIER_nondet_int();
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x >= y && tx >= 0) {
    if (__VERIFIER_nondet_int() != 0) {
      x = x - 1 - tx;
    } else {
      y = y + 1 + tx;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1158 <main+0x48>
cmpl   $0x0,-0x10(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x58>
jmp    119a <main+0x8a>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1189 <main+0x79>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1195 <main+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %eax,%ebp
jl     116e <main+0x5e>
test   %r14d,%r14d
js     116e <main+0x5e>
mov    %eax,%ebx
mov    %r14d,%r15d
not    %r15d
add    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x0,%ecx
cmove  %r14d,%ecx
cmovne %r15d,%eax
add    %ecx,%ebx
add    %eax,%ebp
cmp    %ebx,%ebp
jge    1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = icmp sgt i32 %1, -1
%5 = icmp sge i32 %2, %3
%6 = select i1 %5, i1 %4, i1 false
br i1 %6, label %7, label %20
7: ; preds = %0
%8 = xor i32 %1, -1
%9 = add nuw i32 %1, 1
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ %2, %7 ], [ %18, %10 ]
%12 = phi i32 [ %3, %7 ], [ %16, %10 ]
%13 = tail call i32 (...) @__VERIFIER_nondet_int()
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 %9, i32 0
%16 = add i32 %12, %15
%17 = select i1 %14, i32 0, i32 %8
%18 = add i32 %17, %11
%19 = icmp slt i32 %18, %16
br i1 %19, label %20, label %10
20: ; preds = %10, %0
ret i32 0
}