#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 */
double pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  long long ar[50], sa[50];
  ar[3] = 104;
  ar[4] = 904;
  sa[3] = 16;
  printf("N=3: 104\n");
  for (i = 4; i < 26; i++) {
    sa[i] = ar[i - 1] - sa[i - 1];
    ar[i] = 6 * ar[i - 1] - 2 * sa[i - 1] + 36 * (pow(2.0, (i - 1)) - 2.0) +
            2 * (6 * (pow(2.0, (i - 1)) - 2.0) + 4 * (pow(2.0, (i - 2)) - 1.0));
    printf("N=%d: %lld\n", i, ar[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x68,-0x188(%rbp)
movq   $0x388,-0x180(%rbp)
movq   $0x10,-0x318(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x4,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    12cc <main+0x1ac>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,8),%rcx
ff
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
sub    -0x330(%rbp,%rax,8),%rcx
ff
movslq -0x8(%rbp),%rax
mov    %rcx,-0x330(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
imul   $0x6,-0x1a0(%rbp,%rax,8),%rax
ff 06
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    -0x330(%rbp,%rcx,8),%rcx
ff
shl    $0x1,%rcx
sub    %rcx,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x348(%rbp)
ff
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
movsd  0xe36(%rip),%xmm0
call   1040 <pow@plt>
movsd  -0x348(%rbp),%xmm1
ff
movsd  0xe21(%rip),%xmm2
subsd  %xmm2,%xmm0
movsd  0xe1d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x340(%rbp)
ff
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
movsd  0xdf7(%rip),%xmm0
call   1040 <pow@plt>
movsd  0xdea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x338(%rbp)
ff
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
movsd  0xdd0(%rip),%xmm0
call   1040 <pow@plt>
movsd  -0x340(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x338(%rbp),%xmm0
ff
movsd  0xda8(%rip),%xmm2
subsd  %xmm2,%xmm3
movsd  0xd94(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  0xd80(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x1a0(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,8),%rdx
ff
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1168 <main+0x48>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x68,%ebx
mov    $0x10,%eax
mov    $0xffffffffffffffea,%r15
lea    0xed1(%rip),%r14
nop
mov    %rbx,%r12
sub    %rax,%r12
add    %rbx,%rbx
lea    (%rbx,%rbx,2),%rcx
add    %rax,%rax
sub    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x19(%r15),%ebx
movsd  0xe73(%rip),%xmm0
mov    %ebx,%edi
call   1050 <pow@plt>
movapd %xmm0,%xmm1
movsd  0xe68(%rip),%xmm0
addsd  %xmm0,%xmm1
mulsd  0xe64(%rip),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe40(%rip),%xmm0
mov    %ebx,%edi
call   1050 <pow@plt>
addsd  0xe39(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x18(%r15),%edi
movsd  0xe1f(%rip),%xmm0
call   1050 <pow@plt>
addsd  0xe2a(%rip),%xmm0
mulsd  0xe2a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xe24(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
addsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%rbx
lea    0x1a(%r15),%esi
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rax
inc    %r15
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"N=3: 104\0A\00"
@.str.1 = [12 x i8] c"N=%d: %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i64]
%4 = alloca [50 x i64]
store i32 0, i32* %1
%5 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 3
store i64 104, i64* %5
%6 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 4
store i64 904, i64* %6
%7 = getelementptr inbounds [50 x i64], [50 x i64]* %4, i64 0, i64 3
store i64 16, i64* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 4, i32* %2
br label %9
9: ; preds = %67, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 26
br i1 %11, label %12, label %70
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 %15
%17 = load i64, i64* %16
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [50 x i64], [50 x i64]* %4, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = sub nsw i64 %17, %22
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [50 x i64], [50 x i64]* %4, i64 0, i64 %25
store i64 %23, i64* %26
%27 = load i32, i32* %2
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 %29
%31 = load i64, i64* %30
%32 = mul nsw i64 6, %31
%33 = load i32, i32* %2
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [50 x i64], [50 x i64]* %4, i64 0, i64 %35
%37 = load i64, i64* %36
%38 = mul nsw i64 2, %37
%39 = sub nsw i64 %32, %38
%40 = sitofp i64 %39 to double
%41 = load i32, i32* %2
%42 = sub nsw i32 %41, 1
%43 = call double @pow(double 2.000000e+00, i32 %42)
%44 = fsub double %43, 2.000000e+00
%45 = call double @llvm.fmuladd.f64(double 3.600000e+01, double %44, double %40)
%46 = load i32, i32* %2
%47 = sub nsw i32 %46, 1
%48 = call double @pow(double 2.000000e+00, i32 %47)
%49 = fsub double %48, 2.000000e+00
%50 = load i32, i32* %2
%51 = sub nsw i32 %50, 2
%52 = call double @pow(double 2.000000e+00, i32 %51)
%53 = fsub double %52, 1.000000e+00
%54 = fmul double 4.000000e+00, %53
%55 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %49, double %54)
%56 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %55, double %45)
%57 = fptosi double %56 to i64
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 %59
store i64 %57, i64* %60
%61 = load i32, i32* %2
%62 = load i32, i32* %2
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [50 x i64], [50 x i64]* %3, i64 0, i64 %63
%65 = load i64, i64* %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %61, i64 %65)
br label %67
67: ; preds = %12
%68 = load i32, i32* %2
%69 = add nsw i32 %68, 1
store i32 %69, i32* %2
br label %9
70: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"N=%d: %lld\0A\00"
@str = [9 x i8] c"N=3: 104\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 16, %0 ], [ %6, %2 ]
%4 = phi i64 [ 104, %0 ], [ %25, %2 ]
%5 = phi i64 [ 4, %0 ], [ %28, %2 ]
%6 = sub nsw i64 %4, %3
%7 = mul nsw i64 %4, 6
%8 = mul i64 %3, -2
%9 = add i64 %8, %7
%10 = sitofp i64 %9 to double
%11 = trunc i64 %5 to i32
%12 = add i32 %11, -1
%13 = tail call double @pow(double 2.000000e+00, i32 %12)
%14 = fadd double %13, -2.000000e+00
%15 = tail call double @llvm.fmuladd.f64(double %14, double 3.600000e+01, double %10)
%16 = tail call double @pow(double 2.000000e+00, i32 %12)
%17 = fadd double %16, -2.000000e+00
%18 = trunc i64 %5 to i32
%19 = add i32 %18, -2
%20 = tail call double @pow(double 2.000000e+00, i32 %19)
%21 = fadd double %20, -1.000000e+00
%22 = fmul double %21, 4.000000e+00
%23 = tail call double @llvm.fmuladd.f64(double %17, double 6.000000e+00, double %22)
%24 = tail call double @llvm.fmuladd.f64(double %23, double 2.000000e+00, double %15)
%25 = fptosi double %24 to i64
%26 = trunc i64 %5 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %26, i64 %25)
%28 = add nuw nsw i64 %5, 1
%29 = icmp eq i64 %28, 26
br i1 %29, label %30, label %2
30: ; preds = %2
ret i32 0
}