int main() {
  char ch = 0;
  char b1[13] = {'a', 'a', 's', 'e', 'r', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char b2[13] = {'a', 'a', 'd', 'e', 'r', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char b3[13] = {'a', 'a', 's', 't', 'y', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char b4[13] = {'a', 'a', 'd', 't', 'y', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char b5[13] = {'a', 'a', 'f', 'e', 'r', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char b6[13] = {'a', 's', 'd', 'e', 'r', '6', '7',
                 '8', '9', '1', '2', '3', '4'};
  char c[8] = {""};
  int i;
  printf("Enter Number from 1 to 6 to select the input\n");
  scanf("%c", &ch);
  if (ch == '1')
    integrate(b1, c);
  if (ch == '2')
    integrate(b2, c);
  if (ch == '3')
    integrate(b3, c);
  if (ch == '4')
    integrate(b4, c);
  if (ch == '5')
    integrate(b5, c);
  if (ch == '6')
    integrate(b6, c);
  for (i = 0; i < 8; i++) {
    printf("%d\n", c[i]);
  }
  printf("Process done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xea4(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xe9f(%rip),%al
mov    %al,-0x6(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xe94(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xe8f(%rip),%al
mov    %al,-0x13(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xe84(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    0xe7f(%rip),%al
mov    %al,-0x20(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xe74(%rip),%eax
mov    %eax,-0x31(%rbp)
mov    0xe6f(%rip),%al
mov    %al,-0x2d(%rbp)
mov    0xe66(%rip),%rax
mov    %rax,-0x46(%rbp)
mov    0xe64(%rip),%eax
mov    %eax,-0x3e(%rbp)
mov    0xe5f(%rip),%al
mov    %al,-0x3a(%rbp)
mov    0xe56(%rip),%rax
mov    %rax,-0x53(%rbp)
mov    0xe54(%rip),%eax
mov    %eax,-0x4b(%rbp)
mov    0xe4f(%rip),%al
mov    %al,-0x47(%rbp)
lea    -0x5b(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe56(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    124d <main+0x10d>
lea    -0x12(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    1269 <main+0x129>
lea    -0x1f(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    1285 <main+0x145>
lea    -0x2c(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jne    12a1 <main+0x161>
lea    -0x39(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x35,%eax
jne    12bd <main+0x17d>
lea    -0x46(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x36,%eax
jne    12d9 <main+0x199>
lea    -0x53(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
mov    $0x0,%al
call   1030 <integrate@plt>
movl   $0x0,-0x60(%rbp)
cmpl   $0x8,-0x60(%rbp)
jge    130f <main+0x1cf>
movslq -0x60(%rbp),%rax
movsbl -0x5b(%rbp,%rax,1),%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    12e0 <main+0x1a0>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movb   $0x0,0x7(%rsp)
movabs $0x3433323139383736,%rax
32 33 34
mov    %rax,0x65(%rsp)
movabs $0x3837367265736161,%rcx
36 37 38
mov    %rcx,0x60(%rsp)
mov    %rax,0x55(%rsp)
movabs $0x3837367265646161,%rcx
36 37 38
mov    %rcx,0x50(%rsp)
mov    %rax,0x45(%rsp)
movabs $0x3837367974736161,%rcx
36 37 38
mov    %rcx,0x40(%rsp)
mov    %rax,0x35(%rsp)
movabs $0x3837367974646161,%rcx
36 37 38
mov    %rcx,0x30(%rsp)
mov    %rax,0x25(%rsp)
movabs $0x3837367265666161,%rcx
36 37 38
mov    %rcx,0x20(%rsp)
mov    %rax,0x15(%rsp)
movabs $0x3837367265647361,%rax
36 37 38
mov    %rax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
lea    0xe66(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x7(%rsp),%al
cmp    $0x31,%al
je     12c8 <main+0x188>
cmp    $0x32,%al
je     12e5 <main+0x1a5>
cmp    $0x33,%al
je     1302 <main+0x1c2>
cmp    $0x34,%al
je     131f <main+0x1df>
cmp    $0x35,%al
je     133c <main+0x1fc>
cmp    $0x36,%al
jne    1235 <main+0xf5>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
movsbl 0x8(%rsp),%esi
lea    0xe10(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x9(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xa(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret
lea    0x60(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
mov    0x7(%rsp),%al
cmp    $0x32,%al
jne    1208 <main+0xc8>
lea    0x50(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
mov    0x7(%rsp),%al
cmp    $0x33,%al
jne    1210 <main+0xd0>
lea    0x40(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
mov    0x7(%rsp),%al
cmp    $0x34,%al
jne    1218 <main+0xd8>
lea    0x30(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
mov    0x7(%rsp),%al
cmp    $0x35,%al
jne    1220 <main+0xe0>
lea    0x20(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <integrate@plt>
mov    0x7(%rsp),%al
cmp    $0x36,%al
je     1224 <main+0xe4>
jmp    1235 <main+0xf5>

LLVM IR (-O0):
@__const.main.b1 = [13 x i8] c"aaser67891234"
@__const.main.b2 = [13 x i8] c"aader67891234"
@__const.main.b3 = [13 x i8] c"aasty67891234"
@__const.main.b4 = [13 x i8] c"aadty67891234"
@__const.main.b5 = [13 x i8] c"aafer67891234"
@__const.main.b6 = [13 x i8] c"asder67891234"
@.str = [46 x i8] c"Enter Number from 1 to 6 to select the input\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [14 x i8] c"Process done\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [13 x i8]
%4 = alloca [13 x i8]
%5 = alloca [13 x i8]
%6 = alloca [13 x i8]
%7 = alloca [13 x i8]
%8 = alloca [13 x i8]
%9 = alloca [8 x i8]
%10 = alloca i32
store i32 0, i32* %1
store i8 0, i8* %2
%11 = bitcast [13 x i8]* %3 to i8*
%12 = bitcast [13 x i8]* %4 to i8*
%13 = bitcast [13 x i8]* %5 to i8*
%14 = bitcast [13 x i8]* %6 to i8*
%15 = bitcast [13 x i8]* %7 to i8*
%16 = bitcast [13 x i8]* %8 to i8*
%17 = bitcast [8 x i8]* %9 to i8*
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 49
br i1 %22, label %23, label %27
23: ; preds = %0
%24 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%26 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %24, i8* %25)
br label %27
27: ; preds = %23, %0
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 50
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%33 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%34 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %32, i8* %33)
br label %35
35: ; preds = %31, %27
%36 = load i8, i8* %2
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 51
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%41 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%42 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %40, i8* %41)
br label %43
43: ; preds = %39, %35
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 52
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%49 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%50 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %48, i8* %49)
br label %51
51: ; preds = %47, %43
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 53
br i1 %54, label %55, label %59
55: ; preds = %51
%56 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%57 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%58 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %56, i8* %57)
br label %59
59: ; preds = %55, %51
%60 = load i8, i8* %2
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 54
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = getelementptr inbounds [13 x i8], [13 x i8]* %8, i64 0, i64 0
%65 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%66 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %64, i8* %65)
br label %67
67: ; preds = %63, %59
store i32 0, i32* %10
br label %68
68: ; preds = %78, %67
%69 = load i32, i32* %10
%70 = icmp slt i32 %69, 8
br i1 %70, label %71, label %81
71: ; preds = %68
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %71
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %68
81: ; preds = %68
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.b1 = [13 x i8] c"aaser67891234"
@__const.main.b2 = [13 x i8] c"aader67891234"
@__const.main.b3 = [13 x i8] c"aasty67891234"
@__const.main.b4 = [13 x i8] c"aadty67891234"
@__const.main.b5 = [13 x i8] c"aafer67891234"
@__const.main.b6 = [13 x i8] c"asder67891234"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [45 x i8] c"Enter Number from 1 to 6 to select the input\00"
@str.4 = [13 x i8] c"Process done\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [13 x i8]
%3 = alloca [13 x i8]
%4 = alloca [13 x i8]
%5 = alloca [13 x i8]
%6 = alloca [13 x i8]
%7 = alloca [13 x i8]
%8 = alloca i64
%9 = bitcast i64* %8 to [8 x i8]*
store i8 0, i8* %1
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%16 = bitcast i64* %8 to i8*
store i64 0, i64* %8
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%19 = load i8, i8* %1
%20 = icmp eq i8 %19, 49
br i1 %20, label %21, label %24
21: ; preds = %0
%22 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %10, i8* %16)
%23 = load i8, i8* %1
br label %24
24: ; preds = %21, %0
%25 = phi i8 [ %23, %21 ], [ %19, %0 ]
%26 = icmp eq i8 %25, 50
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %11, i8* %16)
%29 = load i8, i8* %1
br label %30
30: ; preds = %27, %24
%31 = phi i8 [ %29, %27 ], [ %25, %24 ]
%32 = icmp eq i8 %31, 51
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %12, i8* %16)
%35 = load i8, i8* %1
br label %36
36: ; preds = %33, %30
%37 = phi i8 [ %35, %33 ], [ %31, %30 ]
%38 = icmp eq i8 %37, 52
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %13, i8* %16)
%41 = load i8, i8* %1
br label %42
42: ; preds = %39, %36
%43 = phi i8 [ %41, %39 ], [ %37, %36 ]
%44 = icmp eq i8 %43, 53
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %14, i8* %16)
%47 = load i8, i8* %1
br label %48
48: ; preds = %45, %42
%49 = phi i8 [ %47, %45 ], [ %43, %42 ]
%50 = icmp eq i8 %49, 54
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @integrate to i32 (i8*, i8*, ...)*)(i8* %15, i8* %16)
br label %53
53: ; preds = %51, %48
%54 = bitcast i64* %8 to i8*
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 1
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 2
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %64)
%66 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 3
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 4
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 5
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %76)
%78 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 6
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 7
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %84)
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}