#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;
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  __VERIFIER_assume(i >= 0);
  __VERIFIER_assume(j >= 0);
  int x = i;
  int y = j;
  int z = 0;
  while (x != 0) {
    x--;
    y -= 2;
    z++;
  }
  if (i == j) {
    __VERIFIER_assert(y == -z);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11ab <main+0x7b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x51>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11ce <main+0x9e>
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
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
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <__VERIFIER_assume@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <__VERIFIER_assume@plt>
cmp    %ebp,%ebx
jne    1178 <main+0x48>
sub    %ebx,%ebp
sub    %ebx,%ebp
xor    %edi,%edi
add    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__VERIFIER_assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @__VERIFIER_assume(i32 %4)
%6 = xor i32 %2, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @__VERIFIER_assume(i32 %7)
%9 = icmp eq i32 %1, %2
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = sub i32 0, %1
%12 = mul i32 %1, -2
%13 = add i32 %2, %12
%14 = icmp eq i32 %13, %11
%15 = zext i1 %14 to i32
%16 = tail call i32 @__VERIFIER_assert(i32 %15)
br label %17
17: ; preds = %10, %0
ret void
}