#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 */
struct index {
  int dummy;
};

/* Variables and functions */
struct index *append_index(struct index *, int);
struct index *append_node(struct index *, int, int);
struct index *delete_index(struct index *, int);
struct index *delete_node(struct index *, int, int);
int /*<<< orphan*/ display(struct index *);
int /*<<< orphan*/ freeallnow(struct index *);
int /*<<< orphan*/ getchar();
struct index *insert_index(struct index *, int, int);
struct index *insert_node(struct index *, int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int choice, pos, data, indexNo;
  struct index *start = NULL;
  system("clear");
  while (1) {
    printf("\n\n "
           "==================================================================="
           "======================================================\n\n");
    display(start);
    printf("\n "
           "==================================================================="
           "=======================================================\n\n\n");
    printf("\t\tWelcome to the data base. \n\n\n");
    printf("Please enter your choice.\n\n 1. To insert an index.\n\n 2. To "
           "append a Index. \n\n 3. To Insert a node. \n\n");
    printf(" 4. To Append a node. \n\n 5. To delete an Index \n\n 6. To delete "
           "a node \n\n 7. To Display. \n\n 8. To exit\n\n\t:  ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      printf("Enter the data (to be inserted into the index):  ");
      scanf("%d", &data);
      printf("Enter the position you want to insert the Index:  ");
      scanf("%d", &pos);
      start = insert_index(start, data, pos);
      break;
    case 2:
      printf("Enter the data (to be inserted into the index):  ");
      scanf("%d", &data);
      start = append_index(start, data);
      break;
    case 3:
      printf("Enter the data (to be inserted into the node):  ");
      scanf("%d", &data);
      printf("Enter the position you want to insert into the node: ");
      scanf("%d", &pos);
      printf("Enter the index number you want to insert the node:  ");
      scanf("%d", &indexNo);
      start = insert_node(start, pos, data, indexNo);
      break;
    case 4:
      printf("Enter the data (to be inserted into the node):  ");
      scanf("%d", &data);
      printf("Enter the index number you want to insert the node:  ");
      scanf("%d", &indexNo);
      start = append_node(start, data, indexNo);
      break;
    case 5:
      printf("Enter the data stored inside inside the index:  ");
      scanf("%d", &data);
      start = delete_index(start, data);
      break;
    case 6:
      printf("Enter the data stored inside inside the node:  ");
      scanf("%d", &data);
      printf("Enter the index number you want to insert the node:  ");
      scanf("%d", &indexNo);
      start = delete_node(start, data, indexNo);
      break;
    case 7:
      printf("\n\n\n");
      display(start);
      break;
    case 8:
      goto last;
    default:
      printf("Invalid Option.\n\n");
    }
    printf("\n\nPress ENTER to return to menu. ");
    getchar();
    getchar();
    system("clear");
  }
last:
  freeallnow(start);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe42(%rip),%rdi
call   1050 <system@plt>
lea    0xe3c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <display@plt>
lea    0xea6(%rip),%rdi
call   1060 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1060 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1060 <printf@plt>
lea    0xf88(%rip),%rdi
call   1060 <printf@plt>
lea    0xfe8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x7,%eax
ja     1441 <main+0x281>
mov    -0x28(%rbp),%rax
lea    0xda8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfb2(%rip),%rdi
call   1060 <printf@plt>
lea    0xfa3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xfc8(%rip),%rdi
call   1060 <printf@plt>
lea    0xf87(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   10e0 <insert_index@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xf62(%rip),%rdi
call   1060 <printf@plt>
lea    0xf53(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <append_index@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xf96(%rip),%rdi
call   1060 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xfab(%rip),%rdi
call   1060 <printf@plt>
lea    0xf06(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xfc5(%rip),%rdi
call   1060 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   10b0 <insert_node@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xf27(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xf72(%rip),%rdi
call   1060 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1070 <append_node@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xf74(%rip),%rdi
call   1060 <printf@plt>
lea    0xe63(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1090 <delete_index@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xf74(%rip),%rdi
call   1060 <printf@plt>
lea    0xe32(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xef1(%rip),%rdi
call   1060 <printf@plt>
lea    0xe16(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <delete_node@plt>
mov    %rax,-0x20(%rbp)
jmp    144d <main+0x28d>
lea    0xd18(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <display@plt>
jmp    144d <main+0x28d>
jmp    1478 <main+0x2b8>
lea    0xf35(%rip),%rdi
call   1060 <printf@plt>
lea    0xf3b(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
lea    0xbb2(%rip),%rdi
call   1050 <system@plt>
jmp    11e3 <main+0x23>
mov    -0x20(%rbp),%rdi
call   10c0 <freeallnow@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe3b(%rip),%rdi
call   1060 <system@plt>
lea    0xe35(%rip),%rbp
lea    0xe9a(%rip),%r14
lea    0x14(%rsp),%r15
lea    0xff4(%rip),%r12
lea    0xdf5(%rip),%rbx
xor    %r13d,%r13d
jmp    1242 <main+0x72>
lea    0x1184(%rip),%rdi
call   1040 <puts@plt>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1070 <printf@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
lea    0xde3(%rip),%rdi
call   1060 <system@plt>
lea    0xfd1(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1050 <display@plt>
lea    0x103b(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ae(%rip),%rdi
call   1040 <puts@plt>
lea    0x10c1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   10e0 <scanf@plt>
mov    0x14(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x7,%eax
ja     1210 <main+0x40>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
lea    0xde8(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
lea    0xe01(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x10(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %r13,%rdi
call   10f0 <insert_index@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xd9e(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    %r13,%rdi
call   1030 <append_index@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xdd6(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
lea    0xdee(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x10(%rsp),%rsi
call   10e0 <scanf@plt>
lea    0xe0b(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %r13,%rdi
call   10c0 <insert_node@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xd6f(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
lea    0xdbd(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r13,%rdi
call   1080 <append_node@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xdc2(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    %r13,%rdi
call   10a0 <delete_index@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xdc6(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
call   10e0 <scanf@plt>
lea    0xd46(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r13,%rdi
call   10b0 <delete_node@plt>
mov    %rax,%r13
jmp    1220 <main+0x50>
lea    0xee7(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1050 <display@plt>
jmp    1220 <main+0x50>
mov    %r13,%rdi
call   10d0 <freeallnow@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.index = type { i32 }
@.str = [6 x i8] c"clear\00"
@.str.1 = [127 x i8] c"\0A\0A =========================================================================================================================\0A\0A\00"
@.str.2 = [128 x i8] c"\0A ==========================================================================================================================\0A\0A\0A\00"
@.str.3 = [32 x i8] c"\09\09Welcome to the data base. \0A\0A\0A\00"
@.str.4 = [102 x i8] c"Please enter your choice.\0A\0A 1. To insert an index.\0A\0A 2. To append a Index. \0A\0A 3. To Insert a node. \0A\0A\00"
@.str.5 = [108 x i8] c" 4. To Append a node. \0A\0A 5. To delete an Index \0A\0A 6. To delete a node \0A\0A 7. To Display. \0A\0A 8. To exit\0A\0A\09: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [50 x i8] c"Enter the data (to be inserted into the index): \00"
@.str.8 = [51 x i8] c"Enter the position you want to insert the Index: \00"
@.str.9 = [49 x i8] c"Enter the data (to be inserted into the node): \00"
@.str.10 = [54 x i8] c"Enter the position you want to insert into the node: \00"
@.str.11 = [54 x i8] c"Enter the index number you want to insert the node: \00"
@.str.12 = [49 x i8] c"Enter the data stored inside inside the index: \00"
@.str.13 = [48 x i8] c"Enter the data stored inside inside the node: \00"
@.str.14 = [4 x i8] c"\0A\0A\0A\00"
@.str.15 = [18 x i8] c"Invalid Option.\0A\0A\00"
@.str.16 = [34 x i8] c"\0A\0APress ENTER to return to menu. \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.index*
store i32 0, i32* %1
store %struct.index* null, %struct.index** %6
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %76
%9 = call i32 @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0))
%10 = load %struct.index*, %struct.index** %6
%11 = call i32 @display(%struct.index* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
switch i32 %17, label %74 [
i32 1, label %18
i32 2, label %27
i32 3, label %33
i32 4, label %45
i32 5, label %54
i32 6, label %60
i32 7, label %69
i32 8, label %73
]
18: ; preds = %8
%19 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%21 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%23 = load %struct.index*, %struct.index** %6
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = call %struct.index* @insert_index(%struct.index* %23, i32 %24, i32 %25)
store %struct.index* %26, %struct.index** %6
br label %76
27: ; preds = %8
%28 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%30 = load %struct.index*, %struct.index** %6
%31 = load i32, i32* %4
%32 = call %struct.index* @append_index(%struct.index* %30, i32 %31)
store %struct.index* %32, %struct.index** %6
br label %76
33: ; preds = %8
%34 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%36 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.10, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%38 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%40 = load %struct.index*, %struct.index** %6
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = load i32, i32* %5
%44 = call %struct.index* @insert_node(%struct.index* %40, i32 %41, i32 %42, i32 %43)
store %struct.index* %44, %struct.index** %6
br label %76
45: ; preds = %8
%46 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%48 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%50 = load %struct.index*, %struct.index** %6
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = call %struct.index* @append_node(%struct.index* %50, i32 %51, i32 %52)
store %struct.index* %53, %struct.index** %6
br label %76
54: ; preds = %8
%55 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%57 = load %struct.index*, %struct.index** %6
%58 = load i32, i32* %4
%59 = call %struct.index* @delete_index(%struct.index* %57, i32 %58)
store %struct.index* %59, %struct.index** %6
br label %76
60: ; preds = %8
%61 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%63 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%64 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%65 = load %struct.index*, %struct.index** %6
%66 = load i32, i32* %4
%67 = load i32, i32* %5
%68 = call %struct.index* @delete_node(%struct.index* %65, i32 %66, i32 %67)
store %struct.index* %68, %struct.index** %6
br label %76
69: ; preds = %8
%70 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%71 = load %struct.index*, %struct.index** %6
%72 = call i32 @display(%struct.index* %71)
br label %76
73: ; preds = %8
br label %81
74: ; preds = %8
%75 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
br label %76
76: ; preds = %74, %69, %60, %54, %45, %33, %27, %18
%77 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
%78 = call i32 (...) @getchar()
%79 = call i32 (...) @getchar()
%80 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
81: ; preds = %73
%82 = load %struct.index*, %struct.index** %6
%83 = call i32 @freeallnow(%struct.index* %82)
ret i32 0
}

LLVM IR (-O2):
%struct.index = type { i32 }
@.str = [6 x i8] c"clear\00"
@.str.5 = [108 x i8] c" 4. To Append a node. \0A\0A 5. To delete an Index \0A\0A 6. To delete a node \0A\0A 7. To Display. \0A\0A 8. To exit\0A\0A\09: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [50 x i8] c"Enter the data (to be inserted into the index): \00"
@.str.8 = [51 x i8] c"Enter the position you want to insert the Index: \00"
@.str.9 = [49 x i8] c"Enter the data (to be inserted into the node): \00"
@.str.10 = [54 x i8] c"Enter the position you want to insert into the node: \00"
@.str.11 = [54 x i8] c"Enter the index number you want to insert the node: \00"
@.str.12 = [49 x i8] c"Enter the data stored inside inside the index: \00"
@.str.13 = [48 x i8] c"Enter the data stored inside inside the node: \00"
@.str.16 = [34 x i8] c"\0A\0APress ENTER to return to menu. \00"
@str = [126 x i8] c"\0A\0A =========================================================================================================================\0A\00"
@str.17 = [127 x i8] c"\0A ==========================================================================================================================\0A\0A\00"
@str.18 = [31 x i8] c"\09\09Welcome to the data base. \0A\0A\00"
@str.19 = [101 x i8] c"Please enter your choice.\0A\0A 1. To insert an index.\0A\0A 2. To append a Index. \0A\0A 3. To Insert a node. \0A\00"
@str.20 = [3 x i8] c"\0A\0A\00"
@str.21 = [17 x i8] c"Invalid Option.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %70, %0
%11 = phi %struct.index* [ null, %0 ], [ %71, %70 ]
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
%13 = call i32 @display(%struct.index* %11)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([127 x i8], [127 x i8]* @str.17, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.18, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str.19, i64 0, i64 0))
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
switch i32 %19, label %68 [
i32 1, label %20
i32 2, label %28
i32 3, label %33
i32 4, label %44
i32 5, label %52
i32 6, label %57
i32 7, label %65
i32 8, label %76
]
20: ; preds = %10
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = call %struct.index* @insert_index(%struct.index* %11, i32 %25, i32 %26)
br label %70
28: ; preds = %10
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%31 = load i32, i32* %3
%32 = call %struct.index* @append_index(%struct.index* %11, i32 %31)
br label %70
33: ; preds = %10
%34 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%36 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.10, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%38 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = call %struct.index* @insert_node(%struct.index* %11, i32 %40, i32 %41, i32 %42)
br label %70
44: ; preds = %10
%45 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%47 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%49 = load i32, i32* %3
%50 = load i32, i32* %4
%51 = call %struct.index* @append_node(%struct.index* %11, i32 %49, i32 %50)
br label %70
52: ; preds = %10
%53 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%55 = load i32, i32* %3
%56 = call %struct.index* @delete_index(%struct.index* %11, i32 %55)
br label %70
57: ; preds = %10
%58 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
%59 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%60 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%61 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%62 = load i32, i32* %3
%63 = load i32, i32* %4
%64 = call %struct.index* @delete_node(%struct.index* %11, i32 %62, i32 %63)
br label %70
65: ; preds = %10
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.20, i64 0, i64 0))
%67 = call i32 @display(%struct.index* %11)
br label %70
68: ; preds = %10
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.21, i64 0, i64 0))
br label %70
70: ; preds = %68, %65, %57, %52, %44, %33, %28, %20
%71 = phi %struct.index* [ %11, %68 ], [ %11, %65 ], [ %64, %57 ], [ %56, %52 ], [ %51, %44 ], [ %43, %33 ], [ %32, %28 ], [ %27, %20 ]
%72 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
%73 = call i32 (...) @getchar()
%74 = call i32 (...) @getchar()
%75 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
76: ; preds = %10
%77 = call i32 @freeallnow(%struct.index* %11)
ret i32 0
}