#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*/ operation(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  while (1) {
    printf("Enter 1 for create the linklist\n ");
    printf("Enter 2 for delete the  linklist\n ");
    printf("Enter 3 for display the linklist\n ");
    printf("Enter 4 for  insert into the link list \n ");
    printf("Enter 5 for remove the element from the linklist\n");
    printf("Enter 6 to display is reverse\n");
    printf("press 7 for stop operation\n");
    scanf(" %d", &n);
    if (n == 7)
      break;
    operation(n);
    printf("\n");
  }
  printf("Good bye\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
call   1030 <printf@plt>
lea    0xf55(%rip),%rdi
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x7,-0x8(%rbp)
jne    11b2 <main+0x82>
jmp    11cb <main+0x9b>
mov    -0x8(%rbp),%edi
call   1040 <operation@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf06(%rip),%r13
lea    0xf2d(%rip),%rbx
lea    0xf57(%rip),%rbp
lea    0xf6e(%rip),%r14
lea    0xf14(%rip),%r15
lea    0x4(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1050 <printf@plt>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0x7,%edi
je     11f9 <main+0xa9>
call   1060 <operation@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1190 <main+0x40>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter 1 for create the linklist\0A \00"
@.str.1 = [35 x i8] c"Enter 2 for delete the linklist\0A \00"
@.str.2 = [35 x i8] c"Enter 3 for display the linklist\0A \00"
@.str.3 = [42 x i8] c"Enter 4 for insert into the link list \0A \00"
@.str.4 = [50 x i8] c"Enter 5 for remove the element from the linklist\0A\00"
@.str.5 = [31 x i8] c"Enter 6 to display is reverse\0A\00"
@.str.6 = [28 x i8] c"press 7 for stop operation\0A\00"
@.str.7 = [4 x i8] c" %d\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [10 x i8] c"Good bye\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %15
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 7
br i1 %13, label %14, label %15
14: ; preds = %3
br label %19
15: ; preds = %3
%16 = load i32, i32* %2
%17 = call i32 @operation(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %3
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter 1 for create the linklist\0A \00"
@.str.1 = [35 x i8] c"Enter 2 for delete the linklist\0A \00"
@.str.2 = [35 x i8] c"Enter 3 for display the linklist\0A \00"
@.str.3 = [42 x i8] c"Enter 4 for insert into the link list \0A \00"
@.str.7 = [4 x i8] c" %d\00"
@str = [49 x i8] c"Enter 5 for remove the element from the linklist\00"
@str.10 = [30 x i8] c"Enter 6 to display is reverse\00"
@str.11 = [27 x i8] c"press 7 for stop operation\00"
@str.12 = [9 x i8] c"Good bye\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %14, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.10, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.11, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 7
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = call i32 @operation(i32 %12)
%16 = call i32 @putchar(i32 10)
br label %3
17: ; preds = %3
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
ret i32 0
}