#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 (__VERIFIER_nondet_int() != 0) {
      x = x - 1;
    } else {
      if (__VERIFIER_nondet_int() != 0) {
        y = y - 1;
        z = __VERIFIER_nondet_int();
      } else {
        z = z - 1;
        x = __VERIFIER_nondet_int();
      }
    }
  }
  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    11d8 <main+0xc8>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1193 <main+0x83>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d3 <main+0xc3>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11bb <main+0xab>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
jmp    11ce <main+0xbe>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    11d3 <main+0xc3>
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,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebp,%ebp
jle    1195 <main+0x85>
test   %r14d,%r14d
jle    1195 <main+0x85>
mov    %eax,%ebx
nopl   0x0(%rax)
test   %ebx,%ebx
jle    1195 <main+0x85>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1160 <main+0x50>
add    $0xffffffff,%ebp
test   %ebp,%ebp
jg     1190 <main+0x80>
jmp    1195 <main+0x85>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     117e <main+0x6e>
add    $0xffffffff,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
test   %ebp,%ebp
jg     1190 <main+0x80>
jmp    1195 <main+0x85>
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
test   %ebp,%ebp
jle    1195 <main+0x85>
xchg   %ax,%ax
test   %r14d,%r14d
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 = %37, %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 %38
19: ; preds = %17
%20 = call i32 (...) @__VERIFIER_nondet_int()
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %2
br label %37
25: ; preds = %19
%26 = call i32 (...) @__VERIFIER_nondet_int()
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %3
%31 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %31, i32* %4
br label %36
32: ; preds = %25
%33 = load i32, i32* %4
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %4
%35 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %35, i32* %2
br label %36
36: ; preds = %32, %28
br label %37
37: ; preds = %36, %22
br label %8
38: ; 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 %35
9: ; preds = %0, %26
%10 = phi i32 [ %29, %26 ], [ %3, %0 ]
%11 = phi i32 [ %28, %26 ], [ %2, %0 ]
%12 = phi i32 [ %27, %26 ], [ %1, %0 ]
%13 = tail call i32 (...) @__VERIFIER_nondet_int()
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %9
%16 = add nsw i32 %12, -1
br label %26
17: ; preds = %9
%18 = tail call i32 (...) @__VERIFIER_nondet_int()
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = add nsw i32 %11, -1
%22 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %26
23: ; preds = %17
%24 = add nsw i32 %10, -1
%25 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %26
26: ; preds = %20, %23, %15
%27 = phi i32 [ %16, %15 ], [ %12, %20 ], [ %25, %23 ]
%28 = phi i32 [ %11, %15 ], [ %21, %20 ], [ %11, %23 ]
%29 = phi i32 [ %10, %15 ], [ %22, %20 ], [ %24, %23 ]
%30 = icmp sgt i32 %27, 0
%31 = icmp sgt i32 %28, 0
%32 = select i1 %30, i1 %31, i1 false
%33 = icmp sgt i32 %29, 0
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %9, label %35
35: ; preds = %26, %0
ret i32 0
}