#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 = __VERIFIER_nondet_int();
  while (x >= 0) {
    if (__VERIFIER_nondet_int()) {
      x += 1;
    } else if (__VERIFIER_nondet_int()) {
      x += 2;
    } else if (__VERIFIER_nondet_int()) {
      x += 3;
    } else if (__VERIFIER_nondet_int()) {
      x += 4;
    } else {
      break;
    }
  }
  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     11c4 <main+0xb4>
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    11bf <main+0xaf>
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    11ba <main+0xaa>
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    11b5 <main+0xa5>
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    11b0 <main+0xa0>
jmp    11c4 <main+0xb4>
jmp    11b5 <main+0xa5>
jmp    11ba <main+0xaa>
jmp    11bf <main+0xaf>
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
br label %36
32: ; preds = %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 = %31, %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, %15
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i32 (...) @__VERIFIER_nondet_int()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 (...) @__VERIFIER_nondet_int()
%14 = icmp eq i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %12, %9, %6, %3
br label %3
16: ; preds = %12, %0
ret i32 0
}