#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;
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    if (__VERIFIER_nondet_int() != 0) {
      x = x + 1;
    } else {
      if (__VERIFIER_nondet_int() != 0) {
        x = x + 2;
      } else {
        if (__VERIFIER_nondet_int() != 0) {
          x = x + 3;
        } else {
          if (__VERIFIER_nondet_int() != 0) {
            x = x + 4;
          } else {
            x = -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)
cmpl   $0x0,-0x8(%rbp)
jl     11c6 <main+0xb6>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0xb1>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     116f <main+0x5f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    11bc <main+0xac>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     118d <main+0x7d>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    11b7 <main+0xa7>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11ab <main+0x9b>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    11b2 <main+0xa2>
movl   $0xffffffff,-0x8(%rbp)
jmp    11b7 <main+0xa7>
jmp    11bc <main+0xac>
jmp    11c1 <main+0xb1>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114c <main+0x3c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1120 <main+0x10>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1120 <main+0x10>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1120 <main+0x10>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %35, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %36
7: ; preds = %4
%8 = call i32 (...) @__VERIFIER_nondet_int()
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %35
13: ; preds = %7
%14 = call i32 (...) @__VERIFIER_nondet_int()
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 2
store i32 %18, i32* %2
br label %34
19: ; preds = %13
%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 = add nsw i32 %23, 3
store i32 %24, i32* %2
br label %33
25: ; preds = %19
%26 = call i32 (...) @__VERIFIER_nondet_int()
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 4
store i32 %30, i32* %2
br label %32
31: ; preds = %25
store i32 -1, i32* %2
br label %32
32: ; preds = %31, %28
br label %33
33: ; preds = %32, %22
br label %34
34: ; preds = %33, %16
br label %35
35: ; preds = %34, %10
br label %4
36: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %16
3: ; preds = %0, %12
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 (...) @__VERIFIER_nondet_int()
%11 = icmp eq i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9, %6, %3, %13
br label %3
13: ; preds = %9
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %12
16: ; preds = %13, %0
ret i32 0
}