#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) {
    if (__VERIFIER_nondet_int() != 0) {
      x = x + y;
    } else {
      x = x + z;
    }
    y = y + z;
    z = z - 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)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1185 <main+0x75>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1165 <main+0x55>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x5e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%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,%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
js     115b <main+0x4b>
mov    %eax,%ebx
jmp    114a <main+0x3a>
nopw   0x0(%rax,%rax,1)
add    %ebx,%ebp
add    $0xffffffff,%ebx
add    %ecx,%r14d
js     115b <main+0x4b>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%ecx
test   %eax,%eax
je     1140 <main+0x30>
mov    %ebp,%ecx
jmp    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 = %22, %0
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %28
11: ; preds = %8
%12 = call i32 (...) @__VERIFIER_nondet_int()
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
store i32 %17, i32* %2
br label %22
18: ; preds = %11
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
store i32 %21, i32* %2
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %4
br label %8
28: ; preds = %8
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, -1
br i1 %4, label %5, label %16
5: ; preds = %0, %5
%6 = phi i32 [ %14, %5 ], [ %3, %0 ]
%7 = phi i32 [ %13, %5 ], [ %2, %0 ]
%8 = phi i32 [ %12, %5 ], [ %1, %0 ]
%9 = tail call i32 (...) @__VERIFIER_nondet_int()
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 %6, i32 %7
%12 = add nsw i32 %11, %8
%13 = add nsw i32 %6, %7
%14 = add nsw i32 %6, -1
%15 = icmp sgt i32 %12, -1
br i1 %15, label %5, label %16
16: ; preds = %5, %0
ret i32 0
}