#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ yyparse();
main() {
  printf("\n--------------------------- ARITHMETIC EXPRESSION PARSER "
         "---------------------------\n");
  char ch;
  do {
    printf("\nEnter a  expression :\n");
    yyparse();
    printf("\nDo you wanna continue :  (y/n)\n");
    scanf(" %c", &ch);
  } while (ch == 'y' || ch == 'Y');
  printf("\n--------------------------- USER REQUESTED EXIT "
         "---------------------------\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
lea    0xf0a(%rip),%rdi
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x6(%rbp)
je     1199 <main+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    114b <main+0x1b>
lea    0xee9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%r14
lea    0xf1f(%rip),%r15
lea    0xea7(%rip),%r12
lea    0x7(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <yyparse@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movzbl 0x7(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
je     1160 <main+0x30>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [87 x i8] c"\0A--------------------------- ARITHMETIC EXPRESSION PARSER ---------------------------\0A\00"
@.str.1 = [24 x i8] c"\0AEnter a expression :\0A\00"
@.str.2 = [33 x i8] c"\0ADo you wanna continue : (y/n)\0A\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [79 x i8] c"\0A--------------------------- USER REQUESTED EXIT ---------------------------\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %17, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @yyparse()
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %9
9: ; preds = %4
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 89
br label %17
17: ; preds = %13, %9
%18 = phi i1 [ true, %9 ], [ %16, %13 ]
br i1 %18, label %4, label %19
19: ; preds = %17
%20 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c" %c\00"
@str = [86 x i8] c"\0A--------------------------- ARITHMETIC EXPRESSION PARSER ---------------------------\00"
@str.5 = [23 x i8] c"\0AEnter a expression :\00"
@str.6 = [32 x i8] c"\0ADo you wanna continue : (y/n)\00"
@str.7 = [78 x i8] c"\0A--------------------------- USER REQUESTED EXIT ---------------------------\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
%5 = call i32 (...) @yyparse()
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = and i8 %8, -33
%10 = icmp eq i8 %9, 89
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}