#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 unknown1();
void main() {
  int flag = unknown1();
  int x = 0;
  int y = 0;
  int j = 0;
  int i = 0;
  while (unknown1()) {
    x++;
    y++;
    i += x;
    j += y;
    if (flag)
      j += 1;
    j = j;
  }
  if (j <= i - 1) {
    goto ERROR;
  ERROR:;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <unknown1@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <unknown1@plt>
cmp    $0x0,%eax
je     1190 <main+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1185 <main+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113e <main+0x2e>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11ab <main+0x9b>
jmp    11a6 <main+0x96>
jmp    11ab <main+0x9b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <unknown1@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %eax,%eax
jne    1120 <main+0x10>
pop    %rax
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 (...) @unknown1()
store i32 %6, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %26, %0
%8 = call i32 (...) @unknown1()
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
%21 = load i32, i32* %1
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %10
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %10
%27 = load i32, i32* %4
store i32 %27, i32* %4
br label %7
28: ; preds = %7
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = sub nsw i32 %30, 1
%32 = icmp sle i32 %29, %31
br i1 %32, label %33, label %35
33: ; preds = %28
br label %34
34: ; preds = %33
br label %35
35: ; preds = %34, %28
ret void
}

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