#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ series1(int);
int /*<<< orphan*/ series2(int);
int /*<<< orphan*/ series3(int);
int /*<<< orphan*/ series4(int);
int /*<<< orphan*/ series5(int);
int /*<<< orphan*/ series6(int);
int /*<<< orphan*/ series7(int);
int main() {
  int n, choice;
  puts("Welcome to Seriezzz Mania!!.");
  puts("Enter Value of n");
  scanf("%d", &n);
  puts("Enter a value (1-7) and print corresponding sequence");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    series1(n);
    break;
  case 2:
    series2(n);
    break;
  case 3:
    series3(n);
    break;
  case 4:
    series4(n);
    break;
  case 5:
    series5(n);
    break;
  case 6:
    series6(n);
    break;
  case 7:
    series7(n);
    break;
  default:
    puts("Invalid Input");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
mov    %rdi,-0x20(%rbp)
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
mov    -0x20(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     1268 <main+0xd8>
mov    -0x18(%rbp),%rax
lea    0xdfc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
call   1050 <series1@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   1090 <series2@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   1070 <series3@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   10a0 <series4@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   1040 <series5@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   10b0 <series6@plt>
jmp    1274 <main+0xe4>
mov    -0x8(%rbp),%edi
call   1060 <series7@plt>
jmp    1274 <main+0xe4>
lea    0xe13(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1201 <main+0x71>
lea    0xe13(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rsp),%edi
call   1050 <series1@plt>
jmp    124f <main+0xbf>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   1090 <series2@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   1070 <series3@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   10a0 <series4@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   1040 <series5@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   10b0 <series6@plt>
jmp    124f <main+0xbf>
mov    0x8(%rsp),%edi
call   1060 <series7@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Welcome to Seriezzz Mania!!.\00"
@.str.1 = [17 x i8] c"Enter Value of n\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [53 x i8] c"Enter a value (1-7) and print corresponding sequence\00"
@.str.4 = [14 x i8] c"Invalid Input\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
switch i32 %9, label %31 [
i32 1, label %10
i32 2, label %13
i32 3, label %16
i32 4, label %19
i32 5, label %22
i32 6, label %25
i32 7, label %28
]
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i32 @series1(i32 %11)
br label %33
13: ; preds = %0
%14 = load i32, i32* %2
%15 = call i32 @series2(i32 %14)
br label %33
16: ; preds = %0
%17 = load i32, i32* %2
%18 = call i32 @series3(i32 %17)
br label %33
19: ; preds = %0
%20 = load i32, i32* %2
%21 = call i32 @series4(i32 %20)
br label %33
22: ; preds = %0
%23 = load i32, i32* %2
%24 = call i32 @series5(i32 %23)
br label %33
25: ; preds = %0
%26 = load i32, i32* %2
%27 = call i32 @series6(i32 %26)
br label %33
28: ; preds = %0
%29 = load i32, i32* %2
%30 = call i32 @series7(i32 %29)
br label %33
31: ; preds = %0
%32 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %28, %25, %22, %19, %16, %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Welcome to Seriezzz Mania!!.\00"
@.str.1 = [17 x i8] c"Enter Value of n\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [53 x i8] c"Enter a value (1-7) and print corresponding sequence\00"
@.str.4 = [14 x i8] c"Invalid Input\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
switch i32 %10, label %32 [
i32 1, label %11
i32 2, label %14
i32 3, label %17
i32 4, label %20
i32 5, label %23
i32 6, label %26
i32 7, label %29
]
11: ; preds = %0
%12 = load i32, i32* %1
%13 = call i32 @series1(i32 %12)
br label %34
14: ; preds = %0
%15 = load i32, i32* %1
%16 = call i32 @series2(i32 %15)
br label %34
17: ; preds = %0
%18 = load i32, i32* %1
%19 = call i32 @series3(i32 %18)
br label %34
20: ; preds = %0
%21 = load i32, i32* %1
%22 = call i32 @series4(i32 %21)
br label %34
23: ; preds = %0
%24 = load i32, i32* %1
%25 = call i32 @series5(i32 %24)
br label %34
26: ; preds = %0
%27 = load i32, i32* %1
%28 = call i32 @series6(i32 %27)
br label %34
29: ; preds = %0
%30 = load i32, i32* %1
%31 = call i32 @series7(i32 %30)
br label %34
32: ; preds = %0
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %29, %26, %23, %20, %17, %14, %11
ret i32 0
}