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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%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,-0xd(%rbp)
je     114c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115c <main+0x4c>
jmp    11d7 <main+0xc7>
cmpl   $0x0,-0x8(%rbp)
jle    119c <main+0x8c>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     118e <main+0x7e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
jmp    1197 <main+0x87>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d2 <main+0xc2>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11ba <main+0xaa>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cd <main+0xbd>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    11d2 <main+0xc2>
jmp    1133 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
je     1177 <main+0x67>
mov    %eax,%ebp
jmp    1140 <main+0x30>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
test   %ebx,%ebx
je     1177 <main+0x67>
test   %ebp,%ebp
jle    1177 <main+0x67>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
jle    1160 <main+0x50>
test   %eax,%eax
jne    1130 <main+0x20>
add    $0xffffffff,%ebp
jmp    113c <main+0x2c>
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
je     1169 <main+0x59>
add    $0x1,%ebx
jmp    113c <main+0x2c>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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