#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, n, b;
  n = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x >= 0 && 0 <= y && y <= n) {
    if (b == 0) {
      y = y + 1;
      if (__VERIFIER_nondet_int() != 0) {
        b = 1;
      }
    } else {
      y = y - 1;
      if (__VERIFIER_nondet_int() != 0) {
        x = x - 1;
        b = 0;
      }
    }
  }
  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,-0x14(%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)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     1172 <main+0x62>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
jg     1172 <main+0x62>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1182 <main+0x72>
jmp    11e4 <main+0xd4>
cmpl   $0x0,-0x14(%rbp)
jne    11b1 <main+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11ac <main+0x9c>
movl   $0x1,-0x14(%rbp)
jmp    11df <main+0xcf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11da <main+0xca>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    11df <main+0xcf>
jmp    1147 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %r15d,%r15d
js     119f <main+0x8f>
mov    %eax,%ebp
test   %eax,%eax
js     119f <main+0x8f>
cmp    %r14d,%ebp
jg     119f <main+0x8f>
xor    %r12d,%r12d
nop
test   %ebx,%ebx
je     1180 <main+0x70>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
cmovne %r12d,%ebx
sub    %ecx,%r15d
test   %r15d,%r15d
jns    1196 <main+0x86>
jmp    119f <main+0x8f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
test   %r15d,%r15d
js     119f <main+0x8f>
test   %ebp,%ebp
js     119f <main+0x8f>
cmp    %r14d,%ebp
jle    1150 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
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
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %5
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %2
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %3
br label %10
10: ; preds = %41, %0
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 0, %14
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br label %20
20: ; preds = %16, %13, %10
%21 = phi i1 [ false, %13 ], [ false, %10 ], [ %19, %16 ]
br i1 %21, label %22, label %42
22: ; preds = %20
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
%28 = call i32 (...) @__VERIFIER_nondet_int()
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 1, i32* %5
br label %31
31: ; preds = %30, %25
br label %41
32: ; preds = %22
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %3
%35 = call i32 (...) @__VERIFIER_nondet_int()
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i32, i32* %2
%39 = sub nsw i32 %38, 1
store i32 %39, i32* %2
store i32 0, i32* %5
br label %40
40: ; preds = %37, %32
br label %41
41: ; preds = %40, %31
br label %10
42: ; preds = %20
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 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp slt i32 %3, 0
%6 = icmp slt i32 %4, 0
%7 = select i1 %5, i1 true, i1 %6
%8 = icmp sgt i32 %4, %1
%9 = select i1 %7, i1 true, i1 %8
br i1 %9, label %37, label %10
10: ; preds = %0, %28
%11 = phi i32 [ %31, %28 ], [ %2, %0 ]
%12 = phi i32 [ %30, %28 ], [ %3, %0 ]
%13 = phi i32 [ %29, %28 ], [ %4, %0 ]
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = add nuw nsw i32 %13, 1
%17 = tail call i32 (...) @__VERIFIER_nondet_int()
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
br label %28
20: ; preds = %10
%21 = add nsw i32 %13, -1
%22 = tail call i32 (...) @__VERIFIER_nondet_int()
%23 = icmp eq i32 %22, 0
%24 = xor i1 %23, true
%25 = sext i1 %24 to i32
%26 = add nsw i32 %12, %25
%27 = select i1 %23, i32 %11, i32 0
br label %28
28: ; preds = %20, %15
%29 = phi i32 [ %16, %15 ], [ %21, %20 ]
%30 = phi i32 [ %12, %15 ], [ %26, %20 ]
%31 = phi i32 [ %19, %15 ], [ %27, %20 ]
%32 = icmp slt i32 %30, 0
%33 = icmp slt i32 %29, 0
%34 = select i1 %32, i1 true, i1 %33
%35 = icmp sgt i32 %29, %1
%36 = select i1 %34, i1 true, i1 %35
br i1 %36, label %37, label %10
37: ; preds = %28, %0
ret i32 0
}