#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 */
char *malloc(int);
int /*<<< orphan*/ precedence(char);
size_t strlen(char *);
char *infixToPostfix(char *s) {
  int i;
  int j;
  char *out = malloc(sizeof(char) * 100);
  char *opStack = malloc(sizeof(char) * 100);
  for (i = 0; i < strlen(s); i++) {
    switch (s[i]) {
    case '^':
    case '/':
    case '*':
    case '+':
    case '-':
      if (opStack[strlen(opStack) - 1] == '(') {
        opStack[strlen(opStack)] = s[i];
      } else {
        for (j = strlen(opStack) - 1; j >= 0; j--) {
          if (opStack[j] == '(') {
            break;
          } else if ((s[i] == '^') &&
                     (precedence(s[i]) < precedence(opStack[j]))) {
            out[strlen(out)] = opStack[j];
            opStack[j] = '\0';
          } else if (precedence(s[i]) <= precedence(opStack[j])) {
            out[strlen(out)] = opStack[j];
            opStack[j] = '\0';
          }
        }
        opStack[strlen(opStack)] = s[i];
      }
      break;
    case '(':
      opStack[strlen(opStack)] = s[i];
      break;
    case ')':
      for (j = strlen(opStack); j >= 0; j--) {
        if (opStack[j] == '(') {
          opStack[j] = '\0';
          break;
        } else {
          out[strlen(out)] = opStack[j];
          opStack[j] = '\0';
        }
      }
      break;
    default:
      out[strlen(out)] = s[i];
      break;
    }
  }
  for (i = strlen(opStack) - 1; i >= 0; i--)
    out[strlen(out)] = opStack[i];
  return out;
}


