#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*/ CreateValTbl(char *, int *);
int /*<<< orphan*/ CreateVarTbl(char *, char *);
scalar_t__ checkValidityOfExpression(char *);
int /*<<< orphan*/ convertToPostfix(char *, char *, char *, int *);
int /*<<< orphan*/ displayT(char *, int *);
int evalExp(char *, char *, int *, int *, int *);
int /*<<< orphan*/ getExp(char *);
int /*<<< orphan*/ initializeCStack(char *, int *);
int /*<<< orphan*/ initializeStack(int *, int *);
int /*<<< orphan*/ populateRpn(char *);
int /*<<< orphan*/ populateValTbl(int *, int);
int /*<<< orphan*/ populateVarTbl(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int pushC(char *, int, char);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char rpn[20], varTbl[20], opStack[20], ConRPN[20] = {0};
  int i, valTbl[20], oprStack[20], oprStackTop, opStackTop, bufferStackTop,
      conResponse, choice;
  printf("---------------Infix To Postfix---------------\n");
  do {
    initializeCStack(opStack, &opStackTop);
    opStackTop = pushC(opStack, opStackTop, '#');
    populateRpn(rpn);
    do {
      printf("\tPlease enter the Expression: ");
      getExp(rpn);
    } while (!checkValidityOfExpression(rpn));
    populateVarTbl(varTbl, 20);
    populateValTbl(valTbl, 20);
    initializeStack(oprStack, &oprStackTop);
    CreateVarTbl(rpn, varTbl);
    CreateValTbl(varTbl, valTbl);
    do {
      printf("\n\t1. Validate Expression\t2. Convert to postfix \t3. "
             "Evaluate\t0. Exit");
      printf("\n\tYour Choice?");
      scanf("%d", &choice);
      switch (choice) {
      case 1:
        if (checkValidityOfExpression(rpn))
          printf("\n\tThe expression is valid.");
        else
          printf("\n\tThe expression is invalid.");
        break;
      case 2:
        initializeStack(oprStack, &oprStackTop);
        initializeCStack(opStack, &opStackTop);
        opStackTop = pushC(opStack, opStackTop, '#');
        populateRpn(ConRPN);
        convertToPostfix(rpn, opStack, ConRPN, &opStackTop);
        printf("\n\tThe PostFix expression is: %s\n", ConRPN);
        break;
      case 3:
        initializeStack(oprStack, &oprStackTop);
        initializeCStack(opStack, &opStackTop);
        opStackTop = pushC(opStack, opStackTop, '#');
        populateRpn(ConRPN);
        convertToPostfix(rpn, opStack, ConRPN, &opStackTop);
        printf("\n\tThe variable table is: \n");
        displayT(varTbl, valTbl);
        printf("\n\tThe evaluated expression is: %d\n",
               evalExp(ConRPN, varTbl, valTbl, oprStack, &oprStackTop));
        break;
      }
    } while (choice != 0);
    printf("\n\tEnter 0 to exit and 1 to continue!");
    scanf("%d", &conResponse);
  } while (conResponse != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x138(%rbp),%rsi
call   1070 <initializeCStack@plt>
lea    -0x60(%rbp),%rdi
mov    -0x138(%rbp),%esi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,-0x138(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <populateRpn@plt>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   10f0 <getExp@plt>
lea    -0x20(%rbp),%rdi
call   10b0 <checkValidityOfExpression@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1263 <main+0x63>
lea    -0x40(%rbp),%rdi
mov    $0x14,%esi
call   1100 <populateVarTbl@plt>
lea    -0xe0(%rbp),%rdi
mov    $0x14,%esi
call   1090 <populateValTbl@plt>
lea    -0x130(%rbp),%rdi
lea    -0x134(%rbp),%rsi
call   10d0 <initializeStack@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1120 <CreateVarTbl@plt>
lea    -0x40(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1110 <CreateValTbl@plt>
lea    0xd65(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x149(%rbp)
call   1050 <printf@plt>
mov    -0x149(%rbp),%al
lea    0xd8f(%rip),%rdi
call   1050 <printf@plt>
lea    0xd92(%rip),%rdi
lea    -0x144(%rbp),%rsi
call   10e0 <scanf@plt>
mov    -0x144(%rbp),%eax
mov    %eax,-0x148(%rbp)
sub    $0x1,%eax
je     135e <main+0x15e>
jmp    1336 <main+0x136>
mov    -0x148(%rbp),%eax
sub    $0x2,%eax
je     1397 <main+0x197>
jmp    134a <main+0x14a>
mov    -0x148(%rbp),%eax
sub    $0x3,%eax
je     140c <main+0x20c>
jmp    14ba <main+0x2ba>
lea    -0x20(%rbp),%rdi
call   10b0 <checkValidityOfExpression@plt>
cmp    $0x0,%rax
je     1384 <main+0x184>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1392 <main+0x192>
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14ba <main+0x2ba>
lea    -0x130(%rbp),%rdi
lea    -0x134(%rbp),%rsi
call   10d0 <initializeStack@plt>
lea    -0x60(%rbp),%rdi
lea    -0x138(%rbp),%rsi
call   1070 <initializeCStack@plt>
lea    -0x60(%rbp),%rdi
mov    -0x138(%rbp),%esi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,-0x138(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <populateRpn@plt>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0x138(%rbp),%rcx
call   10a0 <convertToPostfix@plt>
lea    -0x80(%rbp),%rsi
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14ba <main+0x2ba>
lea    -0x130(%rbp),%rdi
lea    -0x134(%rbp),%rsi
call   10d0 <initializeStack@plt>
lea    -0x60(%rbp),%rdi
lea    -0x138(%rbp),%rsi
call   1070 <initializeCStack@plt>
lea    -0x60(%rbp),%rdi
mov    -0x138(%rbp),%esi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,-0x138(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <populateRpn@plt>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0x138(%rbp),%rcx
call   10a0 <convertToPostfix@plt>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1060 <displayT@plt>
lea    -0x80(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0x130(%rbp),%rcx
lea    -0x134(%rbp),%r8
call   1040 <evalExp@plt>
mov    %eax,%esi
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14bf <main+0x2bf>
cmpl   $0x0,-0x144(%rbp)
jne    12e3 <main+0xe3>
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbc1(%rip),%rdi
lea    -0x140(%rbp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x0,-0x140(%rbp)
jne    1230 <main+0x30>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
lea    0x70(%rsp),%rbp
lea    0xde6(%rip),%r14
lea    0xe23(%rip),%r12
jmp    127a <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe0d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     14d0 <main+0x2d0>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1080 <initializeCStack@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,(%rsp)
mov    %rbp,%rdi
call   1030 <populateRpn@plt>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xd49(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
call   10f0 <getExp@plt>
mov    %rbp,%rdi
call   10b0 <checkValidityOfExpression@plt>
test   %rax,%rax
je     12b0 <main+0xb0>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1100 <populateVarTbl@plt>
lea    0xe0(%rsp),%r13
mov    %r13,%rdi
mov    $0x14,%esi
call   1090 <populateValTbl@plt>
lea    0x90(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   10d0 <initializeStack@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1120 <CreateVarTbl@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1110 <CreateValTbl@plt>
jmp    13a3 <main+0x1a3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x90(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   10d0 <initializeStack@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %rsp,%r13
mov    %r13,%rsi
call   1080 <initializeCStack@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,(%rsp)
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1030 <populateRpn@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
call   10a0 <convertToPostfix@plt>
lea    0xd20(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1250 <main+0x50>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10e0 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     1400 <main+0x200>
cmp    $0x2,%eax
je     1330 <main+0x130>
cmp    $0x1,%eax
jne    139b <main+0x19b>
mov    %rbp,%rdi
call   10b0 <checkValidityOfExpression@plt>
test   %rax,%rax
je     14bd <main+0x2bd>
lea    0xc7e(%rip),%rdi
jmp    14c4 <main+0x2c4>
nopl   0x0(%rax)
lea    0x90(%rsp),%r13
mov    %r13,%rdi
mov    %rbp,%r12
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   10d0 <initializeStack@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %rsp,%rbp
mov    %rbp,%rsi
call   1080 <initializeCStack@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
mov    $0x23,%edx
call   10c0 <pushC@plt>
mov    %eax,(%rsp)
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1030 <populateRpn@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
call   10a0 <convertToPostfix@plt>
lea    0xcdf(%rip),%rdi
call   1040 <puts@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
lea    0xe0(%rsp),%rbp
mov    %rbp,%rsi
call   1070 <displayT@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
mov    %r14,%r8
mov    %r12,%rbp
lea    0xbc7(%rip),%r12
lea    0xb7c(%rip),%r14
call   1050 <evalExp@plt>
lea    0xc1f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1397 <main+0x197>
lea    0xbcc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1397 <main+0x197>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"---------------Infix To Postfix---------------\0A\00"
@.str.1 = [31 x i8] c"\09Please enter the Expression: \00"
@.str.2 = [68 x i8] c"\0A\091. Validate Expression\092. Convert to postfix \093. Evaluate\090. Exit\00"
@.str.3 = [15 x i8] c"\0A\09Your Choice?\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [27 x i8] c"\0A\09The expression is valid.\00"
@.str.6 = [29 x i8] c"\0A\09The expression is invalid.\00"
@.str.7 = [33 x i8] c"\0A\09The PostFix expression is: %s\0A\00"
@.str.8 = [27 x i8] c"\0A\09The variable table is: \0A\00"
@.str.9 = [35 x i8] c"\0A\09The evaluated expression is: %d\0A\00"
@.str.10 = [37 x i8] c"\0A\09Enter 0 to exit and 1 to continue!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = alloca [20 x i8]
%6 = alloca i32
%7 = alloca [20 x i32]
%8 = alloca [20 x i32]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
%14 = bitcast [20 x i8]* %5 to i8*
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %107, %0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%18 = call i32 @initializeCStack(i8* %17, i32* %10)
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%20 = load i32, i32* %10
%21 = call i32 @pushC(i8* %19, i32 %20, i8 signext 35)
store i32 %21, i32* %10
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%23 = call i32 @populateRpn(i8* %22)
br label %24
24: ; preds = %28, %16
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%27 = call i32 @getExp(i8* %26)
br label %28
28: ; preds = %24
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%30 = call i64 @checkValidityOfExpression(i8* %29)
%31 = icmp ne i64 %30, 0
%32 = xor i1 %31, true
br i1 %32, label %24, label %33
33: ; preds = %28
%34 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%35 = call i32 @populateVarTbl(i8* %34, i32 20)
%36 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%37 = call i32 @populateValTbl(i32* %36, i32 20)
%38 = getelementptr inbounds [20 x i32], [20 x i32]* %8, i64 0, i64 0
%39 = call i32 @initializeStack(i32* %38, i32* %9)
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%42 = call i32 @CreateVarTbl(i8* %40, i8* %41)
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%44 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%45 = call i32 @CreateValTbl(i8* %43, i32* %44)
br label %46
46: ; preds = %101, %33
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %13)
%50 = load i32, i32* %13
switch i32 %50, label %100 [
i32 1, label %51
i32 2, label %60
i32 3, label %76
]
51: ; preds = %46
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%53 = call i64 @checkValidityOfExpression(i8* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %59
57: ; preds = %51
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %59
59: ; preds = %57, %55
br label %100
60: ; preds = %46
%61 = getelementptr inbounds [20 x i32], [20 x i32]* %8, i64 0, i64 0
%62 = call i32 @initializeStack(i32* %61, i32* %9)
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%64 = call i32 @initializeCStack(i8* %63, i32* %10)
%65 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%66 = load i32, i32* %10
%67 = call i32 @pushC(i8* %65, i32 %66, i8 signext 35)
store i32 %67, i32* %10
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%69 = call i32 @populateRpn(i8* %68)
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%71 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%72 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%73 = call i32 @convertToPostfix(i8* %70, i8* %71, i8* %72, i32* %10)
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %74)
br label %100
76: ; preds = %46
%77 = getelementptr inbounds [20 x i32], [20 x i32]* %8, i64 0, i64 0
%78 = call i32 @initializeStack(i32* %77, i32* %9)
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%80 = call i32 @initializeCStack(i8* %79, i32* %10)
%81 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%82 = load i32, i32* %10
%83 = call i32 @pushC(i8* %81, i32 %82, i8 signext 35)
store i32 %83, i32* %10
%84 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%85 = call i32 @populateRpn(i8* %84)
%86 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%87 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%89 = call i32 @convertToPostfix(i8* %86, i8* %87, i8* %88, i32* %10)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%92 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%93 = call i32 @displayT(i8* %91, i32* %92)
%94 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%95 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%96 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%97 = getelementptr inbounds [20 x i32], [20 x i32]* %8, i64 0, i64 0
%98 = call i32 @evalExp(i8* %94, i8* %95, i32* %96, i32* %97, i32* %9)
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i32 %98)
br label %100
100: ; preds = %46, %76, %60, %59
br label %101
101: ; preds = %100
%102 = load i32, i32* %13
%103 = icmp ne i32 %102, 0
br i1 %103, label %46, label %104
104: ; preds = %101
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%106 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %12)
br label %107
107: ; preds = %104
%108 = load i32, i32* %12
%109 = icmp ne i32 %108, 0
br i1 %109, label %16, label %110
110: ; preds = %107
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"\09Please enter the Expression: \00"
@.str.2 = [68 x i8] c"\0A\091. Validate Expression\092. Convert to postfix \093. Evaluate\090. Exit\00"
@.str.3 = [15 x i8] c"\0A\09Your Choice?\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [27 x i8] c"\0A\09The expression is valid.\00"
@.str.6 = [29 x i8] c"\0A\09The expression is invalid.\00"
@.str.7 = [33 x i8] c"\0A\09The PostFix expression is: %s\0A\00"
@.str.9 = [35 x i8] c"\0A\09The evaluated expression is: %d\0A\00"
@.str.10 = [37 x i8] c"\0A\09Enter 0 to exit and 1 to continue!\00"
@str = [47 x i8] c"---------------Infix To Postfix---------------\00"
@str.11 = [26 x i8] c"\0A\09The variable table is: \00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = alloca [20 x i32]
%6 = alloca [20 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%15 = bitcast [20 x i32]* %5 to i8*
%16 = bitcast [20 x i32]* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = bitcast i32* %9 to i8*
%20 = bitcast i32* %10 to i8*
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 0
%23 = getelementptr inbounds [20 x i32], [20 x i32]* %6, i64 0, i64 0
br label %24
24: ; preds = %76, %0
%25 = call i32 @initializeCStack(i8* %13, i32* %8)
%26 = load i32, i32* %8
%27 = call i32 @pushC(i8* %13, i32 %26, i8 signext 35)
store i32 %27, i32* %8
%28 = call i32 @populateRpn(i8* %11)
br label %29
29: ; preds = %29, %24
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @getExp(i8* %11)
%32 = call i64 @checkValidityOfExpression(i8* %11)
%33 = icmp eq i64 %32, 0
br i1 %33, label %29, label %34
34: ; preds = %29
%35 = call i32 @populateVarTbl(i8* %12, i32 20)
%36 = call i32 @populateValTbl(i32* %22, i32 20)
%37 = call i32 @initializeStack(i32* %23, i32* %7)
%38 = call i32 @CreateVarTbl(i8* %11, i8* %12)
%39 = call i32 @CreateValTbl(i8* %12, i32* %22)
br label %40
40: ; preds = %73, %34
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %10)
%44 = load i32, i32* %10
switch i32 %44, label %73 [
i32 1, label %45
i32 2, label %52
i32 3, label %60
]
45: ; preds = %40
%46 = call i64 @checkValidityOfExpression(i8* %11)
%47 = icmp eq i64 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %71
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %71
52: ; preds = %40
%53 = call i32 @initializeStack(i32* %23, i32* %7)
%54 = call i32 @initializeCStack(i8* %13, i32* %8)
%55 = load i32, i32* %8
%56 = call i32 @pushC(i8* %13, i32 %55, i8 signext 35)
store i32 %56, i32* %8
%57 = call i32 @populateRpn(i8* %14)
%58 = call i32 @convertToPostfix(i8* %11, i8* %13, i8* %14, i32* %8)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %14)
br label %71
60: ; preds = %40
%61 = call i32 @initializeStack(i32* %23, i32* %7)
%62 = call i32 @initializeCStack(i8* %13, i32* %8)
%63 = load i32, i32* %8
%64 = call i32 @pushC(i8* %13, i32 %63, i8 signext 35)
store i32 %64, i32* %8
%65 = call i32 @populateRpn(i8* %14)
%66 = call i32 @convertToPostfix(i8* %11, i8* %13, i8* %14, i32* %8)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0))
%68 = call i32 @displayT(i8* %12, i32* %22)
%69 = call i32 @evalExp(i8* %14, i8* %12, i32* %22, i32* %23, i32* %7)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %48, %50, %60, %52
%72 = load i32, i32* %10
br label %73
73: ; preds = %71, %40
%74 = phi i32 [ %72, %71 ], [ %44, %40 ]
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %40
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%78 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %9)
%79 = load i32, i32* %9
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %24
81: ; preds = %76
ret i32 0
}