#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*/ add_node();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
void display(void) {
  int choice = 4;
  char cnt, temp;
  printf("\n\n\t Telephone Directory");
  printf("\n\t ===================");
  do {
    printf("\n\t Menu");
    printf("\n\t 1. Add Sudirriber");
    printf("\n\t 2. Search Suscriber");
    printf("\n\t 3. Remove Suscriber");
    printf("\n\t 4. Exit\n");
    printf("\n\n\t ::Enter Your Choice::");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      add_node();
      break;
    case 2:
      break;
    case 3:
      break;
    case 4:
      exit(0);
    default:
      continue;
    }
    printf("\n\n\t Would you like to continue:::(y/n)");
    scanf("%c%c", &temp, &cnt);
  } while (cnt != 'n' || cnt != 'N');
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
xor    %eax,%eax
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1207 <display+0xc7>
mov    -0x10(%rbp),%rax
lea    0xe1f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <add_node@plt>
jmp    120c <display+0xcc>
jmp    120c <display+0xcc>
jmp    120c <display+0xcc>
xor    %edi,%edi
call   1060 <exit@plt>
jmp    122e <display+0xee>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x6(%rbp),%rsi
lea    -0x5(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6e,%ecx
mov    %al,-0x11(%rbp)
jne    124d <display+0x10d>
movsbl -0x5(%rbp),%eax
cmp    $0x4e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1167 <display+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x4,0x4(%rsp)
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%r12
lea    0xeda(%rip),%r13
lea    0xf33(%rip),%rbx
lea    0xee3(%rip),%rbp
lea    0xef6(%rip),%r14
lea    0x4(%rsp),%r15
jmp    11db <display+0x8b>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <add_node@plt>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x2(%rsp),%rsi
lea    0x3(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2(%rax),%ecx
cmp    $0x2,%ecx
jb     11b7 <display+0x67>
cmp    $0x1,%eax
je     11b0 <display+0x60>
cmp    $0x4,%eax
jne    11db <display+0x8b>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0A\0A\09 Telephone Directory\00"
@.str.1 = [23 x i8] c"\0A\09 ===================\00"
@.str.2 = [8 x i8] c"\0A\09 Menu\00"
@.str.3 = [21 x i8] c"\0A\09 1. Add Sudirriber\00"
@.str.4 = [23 x i8] c"\0A\09 2. Search Suscriber\00"
@.str.5 = [23 x i8] c"\0A\09 3. Remove Suscriber\00"
@.str.6 = [12 x i8] c"\0A\09 4. Exit\0A\00"
@.str.7 = [26 x i8] c"\0A\0A\09 ::Enter Your Choice::\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [39 x i8] c"\0A\0A\09 Would you like to continue:::(y/n)\00"
@.str.10 = [5 x i8] c"%c%c\00"
define void @display() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 4, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %33, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
switch i32 %14, label %21 [
i32 1, label %15
i32 2, label %17
i32 3, label %18
i32 4, label %19
]
15: ; preds = %6
%16 = call i32 (...) @add_node()
br label %22
17: ; preds = %6
br label %22
18: ; preds = %6
br label %22
19: ; preds = %6
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %6
br label %25
22: ; preds = %18, %17, %15
%23 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %3, i8* %2)
br label %25
25: ; preds = %22, %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 110
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 78
br label %33
33: ; preds = %29, %25
%34 = phi i1 [ true, %25 ], [ %32, %29 ]
br i1 %34, label %6, label %35
35: ; preds = %33
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A\0A\09 Telephone Directory\00"
@.str.1 = [23 x i8] c"\0A\09 ===================\00"
@.str.2 = [8 x i8] c"\0A\09 Menu\00"
@.str.3 = [21 x i8] c"\0A\09 1. Add Sudirriber\00"
@.str.4 = [23 x i8] c"\0A\09 2. Search Suscriber\00"
@.str.5 = [23 x i8] c"\0A\09 3. Remove Suscriber\00"
@.str.7 = [26 x i8] c"\0A\0A\09 ::Enter Your Choice::\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [39 x i8] c"\0A\0A\09 Would you like to continue:::(y/n)\00"
@.str.10 = [5 x i8] c"%c%c\00"
@str = [11 x i8] c"\0A\09 4. Exit\00"
define void @display() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %16, %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
switch i32 %15, label %16 [
i32 1, label %17
i32 2, label %21
i32 3, label %21
i32 4, label %19
]
16: ; preds = %7, %21
br label %7
17: ; preds = %7
%18 = call i32 (...) @add_node()
br label %21
19: ; preds = %7
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %7, %7, %17
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %3, i8* %2)
br label %16
}