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


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)
jle    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    1192 <main+0x82>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1184 <main+0x74>
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    118d <main+0x7d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%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
jle    1156 <main+0x46>
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
jle    1156 <main+0x46>
test   %ebp,%ebp
jle    1156 <main+0x46>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1130 <main+0x20>
add    $0xffffffff,%ebp
test   %ebx,%ebx
jg     1140 <main+0x30>
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 = %24, %0
%7 = load i32, i32* %2
%8 = icmp sgt 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 %25
14: ; preds = %12
%15 = call i32 (...) @__VERIFIER_nondet_int()
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 1
store i32 %19, i32* %2
%20 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %20, i32* %3
br label %24
21: ; preds = %14
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
br label %6
25: ; preds = %12
ret i32 0
}

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