#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*/ runConverter(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char infix[40];
  strcpy(infix, "A + B - C");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  strcpy(infix, "W % X / Y * Z");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  strcpy(infix, "A + (B * (C ? D) / E) % F)");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  strcpy(infix, "A+(B-C)*(D*(E/F%G))");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  strcpy(infix, "A + (B - C * D) / E) % F)");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  strcpy(infix, "A + (B * (C - D) / E) % F");
  printf("\nINFIX   : %s\nPOSTFIX : ", infix);
  runConverter(infix);
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    -0x40(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    -0x40(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    -0x40(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    -0x40(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    -0x40(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <runConverter@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xeb2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
lea    0xeaa(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
lea    0xe78(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <runConverter@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"A + B - C\00"
@.str.1 = [25 x i8] c"\0AINFIX : %s\0APOSTFIX : \00"
@.str.2 = [14 x i8] c"W % X / Y * Z\00"
@.str.3 = [27 x i8] c"A + (B * (C ? D) / E) % F)\00"
@.str.4 = [20 x i8] c"A+(B-C)*(D*(E/F%G))\00"
@.str.5 = [26 x i8] c"A + (B - C * D) / E) % F)\00"
@.str.6 = [26 x i8] c"A + (B * (C - D) / E) % F\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [40 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%12 = call i32 @runConverter(i8* %11)
%13 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%18 = call i32 @runConverter(i8* %17)
%19 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%21 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%24 = call i32 @runConverter(i8* %23)
%25 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%27 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%30 = call i32 @runConverter(i8* %29)
%31 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%33 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%36 = call i32 @runConverter(i8* %35)
%37 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%39 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %39)
%41 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%42 = call i32 @runConverter(i8* %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"A + B - C\00"
@.str.1 = [25 x i8] c"\0AINFIX : %s\0APOSTFIX : \00"
@.str.2 = [14 x i8] c"W % X / Y * Z\00"
@.str.3 = [27 x i8] c"A + (B * (C ? D) / E) % F)\00"
@.str.4 = [20 x i8] c"A+(B-C)*(D*(E/F%G))\00"
@.str.5 = [26 x i8] c"A + (B - C * D) / E) % F)\00"
@.str.6 = [26 x i8] c"A + (B * (C - D) / E) % F\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @runConverter(i8* %4)
%8 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%10 = call i32 @runConverter(i8* %4)
%11 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%13 = call i32 @runConverter(i8* %4)
%14 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%16 = call i32 @runConverter(i8* %4)
%17 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%19 = call i32 @runConverter(i8* %4)
%20 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%22 = call i32 @runConverter(i8* %4)
%23 = call i32 @putchar(i32 10)
ret i32 0
}