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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1194 <main+0x74>
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1180 <main+0x60>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x3d>
mov    -0x10(%rbp),%esi
lea    0xe79(%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   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
jne    1154 <main+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xea8(%rip),%r14
lea    0xe9e(%rip),%r15
lea    0x4(%rsp),%rbx
jmp    1189 <main+0x69>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     1146 <main+0x26>
mov    0x4(%rsp),%eax
mov    $0x1,%esi
cmp    $0x2,%eax
jl     1170 <main+0x50>
lea    -0x2(%rax),%ecx
lea    -0x3(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rdx,%rax,2),%esi
add    $0xfffffffe,%esi
jmp    1170 <main+0x50>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %26, label %6
6: ; preds = %0, %20
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = shl nuw i32 %7, 1
%11 = add nsw i32 %7, -2
%12 = zext i32 %11 to i33
%13 = add nsw i32 %7, -3
%14 = zext i32 %13 to i33
%15 = mul i33 %12, %14
%16 = lshr i33 %15, 1
%17 = trunc i33 %16 to i32
%18 = add i32 %10, -2
%19 = add i32 %18, %17
br label %20
20: ; preds = %9, %6
%21 = phi i32 [ 1, %6 ], [ %19, %9 ]
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %6
26: ; preds = %20, %0
ret i32 0
}