#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int checkStringNotation(char *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ imbalancedParentheses(char *);
char *infixToPostfix(char *);
char *infixToPrefix(char *);
char *postfixToX(char *, int);
char *prefixToX(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void parseInput(char *inputString, char *outputFileString) {
  FILE *outputFile;
  int choice;
  outputFile = fopen(outputFileString, "a");
  if (imbalancedParentheses(inputString)) {
    printf("\n");
    return;
  }
  printf("\nReceived input: %s\n", inputString);
  switch (checkStringNotation(inputString)) {
  case 2:
    printf("--------------------------------\n");
    printf("Received input is an infix string. Options:\n");
    printf("1) Convert to postfix string\n");
    printf("2) Convert to prefix string\n");
    printf("3) Convert to both postfix and prefix strings\n");
    printf("\nEnter your choice: ");
    scanf("%d", &choice);
    if (choice == 1) {
      printf("Postfix notation: %s\n", infixToPostfix(inputString));
    } else if (choice == 2) {
      printf("Prefix notation: %s\n", infixToPrefix(inputString));
    } else if (choice == 3) {
      printf("Postfix notation: %s\n", infixToPostfix(inputString));
      printf("Prefix notation: %s\n", infixToPrefix(inputString));
    } else {
      printf("Invalid choice.\n");
    }
    break;
  case 1:
    printf("--------------------------------\n");
    printf("It seems that the received input is a prefix string. Options:\n");
    printf("1) Convert to infix string\n");
    printf("2) Convert to postfix string\n");
    printf("3) Convert to both infix and postfix strings\n");
    printf("\nEnter your choice: ");
    scanf("%d", &choice);
    if (choice == 1) {
      printf("Infix notation: %s\n", prefixToX(inputString, 2));
    } else if (choice == 2) {
      printf("Prefix notation: %s\n", prefixToX(inputString, 3));
    } else if (choice == 3) {
      printf("Infix notation: %s\n", prefixToX(inputString, 2));
      printf("Prefix notation: %s\n", prefixToX(inputString, 3));
    } else {
      printf("Invalid choice.\n");
    }
    break;
  case 3:
    printf("--------------------------------\n");
    printf("It seems that the received input is a postfix string. Options:\n");
    printf("1) Convert to infix string\n");
    printf("2) Convert to prefix string\n");
    printf("3) Convert to both infix and prefix strings\n");
    printf("\nEnter your choice: ");
    scanf("%d", &choice);
    if (choice == 1) {
      printf("Infix notation: %s\n", postfixToX(inputString, 2));
    } else if (choice == 2) {
      printf("Prefix notation: %s\n", postfixToX(inputString, 1));
    } else if (choice == 3) {
      printf("Infix notation: %s\n", postfixToX(inputString, 2));
      printf("Prefix notation: %s\n", postfixToX(inputString, 1));
    } else {
      printf("Invalid choice.\n");
    }
    break;
  }
}


x86 assembly (clang, -O0):
<parseInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <imbalancedParentheses@plt>
cmp    $0x0,%rax
je     11da <parseInput+0x4a>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1594 <parseInput+0x404>
mov    -0x8(%rbp),%rsi
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <checkStringNotation@plt>
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
sub    $0x1,%eax
je     1340 <parseInput+0x1b0>
jmp    1208 <parseInput+0x78>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     122a <parseInput+0x9a>
jmp    1219 <parseInput+0x89>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     146a <parseInput+0x2da>
jmp    1594 <parseInput+0x404>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    12b7 <parseInput+0x127>
mov    -0x8(%rbp),%rdi
call   1070 <infixToPostfix@plt>
mov    %rax,%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133b <parseInput+0x1ab>
cmpl   $0x2,-0x1c(%rbp)
jne    12e0 <parseInput+0x150>
mov    -0x8(%rbp),%rdi
call   1080 <infixToPrefix@plt>
mov    %rax,%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1336 <parseInput+0x1a6>
cmpl   $0x3,-0x1c(%rbp)
jne    1323 <parseInput+0x193>
mov    -0x8(%rbp),%rdi
call   1070 <infixToPostfix@plt>
mov    %rax,%rsi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1080 <infixToPrefix@plt>
mov    %rax,%rsi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1331 <parseInput+0x1a1>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1336 <parseInput+0x1a6>
jmp    133b <parseInput+0x1ab>
jmp    1594 <parseInput+0x404>
lea    0xcd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd4a(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    13d2 <parseInput+0x242>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <prefixToX@plt>
mov    %rax,%rsi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1465 <parseInput+0x2d5>
cmpl   $0x2,-0x1c(%rbp)
jne    1400 <parseInput+0x270>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1060 <prefixToX@plt>
mov    %rax,%rsi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1460 <parseInput+0x2d0>
cmpl   $0x3,-0x1c(%rbp)
jne    144d <parseInput+0x2bd>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <prefixToX@plt>
mov    %rax,%rsi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1060 <prefixToX@plt>
mov    %rax,%rsi
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    145b <parseInput+0x2cb>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1460 <parseInput+0x2d0>
jmp    1465 <parseInput+0x2d5>
jmp    1594 <parseInput+0x404>
lea    0xba6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbe9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc20(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    14fc <parseInput+0x36c>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1050 <postfixToX@plt>
mov    %rax,%rsi
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    158f <parseInput+0x3ff>
cmpl   $0x2,-0x1c(%rbp)
jne    152a <parseInput+0x39a>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <postfixToX@plt>
mov    %rax,%rsi
lea    0xbe0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    158a <parseInput+0x3fa>
cmpl   $0x3,-0x1c(%rbp)
jne    1577 <parseInput+0x3e7>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1050 <postfixToX@plt>
mov    %rax,%rsi
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <postfixToX@plt>
mov    %rax,%rsi
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1585 <parseInput+0x3f5>
lea    0xb95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    158a <parseInput+0x3fa>
jmp    158f <parseInput+0x3ff>
jmp    1594 <parseInput+0x404>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInput>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xe3e(%rip),%rsi
mov    %rax,%rdi
call   10c0 <fopen@plt>
mov    %rbx,%rdi
call   1060 <imbalancedParentheses@plt>
test   %rax,%rax
je     11e6 <parseInput+0x36>
mov    $0xa,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xe15(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10d0 <checkStringNotation@plt>
cmp    $0x1,%eax
je     12a8 <parseInput+0xf8>
cmp    $0x3,%eax
je     133b <parseInput+0x18b>
cmp    $0x2,%eax
jne    1467 <parseInput+0x2b7>
lea    0xf5b(%rip),%rdi
call   1040 <puts@plt>
lea    0xf70(%rip),%rdi
call   1040 <puts@plt>
lea    0xf90(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa1(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xdba(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
je     13db <parseInput+0x22b>
cmp    $0x2,%eax
je     13f4 <parseInput+0x244>
cmp    $0x1,%eax
jne    13ca <parseInput+0x21a>
mov    %rbx,%rdi
call   1090 <infixToPostfix@plt>
lea    0xd8c(%rip),%rdi
jmp    145d <parseInput+0x2ad>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe1e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
lea    0xd2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd33(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
je     13fe <parseInput+0x24e>
cmp    $0x2,%eax
je     141c <parseInput+0x26c>
cmp    $0x1,%eax
jne    13ca <parseInput+0x21a>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1080 <prefixToX@plt>
lea    0xd24(%rip),%rdi
jmp    145d <parseInput+0x2ad>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
lea    0xd20(%rip),%rdi
call   1040 <puts@plt>
lea    0xdbd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
lea    0xd3b(%rip),%rdi
call   1040 <puts@plt>
lea    0xc99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xca0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
je     142b <parseInput+0x27b>
cmp    $0x2,%eax
je     1449 <parseInput+0x299>
cmp    $0x1,%eax
jne    13ca <parseInput+0x21a>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <postfixToX@plt>
lea    0xc95(%rip),%rdi
jmp    145d <parseInput+0x2ad>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
jmp    1467 <parseInput+0x2b7>
mov    %rbx,%rdi
call   1090 <infixToPostfix@plt>
lea    0xc45(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <infixToPrefix@plt>
jmp    1456 <parseInput+0x2a6>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1080 <prefixToX@plt>
lea    0xc48(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1080 <prefixToX@plt>
jmp    1456 <parseInput+0x2a6>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <postfixToX@plt>
lea    0xc1b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <postfixToX@plt>
lea    0xbe8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [21 x i8] c"\0AReceived input: %s\0A\00"
@.str.3 = [34 x i8] c"--------------------------------\0A\00"
@.str.4 = [45 x i8] c"Received input is an infix string. Options:\0A\00"
@.str.5 = [30 x i8] c"1) Convert to postfix string\0A\00"
@.str.6 = [29 x i8] c"2) Convert to prefix string\0A\00"
@.str.7 = [47 x i8] c"3) Convert to both postfix and prefix strings\0A\00"
@.str.8 = [21 x i8] c"\0AEnter your choice: \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [22 x i8] c"Postfix notation: %s\0A\00"
@.str.11 = [21 x i8] c"Prefix notation: %s\0A\00"
@.str.12 = [17 x i8] c"Invalid choice.\0A\00"
@.str.13 = [63 x i8] c"It seems that the received input is a prefix string. Options:\0A\00"
@.str.14 = [28 x i8] c"1) Convert to infix string\0A\00"
@.str.15 = [30 x i8] c"2) Convert to postfix string\0A\00"
@.str.16 = [46 x i8] c"3) Convert to both infix and postfix strings\0A\00"
@.str.17 = [20 x i8] c"Infix notation: %s\0A\00"
@.str.18 = [64 x i8] c"It seems that the received input is a postfix string. Options:\0A\00"
@.str.19 = [45 x i8] c"3) Convert to both infix and prefix strings\0A\00"
define void @parseInput(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i8*, i8** %3
%10 = call i64 @imbalancedParentheses(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %127
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %3
%18 = call i32 @checkStringNotation(i8* %17)
switch i32 %18, label %127 [
i32 2, label %19
i32 1, label %55
i32 3, label %91
]
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %6)
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %33
29: ; preds = %19
%30 = load i8*, i8** %3
%31 = call i8* @infixToPostfix(i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %31)
br label %54
33: ; preds = %19
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i8*, i8** %3
%38 = call i8* @infixToPrefix(i8* %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %38)
br label %53
40: ; preds = %33
%41 = load i32, i32* %6
%42 = icmp eq i32 %41, 3
br i1 %42, label %43, label %50
43: ; preds = %40
%44 = load i8*, i8** %3
%45 = call i8* @infixToPostfix(i8* %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %45)
%47 = load i8*, i8** %3
%48 = call i8* @infixToPrefix(i8* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %48)
br label %52
50: ; preds = %40
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %52
52: ; preds = %50, %43
br label %53
53: ; preds = %52, %36
br label %54
54: ; preds = %53, %29
br label %127
55: ; preds = %14
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.13, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %6)
%63 = load i32, i32* %6
%64 = icmp eq i32 %63, 1
br i1 %64, label %65, label %69
65: ; preds = %55
%66 = load i8*, i8** %3
%67 = call i8* @prefixToX(i8* %66, i32 2)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %67)
br label %90
69: ; preds = %55
%70 = load i32, i32* %6
%71 = icmp eq i32 %70, 2
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load i8*, i8** %3
%74 = call i8* @prefixToX(i8* %73, i32 3)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %74)
br label %89
76: ; preds = %69
%77 = load i32, i32* %6
%78 = icmp eq i32 %77, 3
br i1 %78, label %79, label %86
79: ; preds = %76
%80 = load i8*, i8** %3
%81 = call i8* @prefixToX(i8* %80, i32 2)
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %81)
%83 = load i8*, i8** %3
%84 = call i8* @prefixToX(i8* %83, i32 3)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %84)
br label %88
86: ; preds = %76
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %88
88: ; preds = %86, %79
br label %89
89: ; preds = %88, %72
br label %90
90: ; preds = %89, %65
br label %127
91: ; preds = %14
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.18, i64 0, i64 0))
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.19, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%98 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %6)
%99 = load i32, i32* %6
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %105
101: ; preds = %91
%102 = load i8*, i8** %3
%103 = call i8* @postfixToX(i8* %102, i32 2)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %103)
br label %126
105: ; preds = %91
%106 = load i32, i32* %6
%107 = icmp eq i32 %106, 2
br i1 %107, label %108, label %112
108: ; preds = %105
%109 = load i8*, i8** %3
%110 = call i8* @postfixToX(i8* %109, i32 1)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %110)
br label %125
112: ; preds = %105
%113 = load i32, i32* %6
%114 = icmp eq i32 %113, 3
br i1 %114, label %115, label %122
115: ; preds = %112
%116 = load i8*, i8** %3
%117 = call i8* @postfixToX(i8* %116, i32 2)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %117)
%119 = load i8*, i8** %3
%120 = call i8* @postfixToX(i8* %119, i32 1)
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %120)
br label %124
122: ; preds = %112
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %124
124: ; preds = %122, %115
br label %125
125: ; preds = %124, %108
br label %126
126: ; preds = %125, %101
br label %127
127: ; preds = %12, %14, %126, %90, %54
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.2 = [21 x i8] c"\0AReceived input: %s\0A\00"
@.str.8 = [21 x i8] c"\0AEnter your choice: \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [22 x i8] c"Postfix notation: %s\0A\00"
@.str.11 = [21 x i8] c"Prefix notation: %s\0A\00"
@.str.17 = [20 x i8] c"Infix notation: %s\0A\00"
@str.20 = [63 x i8] c"It seems that the received input is a postfix string. Options:\00"
@str.23 = [44 x i8] c"3) Convert to both infix and prefix strings\00"
@str.26 = [62 x i8] c"It seems that the received input is a prefix string. Options:\00"
@str.27 = [27 x i8] c"1) Convert to infix string\00"
@str.28 = [29 x i8] c"2) Convert to postfix string\00"
@str.29 = [45 x i8] c"3) Convert to both infix and postfix strings\00"
@str.31 = [33 x i8] c"--------------------------------\00"
@str.32 = [44 x i8] c"Received input is an infix string. Options:\00"
@str.33 = [29 x i8] c"1) Convert to postfix string\00"
@str.34 = [28 x i8] c"2) Convert to prefix string\00"
@str.35 = [46 x i8] c"3) Convert to both postfix and prefix strings\00"
@str.36 = [16 x i8] c"Invalid choice.\00"
define void @parseInput(i8* %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 @imbalancedParentheses(i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @putchar(i32 10)
br label %79
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%12 = tail call i32 @checkStringNotation(i8* %0)
switch i32 %12, label %79 [
i32 2, label %13
i32 1, label %35
i32 3, label %57
]
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.31, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.32, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.33, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.34, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.35, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%21 = load i32, i32* %3
switch i32 %21, label %33 [
i32 1, label %22
i32 2, label %25
i32 3, label %28
]
22: ; preds = %13
%23 = call i8* @infixToPostfix(i8* %0)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %23)
br label %79
25: ; preds = %13
%26 = call i8* @infixToPrefix(i8* %0)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %26)
br label %79
28: ; preds = %13
%29 = call i8* @infixToPostfix(i8* %0)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %29)
%31 = call i8* @infixToPrefix(i8* %0)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %31)
br label %79
33: ; preds = %13
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.36, i64 0, i64 0))
br label %79
35: ; preds = %10
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.31, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.26, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.27, i64 0, i64 0))
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.28, i64 0, i64 0))
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.29, i64 0, i64 0))
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%43 = load i32, i32* %3
switch i32 %43, label %55 [
i32 1, label %44
i32 2, label %47
i32 3, label %50
]
44: ; preds = %35
%45 = call i8* @prefixToX(i8* %0, i32 2)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %45)
br label %79
47: ; preds = %35
%48 = call i8* @prefixToX(i8* %0, i32 3)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %48)
br label %79
50: ; preds = %35
%51 = call i8* @prefixToX(i8* %0, i32 2)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %51)
%53 = call i8* @prefixToX(i8* %0, i32 3)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %53)
br label %79
55: ; preds = %35
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.36, i64 0, i64 0))
br label %79
57: ; preds = %10
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.31, i64 0, i64 0))
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.20, i64 0, i64 0))
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.27, i64 0, i64 0))
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.34, i64 0, i64 0))
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.23, i64 0, i64 0))
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%64 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%65 = load i32, i32* %3
switch i32 %65, label %77 [
i32 1, label %66
i32 2, label %69
i32 3, label %72
]
66: ; preds = %57
%67 = call i8* @postfixToX(i8* %0, i32 2)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %67)
br label %79
69: ; preds = %57
%70 = call i8* @postfixToX(i8* %0, i32 1)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %70)
br label %79
72: ; preds = %57
%73 = call i8* @postfixToX(i8* %0, i32 2)
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %73)
%75 = call i8* @postfixToX(i8* %0, i32 1)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %75)
br label %79
77: ; preds = %57
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.36, i64 0, i64 0))
br label %79
79: ; preds = %10, %25, %33, %28, %22, %47, %55, %50, %44, %69, %77, %72, %66, %8
ret void
}