#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*/ printf(char *);
int /*<<< orphan*/ push();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ch;
  while (ch != 6) {
    printf("1 for Push\n");
    printf("2 for Pop\n");
    printf("3 for Peep\n");
    printf("4 for Change\n");
    printf("5 for Display\n");
    printf("6 for exit\n");
    printf("Enter ur choice:");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      push();
      break;
    case 5:
      display();
      break;
    case 6:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     1215 <main+0xd5>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11f3 <main+0xb3>
jmp    11d1 <main+0x91>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     11ff <main+0xbf>
jmp    11e2 <main+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     120b <main+0xcb>
jmp    1210 <main+0xd0>
mov    $0x0,%al
call   1060 <push@plt>
jmp    1210 <main+0xd0>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1210 <main+0xd0>
jmp    1210 <main+0xd0>
jmp    114f <main+0xf>
mov    -0x4(%rbp),%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    0xed2(%rip),%r13
lea    0xed8(%rip),%rbx
lea    0xedf(%rip),%rbp
lea    0xe89(%rip),%r14
lea    0xe93(%rip),%r15
lea    0x4(%rsp),%r12
jmp    11a0 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <display@plt>
mov    0x4(%rsp),%eax
cmp    $0x6,%eax
je     1206 <main+0xb6>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
je     1190 <main+0x40>
cmp    $0x1,%eax
jne    119b <main+0x4b>
xor    %eax,%eax
call   1070 <push@plt>
jmp    1197 <main+0x47>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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