#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, d;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  d = __VERIFIER_nondet_int();
  while (x > 0 && y > 0 && d > 0) {
    if (__VERIFIER_nondet_int() != 0) {
      x = x - 1;
      d = __VERIFIER_nondet_int();
    } else {
      x = __VERIFIER_nondet_int();
      y = y - 1;
      d = d - 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    11be <main+0xae>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     119d <main+0x8d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
jmp    11b9 <main+0xa9>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%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,%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    1189 <main+0x79>
test   %r14d,%r14d
jle    1189 <main+0x79>
mov    %eax,%ebx
nopl   0x0(%rax)
test   %ebx,%ebx
jle    1189 <main+0x79>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1170 <main+0x60>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
test   %ebp,%ebp
jg     1184 <main+0x74>
jmp    1189 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
add    $0xffffffff,%r14d
add    $0xffffffff,%ebx
test   %ebp,%ebp
jle    1189 <main+0x79>
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 = %32, %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 %33
19: ; preds = %17
%20 = call i32 (...) @__VERIFIER_nondet_int()
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %2
%25 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %25, i32* %4
br label %32
26: ; preds = %19
%27 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %27, i32* %2
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %26, %22
br label %8
33: ; 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 %31
9: ; preds = %0, %22
%10 = phi i32 [ %25, %22 ], [ %3, %0 ]
%11 = phi i32 [ %24, %22 ], [ %2, %0 ]
%12 = phi i32 [ %23, %22 ], [ %1, %0 ]
%13 = tail call i32 (...) @__VERIFIER_nondet_int()
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = add nsw i32 %12, -1
%17 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %22
18: ; preds = %9
%19 = tail call i32 (...) @__VERIFIER_nondet_int()
%20 = add nsw i32 %11, -1
%21 = add nsw i32 %10, -1
br label %22
22: ; preds = %18, %15
%23 = phi i32 [ %16, %15 ], [ %19, %18 ]
%24 = phi i32 [ %11, %15 ], [ %20, %18 ]
%25 = phi i32 [ %17, %15 ], [ %21, %18 ]
%26 = icmp sgt i32 %23, 0
%27 = icmp sgt i32 %24, 0
%28 = select i1 %26, i1 %27, i1 false
%29 = icmp sgt i32 %25, 0
%30 = select i1 %28, i1 %29, i1 false
br i1 %30, label %9, label %31
31: ; preds = %22, %0
ret i32 0
}