x86 assembly (clang, -O0):
<infixToPostfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jae    14dc <infixToPostfix+0x3ac>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x28,%eax
je     13c2 <infixToPostfix+0x292>
jmp    11a0 <infixToPostfix+0x70>
mov    -0x2c(%rbp),%eax
sub    $0x29,%eax
je     13f9 <infixToPostfix+0x2c9>
jmp    11b1 <infixToPostfix+0x81>
mov    -0x2c(%rbp),%eax
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     11f8 <infixToPostfix+0xc8>
jmp    11c5 <infixToPostfix+0x95>
mov    -0x2c(%rbp),%eax
sub    $0x2d,%eax
je     11f8 <infixToPostfix+0xc8>
jmp    11d6 <infixToPostfix+0xa6>
mov    -0x2c(%rbp),%eax
sub    $0x2f,%eax
je     11f8 <infixToPostfix+0xc8>
jmp    11e7 <infixToPostfix+0xb7>
mov    -0x2c(%rbp),%eax
sub    $0x5e,%eax
jne    1491 <infixToPostfix+0x361>
jmp    11f8 <infixToPostfix+0xc8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x28,%eax
jne    1252 <infixToPostfix+0x122>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x41(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x41(%rbp),%dl
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
jmp    13bd <infixToPostfix+0x28d>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1391 <infixToPostfix+0x261>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x28,%eax
jne    1286 <infixToPostfix+0x156>
jmp    1391 <infixToPostfix+0x261>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5e,%eax
jne    130a <infixToPostfix+0x1da>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <precedence@plt>
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <precedence@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
cmp    %ecx,%eax
jge    130a <infixToPostfix+0x1da>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x51(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x51(%rbp),%dl
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1379 <infixToPostfix+0x249>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <precedence@plt>
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <precedence@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
cmp    %ecx,%eax
jg     1374 <infixToPostfix+0x244>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x61(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x61(%rbp),%dl
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1379 <infixToPostfix+0x249>
jmp    137e <infixToPostfix+0x24e>
jmp    1383 <infixToPostfix+0x253>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1262 <infixToPostfix+0x132>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x71(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x71(%rbp),%dl
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
jmp    14c9 <infixToPostfix+0x399>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x81(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x81(%rbp),%dl
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
jmp    14c9 <infixToPostfix+0x399>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     148c <infixToPostfix+0x35c>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x28,%eax
jne    1435 <infixToPostfix+0x305>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    148c <infixToPostfix+0x35c>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x91(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x91(%rbp),%dl
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    147e <infixToPostfix+0x34e>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1405 <infixToPostfix+0x2d5>
jmp    14c9 <infixToPostfix+0x399>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xa1(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xa1(%rbp),%dl
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
jmp    14ce <infixToPostfix+0x39e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <infixToPostfix+0x32>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     153c <infixToPostfix+0x40c>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb1(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xb1(%rbp),%dl
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    14ec <infixToPostfix+0x3bc>
mov    -0x18(%rbp),%rax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<infixToPostfix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r15
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    (%r15),%bpl
test   %bpl,%bpl
je     12fa <infixToPostfix+0x1ca>
xor    %r14d,%r14d
mov    %r15,0x10(%rsp)
nop
movsbl %bpl,%eax
add    $0xffffffd8,%eax
cmp    $0x36,%eax
ja     12c8 <infixToPostfix+0x198>
movabs $0x400000000000ac,%rcx
bt     %rax,%rcx
jae    11b0 <infixToPostfix+0x80>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
cmpb   $0x28,-0x1(%r12,%rax,1)
jne    1210 <infixToPostfix+0xe0>
mov    %bpl,(%r12,%rbx,1)
jmp    12e0 <infixToPostfix+0x1b0>
nopl   0x0(%rax)
test   %rax,%rax
je     12ba <infixToPostfix+0x18a>
cmp    $0x1,%rax
jne    12c8 <infixToPostfix+0x198>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
js     12e0 <infixToPostfix+0x1b0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ebx
movzbl (%r12,%rbx,1),%ebp
cmp    $0x28,%bpl
je     12d7 <infixToPostfix+0x1a7>
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %bpl,0x0(%r13,%rax,1)
movb   $0x0,(%r12,%rbx,1)
lea    -0x1(%rbx),%eax
test   %ebx,%ebx
jg     11e0 <infixToPostfix+0xb0>
jmp    12e0 <infixToPostfix+0x1b0>
nop
add    $0xffffffffffffffff,%rbx
test   %ebx,%ebx
js     12ba <infixToPostfix+0x18a>
mov    %r14,0x8(%rsp)
add    $0x1,%ebx
jmp    124b <infixToPostfix+0x11b>
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %r14b,0x0(%r13,%rax,1)
movb   $0x0,(%r12,%rbx,1)
test   %ebx,%ebx
mov    0x10(%rsp),%r15
jle    12b1 <infixToPostfix+0x181>
add    $0xffffffff,%ebx
movzbl (%r12,%rbx,1),%r14d
cmp    $0x28,%r14b
je     12b1 <infixToPostfix+0x181>
mov    0x8(%rsp),%rax
movzbl (%r15,%rax,1),%eax
movsbl %r14b,%r15d
cmp    $0x5e,%al
jne    1299 <infixToPostfix+0x169>
mov    $0x5e,%edi
call   1030 <precedence@plt>
mov    %r13,%rbp
mov    %eax,%r13d
mov    %r15d,%edi
call   1030 <precedence@plt>
cmp    %eax,%r13d
mov    %rbp,%r13
jl     1230 <infixToPostfix+0x100>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
movzbl (%rax,%rcx,1),%eax
movsbl %al,%edi
call   1030 <precedence@plt>
mov    %eax,%ebp
mov    %r15d,%edi
call   1030 <precedence@plt>
cmp    %eax,%ebp
jle    1230 <infixToPostfix+0x100>
jmp    1242 <infixToPostfix+0x112>
mov    0x8(%rsp),%r14
mov    (%r15,%r14,1),%bpl
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %bpl,(%r12,%rax,1)
jmp    12e0 <infixToPostfix+0x1b0>
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %bpl,0x0(%r13,%rax,1)
jmp    12e0 <infixToPostfix+0x1b0>
movb   $0x0,(%r12,%rbx,1)
nopl   0x0(%rax)
add    $0x1,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    %r14,%rax
jbe    12fa <infixToPostfix+0x1ca>
mov    (%r15,%r14,1),%bpl
jmp    1170 <infixToPostfix+0x40>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0xffffffff,%eax
js     132d <infixToPostfix+0x1fd>
mov    %eax,%eax
add    %rax,%r12
nop
movzbl (%r12),%ebp
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %bpl,0x0(%r13,%rax,1)
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%r12
test   %ebx,%ebx
jg     1310 <infixToPostfix+0x1e0>
mov    %r13,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @infixToPostfix(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %2
%7 = call i8* @malloc(i32 100)
store i8* %7, i8** %5
%8 = call i8* @malloc(i32 100)
store i8* %8, i8** %6
store i32 0, i32* %3
br label %9
9: ; preds = %199, %1
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = load i8*, i8** %2
%13 = call i64 @strlen(i8* %12)
%14 = icmp ult i64 %11, %13
br i1 %14, label %15, label %202
15: ; preds = %9
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %188 [
i32 94, label %22
i32 47, label %22
i32 42, label %22
i32 43, label %22
i32 45, label %22
i32 40, label %139
i32 41, label %149
]
22: ; preds = %15, %15, %15, %15, %15
%23 = load i8*, i8** %6
%24 = load i8*, i8** %6
%25 = call i64 @strlen(i8* %24)
%26 = sub i64 %25, 1
%27 = getelementptr inbounds i8, i8* %23, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 40
br i1 %30, label %31, label %41
31: ; preds = %22
%32 = load i8*, i8** %2
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = load i8*, i8** %6
%38 = load i8*, i8** %6
%39 = call i64 @strlen(i8* %38)
%40 = getelementptr inbounds i8, i8* %37, i64 %39
store i8 %36, i8* %40
br label %138
41: ; preds = %22
%42 = load i8*, i8** %6
%43 = call i64 @strlen(i8* %42)
%44 = sub i64 %43, 1
%45 = trunc i64 %44 to i32
store i32 %45, i32* %4
br label %46
46: ; preds = %125, %41
%47 = load i32, i32* %4
%48 = icmp sge i32 %47, 0
br i1 %48, label %49, label %128
49: ; preds = %46
%50 = load i8*, i8** %6
%51 = load i32, i32* %4
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 40
br i1 %56, label %57, label %58
57: ; preds = %49
br label %128
58: ; preds = %49
%59 = load i8*, i8** %2
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %59, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 94
br i1 %65, label %66, label %94
66: ; preds = %58
%67 = load i8*, i8** %2
%68 = load i32, i32* %3
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %67, i64 %69
%71 = load i8, i8* %70
%72 = call i32 @precedence(i8 signext %71)
%73 = load i8*, i8** %6
%74 = load i32, i32* %4
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %73, i64 %75
%77 = load i8, i8* %76
%78 = call i32 @precedence(i8 signext %77)
%79 = icmp slt i32 %72, %78
br i1 %79, label %80, label %94
80: ; preds = %66
%81 = load i8*, i8** %6
%82 = load i32, i32* %4
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = load i8, i8* %84
%86 = load i8*, i8** %5
%87 = load i8*, i8** %5
%88 = call i64 @strlen(i8* %87)
%89 = getelementptr inbounds i8, i8* %86, i64 %88
store i8 %85, i8* %89
%90 = load i8*, i8** %6
%91 = load i32, i32* %4
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %90, i64 %92
store i8 0, i8* %93
br label %123
94: ; preds = %66, %58
%95 = load i8*, i8** %2
%96 = load i32, i32* %3
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %95, i64 %97
%99 = load i8, i8* %98
%100 = call i32 @precedence(i8 signext %99)
%101 = load i8*, i8** %6
%102 = load i32, i32* %4
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = load i8, i8* %104
%106 = call i32 @precedence(i8 signext %105)
%107 = icmp sle i32 %100, %106
br i1 %107, label %108, label %122
108: ; preds = %94
%109 = load i8*, i8** %6
%110 = load i32, i32* %4
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8, i8* %109, i64 %111
%113 = load i8, i8* %112
%114 = load i8*, i8** %5
%115 = load i8*, i8** %5
%116 = call i64 @strlen(i8* %115)
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 %113, i8* %117
%118 = load i8*, i8** %6
%119 = load i32, i32* %4
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* %118, i64 %120
store i8 0, i8* %121
br label %122
122: ; preds = %108, %94
br label %123
123: ; preds = %122, %80
br label %124
124: ; preds = %123
br label %125
125: ; preds = %124
%126 = load i32, i32* %4
%127 = add nsw i32 %126, -1
store i32 %127, i32* %4
br label %46
128: ; preds = %57, %46
%129 = load i8*, i8** %2
%130 = load i32, i32* %3
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %129, i64 %131
%133 = load i8, i8* %132
%134 = load i8*, i8** %6
%135 = load i8*, i8** %6
%136 = call i64 @strlen(i8* %135)
%137 = getelementptr inbounds i8, i8* %134, i64 %136
store i8 %133, i8* %137
br label %138
138: ; preds = %128, %31
br label %198
139: ; preds = %15
%140 = load i8*, i8** %2
%141 = load i32, i32* %3
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = load i8, i8* %143
%145 = load i8*, i8** %6
%146 = load i8*, i8** %6
%147 = call i64 @strlen(i8* %146)
%148 = getelementptr inbounds i8, i8* %145, i64 %147
store i8 %144, i8* %148
br label %198
149: ; preds = %15
%150 = load i8*, i8** %6
%151 = call i64 @strlen(i8* %150)
%152 = trunc i64 %151 to i32
store i32 %152, i32* %4
br label %153
153: ; preds = %184, %149
%154 = load i32, i32* %4
%155 = icmp sge i32 %154, 0
br i1 %155, label %156, label %187
156: ; preds = %153
%157 = load i8*, i8** %6
%158 = load i32, i32* %4
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp eq i32 %162, 40
br i1 %163, label %164, label %169
164: ; preds = %156
%165 = load i8*, i8** %6
%166 = load i32, i32* %4
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8, i8* %165, i64 %167
store i8 0, i8* %168
br label %187
169: ; preds = %156
%170 = load i8*, i8** %6
%171 = load i32, i32* %4
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i8, i8* %170, i64 %172
%174 = load i8, i8* %173
%175 = load i8*, i8** %5
%176 = load i8*, i8** %5
%177 = call i64 @strlen(i8* %176)
%178 = getelementptr inbounds i8, i8* %175, i64 %177
store i8 %174, i8* %178
%179 = load i8*, i8** %6
%180 = load i32, i32* %4
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
store i8 0, i8* %182
br label %183
183: ; preds = %169
br label %184
184: ; preds = %183
%185 = load i32, i32* %4
%186 = add nsw i32 %185, -1
store i32 %186, i32* %4
br label %153
187: ; preds = %164, %153
br label %198
188: ; preds = %15
%189 = load i8*, i8** %2
%190 = load i32, i32* %3
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i8, i8* %189, i64 %191
%193 = load i8, i8* %192
%194 = load i8*, i8** %5
%195 = load i8*, i8** %5
%196 = call i64 @strlen(i8* %195)
%197 = getelementptr inbounds i8, i8* %194, i64 %196
store i8 %193, i8* %197
br label %198
198: ; preds = %188, %187, %139, %138
br label %199
199: ; preds = %198
%200 = load i32, i32* %3
%201 = add nsw i32 %200, 1
store i32 %201, i32* %3
br label %9
202: ; preds = %9
%203 = load i8*, i8** %6
%204 = call i64 @strlen(i8* %203)
%205 = sub i64 %204, 1
%206 = trunc i64 %205 to i32
store i32 %206, i32* %3
br label %207
207: ; preds = %220, %202
%208 = load i32, i32* %3
%209 = icmp sge i32 %208, 0
br i1 %209, label %210, label %223
210: ; preds = %207
%211 = load i8*, i8** %6
%212 = load i32, i32* %3
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds i8, i8* %211, i64 %213
%215 = load i8, i8* %214
%216 = load i8*, i8** %5
%217 = load i8*, i8** %5
%218 = call i64 @strlen(i8* %217)
%219 = getelementptr inbounds i8, i8* %216, i64 %218
store i8 %215, i8* %219
br label %220
220: ; preds = %210
%221 = load i32, i32* %3
%222 = add nsw i32 %221, -1
store i32 %222, i32* %3
br label %207
223: ; preds = %207
%224 = load i8*, i8** %5
ret i8* %224
}

LLVM IR (-O2):
define noalias i8* @infixToPostfix(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %83, label %6
6: ; preds = %1, %80
%7 = phi i8 [ %82, %80 ], [ %4, %1 ]
%8 = phi i64 [ %77, %80 ], [ 0, %1 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = sext i8 %7 to i32
switch i32 %10, label %73 [
i32 94, label %11
i32 47, label %11
i32 42, label %11
i32 43, label %11
i32 45, label %11
i32 40, label %54
i32 41, label %57
]
11: ; preds = %6, %6, %6, %6, %6
%12 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%13 = add i64 %12, -1
%14 = getelementptr inbounds i8, i8* %3, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 40
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = getelementptr inbounds i8, i8* %3, i64 %12
store i8 %7, i8* %18
br label %76
19: ; preds = %11
%20 = trunc i64 %13 to i32
%21 = icmp sgt i32 %20, -1
br i1 %21, label %22, label %50
22: ; preds = %19, %45
%23 = phi i32 [ %46, %45 ], [ %20, %19 ]
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %3, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 40
br i1 %27, label %48, label %28
28: ; preds = %22
%29 = load i8, i8* %9
%30 = icmp eq i8 %29, 94
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = tail call i32 @precedence(i8 signext 94)
%33 = tail call i32 @precedence(i8 signext %26)
%34 = icmp slt i32 %32, %33
br i1 %34, label %42, label %35
35: ; preds = %31
%36 = load i8, i8* %9
br label %37
37: ; preds = %35, %28
%38 = phi i8 [ %36, %35 ], [ %29, %28 ]
%39 = tail call i32 @precedence(i8 signext %38)
%40 = tail call i32 @precedence(i8 signext %26)
%41 = icmp sgt i32 %39, %40
br i1 %41, label %45, label %42
42: ; preds = %37, %31
%43 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%44 = getelementptr inbounds i8, i8* %2, i64 %43
store i8 %26, i8* %44
store i8 0, i8* %25
br label %45
45: ; preds = %42, %37
%46 = add nsw i32 %23, -1
%47 = icmp sgt i32 %23, 0
br i1 %47, label %22, label %48
48: ; preds = %22, %45
%49 = load i8, i8* %9
br label %50
50: ; preds = %48, %19
%51 = phi i8 [ %49, %48 ], [ %7, %19 ]
%52 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%53 = getelementptr inbounds i8, i8* %3, i64 %52
store i8 %51, i8* %53
br label %76
54: ; preds = %6
%55 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%56 = getelementptr inbounds i8, i8* %3, i64 %55
store i8 %7, i8* %56
br label %76
57: ; preds = %6
%58 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%59 = trunc i64 %58 to i32
%60 = icmp sgt i32 %59, -1
br i1 %60, label %61, label %76
61: ; preds = %57, %68
%62 = phi i32 [ %71, %68 ], [ %59, %57 ]
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %3, i64 %63
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 40
br i1 %66, label %67, label %68
67: ; preds = %61
store i8 0, i8* %64
br label %76
68: ; preds = %61
%69 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%70 = getelementptr inbounds i8, i8* %2, i64 %69
store i8 %65, i8* %70
store i8 0, i8* %64
%71 = add nsw i32 %62, -1
%72 = icmp sgt i32 %62, 0
br i1 %72, label %61, label %76
73: ; preds = %6
%74 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%75 = getelementptr inbounds i8, i8* %2, i64 %74
store i8 %7, i8* %75
br label %76
76: ; preds = %68, %57, %54, %73, %50, %17, %67
%77 = add nuw i64 %8, 1
%78 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%79 = icmp ugt i64 %78, %77
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = getelementptr inbounds i8, i8* %0, i64 %77
%82 = load i8, i8* %81
br label %6
83: ; preds = %76, %1
%84 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%85 = trunc i64 %84 to i32
%86 = add i32 %85, -1
%87 = icmp sgt i32 %86, -1
br i1 %87, label %88, label %97
88: ; preds = %83, %88
%89 = phi i32 [ %95, %88 ], [ %86, %83 ]
%90 = zext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %3, i64 %90
%92 = load i8, i8* %91
%93 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%94 = getelementptr inbounds i8, i8* %2, i64 %93
store i8 %92, i8* %94
%95 = add nsw i32 %89, -1
%96 = icmp sgt i32 %89, 0
br i1 %96, label %88, label %97
97: ; preds = %88, %83
ret i8* %2
}