#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 lo, mid, hi;
  lo = 0;
  mid = __VERIFIER_nondet_int();
  __VERIFIER_assume(mid > 0);
  hi = 2 * mid;
  while (mid > 0) {
    lo = lo + 1;
    hi = hi - 1;
    mid = mid - 1;
  }
  __VERIFIER_assert(lo == hi);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    118d <main+0x5d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %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,%ebx
xor    %edi,%edi
test   %eax,%eax
setle  %r14b
setg   %dil
cmovg  %eax,%ebp
call   1050 <__VERIFIER_assume@plt>
mov    %r14d,%ecx
shl    %cl,%ebx
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
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
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assume(i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %14, %0
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %2
br label %11
21: ; preds = %11
%22 = load i32, i32* %1
%23 = load i32, i32* %3
%24 = icmp eq i32 %22, %23
%25 = zext i1 %24 to i32
%26 = call i32 @__VERIFIER_assert(i32 %25)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
%5 = select i1 %2, i32 %1, i32 0
%6 = xor i1 %2, true
%7 = zext i1 %6 to i32
%8 = shl nsw i32 %1, %7
%9 = icmp eq i32 %5, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @__VERIFIER_assert(i32 %10)
ret void
}