#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
main() {
  long int n = 1000, Cont, SumInf = 0, SumSup;
  printf("\nEscriba un número: ");
  scanf("%ld", &n);
  printf("Los centros numéricos que hay entre 1 y %ld son:\n", n);
  for (Cont = 1; Cont < n; Cont++) {
    long int Temp;
    for (Temp = Cont + 1, SumSup = 0; SumSup < SumInf; Temp++) {
      SumSup += Temp;
      if (SumSup == SumInf)
        printf("%ld ", Cont);
    }
    SumInf += Cont;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3e8,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1206 <main+0xe6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    11e9 <main+0xc9>
mov    -0x30(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    11d3 <main+0xb3>
mov    -0x18(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1199 <main+0x79>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1177 <main+0x57>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movq   $0x3e8,(%rsp)
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
cmp    $0x2,%rax
jl     11c0 <main+0xa0>
mov    $0x1,%r15d
lea    0xed4(%rip),%r14
xor    %r13d,%r13d
jmp    118f <main+0x6f>
xchg   %ax,%ax
mov    (%rsp),%rax
add    %r15,%r13
mov    %r12,%r15
cmp    %rax,%r12
jge    11c0 <main+0xa0>
lea    0x1(%r15),%r12
test   %r13,%r13
je     1184 <main+0x64>
mov    %r12,%rbx
xor    %ebp,%ebp
jmp    11a9 <main+0x89>
nop
add    $0x1,%rbx
cmp    %r13,%rbp
jae    1180 <main+0x60>
add    %rbx,%rbp
cmp    %r13,%rbp
jne    11a0 <main+0x80>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0AEscriba un n\C3\BAmero: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [51 x i8] c"Los centros num\C3\A9ricos que hay entre 1 y %ld son:\0A\00"
@.str.3 = [5 x i8] c"%ld \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i64 1000, i64* %2
store i64 0, i64* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%9 = load i64, i64* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i64 %9)
store i64 1, i64* %3
br label %11
11: ; preds = %40, %0
%12 = load i64, i64* %3
%13 = load i64, i64* %2
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %11
%16 = load i64, i64* %3
%17 = add nsw i64 %16, 1
store i64 %17, i64* %6
store i64 0, i64* %5
br label %18
18: ; preds = %33, %15
%19 = load i64, i64* %5
%20 = load i64, i64* %4
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %36
22: ; preds = %18
%23 = load i64, i64* %6
%24 = load i64, i64* %5
%25 = add nsw i64 %24, %23
store i64 %25, i64* %5
%26 = load i64, i64* %5
%27 = load i64, i64* %4
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = load i64, i64* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %30)
br label %32
32: ; preds = %29, %22
br label %33
33: ; preds = %32
%34 = load i64, i64* %6
%35 = add nsw i64 %34, 1
store i64 %35, i64* %6
br label %18
36: ; preds = %18
%37 = load i64, i64* %3
%38 = load i64, i64* %4
%39 = add nsw i64 %38, %37
store i64 %39, i64* %4
br label %40
40: ; preds = %36
%41 = load i64, i64* %3
%42 = add nsw i64 %41, 1
store i64 %42, i64* %3
br label %11
43: ; preds = %11
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AEscriba un n\C3\BAmero: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [51 x i8] c"Los centros num\C3\A9ricos que hay entre 1 y %ld son:\0A\00"
@.str.3 = [5 x i8] c"%ld \00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 1000, i64* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %1
%8 = icmp sgt i64 %7, 1
br i1 %8, label %9, label %31
9: ; preds = %0, %27
%10 = phi i64 [ %28, %27 ], [ %7, %0 ]
%11 = phi i64 [ %29, %27 ], [ 0, %0 ]
%12 = phi i64 [ %13, %27 ], [ 1, %0 ]
%13 = add nuw nsw i64 %12, 1
%14 = icmp eq i64 %11, 0
br i1 %14, label %27, label %15
15: ; preds = %9, %22
%16 = phi i64 [ %23, %22 ], [ %13, %9 ]
%17 = phi i64 [ %18, %22 ], [ 0, %9 ]
%18 = add nuw nsw i64 %16, %17
%19 = icmp eq i64 %18, %11
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %12)
br label %22
22: ; preds = %15, %20
%23 = add nuw nsw i64 %16, 1
%24 = icmp ult i64 %18, %11
br i1 %24, label %15, label %25
25: ; preds = %22
%26 = load i64, i64* %1
br label %27
27: ; preds = %25, %9
%28 = phi i64 [ %26, %25 ], [ %10, %9 ]
%29 = add nuw nsw i64 %11, %12
%30 = icmp slt i64 %13, %28
br i1 %30, label %9, label %31
31: ; preds = %27, %0
ret i32 0
}