#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*/ deleteQueue();
int /*<<< orphan*/ display();
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choice, value;
  printf("1.Insert\n");
  printf("2.Delete\n");
  printf("3.Display\n");
  do {
    printf("Enter choice: ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      printf("Enter the value: ");
      scanf("%d", &value);
      insert(value);
      break;
    case 2:
      deleteQueue();
      break;
    case 3:
      display();
      break;
    }
  } while (choice != 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11d5 <main+0x85>
jmp    11b3 <main+0x63>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11fe <main+0xae>
jmp    11c4 <main+0x74>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     120a <main+0xba>
jmp    1211 <main+0xc1>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
lea    0xe46(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1070 <insert@plt>
jmp    1211 <main+0xc1>
mov    $0x0,%al
call   1050 <deleteQueue@plt>
jmp    1211 <main+0xc1>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1216 <main+0xc6>
cmpl   $0x3,-0x8(%rbp)
jne    1183 <main+0x33>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%r14
lea    0xe70(%rip),%rbx
lea    0x8(%rsp),%r15
lea    0xe67(%rip),%r12
lea    0xc(%rsp),%r13
jmp    11d0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <deleteQueue@plt>
mov    0x8(%rsp),%eax
cmp    $0x3,%eax
je     1229 <main+0xc9>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x3,%eax
je     1220 <main+0xc0>
cmp    $0x2,%eax
je     11c0 <main+0x60>
cmp    $0x1,%eax
jne    11cb <main+0x6b>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
call   1080 <insert@plt>
jmp    11c7 <main+0x67>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <display@plt>
jmp    11c7 <main+0x67>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"1.Insert\0A\00"
@.str.1 = [10 x i8] c"2.Delete\0A\00"
@.str.2 = [11 x i8] c"3.Display\0A\00"
@.str.3 = [15 x i8] c"Enter choice: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [18 x i8] c"Enter the value: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %21, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
switch i32 %10, label %20 [
i32 1, label %11
i32 2, label %16
i32 3, label %18
]
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = call i32 @insert(i32 %14)
br label %20
16: ; preds = %7
%17 = call i32 (...) @deleteQueue()
br label %20
18: ; preds = %7
%19 = call i32 (...) @display()
br label %20
20: ; preds = %7, %18, %16, %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 3
br i1 %23, label %7, label %24
24: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [15 x i8] c"Enter choice: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [18 x i8] c"Enter the value: \00"
@str = [9 x i8] c"1.Insert\00"
@str.6 = [9 x i8] c"2.Delete\00"
@str.7 = [10 x i8] c"3.Display\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0))
br label %8
8: ; preds = %23, %0
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
switch i32 %11, label %23 [
i32 1, label %12
i32 2, label %17
i32 3, label %19
]
12: ; preds = %8
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = call i32 @insert(i32 %15)
br label %21
17: ; preds = %8
%18 = call i32 (...) @deleteQueue()
br label %21
19: ; preds = %8
%20 = call i32 (...) @display()
br label %21
21: ; preds = %19, %17, %12
%22 = load i32, i32* %1
br label %23
23: ; preds = %21, %8
%24 = phi i32 [ %22, %21 ], [ %11, %8 ]
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %8
26: ; preds = %23
ret i32 0
}