#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*/ 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*/ display_reverse();
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*/ printf(char *);
int /*<<< orphan*/ readfile(char *);
int /*<<< orphan*/ replace_node(int, int);
int /*<<< orphan*/ replace_value(int, int);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ sortlist();
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ writefile(char *);
int menu() {
  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 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 value you want to replace: ");
    scanf("%d", &a);
    printf("Enter the new value: ");
    scanf("%d", &b);
    replace_value(a, b);
    break;
  case 10:
    printf("Enter the node location you want to replace: ");
    scanf("%d", &a);
    printf("Enter the new number: ");
    scanf("%d", &b);
    replace_node(a, b);
    break;
  case 11:
    sortlist();
    break;
  case 12:
    delete_dup_vals();
    break;
  case 13:
    display();
    usleep(5000);
    break;
  case 14:
    display_reverse();
    usleep(5000);
    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;
    break;
  }
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x14,%edi
call   1100 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xdd7(%rip),%rdi
call   1080 <printf@plt>
lea    0xe03(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1110 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x10,%eax
ja     154a <menu+0x2fa>
mov    -0x20(%rbp),%rax
lea    0xd5c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdcb(%rip),%rdi
call   1080 <printf@plt>
lea    0xdbc(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <insert_beg@plt>
jmp    154a <menu+0x2fa>
lea    0xda0(%rip),%rdi
call   1080 <printf@plt>
lea    0xd91(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1060 <insert_end@plt>
jmp    154a <menu+0x2fa>
lea    0xd75(%rip),%rdi
call   1080 <printf@plt>
lea    0xd66(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
lea    0xd7d(%rip),%rdi
call   1080 <printf@plt>
lea    0xd48(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1130 <insert_at_loc@plt>
jmp    154a <menu+0x2fa>
lea    0xd29(%rip),%rdi
call   1080 <printf@plt>
lea    0xd1a(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
lea    0xd59(%rip),%rdi
call   1080 <printf@plt>
lea    0xcfc(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   10d0 <insert_after_value@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   10e0 <delete_beg@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   10c0 <delete_end@plt>
jmp    154a <menu+0x2fa>
lea    0xd3b(%rip),%rdi
call   1080 <printf@plt>
lea    0xcb6(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
call   10b0 <delete_node@plt>
jmp    154a <menu+0x2fa>
lea    0xd37(%rip),%rdi
call   1080 <printf@plt>
lea    0xc8b(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1150 <delete_value@plt>
jmp    154a <menu+0x2fa>
lea    0xd31(%rip),%rdi
call   1080 <printf@plt>
lea    0xc60(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
lea    0xd39(%rip),%rdi
call   1080 <printf@plt>
lea    0xc42(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <replace_value@plt>
jmp    154a <menu+0x2fa>
lea    0xd21(%rip),%rdi
call   1080 <printf@plt>
lea    0xc14(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
lea    0xd31(%rip),%rdi
call   1080 <printf@plt>
lea    0xbf6(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1170 <replace_node@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   10a0 <sortlist@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   1090 <delete_dup_vals@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   1070 <display@plt>
mov    $0x1388,%edi
call   1160 <usleep@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   1050 <display_reverse@plt>
mov    $0x1388,%edi
call   1160 <usleep@plt>
jmp    154a <menu+0x2fa>
lea    0xcd6(%rip),%rdi
call   1080 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <writefile@plt>
jmp    154a <menu+0x2fa>
mov    $0x0,%al
call   1120 <listfile@plt>
lea    0xccb(%rip),%rdi
call   1080 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1110 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1140 <readfile@plt>
jmp    154a <menu+0x2fa>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rbx
sub    $0x10,%rsp
mov    $0x14,%edi
call   1100 <malloc@plt>
mov    %rax,%rbx
lea    0xdd7(%rip),%rdi
call   1080 <printf@plt>
lea    0xe03(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xf,%eax
ja     152a <menu+0x2da>
lea    0xd68(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdd3(%rip),%rdi
call   1080 <printf@plt>
lea    0xdc4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <insert_beg@plt>
jmp    152a <menu+0x2da>
lea    0xda6(%rip),%rdi
call   1080 <printf@plt>
lea    0xd97(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <insert_end@plt>
jmp    152a <menu+0x2da>
lea    0xd79(%rip),%rdi
call   1080 <printf@plt>
lea    0xd6a(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
lea    0xd7d(%rip),%rdi
call   1080 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   1130 <insert_at_loc@plt>
jmp    152a <menu+0x2da>
lea    0xd2a(%rip),%rdi
call   1080 <printf@plt>
lea    0xd1b(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
lea    0xd56(%rip),%rdi
call   1080 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   10d0 <insert_after_value@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   10e0 <delete_beg@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   10c0 <delete_end@plt>
jmp    152a <menu+0x2da>
lea    0xd39(%rip),%rdi
call   1080 <printf@plt>
lea    0xcb4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
call   10b0 <delete_node@plt>
jmp    152a <menu+0x2da>
lea    0xd33(%rip),%rdi
call   1080 <printf@plt>
lea    0xc87(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
call   1150 <delete_value@plt>
jmp    152a <menu+0x2da>
lea    0xd2b(%rip),%rdi
call   1080 <printf@plt>
lea    0xc5a(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
lea    0xd2f(%rip),%rdi
call   1080 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <replace_value@plt>
jmp    152a <menu+0x2da>
lea    0xd18(%rip),%rdi
call   1080 <printf@plt>
lea    0xc0b(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
lea    0xd24(%rip),%rdi
call   1080 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
call   1170 <replace_node@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   10a0 <sortlist@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   1090 <delete_dup_vals@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   1070 <display@plt>
jmp    14cb <menu+0x27b>
xor    %eax,%eax
call   1050 <display_reverse@plt>
mov    $0x1388,%edi
call   1160 <usleep@plt>
jmp    152a <menu+0x2da>
lea    0xce0(%rip),%rdi
call   1080 <printf@plt>
lea    0xcf9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    %rbx,%rdi
call   10f0 <writefile@plt>
jmp    152a <menu+0x2da>
xor    %eax,%eax
call   1120 <listfile@plt>
lea    0xcda(%rip),%rdi
call   1080 <printf@plt>
lea    0xccb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1110 <scanf@plt>
mov    %rbx,%rdi
call   1140 <readfile@plt>
mov    $0x11,%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 = [40 x i8] c"Enter the location in which 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 = [38 x i8] c"Enter the value you want to replace: \00"
@.str.8 = [22 x i8] c"Enter the new value: \00"
@.str.9 = [46 x i8] c"Enter the node location you want to replace: \00"
@.str.10 = [23 x i8] c"Enter the new number: \00"
@.str.11 = [37 x i8] c"Enter the name of file to write to: \00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [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 i64 @malloc(i32 20)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
switch i32 %10, label %92 [
i32 1, label %11
i32 2, label %16
i32 3, label %21
i32 4, label %29
i32 5, label %37
i32 6, label %39
i32 7, label %41
i32 8, label %46
i32 9, label %51
i32 10, label %59
i32 11, label %67
i32 12, label %69
i32 13, label %71
i32 14, label %74
i32 15, label %77
i32 16, label %83
i32 17, label %90
]
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, 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* %3)
%14 = load i32, i32* %3
%15 = call i32 @insert_beg(i32 %14)
br label %92
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = call i32 @insert_end(i32 %19)
br label %92
21: ; preds = %0
%22 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%24 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @insert_at_loc(i32 %26, i32 %27)
br label %92
29: ; preds = %0
%30 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%32 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = call i32 @insert_after_value(i32 %34, i32 %35)
br label %92
37: ; preds = %0
%38 = call i32 (...) @delete_beg()
br label %92
39: ; preds = %0
%40 = call i32 (...) @delete_end()
br label %92
41: ; preds = %0
%42 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%44 = load i32, i32* %3
%45 = call i32 @delete_node(i32 %44)
br label %92
46: ; preds = %0
%47 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%49 = load i32, i32* %3
%50 = call i32 @delete_value(i32 %49)
br label %92
51: ; preds = %0
%52 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%54 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%56 = load i32, i32* %3
%57 = load i32, i32* %4
%58 = call i32 @replace_value(i32 %56, i32 %57)
br label %92
59: ; preds = %0
%60 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
%61 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%62 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%64 = load i32, i32* %3
%65 = load i32, i32* %4
%66 = call i32 @replace_node(i32 %64, i32 %65)
br label %92
67: ; preds = %0
%68 = call i32 (...) @sortlist()
br label %92
69: ; preds = %0
%70 = call i32 (...) @delete_dup_vals()
br label %92
71: ; preds = %0
%72 = call i32 (...) @display()
%73 = call i32 @usleep(i32 5000)
br label %92
74: ; preds = %0
%75 = call i32 (...) @display_reverse()
%76 = call i32 @usleep(i32 5000)
br label %92
77: ; preds = %0
%78 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%79 = load i8*, i8** %5
%80 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %79)
%81 = load i8*, i8** %5
%82 = call i32 @writefile(i8* %81)
br label %92
83: ; preds = %0
%84 = call i32 (...) @listfile()
%85 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%86 = load i8*, i8** %5
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %86)
%88 = load i8*, i8** %5
%89 = call i32 @readfile(i8* %88)
br label %92
90: ; preds = %0
%91 = load i32, i32* %2
store i32 %91, i32* %1
br label %92
92: ; preds = %90, %0, %83, %77, %74, %71, %69, %67, %59, %51, %46, %41, %39, %37, %29, %21, %16, %11
%93 = load i32, i32* %1
ret i32 %93
}

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