#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 (__VERIFIER_nondet_int()) {
      if (x < y) {
        y = x - 1;
      } else {
        y = y - 1;
      }
      x = __VERIFIER_nondet_int();
    } else {
      if (x < y) {
        x = x - 1;
      } else {
        x = y - 1;
      }
      y = __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)
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    11d0 <main+0xc0>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     119e <main+0x8e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1186 <main+0x76>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118f <main+0x7f>
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    11cb <main+0xbb>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b8 <main+0xa8>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0xb1>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebp,%ebp
jle    115c <main+0x4c>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
jle    115c <main+0x4c>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
cmp    %ebx,%ebp
cmovb  %ebp,%ebx
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %r14d,%r14d
mov    %eax,%ebp
cmove  %ebx,%ebp
cmove  %eax,%ebx
test   %ebp,%ebp
jg     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
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 = %41, %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 %42
14: ; preds = %12
%15 = call i32 (...) @__VERIFIER_nondet_int()
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 1
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, %21
%28 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %28, i32* %2
br label %41
29: ; preds = %14
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, 1
store i32 %35, i32* %2
br label %39
36: ; preds = %29
%37 = load i32, i32* %3
%38 = sub nsw i32 %37, 1
store i32 %38, i32* %2
br label %39
39: ; preds = %36, %33
%40 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %40, i32* %3
br label %41
41: ; preds = %39, %27
br label %6
42: ; preds = %12
%43 = load i32, i32* %1
ret i32 %43
}

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 %20
6: ; preds = %0, %6
%7 = phi i32 [ %16, %6 ], [ %2, %0 ]
%8 = phi i32 [ %15, %6 ], [ %1, %0 ]
%9 = tail call i32 (...) @__VERIFIER_nondet_int()
%10 = icmp eq i32 %9, 0
%11 = icmp ult i32 %8, %7
%12 = select i1 %11, i32 %8, i32 %7
%13 = add nsw i32 %12, -1
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
%15 = select i1 %10, i32 %13, i32 %14
%16 = select i1 %10, i32 %14, i32 %13
%17 = icmp sgt i32 %15, 0
%18 = icmp sgt i32 %16, 0
%19 = select i1 %17, i1 %18, i1 false
br i1 %19, label %6, label %20
20: ; preds = %6, %0
ret i32 0
}