#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*/ display();
int /*<<< orphan*/ pop();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push();
int /*<<< orphan*/ scanf(char *, ...);
void main() {
  int c;
  char ch, t;
  do {
    printf("\n1.Insert \t 2.Delete \t 3.Display");
    printf("\n Enter your choice:");
    scanf("%d", &c);
    switch (c) {
    case 1:
      push();
      break;
    case 2:
      pop();
      break;
    case 3:
      display();
      break;
    default:
      printf("\nEnter choice as 1,2 or 3");
    }
    printf("\nDo you want to continue(y:yes/n:no)");
    scanf("%c", &t);
    scanf("%c", &ch);
  } while (ch == 'y' || ch == 'Y');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11b8 <main+0x68>
jmp    1196 <main+0x46>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11c4 <main+0x74>
jmp    11a7 <main+0x57>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11d0 <main+0x80>
jmp    11dc <main+0x8c>
mov    $0x0,%al
call   1070 <push@plt>
jmp    11e8 <main+0x98>
mov    $0x0,%al
call   1050 <pop@plt>
jmp    11e8 <main+0x98>
mov    $0x0,%al
call   1030 <display@plt>
jmp    11e8 <main+0x98>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
lea    -0x6(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe6b(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0xd(%rbp)
je     1237 <main+0xe7>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1158 <main+0x8>
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    0xed4(%rip),%r12
lea    0x4(%rsp),%r13
lea    0xee5(%rip),%rbx
lea    0xf03(%rip),%rbp
lea    0x3(%rsp),%r14
lea    0x2(%rsp),%r15
jmp    11c4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <pop@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movzbl 0x2(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
jne    1231 <main+0xe1>
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     1210 <main+0xc0>
cmp    $0x2,%eax
je     1190 <main+0x40>
cmp    $0x1,%eax
jne    1220 <main+0xd0>
xor    %eax,%eax
call   1070 <push@plt>
jmp    1197 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <display@plt>
jmp    1197 <main+0x47>
nopl   0x0(%rax)
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
jmp    1197 <main+0x47>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A1.Insert \09 2.Delete \09 3.Display\00"
@.str.1 = [21 x i8] c"\0A Enter your choice:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"\0AEnter choice as 1,2 or 3\00"
@.str.4 = [37 x i8] c"\0ADo you want to continue(y:yes/n:no)\00"
@.str.5 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
br label %4
4: ; preds = %29, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
switch i32 %8, label %15 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
]
9: ; preds = %4
%10 = call i32 (...) @push()
br label %17
11: ; preds = %4
%12 = call i32 (...) @pop()
br label %17
13: ; preds = %4
%14 = call i32 (...) @display()
br label %17
15: ; preds = %4
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
br label %21
21: ; preds = %17
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 121
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 89
br label %29
29: ; preds = %25, %21
%30 = phi i1 [ true, %21 ], [ %28, %25 ]
br i1 %30, label %4, label %31
31: ; preds = %29
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A1.Insert \09 2.Delete \09 3.Display\00"
@.str.1 = [21 x i8] c"\0A Enter your choice:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"\0AEnter choice as 1,2 or 3\00"
@.str.4 = [37 x i8] c"\0ADo you want to continue(y:yes/n:no)\00"
@.str.5 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
br label %5
5: ; preds = %18, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
switch i32 %9, label %16 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
]
10: ; preds = %5
%11 = call i32 (...) @push()
br label %18
12: ; preds = %5
%13 = call i32 (...) @pop()
br label %18
14: ; preds = %5
%15 = call i32 (...) @display()
br label %18
16: ; preds = %5
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%22 = load i8, i8* %2
%23 = and i8 %22, -33
%24 = icmp eq i8 %23, 89
br i1 %24, label %5, label %25
25: ; preds = %18
ret void
}