#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 */
typedef int /*<<< orphan*/ serise;

/* Variables and functions */
int fibonacci_serise(int, int *);
int fibonacci_serise_upto(int, int *);
int /*<<< orphan*/ memset(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int serise[100] = {0x00};
  int max_term = fibonacci_serise(15, serise);
  for (int i = 0; i < max_term; i++) {
    if ((max_term - 1) == i) {
      printf("%d\n", serise[i]);
    } else {
      printf("%d,", serise[i]);
    }
  }
  memset(serise, 0x00, sizeof(serise));
  max_term = fibonacci_serise_upto(100, serise);
  for (int i = 0; i < max_term; i++) {
    if ((max_term - 1) == i) {
      printf("%d\n", serise[i]);
    } else {
      printf("%d,", serise[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    -0x1a0(%rbp),%rsi
mov    $0xf,%edi
call   1050 <fibonacci_serise@plt>
mov    %eax,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    1206 <main+0xc6>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cmp    -0x1a8(%rbp),%eax
jne    11d3 <main+0x93>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
jmp    11ed <main+0xad>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
jmp    11f2 <main+0xb2>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    118d <main+0x4d>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    -0x1a0(%rbp),%rsi
mov    $0x64,%edi
call   1060 <fibonacci_serise_upto@plt>
mov    %eax,-0x1a4(%rbp)
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    12b3 <main+0x173>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cmp    -0x1ac(%rbp),%eax
jne    1280 <main+0x140>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xd8a(%rip),%rdi
call   1030 <printf@plt>
jmp    129a <main+0x15a>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xd6f(%rip),%rdi
call   1030 <printf@plt>
jmp    129f <main+0x15f>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    123a <main+0xfa>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    $0xf,%edi
mov    %rbx,%rsi
call   1050 <fibonacci_serise@plt>
test   %eax,%eax
jle    11c2 <main+0x82>
lea    -0x1(%rax),%r14d
mov    %eax,%r12d
lea    (%rsp,%r14,4),%r15
shl    $0x2,%r14
shl    $0x2,%r12
xor    %ebx,%ebx
lea    0xe70(%rip),%r13
lea    0xe6d(%rip),%rbp
nopw   0x0(%rax,%rax,1)
cmp    %rbx,%r14
lea    (%rsp,%rbx,1),%rax
cmove  %r15,%rax
mov    %rbp,%rdi
cmove  %r13,%rdi
mov    (%rax),%esi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    %rbx,%r12
jne    11a0 <main+0x60>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
call   1060 <fibonacci_serise_upto@plt>
test   %eax,%eax
jle    1232 <main+0xf2>
lea    -0x1(%rax),%r14d
mov    %eax,%r12d
lea    (%rsp,%r14,4),%r15
shl    $0x2,%r14
shl    $0x2,%r12
xor    %ebx,%ebx
lea    0xdff(%rip),%r13
lea    0xdfc(%rip),%rbp
nopl   0x0(%rax,%rax,1)
cmp    %rbx,%r14
lea    (%rsp,%rbx,1),%rax
cmove  %r15,%rax
mov    %rbp,%rdi
cmove  %r13,%rdi
mov    (%rax),%esi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1210 <main+0xd0>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [100 x i32]* %6 to i8*
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%12 = call i32 @fibonacci_serise(i32 15, i32* %11)
store i32 %12, i32* %7
store i32 0, i32* %8
br label %13
13: ; preds = %35, %2
%14 = load i32, i32* %8
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %38
17: ; preds = %13
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* %8
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %28
22: ; preds = %17
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %34
28: ; preds = %17
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %28, %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %13
38: ; preds = %13
%39 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%40 = call i32 @memset(i32* %39, i32 0, i32 400)
%41 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%42 = call i32 @fibonacci_serise_upto(i32 100, i32* %41)
store i32 %42, i32* %7
store i32 0, i32* %9
br label %43
43: ; preds = %65, %38
%44 = load i32, i32* %9
%45 = load i32, i32* %7
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %68
47: ; preds = %43
%48 = load i32, i32* %7
%49 = sub nsw i32 %48, 1
%50 = load i32, i32* %9
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %58
52: ; preds = %47
%53 = load i32, i32* %9
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
br label %64
58: ; preds = %47
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %58, %52
br label %65
65: ; preds = %64
%66 = load i32, i32* %9
%67 = add nsw i32 %66, 1
store i32 %67, i32* %9
br label %43
68: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = call i32 @fibonacci_serise(i32 15, i32* %5)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = add nsw i32 %6, -1
%10 = zext i32 %9 to i64
%11 = zext i32 %6 to i64
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %10
br label %22
13: ; preds = %22, %2
%14 = call i32 @memset(i32* %5, i32 0, i32 400)
%15 = call i32 @fibonacci_serise_upto(i32 100, i32* %5)
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %13
%18 = add nsw i32 %15, -1
%19 = zext i32 %18 to i64
%20 = zext i32 %15 to i64
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %19
br label %33
22: ; preds = %8, %22
%23 = phi i64 [ 0, %8 ], [ %30, %22 ]
%24 = icmp eq i64 %23, %10
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %23
%26 = select i1 %24, i32* %12, i32* %25
%27 = select i1 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%28 = load i32, i32* %26
%29 = call i32 @printf(i8* %27, i32 %28)
%30 = add nuw nsw i64 %23, 1
%31 = icmp eq i64 %30, %11
br i1 %31, label %13, label %22
32: ; preds = %33, %13
ret i32 0
33: ; preds = %17, %33
%34 = phi i64 [ 0, %17 ], [ %41, %33 ]
%35 = icmp eq i64 %34, %19
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %34
%37 = select i1 %35, i32* %21, i32* %36
%38 = select i1 %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%39 = load i32, i32* %37
%40 = call i32 @printf(i8* %38, i32 %39)
%41 = add nuw nsw i64 %34, 1
%42 = icmp eq i64 %41, %20
br i1 %42, label %32, label %33
}