#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*/ convert(char *, char *);
double evaluate(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ test(char *, char *);
int main(int argc, char **argv) {
  char infix[128];
  char postfix[256];
  test(infix, postfix);
  if (argc > 1) {
    strcpy(infix, argv[1]);
  }
  convert(infix, postfix);
  printf("Infix expression is   :[%s]\n", infix);
  printf("Postfix expression is :[%s]\n", postfix);
  printf("Evaluation is         :[%.2f]\n", evaluate(postfix));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1070 <test@plt>
cmpl   $0x1,-0x8(%rbp)
jle    119a <main+0x4a>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1030 <convert@plt>
lea    -0x90(%rbp),%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x190(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1060 <evaluate@plt>
lea    0xe50(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x188,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
lea    0x80(%rsp),%rsi
call   1070 <test@plt>
cmp    $0x2,%ebp
jl     117f <main+0x2f>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%rbx
lea    0x80(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <convert@plt>
lea    0xe64(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe70(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1060 <evaluate@plt>
lea    0xe74(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x188,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Infix expression is :[%s]\0A\00"
@.str.1 = [29 x i8] c"Postfix expression is :[%s]\0A\00"
@.str.2 = [31 x i8] c"Evaluation is :[%.2f]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
%7 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%10 = call i32 @test(i8* %8, i8* %9)
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %14, i8* %17)
br label %19
19: ; preds = %13, %2
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%22 = call i32 @convert(i8* %20, i8* %21)
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%28 = call double @evaluate(i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %28)
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [29 x i8] c"Infix expression is :[%s]\0A\00"
@.str.1 = [29 x i8] c"Postfix expression is :[%s]\0A\00"
@.str.2 = [31 x i8] c"Evaluation is :[%.2f]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = call i32 @test(i8* %5, i8* %6)
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %5, i8* %11)
br label %13
13: ; preds = %9, %2
%14 = call i32 @convert(i8* %5, i8* %6)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%17 = call double @evaluate(i8* %6)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %17)
ret i32 0
}