#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 main() {
  int x;
  int y;
  if (!(x * y >= 0))
    return 0;
  while (1) {
    if (x == 0) {
      if (y > 0)
        x++;
      else
        x--;
    }
    if (x > 0)
      y++;
    else
      x--;
    assert(x * y >= 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    1137 <main+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    113c <main+0x2c>
cmpl   $0x0,-0x8(%rbp)
jne    116c <main+0x5c>
cmpl   $0x0,-0xc(%rbp)
jle    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x5c>
cmpl   $0x0,-0x8(%rbp)
jle    1184 <main+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118d <main+0x7d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    113c <main+0x2c>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ecx,%ecx
test   %ebx,%ebx
setg   %cl
test   %eax,%eax
lea    -0x1(%rcx,%rcx,1),%ebp
cmovne %eax,%ebp
xor    %eax,%eax
xor    %ecx,%ecx
test   %ebp,%ebp
setg   %al
setle  %cl
sub    %ecx,%ebp
add    %eax,%ebx
mov    %ebp,%edi
imul   %ebx,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebp,%eax
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ undef, %0 ], [ %11, %1 ]
%3 = phi i32 [ undef, %0 ], [ %13, %1 ]
%4 = icmp eq i32 %2, 0
%5 = icmp slt i32 %3, 1
%6 = select i1 %5, i32 -1, i32 1
%7 = select i1 %4, i32 %6, i32 %2
%8 = icmp sgt i32 %7, 0
%9 = xor i1 %8, true
%10 = sext i1 %9 to i32
%11 = add nsw i32 %7, %10
%12 = zext i1 %8 to i32
%13 = add nsw i32 %3, %12
%14 = mul nsw i32 %11, %13
%15 = xor i32 %14, -1
%16 = lshr i32 %15, 31
%17 = tail call i32 @assert(i32 %16)
br label %1
}