#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, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x > 0 && y > 0 && z > 0) {
    if (y > x) {
      y = z;
      x = __VERIFIER_nondet_int();
      z = x - 1;
    } else {
      z = z - 1;
      x = __VERIFIER_nondet_int();
      y = x - 1;
    }
  }
  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,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jle    1165 <main+0x55>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jle    1165 <main+0x55>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1175 <main+0x65>
jmp    11c0 <main+0xb0>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    119f <main+0x8f>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bb <main+0xab>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%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   %r14
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,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %r14d,%r14d
jle    1168 <main+0x58>
test   %ebp,%ebp
jle    1168 <main+0x58>
mov    %eax,%ebx
test   %eax,%eax
jle    1168 <main+0x58>
nopl   (%rax)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %r14d,%ebp
lea    -0x1(%rax),%ebp
cmova  %ebx,%ebp
cmova  %eax,%ebx
test   %eax,%eax
jle    1168 <main+0x58>
test   %ebp,%ebp
jle    1168 <main+0x58>
lea    -0x1(%rbx),%ecx
mov    %eax,%r14d
cmp    $0x1,%ebx
mov    %ecx,%ebx
jg     1140 <main+0x30>
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
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %4
br label %8
8: ; preds = %34, %0
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 0
br label %17
17: ; preds = %14, %11, %8
%18 = phi i1 [ false, %11 ], [ false, %8 ], [ %16, %14 ]
br i1 %18, label %19, label %35
19: ; preds = %17
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i32, i32* %4
store i32 %24, i32* %3
%25 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %4
br label %34
28: ; preds = %19
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %4
%31 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %3
br label %34
34: ; preds = %28, %23
br label %8
35: ; preds = %17
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, 0
%5 = icmp sgt i32 %2, 0
%6 = select i1 %4, i1 %5, i1 false
%7 = icmp sgt i32 %3, 0
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %9, label %24
9: ; preds = %0, %9
%10 = phi i32 [ %18, %9 ], [ %3, %0 ]
%11 = phi i32 [ %16, %9 ], [ %2, %0 ]
%12 = phi i32 [ %14, %9 ], [ %1, %0 ]
%13 = icmp ugt i32 %11, %12
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
%15 = add nsw i32 %14, -1
%16 = select i1 %13, i32 %10, i32 %15
%17 = select i1 %13, i32 %14, i32 %10
%18 = add nsw i32 %17, -1
%19 = icmp sgt i32 %14, 0
%20 = icmp sgt i32 %16, 0
%21 = select i1 %19, i1 %20, i1 false
%22 = icmp sgt i32 %17, 1
%23 = select i1 %21, i1 %22, i1 false
br i1 %23, label %9, label %24
24: ; preds = %9, %0
ret i32 0
}