#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n <= 5)
    return 1;
  int sum = 0;
  int i;
  for (i = 5; i <= n; i++) {
    sum += i * (2 * i + 5) + 1;
  }
  printf("%d\n", sum);
  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>
cmpl   $0x5,-0x8(%rbp)
jg     1155 <main+0x35>
movl   $0x1,-0x4(%rbp)
jmp    11ab <main+0x8b>
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1195 <main+0x75>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x5,%ecx
imul   %ecx,%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <main+0x43>
mov    -0xc(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    $0x1,%eax
cmp    $0x6,%ecx
jl     1180 <main+0x60>
imul   $0x67,%ecx,%eax
lea    -0x5(%rcx),%edx
lea    -0x6(%rcx),%esi
imul   %rdx,%rsi
add    $0xfffffff9,%ecx
imul   %rsi,%rcx
shr    %rsi
mov    %esi,%edx
shl    $0x5,%edx
sub    %esi,%edx
add    %eax,%edx
shr    %rcx
imul   $0xaaaaaaac,%ecx,%eax
lea    (%rax,%rdx,1),%esi
add    $0xfffffe49,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %29
9: ; preds = %0
store i32 0, i32* %3
store i32 5, i32* %4
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 2, %16
%18 = add nsw i32 %17, 5
%19 = mul nsw i32 %15, %18
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %14
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %10
26: ; preds = %10
%27 = load i32, i32* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
store i32 0, i32* %1
br label %29
29: ; preds = %26, %8
%30 = load i32, i32* %1
ret i32 %30
}

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 i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 6
br i1 %5, label %26, label %6
6: ; preds = %0
%7 = mul i32 %4, 103
%8 = add nsw i32 %4, -5
%9 = zext i32 %8 to i33
%10 = add nsw i32 %4, -6
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = mul i32 %14, 31
%16 = add i32 %7, %15
%17 = add nsw i32 %4, -7
%18 = zext i32 %17 to i33
%19 = mul i33 %12, %18
%20 = lshr i33 %19, 1
%21 = trunc i33 %20 to i32
%22 = mul i32 %21, -1431655764
%23 = add i32 %16, -439
%24 = add i32 %22, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %0, %6
%27 = phi i32 [ 0, %6 ], [ 1, %0 ]
ret i32 %27
}