#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 ();
int /*<<< orphan*/ display();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ insert(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int choice;
  char ch;
  while (1) {
    printf("1.insert element to the queue \n");
    printf("2.delete element from queue \n");
    printf("3.dispaly all elements in queue\n");
    printf("4.exit \n");
    printf("please enter yout choice:");
    scanf("%\d", &choice);
    switch (choice) {
    case 1:
      insert(ch);
      break;
    case 2:
      delete ();
      break;
    case 3:
      display();
      break;
    case 4:
      exit(1);
    default:
      printf("wrong choice \n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     121b <main+0xbb>
mov    -0x20(%rbp),%rax
lea    0xe1e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x15(%rbp),%edi
call   1060 <insert@plt>
jmp    1227 <main+0xc7>
mov    $0x0,%al
call   1070 <delete@plt>
jmp    1227 <main+0xc7>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1227 <main+0xc7>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
jmp    1176 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xee7(%rip),%r12
lea    0xf00(%rip),%r13
lea    0xe80(%rip),%rbx
lea    0xe93(%rip),%rbp
lea    0x4(%rsp),%r14
lea    0xe5d(%rip),%r15
jmp    11b7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <display@plt>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1210 <main+0xa0>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %edi,%edi
call   1070 <insert@plt>
jmp    11b7 <main+0x47>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
jmp    11b7 <main+0x47>
xchg   %ax,%ax
xor    %eax,%eax
call   1080 <delete@plt>
jmp    11b7 <main+0x47>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"1.insert element to the queue \0A\00"
@.str.1 = [30 x i8] c"2.delete element from queue \0A\00"
@.str.2 = [33 x i8] c"3.dispaly all elements in queue\0A\00"
@.str.3 = [9 x i8] c"4.exit \0A\00"
@.str.4 = [26 x i8] c"please enter yout choice:\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [15 x i8] c"wrong choice \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2, %27
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%15 = load i32, i32* %6
switch i32 %15, label %25 [
i32 1, label %16
i32 2, label %19
i32 3, label %21
i32 4, label %23
]
16: ; preds = %8
%17 = load i8, i8* %7
%18 = call i32 @insert(i8 signext %17)
br label %27
19: ; preds = %8
%20 = call i32 (...) @delete()
br label %27
21: ; preds = %8
%22 = call i32 (...) @display()
br label %27
23: ; preds = %8
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %8
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %21, %19, %16
br label %8
}

LLVM IR (-O2):
@.str.4 = [26 x i8] c"please enter yout choice:\00"
@.str.5 = [3 x i8] c"%d\00"
@str = [31 x i8] c"1.insert element to the queue \00"
@str.7 = [29 x i8] c"2.delete element from queue \00"
@str.8 = [32 x i8] c"3.dispaly all elements in queue\00"
@str.9 = [8 x i8] c"4.exit \00"
@str.10 = [14 x i8] c"wrong choice \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %23, %2
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
switch i32 %12, label %21 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
]
13: ; preds = %5
%14 = call i32 @insert(i8 signext undef)
br label %23
15: ; preds = %5
%16 = call i32 (...) @delete()
br label %23
17: ; preds = %5
%18 = call i32 (...) @display()
br label %23
19: ; preds = %5
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %5
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
br label %23
23: ; preds = %21, %17, %15, %13
br label %5
}