#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 i = __VERIFIER_nondet_int();
  int a[10];
  while (0 <= i && i < 10 && a[i] >= 0) {
    i = __VERIFIER_nondet_int();
    a[i] = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x31(%rbp)
jg     1157 <main+0x47>
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x31(%rbp)
jge    1157 <main+0x47>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
setge  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1167 <main+0x57>
jmp    1182 <main+0x72>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x9,%eax
ja     113e <main+0x2e>
mov    %eax,%eax
cmpl   $0x0,(%rsp,%rax,4)
js     113e <main+0x2e>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
movslq %eax,%rcx
movl   $0x0,(%rsp,%rcx,4)
cmp    $0xa,%ecx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = bitcast [10 x i32]* %1 to i8*
%4 = icmp ult i32 %2, 10
br i1 %4, label %5, label %16
5: ; preds = %0, %11
%6 = phi i32 [ %12, %11 ], [ %2, %0 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, -1
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = tail call i32 (...) @__VERIFIER_nondet_int()
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %13
store i32 0, i32* %14
%15 = icmp ult i32 %12, 10
br i1 %15, label %5, label %16
16: ; preds = %5, %11, %0
ret i32 0
}