#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 /*<<< orphan*/ assume(int);
int main() {
  int n, i, k;
  n = __VERIFIER_nondet_int();
  assume(n >= 0);
  k = n;
  i = 0;
  while (i < n) {
    k--;
    i = i + 2;
  }
  int j = 0;
  while (j < n / 2) {
    __VERIFIER_assert(k > 0);
    k--;
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assume@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118a <main+0x5a>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1167 <main+0x37>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11d7 <main+0xa7>
cmpl   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <main+0x61>
xor    %eax,%eax
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>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <assume@plt>
test   %ebx,%ebx
jle    1175 <main+0x45>
cmp    $0x1,%ebx
je     1175 <main+0x45>
lea    -0x1(%rbx),%ebp
shr    %ebx
mov    %ebp,%eax
shr    %eax
sub    %eax,%ebp
nopl   0x0(%rax)
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1040 <__VERIFIER_assert@plt>
add    $0xffffffff,%ebp
add    $0xffffffff,%ebx
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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