#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 /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
void main() {
  int i, j, k;
  i = 1;
  j = 1;
  k = __VERIFIER_nondet_int();
  __VERIFIER_assume(0 <= k && k <= 1);
  while (i < 1000000) {
    i = i + 1;
    j = j + k;
    k = k - 1;
    __VERIFIER_assert(1 <= i + k && i + k <= 2 && i >= 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     116a <main+0x3a>
cmpl   $0x1,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0xf4240,-0x4(%rbp)
jge    11e7 <main+0xb7>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edx
add    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0xe(%rbp)
jg     11d5 <main+0xa5>
mov    -0x4(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0xe(%rbp)
jg     11d5 <main+0xa5>
cmpl   $0x1,-0x4(%rbp)
setge  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1177 <main+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ebx,%ebx
cmp    $0x2,%eax
setb   %bl
mov    %ebx,%edi
call   1050 <__VERIFIER_assume@plt>
mov    $0xf423f,%ebp
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp ult i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 1, %0 ], [ %7, %5 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i32 @__VERIFIER_assert(i32 %3)
%9 = icmp eq i32 %7, 1000000
br i1 %9, label %10, label %5
10: ; preds = %5
ret void
}