#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);
int __VERIFIER_nondet_int();
int main() {
  int a[5];
  int len = 0;
  int i;
  int input = __VERIFIER_nondet_int();
  while (input) {
    if (len == 4)
      len = 0;
    if (len < 0 || len >= 5)
      __VERIFIER_assert(0 == 1);
    len++;
    input = __VERIFIER_nondet_int();
  }
  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_int@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     118e <main+0x6e>
cmpl   $0x4,-0x24(%rbp)
jne    115b <main+0x3b>
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     116f <main+0x4f>
cmpl   $0x5,-0x24(%rbp)
jl     1176 <main+0x56>
xor    %edi,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x2c(%rbp)
jmp    1140 <main+0x20>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1162 <main+0x42>
xor    %ebp,%ebp
jmp    114e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1162 <main+0x42>
cmp    $0x4,%ebp
cmove  %ebx,%ebp
cmp    $0x5,%ebp
jb     1140 <main+0x20>
xor    %edi,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1140 <main+0x20>
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
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %5
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 4
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 5
br i1 %19, label %20, label %22
20: ; preds = %17, %14
%21 = call i32 @__VERIFIER_assert(i32 0)
br label %22
22: ; preds = %20, %17
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %25, i32* %5
br label %7
26: ; preds = %7
ret i32 1
}

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