#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();
void main() {
  int x = 0;
  int m = 0;
  int n = __VERIFIER_nondet_int();
  while (x < n) {
    if (__VERIFIER_nondet_int()) {
      m = x;
    }
    x = x + 1;
  }
  __VERIFIER_assert((m >= 0 || n <= 0));
  __VERIFIER_assert((m < n || n <= 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <main+0x50>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1162 <main+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <main+0x20>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jge    1189 <main+0x69>
cmpl   $0x0,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0xe(%rbp)
jl     11b1 <main+0x91>
cmpl   $0x0,-0xc(%rbp)
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
test   %eax,%eax
jle    1154 <main+0x34>
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
cmovne %ebx,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1140 <main+0x20>
test   %ebp,%ebp
setns  %al
test   %r14d,%r14d
setle  %bl
or     %bl,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
cmp    %r14d,%ebp
setl   %al
or     %bl,%al
movzbl %al,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = call i32 (...) @__VERIFIER_nondet_int()
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %1
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %5
17: ; preds = %5
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sle i32 %21, 0
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ true, %17 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
%26 = call i32 @__VERIFIER_assert(i32 %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp slt i32 %27, %28
br i1 %29, label %33, label %30
30: ; preds = %23
%31 = load i32, i32* %3
%32 = icmp sle i32 %31, 0
br label %33
33: ; preds = %30, %23
%34 = phi i1 [ true, %23 ], [ %32, %30 ]
%35 = zext i1 %34 to i32
%36 = call i32 @__VERIFIER_assert(i32 %35)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0, %3
%4 = phi i32 [ %9, %3 ], [ 0, %0 ]
%5 = phi i32 [ %8, %3 ], [ 0, %0 ]
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %5, i32 %4
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %3
11: ; preds = %3, %0
%12 = phi i32 [ 0, %0 ], [ %8, %3 ]
%13 = icmp sgt i32 %12, -1
%14 = icmp slt i32 %1, 1
%15 = select i1 %13, i1 true, i1 %14
%16 = zext i1 %15 to i32
%17 = tail call i32 @__VERIFIER_assert(i32 %16)
%18 = icmp slt i32 %12, %1
%19 = or i1 %14, %18
%20 = zext i1 %19 to i32
%21 = tail call i32 @__VERIFIER_assert(i32 %20)
ret void
}