#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 n = unknown1();
  int k = 1;
  int i = 1;
  int j = 0;
  while (i <= n - 1) {
    j = 0;
    while (j <= i - 1) {
      k += (i - j);
      j++;
    }
    if (j < i)
      return;
    i++;
  }
  if (i < n)
    return;
  if (k <= n - 1) {
    goto ERROR;
  ERROR:;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown1@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1199 <main+0x89>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     117a <main+0x6a>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <main+0x3f>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118b <main+0x7b>
jmp    11c5 <main+0xb5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11aa <main+0x9a>
jmp    11c5 <main+0xb5>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11c5 <main+0xb5>
jmp    11c0 <main+0xb0>
jmp    11c5 <main+0xb5>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <unknown1@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @unknown1()
ret void
}