#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);
scalar_t__ scanf(char *, int *);
int main() {
  int n, total;
  while (scanf("%d", &n) && n) {
    total = (n * (n - 1) * (n + 1) * (n + 2)) / 24;
    printf("%d\n", total);
  }
  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    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
je     115b <main+0x3b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116b <main+0x4b>
jmp    11a8 <main+0x88>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe65(%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   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11a8 <main+0x88>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11a8 <main+0x88>
lea    0xeb5(%rip),%r14
lea    0xeab(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rax),%ecx
imul   %eax,%ecx
lea    0x1(%rax),%edx
add    $0x2,%eax
imul   %edx,%eax
imul   %ecx,%eax
cltq
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11a8 <main+0x88>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.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 = icmp ne i64 %3, 0
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %8, label %23
8: ; preds = %0, %8
%9 = phi i32 [ %20, %8 ], [ %5, %0 ]
%10 = add nsw i32 %9, -1
%11 = mul nsw i32 %10, %9
%12 = add nsw i32 %9, 1
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %9, 2
%15 = mul nsw i32 %13, %14
%16 = sdiv i32 %15, 24
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%19 = icmp ne i64 %18, 0
%20 = load i32, i32* %1
%21 = icmp ne i32 %20, 0
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %8, label %23
23: ; preds = %8, %0
ret i32 0
}