#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*/ clear();
int /*<<< orphan*/ delete_beg();
int /*<<< orphan*/ delete_dup_vals();
int /*<<< orphan*/ delete_end();
int /*<<< orphan*/ delete_node(int);
int /*<<< orphan*/ delete_value(int);
int /*<<< orphan*/ display();
int /*<<< orphan*/ insert_after_value(int, int);
int /*<<< orphan*/ insert_at_loc(int, int);
int /*<<< orphan*/ insert_beg(int);
int /*<<< orphan*/ insert_end(int);
int /*<<< orphan*/ listfile();
scalar_t__ malloc(int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readfile(char *);
int /*<<< orphan*/ replace_node(int, int);
int /*<<< orphan*/ replace_value(int, int);
int /*<<< orphan*/ reverse();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ sortlist();
int /*<<< orphan*/ writefile(char *);
int menu() {
  clear();
  msleep(500);
  print();
  int n, a, b;
  char *filename = (char *)malloc(20 * sizeof(char));
  printf("Select the operation you want to perform (17 to Quit): ");
  scanf("%d", &n);
  switch (n) {
  case 1:
    printf("Enter the number you want to insert: ");
    scanf("%d", &a);
    insert_beg(a);
    break;
  case 2:
    printf("Enter the number you want to insert: ");
    scanf("%d", &a);
    insert_end(a);
    break;
  case 3:
    printf("Enter the number you want to insert: ");
    scanf("%d", &a);
    printf("Enter the location in which you want to insert: ");
    scanf("%d", &b);
    insert_at_loc(a, b);
    break;
  case 4:
    printf("Enter the number you want to insert: ");
    scanf("%d", &a);
    printf("Enter the value after which to insert: ");
    scanf("%d", &b);
    insert_after_value(a, b);
    break;
  case 5:
    delete_beg();
    break;
  case 6:
    delete_end();
    break;
  case 7:
    printf("Enter the location of node to delete: ");
    scanf("%d", &a);
    delete_node(a);
    break;
  case 8:
    printf("Enter the value you want to delete: ");
    scanf("%d", &a);
    delete_value(a);
    break;
  case 9:
    printf("Enter the location of node you want to replace: ");
    scanf("%d", &b);
    printf("Enter the new number: ");
    scanf("%d", &a);
    replace_node(a, b);
    break;
  case 10:
    printf("Enter the value you want to replace: ");
    scanf("%d", &a);
    printf("Enter the new number: ");
    scanf("%d", &b);
    replace_value(b, a);
    break;
  case 11:
    delete_dup_vals();
    break;
  case 12:
    display();
    msleep(5000);
    break;
  case 13:
    reverse();
    break;
  case 14:
    sortlist();
    break;
  case 15:
    printf("Enter the name of file to write to: ");
    scanf("%s", filename);
    writefile(filename);
    break;
  case 16:
    listfile();
    printf("Enter the name of file to read from: ");
    scanf("%s", filename);
    readfile(filename);
    break;
  case 17:
    return (n);
  }
  return (0);
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %eax,%eax
mov    %al,-0x21(%rbp)
call   1160 <clear@plt>
mov    $0x1f4,%edi
call   1080 <msleep@plt>
mov    -0x21(%rbp),%al
call   10b0 <print@plt>
mov    $0x14,%edi
call   1120 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xd9b(%rip),%rdi
call   1090 <printf@plt>
mov    -0x21(%rbp),%al
lea    0xdc4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1130 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x10,%eax
ja     1582 <menu+0x312>
mov    -0x20(%rbp),%rax
lea    0xd1f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd8e(%rip),%rdi
call   1090 <printf@plt>
lea    0xd7f(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1050 <insert_beg@plt>
jmp    1582 <menu+0x312>
lea    0xd63(%rip),%rdi
call   1090 <printf@plt>
lea    0xd54(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1060 <insert_end@plt>
jmp    1582 <menu+0x312>
lea    0xd38(%rip),%rdi
call   1090 <printf@plt>
lea    0xd29(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
lea    0xd40(%rip),%rdi
call   1090 <printf@plt>
lea    0xd0b(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1150 <insert_at_loc@plt>
jmp    1582 <menu+0x312>
lea    0xcec(%rip),%rdi
call   1090 <printf@plt>
lea    0xcdd(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
lea    0xd25(%rip),%rdi
call   1090 <printf@plt>
lea    0xcbf(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   10f0 <insert_after_value@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   1100 <delete_beg@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   10e0 <delete_end@plt>
jmp    1582 <menu+0x312>
lea    0xd07(%rip),%rdi
call   1090 <printf@plt>
lea    0xc79(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
call   10d0 <delete_node@plt>
jmp    1582 <menu+0x312>
lea    0xd03(%rip),%rdi
call   1090 <printf@plt>
lea    0xc4e(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1180 <delete_value@plt>
jmp    1582 <menu+0x312>
lea    0xcfd(%rip),%rdi
call   1090 <printf@plt>
lea    0xc23(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
lea    0xd10(%rip),%rdi
call   1090 <printf@plt>
lea    0xc05(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1190 <replace_node@plt>
jmp    1582 <menu+0x312>
lea    0xcf9(%rip),%rdi
call   1090 <printf@plt>
lea    0xbd7(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
lea    0xcc4(%rip),%rdi
call   1090 <printf@plt>
lea    0xbb9(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <replace_value@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   10a0 <delete_dup_vals@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   1070 <display@plt>
mov    $0x1388,%edi
call   1080 <msleep@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   1030 <reverse@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   10c0 <sortlist@plt>
jmp    1582 <menu+0x312>
lea    0xc99(%rip),%rdi
call   1090 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1110 <writefile@plt>
jmp    1582 <menu+0x312>
mov    $0x0,%al
call   1140 <listfile@plt>
lea    0xc8e(%rip),%rdi
call   1090 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1130 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1170 <readfile@plt>
jmp    1582 <menu+0x312>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1589 <menu+0x319>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1160 <clear@plt>
mov    $0x1f4,%edi
call   1080 <msleep@plt>
xor    %eax,%eax
call   10b0 <print@plt>
mov    $0x14,%edi
call   1120 <malloc@plt>
mov    %rax,%rbx
lea    0xda3(%rip),%rdi
call   1090 <printf@plt>
lea    0xdcf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x10,%ecx
ja     1562 <menu+0x2f2>
lea    0xd30(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xd9f(%rip),%rdi
call   1090 <printf@plt>
lea    0xd90(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <insert_beg@plt>
jmp    1562 <menu+0x2f2>
lea    0xd72(%rip),%rdi
call   1090 <printf@plt>
lea    0xd63(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <insert_end@plt>
jmp    1562 <menu+0x2f2>
lea    0xd45(%rip),%rdi
call   1090 <printf@plt>
lea    0xd36(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
lea    0xd49(%rip),%rdi
call   1090 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   1150 <insert_at_loc@plt>
jmp    1562 <menu+0x2f2>
lea    0xcf6(%rip),%rdi
call   1090 <printf@plt>
lea    0xce7(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
lea    0xd2b(%rip),%rdi
call   1090 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   10f0 <insert_after_value@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   1100 <delete_beg@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   10e0 <delete_end@plt>
jmp    1562 <menu+0x2f2>
lea    0xd0e(%rip),%rdi
call   1090 <printf@plt>
lea    0xc80(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
call   10d0 <delete_node@plt>
jmp    1562 <menu+0x2f2>
lea    0xd08(%rip),%rdi
call   1090 <printf@plt>
lea    0xc53(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
call   1180 <delete_value@plt>
jmp    1562 <menu+0x2f2>
lea    0xd00(%rip),%rdi
call   1090 <printf@plt>
lea    0xc26(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
lea    0xd0f(%rip),%rdi
call   1090 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   1190 <replace_node@plt>
jmp    1562 <menu+0x2f2>
lea    0xcf9(%rip),%rdi
call   1090 <printf@plt>
lea    0xbd7(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
lea    0xcc0(%rip),%rdi
call   1090 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <replace_value@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   10a0 <delete_dup_vals@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   1070 <display@plt>
mov    $0x1388,%edi
call   1080 <msleep@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   1030 <reverse@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   10c0 <sortlist@plt>
jmp    1562 <menu+0x2f2>
lea    0xca2(%rip),%rdi
call   1090 <printf@plt>
lea    0xcbb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    %rbx,%rdi
call   1110 <writefile@plt>
jmp    1562 <menu+0x2f2>
xor    %eax,%eax
call   1140 <listfile@plt>
lea    0xc9c(%rip),%rdi
call   1090 <printf@plt>
lea    0xc8d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1130 <scanf@plt>
mov    %rbx,%rdi
call   1170 <readfile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Select the operation you want to perform (17 to Quit): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Enter the number you want to insert: \00"
@.str.3 = [49 x i8] c"Enter the location in which you want to insert: \00"
@.str.4 = [40 x i8] c"Enter the value after which to insert: \00"
@.str.5 = [39 x i8] c"Enter the location of node to delete: \00"
@.str.6 = [37 x i8] c"Enter the value you want to delete: \00"
@.str.7 = [49 x i8] c"Enter the location of node you want to replace: \00"
@.str.8 = [23 x i8] c"Enter the new number: \00"
@.str.9 = [38 x i8] c"Enter the value you want to replace: \00"
@.str.10 = [37 x i8] c"Enter the name of file to write to: \00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [38 x i8] c"Enter the name of file to read from: \00"
define i32 @menu() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = call i32 (...) @clear()
%7 = call i32 @msleep(i32 500)
%8 = call i32 (...) @print()
%9 = call i64 @malloc(i32 20)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
switch i32 %13, label %94 [
i32 1, label %14
i32 2, label %19
i32 3, label %24
i32 4, label %32
i32 5, label %40
i32 6, label %42
i32 7, label %44
i32 8, label %49
i32 9, label %54
i32 10, label %62
i32 11, label %70
i32 12, label %72
i32 13, label %75
i32 14, label %77
i32 15, label %79
i32 16, label %85
i32 17, label %92
]
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = call i32 @insert_beg(i32 %17)
br label %94
19: ; preds = %0
%20 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%22 = load i32, i32* %3
%23 = call i32 @insert_end(i32 %22)
br label %94
24: ; preds = %0
%25 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%27 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 @insert_at_loc(i32 %29, i32 %30)
br label %94
32: ; preds = %0
%33 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%35 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = call i32 @insert_after_value(i32 %37, i32 %38)
br label %94
40: ; preds = %0
%41 = call i32 (...) @delete_beg()
br label %94
42: ; preds = %0
%43 = call i32 (...) @delete_end()
br label %94
44: ; preds = %0
%45 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%47 = load i32, i32* %3
%48 = call i32 @delete_node(i32 %47)
br label %94
49: ; preds = %0
%50 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%52 = load i32, i32* %3
%53 = call i32 @delete_value(i32 %52)
br label %94
54: ; preds = %0
%55 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
%56 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%57 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%58 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%59 = load i32, i32* %3
%60 = load i32, i32* %4
%61 = call i32 @replace_node(i32 %59, i32 %60)
br label %94
62: ; preds = %0
%63 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%65 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%67 = load i32, i32* %4
%68 = load i32, i32* %3
%69 = call i32 @replace_value(i32 %67, i32 %68)
br label %94
70: ; preds = %0
%71 = call i32 (...) @delete_dup_vals()
br label %94
72: ; preds = %0
%73 = call i32 (...) @display()
%74 = call i32 @msleep(i32 5000)
br label %94
75: ; preds = %0
%76 = call i32 (...) @reverse()
br label %94
77: ; preds = %0
%78 = call i32 (...) @sortlist()
br label %94
79: ; preds = %0
%80 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%81 = load i8*, i8** %5
%82 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %81)
%83 = load i8*, i8** %5
%84 = call i32 @writefile(i8* %83)
br label %94
85: ; preds = %0
%86 = call i32 (...) @listfile()
%87 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
%88 = load i8*, i8** %5
%89 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %88)
%90 = load i8*, i8** %5
%91 = call i32 @readfile(i8* %90)
br label %94
92: ; preds = %0
%93 = load i32, i32* %2
store i32 %93, i32* %1
br label %95
94: ; preds = %0, %85, %79, %77, %75, %72, %70, %62, %54, %49, %44, %42, %40, %32, %24, %19, %14
store i32 0, i32* %1
br label %95
95: ; preds = %94, %92
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@.str = [56 x i8] c"Select the operation you want to perform (17 to Quit): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Enter the number you want to insert: \00"
@.str.3 = [49 x i8] c"Enter the location in which you want to insert: \00"
@.str.4 = [40 x i8] c"Enter the value after which to insert: \00"
@.str.5 = [39 x i8] c"Enter the location of node to delete: \00"
@.str.6 = [37 x i8] c"Enter the value you want to delete: \00"
@.str.7 = [49 x i8] c"Enter the location of node you want to replace: \00"
@.str.8 = [23 x i8] c"Enter the new number: \00"
@.str.9 = [38 x i8] c"Enter the value you want to replace: \00"
@.str.10 = [37 x i8] c"Enter the name of file to write to: \00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [38 x i8] c"Enter the name of file to read from: \00"
define i32 @menu() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32 (...) @clear()
%5 = tail call i32 @msleep(i32 500)
%6 = tail call i32 (...) @print()
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = tail call i64 @malloc(i32 20)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
switch i32 %14, label %89 [
i32 1, label %15
i32 2, label %20
i32 3, label %25
i32 4, label %33
i32 5, label %41
i32 6, label %43
i32 7, label %45
i32 8, label %50
i32 9, label %55
i32 10, label %63
i32 11, label %71
i32 12, label %73
i32 13, label %76
i32 14, label %78
i32 15, label %80
i32 16, label %84
i32 17, label %90
]
15: ; preds = %0
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = call i32 @insert_beg(i32 %18)
br label %89
20: ; preds = %0
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%23 = load i32, i32* %2
%24 = call i32 @insert_end(i32 %23)
br label %89
25: ; preds = %0
%26 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = call i32 @insert_at_loc(i32 %30, i32 %31)
br label %89
33: ; preds = %0
%34 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%36 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = call i32 @insert_after_value(i32 %38, i32 %39)
br label %89
41: ; preds = %0
%42 = call i32 (...) @delete_beg()
br label %89
43: ; preds = %0
%44 = call i32 (...) @delete_end()
br label %89
45: ; preds = %0
%46 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%48 = load i32, i32* %2
%49 = call i32 @delete_node(i32 %48)
br label %89
50: ; preds = %0
%51 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%53 = load i32, i32* %2
%54 = call i32 @delete_value(i32 %53)
br label %89
55: ; preds = %0
%56 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%58 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%60 = load i32, i32* %2
%61 = load i32, i32* %3
%62 = call i32 @replace_node(i32 %60, i32 %61)
br label %89
63: ; preds = %0
%64 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%66 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%68 = load i32, i32* %3
%69 = load i32, i32* %2
%70 = call i32 @replace_value(i32 %68, i32 %69)
br label %89
71: ; preds = %0
%72 = call i32 (...) @delete_dup_vals()
br label %89
73: ; preds = %0
%74 = call i32 (...) @display()
%75 = call i32 @msleep(i32 5000)
br label %89
76: ; preds = %0
%77 = call i32 (...) @reverse()
br label %89
78: ; preds = %0
%79 = call i32 (...) @sortlist()
br label %89
80: ; preds = %0
%81 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%82 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %11)
%83 = call i32 @writefile(i8* %11)
br label %89
84: ; preds = %0
%85 = call i32 (...) @listfile()
%86 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %11)
%88 = call i32 @readfile(i8* %11)
br label %89
89: ; preds = %0, %84, %80, %78, %76, %73, %71, %63, %55, %50, %45, %43, %41, %33, %25, %20, %15
br label %90
90: ; preds = %0, %89
%91 = phi i32 [ 0, %89 ], [ %14, %0 ]
ret i32 %91
}