main() {
  unsigned long long num, n, j;
  scanf("%llu", &num);
  for (j = 1; j <= num; j++) {
    scanf("%llu", &n);
    printf("%llu\n", (n) * (n + 1) + 3 * n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     11a0 <main+0x80>
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
add    $0x1,%rax
imul   %rax,%rsi
imul   $0x3,-0x18(%rbp),%rax
add    %rax,%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1149 <main+0x29>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
je     118f <main+0x6f>
mov    $0x1,%ebx
lea    0xeae(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xea7(%rip),%r12
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
lea    0x4(%rax),%rsi
imul   %rax,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
jbe    1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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