#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*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int);
void main() {
  int x = 0;
  int t = 0;
  int phase = 0;
  __ESBMC_assume(-3 * phase - t + 2 * x == 0);
  __ESBMC_assume(100 - phase - t >= 0);
  __ESBMC_assume(1 - phase >= 0);
  __ESBMC_assume(-phase + t >= 0);
  __ESBMC_assume(phase >= 0);
  while (t < 100) {
    if (phase == 0)
      x = x + 2;
    if (phase == 1)
      x = x - 1;
    phase = 1 - phase;
    t++;
  }
  __ESBMC_assume(-50 + x == 0);
  assert(x <= 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
imul   $0xfffffffd,-0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x64,%eax
sub    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
cmpl   $0x64,-0x8(%rbp)
jge    1204 <main+0xe4>
cmpl   $0x0,-0xc(%rbp)
jne    11d8 <main+0xb8>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11eb <main+0xcb>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bb <main+0x9b>
mov    -0x4(%rbp),%eax
add    $0xffffffce,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
cmpl   $0x64,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <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
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = mul nsw i32 -3, %4
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
%8 = load i32, i32* %1
%9 = mul nsw i32 2, %8
%10 = add nsw i32 %7, %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @__ESBMC_assume(i32 %12)
%14 = load i32, i32* %3
%15 = sub nsw i32 100, %14
%16 = load i32, i32* %2
%17 = sub nsw i32 %15, %16
%18 = icmp sge i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @__ESBMC_assume(i32 %19)
%21 = load i32, i32* %3
%22 = sub nsw i32 1, %21
%23 = icmp sge i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @__ESBMC_assume(i32 %24)
%26 = load i32, i32* %3
%27 = sub nsw i32 0, %26
%28 = load i32, i32* %2
%29 = add nsw i32 %27, %28
%30 = icmp sge i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @__ESBMC_assume(i32 %31)
%33 = load i32, i32* %3
%34 = icmp sge i32 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @__ESBMC_assume(i32 %35)
br label %37
37: ; preds = %52, %0
%38 = load i32, i32* %2
%39 = icmp slt i32 %38, 100
br i1 %39, label %40, label %57
40: ; preds = %37
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %1
%45 = add nsw i32 %44, 2
store i32 %45, i32* %1
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %1
%51 = sub nsw i32 %50, 1
store i32 %51, i32* %1
br label %52
52: ; preds = %49, %46
%53 = load i32, i32* %3
%54 = sub nsw i32 1, %53
store i32 %54, i32* %3
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %37
57: ; preds = %37
%58 = load i32, i32* %1
%59 = add nsw i32 -50, %58
%60 = icmp eq i32 %59, 0
%61 = zext i1 %60 to i32
%62 = call i32 @__ESBMC_assume(i32 %61)
%63 = load i32, i32* %1
%64 = icmp sle i32 %63, 100
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__ESBMC_assume(i32 1)
%2 = tail call i32 @__ESBMC_assume(i32 1)
%3 = tail call i32 @__ESBMC_assume(i32 1)
%4 = tail call i32 @__ESBMC_assume(i32 1)
%5 = tail call i32 @__ESBMC_assume(i32 1)
%6 = tail call i32 @__ESBMC_assume(i32 1)
%7 = tail call i32 @assert(i32 1)
ret void
}