#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 i, pvlen;
  int tmp___1;
  int k = 0;
  int n;
  i = 0;
  pvlen = __VERIFIER_nondet_int();
  while (__VERIFIER_nondet_int())
    i = i + 1;
  if (i > pvlen) {
    pvlen = i;
  }
  i = 0;
  while (__VERIFIER_nondet_int()) {
    tmp___1 = i;
    i = i + 1;
    k = k + 1;
  }
  int j = 0;
  n = i;
  while (1) {
    __VERIFIER_assert(k >= 0);
    k = k - 1;
    i = i - 1;
    j = j + 1;
    if (j >= n) {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     115e <main+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1170 <main+0x50>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11a4 <main+0x84>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1177 <main+0x57>
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11ee <main+0xce>
jmp    11f3 <main+0xd3>
jmp    11b1 <main+0x91>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1130 <main+0x10>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     115e <main+0x3e>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1150 <main+0x30>
cmp    $0x2,%ebx
mov    $0x1,%ebp
cmovae %ebx,%ebp
not    %ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
shr    $0x1f,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1170 <main+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %11, %5
%9 = phi i32 [ 0, %5 ], [ %13, %11 ]
%10 = call i32 @llvm.umax.i32(i32 %9, i32 1)
br label %16
11: ; preds = %5, %11
%12 = phi i32 [ %13, %11 ], [ 0, %5 ]
%13 = add nuw nsw i32 %12, 1
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
%15 = icmp eq i32 %14, 0
br i1 %15, label %8, label %11
16: ; preds = %8, %16
%17 = phi i32 [ %22, %16 ], [ %9, %8 ]
%18 = phi i32 [ %23, %16 ], [ 0, %8 ]
%19 = xor i32 %17, -1
%20 = lshr i32 %19, 31
%21 = tail call i32 @__VERIFIER_assert(i32 %20)
%22 = add nsw i32 %17, -1
%23 = add nuw i32 %18, 1
%24 = icmp eq i32 %23, %10
br i1 %24, label %25, label %16
25: ; preds = %16
ret void
}