#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*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  int z;
  assume(x == y && y == 0 && z == 0);
  while (1) {
    x++;
    y++;
    z -= 2;
    assert(x == y && x >= 0 && x + y + z == 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1159 <main+0x39>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jne    11b3 <main+0x93>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jl     11b3 <main+0x93>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1166 <main+0x46>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x2,%ebx
lea    0x1(%rax),%r14d
cmp    $0xffffffff,%eax
setge  %al
cmp    %ebx,%ebp
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
add    $0x2,%ebx
add    $0x2,%ebp
mov    %r14d,%eax
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ undef, %0 ], [ %5, %2 ]
%4 = phi i32 [ undef, %0 ], [ %6, %2 ]
%5 = add nsw i32 %3, 1
%6 = add nsw i32 %4, -2
%7 = icmp sgt i32 %3, -2
%8 = shl nuw nsw i32 %5, 1
%9 = sub i32 2, %4
%10 = icmp eq i32 %8, %9
%11 = select i1 %7, i1 %10, i1 false
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
br label %2
}