#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__ EOF;
int /*<<< orphan*/ printf(char *, long long);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (EOF != scanf("%d", &n)) {
    printf("%d\n\n", ((long long)n + 1) * n / 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     118b <main+0x6b>
movslq -0x8(%rbp),%rax
add    $0x1,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%r12
mov    (%r12),%rbx
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmp    %rax,%rbx
je     11a6 <main+0x86>
lea    0xeae(%rip),%r14
lea    0xea4(%rip),%r15
lea    0xc(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq 0xc(%rsp),%rax
lea    0x1(%rax),%rcx
imul   %rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
add    %rcx,%rsi
sar    %rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12),%rbx
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
cmp    %rax,%rbx
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i64, i64* @EOF
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, 1
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = mul nsw i64 %10, %12
%14 = sdiv i64 %13, 2
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i64, i64* @EOF
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, 1
%10 = mul nsw i64 %9, %8
%11 = sdiv i64 %10, 2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = load i64, i64* @EOF
%14 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %0
ret i32 0
}