#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 */
scalar_t__ unknown1();
void main() {
  int x = 0;
  int y = 0;
  int n = 0;
  while (unknown1()) {
    x++;
    y++;
  }
  while (x <= n - 1 || x >= n + 1) {
    x--;
    y--;
  }
  if (x != n)
    return;
  if (y != n) {
    goto ERROR;
  ERROR:;
  }
}


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)
mov    $0x0,%al
call   1030 <unknown1@plt>
cmp    $0x0,%rax
je     1155 <main+0x45>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
jmp    115a <main+0x4a>
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jle    1181 <main+0x71>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1191 <main+0x81>
jmp    11a8 <main+0x98>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x4a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11b9 <main+0xa9>
jmp    11cf <main+0xbf>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11cf <main+0xbf>
jmp    11ca <main+0xba>
jmp    11cf <main+0xbf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %rax,%rax
jne    1120 <main+0x10>
pop    %rax
ret

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
br label %4
4: ; preds = %7, %0
%5 = call i64 (...) @unknown1()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %1
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = icmp sle i32 %14, %16
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i32, i32* %1
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
%22 = icmp sge i32 %19, %21
br label %23
23: ; preds = %18, %13
%24 = phi i1 [ true, %13 ], [ %22, %18 ]
br i1 %24, label %25, label %30
25: ; preds = %23
%26 = load i32, i32* %1
%27 = add nsw i32 %26, -1
store i32 %27, i32* %1
%28 = load i32, i32* %2
%29 = add nsw i32 %28, -1
store i32 %29, i32* %2
br label %13
30: ; preds = %23
%31 = load i32, i32* %1
%32 = load i32, i32* %3
%33 = icmp ne i32 %31, %32
br i1 %33, label %34, label %35
34: ; preds = %30
br label %41
35: ; preds = %30
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = icmp ne i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %35
br label %40
40: ; preds = %39
br label %41
41: ; preds = %34, %40, %35
ret void
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @unknown1()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}