#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 /*<<< orphan*/ __VERIFIER_assert(int);
scalar_t__ __VERIFIER_nondet_bool();
int main() {
  int a[5];
  int len = 0;
  int i;
  while (__VERIFIER_nondet_bool()) {
    if (len == 4)
      len = 0;
    a[len] = 0;
    len++;
  }
  __VERIFIER_assert(len >= 0 && len < 5);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_bool@plt>
cmp    $0x0,%rax
je     1172 <main+0x52>
cmpl   $0x4,-0x24(%rbp)
jne    1158 <main+0x38>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x29(%rbp)
jl     118b <main+0x6b>
cmpl   $0x5,-0x24(%rbp)
setl   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_bool@plt>
test   %rax,%rax
je     1162 <main+0x42>
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
cmp    $0x4,%ebx
lea    0x1(%rbx),%eax
mov    %eax,%ebx
cmove  %ebp,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_bool@plt>
test   %rax,%rax
jne    1140 <main+0x20>
xor    %edi,%edi
cmp    $0x5,%ebx
setb   %dil
jmp    1167 <main+0x47>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = call i64 (...) @__VERIFIER_nondet_bool()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 4
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %14
store i32 0, i32* %15
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 5
br label %24
24: ; preds = %21, %18
%25 = phi i1 [ false, %18 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
%27 = call i32 @__VERIFIER_assert(i32 %26)
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_bool()
%2 = icmp eq i64 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = icmp eq i32 %4, 4
%6 = add nsw i32 %4, 1
%7 = select i1 %5, i32 1, i32 %6
%8 = tail call i64 (...) @__VERIFIER_nondet_bool()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = icmp ult i32 %7, 5
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %0
%14 = phi i32 [ 1, %0 ], [ %12, %10 ]
%15 = tail call i32 @__VERIFIER_assert(i32 %14)
ret i32 1
}