#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[100000];
  int marker = __VERIFIER_nondet_int();
  int pos = __VERIFIER_nondet_int();
  for (int i = 0; i < 100000; i++) {
    a[i] = __VERIFIER_nondet_int();
  }
  if (pos >= 0 && pos < 100000) {
    a[pos] = marker;
    int i = 0;
    while (a[i] != marker) {
      i = i + 1;
    }
    __VERIFIER_assert(i <= pos);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61aa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x61a94(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x61a98(%rbp)
movl   $0x0,-0x61a9c(%rbp)
cmpl   $0x186a0,-0x61a9c(%rbp)
jge    1191 <main+0x71>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
movslq -0x61a9c(%rbp),%rax
mov    %ecx,-0x61a90(%rbp,%rax,4)
mov    -0x61a9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a9c(%rbp)
jmp    1156 <main+0x36>
cmpl   $0x0,-0x61a98(%rbp)
jl     1213 <main+0xf3>
cmpl   $0x186a0,-0x61a98(%rbp)
jge    1213 <main+0xf3>
mov    -0x61a94(%rbp),%ecx
movslq -0x61a98(%rbp),%rax
mov    %ecx,-0x61a90(%rbp,%rax,4)
movl   $0x0,-0x61aa0(%rbp)
movslq -0x61aa0(%rbp),%rax
mov    -0x61a90(%rbp,%rax,4),%eax
cmp    -0x61a94(%rbp),%eax
je     11fa <main+0xda>
mov    -0x61aa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61aa0(%rbp)
jmp    11cc <main+0xac>
mov    -0x61aa0(%rbp),%eax
cmp    -0x61a98(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x61aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x61a80,%rsp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,(%rsp,%rbp,4)
add    $0x1,%rbp
cmp    $0x186a0,%rbp
jne    1140 <main+0x20>
cmp    $0x186a0,%r14d
jae    118c <main+0x6c>
mov    %r14d,%eax
mov    %ebx,(%rsp,%rax,4)
mov    $0xffffffff,%eax
mov    %rsp,%rcx
xchg   %ax,%ax
add    $0x1,%eax
lea    0x4(%rcx),%rdx
cmp    %ebx,(%rcx)
mov    %rdx,%rcx
jne    1170 <main+0x50>
xor    %edi,%edi
cmp    %eax,%r14d
setge  %dil
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x61a80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %4
store i32 0, i32* %5
br label %9
9: ; preds = %17, %0
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 100000
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = call i32 (...) @__VERIFIER_nondet_int()
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
%21 = load i32, i32* %4
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %47
23: ; preds = %20
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 100000
br i1 %25, label %26, label %47
26: ; preds = %23
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 %29
store i32 %27, i32* %30
store i32 0, i32* %6
br label %31
31: ; preds = %38, %26
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %3
%37 = icmp ne i32 %35, %36
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %31
41: ; preds = %31
%42 = load i32, i32* %6
%43 = load i32, i32* %4
%44 = icmp sle i32 %42, %43
%45 = zext i1 %44 to i32
%46 = call i32 @__VERIFIER_assert(i32 %45)
br label %47
47: ; preds = %41, %23, %20
ret i32 0
}

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