#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 */
double calcUserAnswer(int, char, int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
double parseNumber(char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
double test3ProcessPostfix(double, double, double, char, char);
int /*<<< orphan*/ testProcessEquationStr(char *, double);
double testProcessPostfix(double, double, char);
int main(void) {
  printf("Testing calcUserAnswer:\n");
  printf("testing neg numbers:\n");
  printf("-42 + 43 = %.0f\n", calcUserAnswer(-42, '+', 43));
  printf("40 - 80 = %.0f\n", calcUserAnswer(40, '-', 80));
  printf("-200 / 2 = %.0f\n", calcUserAnswer(-200, '/', 2));
  printf("100 * -1 = %.0f\n", calcUserAnswer(100, '*', -1));
  printf("-2^5 = %.0f\n", calcUserAnswer(-2, '^', 5));
  printf("-2^6 = %.0f\n", calcUserAnswer(-2, '^', 6));
  printf("-16^3 = %.0f\n", calcUserAnswer(-16, '^', 3));
  printf("testing pos numbers:\n");
  printf("80 + 80 = %.0f\n", calcUserAnswer(80, '+', 80));
  printf("2^5 = %.0f\n", calcUserAnswer(2, '^', 5));
  printf("2^6 = %.0f\n", calcUserAnswer(2, '^', 6));
  printf("16^3 = %.0f\n", calcUserAnswer(16, '^', 3));
  puts("\nTesting the number parser:");
  char *toParse = (char *)malloc(80 * sizeof(char));
  char *toParse0Pos = toParse;
  strcpy(toParse, "16");
  double parseAns = 0;
  double expAns = 16;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "2+2");
  parseAns = 0;
  expAns = 2;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "2.2+4");
  parseAns = 0;
  expAns = 2.2;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "(2+2)");
  parseAns = 0;
  expAns = 0;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "0.05");
  parseAns = 0;
  expAns = 0.05;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "10.10");
  parseAns = 0;
  expAns = 10.10;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "12.12");
  parseAns = 0;
  expAns = 12.12;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  strcpy(toParse, "1.0/2");
  parseAns = 0;
  expAns = 1.00;
  parseAns = parseNumber(&toParse);
  printf("Input was %.2f output %.2f %s\n", expAns, parseAns,
         expAns == parseAns ? "PASSED" : "FAILED");
  free(toParse0Pos);
  puts("\nTesting processPostfixEqa:");
  puts("5.0+2.0 should be 7.0");
  double ans = testProcessPostfix(5.0, 2.0, '+');
  printf("The answer is: %.2lf\n", ans);
  if (ans == 7.0)
    puts("PASSED");
  else
    puts("FAILED");
  puts("144/12 should be 12.0");
  ans = testProcessPostfix(12.0, 144.0, '/');
  printf("The answer is: %.2lf\n", ans);
  if (ans == 12.0)
    puts("PASSED");
  else
    puts("FAILED");
  puts("1/2 should be 0.5");
  ans = testProcessPostfix(2.0, 1.0, '/');
  printf("The answer is: %.2lf\n", ans);
  if (ans == 0.5)
    puts("PASSED");
  else
    puts("FAILED");
  puts("1+2/1 should be 1.5");
  ans = test3ProcessPostfix(1.0, 2.0, 1.0, '/', '+');
  printf("The answer is: %.2lf\n", ans);
  if (ans == 3)
    puts("PASSED");
  else
    puts("FAILED");
  puts("\nTesting processEquationString: ");
  testProcessEquationStr("2+5", 7);
  testProcessEquationStr("2+2*2", 6);
  testProcessEquationStr("2*(2+2)", 8);
  testProcessEquationStr("2*((1*2)+2)", 8);
  puts("\nTesting multy digit and floating point:");
  testProcessEquationStr("16*16", 256);
  testProcessEquationStr("1.0/2", 0.5);
  testProcessEquationStr("10.1/2", 5.05);
  puts("\nEND OF TESTS");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0xffffffd6,%edi
mov    $0x2b,%edx
mov    %edx,%esi
call   10a0 <calcUserAnswer@plt>
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x28,%edi
mov    $0x2d,%esi
mov    $0x50,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xffffff38,%edi
mov    $0x2f,%esi
mov    $0x2,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x64,%edi
mov    $0x2a,%esi
mov    $0xffffffff,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x5e,%esi
mov    $0x5,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x5e,%esi
mov    $0x6,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffff0,%edi
mov    $0x5e,%esi
mov    $0x3,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe65(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x50,%edx
mov    $0x2b,%esi
mov    %edx,%edi
call   10a0 <calcUserAnswer@plt>
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x2,%edi
mov    $0x5e,%esi
mov    $0x5,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xdfd(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x2,%edi
mov    $0x5e,%esi
mov    $0x6,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xde8(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x10,%edi
mov    $0x5e,%esi
mov    $0x3,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xdd3(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xdf8(%rip),%rdi
call   1070 <puts@plt>
mov    $0x50,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xf2b(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xcb5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xdd1(%rip),%rsi
lea    0xdc3(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xd8d(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xda8(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xc12(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xd5e(%rip),%rsi
lea    0xd50(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xd1a(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd39(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xbc7(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xceb(%rip),%rsi
lea    0xcdd(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xca7(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd94(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xc7d(%rip),%rsi
lea    0xc6f(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xc39(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xc5e(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xade(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xc0a(%rip),%rsi
lea    0xbfc(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xbc6(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xbf0(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xa63(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xb97(%rip),%rsi
lea    0xb89(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xb53(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xb83(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0x9e8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xb24(%rip),%rsi
lea    0xb16(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xae0(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xb16(%rip),%rsi
call   1050 <strcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0x96d(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <parseNumber@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xab1(%rip),%rsi
lea    0xaa3(%rip),%rax
ucomisd %xmm3,%xmm2
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xa6d(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xaa4(%rip),%rdi
call   1070 <puts@plt>
lea    0xab4(%rip),%rdi
call   1070 <puts@plt>
movsd  0x8e1(%rip),%xmm0
movsd  0x8e1(%rip),%xmm1
mov    $0x2b,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xa9a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  0x8a2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    177f <main+0x5df>
jp     177f <main+0x5df>
lea    0xa0e(%rip),%rdi
call   1070 <puts@plt>
jmp    178b <main+0x5eb>
lea    0xa04(%rip),%rdi
call   1070 <puts@plt>
lea    0xa68(%rip),%rdi
call   1070 <puts@plt>
movsd  0x8a9(%rip),%xmm0
movsd  0x8a9(%rip),%xmm1
mov    $0x2f,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xa22(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  0x872(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    17f7 <main+0x657>
jp     17f7 <main+0x657>
lea    0x996(%rip),%rdi
call   1070 <puts@plt>
jmp    1803 <main+0x663>
lea    0x98c(%rip),%rdi
call   1070 <puts@plt>
lea    0xa06(%rip),%rdi
call   1070 <puts@plt>
movsd  0x7f9(%rip),%xmm0
movsd  0x7f9(%rip),%xmm1
mov    $0x2f,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0x9aa(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  0x80a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    186f <main+0x6cf>
jp     186f <main+0x6cf>
lea    0x91e(%rip),%rdi
call   1070 <puts@plt>
jmp    187b <main+0x6db>
lea    0x914(%rip),%rdi
call   1070 <puts@plt>
lea    0x9a0(%rip),%rdi
call   1070 <puts@plt>
movsd  0x789(%rip),%xmm2
movsd  0x779(%rip),%xmm1
mov    $0x2f,%edi
mov    $0x2b,%esi
movaps %xmm2,%xmm0
call   10b0 <test3ProcessPostfix@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0x92a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  0x792(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    18ef <main+0x74f>
jp     18ef <main+0x74f>
lea    0x89e(%rip),%rdi
call   1070 <puts@plt>
jmp    18fb <main+0x75b>
lea    0x894(%rip),%rdi
call   1070 <puts@plt>
lea    0x934(%rip),%rdi
call   1070 <puts@plt>
lea    0x949(%rip),%rdi
movsd  0x6ea(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x939(%rip),%rdi
movsd  0x756(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x92b(%rip),%rdi
movsd  0x73a(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x91f(%rip),%rdi
movsd  0x726(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x917(%rip),%rdi
call   1070 <puts@plt>
lea    0x934(%rip),%rdi
movsd  0x6fe(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x82e(%rip),%rdi
movsd  0x6d2(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x912(%rip),%rdi
movsd  0x6ce(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0x905(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x10bf(%rip),%rdi
call   1070 <puts@plt>
lea    0x10cb(%rip),%rdi
call   1070 <puts@plt>
mov    $0xffffffd6,%edi
mov    $0x2b,%esi
mov    $0x2b,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x28,%edi
mov    $0x2d,%esi
mov    $0x50,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xffffff38,%edi
mov    $0x2f,%esi
mov    $0x2,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe84(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x64,%edi
mov    $0x2a,%esi
mov    $0xffffffff,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x5e,%esi
mov    $0x5,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x5e,%esi
mov    $0x6,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0xfffffff0,%edi
mov    $0x5e,%esi
mov    $0x3,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe38(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xfe6(%rip),%rdi
call   1070 <puts@plt>
mov    $0x50,%edi
mov    $0x2b,%esi
mov    $0x50,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xe18(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x2,%edi
mov    $0x5e,%esi
mov    $0x5,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xdcf(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x2,%edi
mov    $0x5e,%esi
mov    $0x6,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xdba(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x10,%edi
mov    $0x5e,%esi
mov    $0x3,%edx
call   10a0 <calcUserAnswer@plt>
lea    0xda5(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xdb4(%rip),%rdi
call   1070 <puts@plt>
mov    $0x50,%edi
call   10c0 <malloc@plt>
mov    %rax,%r14
mov    %rax,0x8(%rsp)
lea    0xeef(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcpy@plt>
lea    0x8(%rsp),%r12
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xc72(%rip),%xmm0
ucomisd %xmm0,%xmm1
lea    0xdac(%rip),%rbp
lea    0xd9e(%rip),%rbx
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
lea    0xd6d(%rip),%r13
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xd84(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xc27(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xd4a(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xbf1(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xdda(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
xorpd  %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xcd4(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xb7d(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xc9b(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xb47(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xc63(%rip),%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xb11(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xc2b(%rip),%r15
mov    %r15,%rsi
call   1050 <strcpy@plt>
mov    %r12,%rdi
call   1040 <parseNumber@plt>
movapd %xmm0,%xmm1
movsd  0xad8(%rip),%xmm0
ucomisd %xmm0,%xmm1
mov    %rbx,%rsi
cmovne %rbp,%rsi
cmovp  %rbp,%rsi
mov    %r13,%rdi
mov    $0x2,%al
call   1090 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xbed(%rip),%rdi
call   1070 <puts@plt>
lea    0xbfd(%rip),%rdi
call   1070 <puts@plt>
movsd  0xa9f(%rip),%xmm0
movsd  0xa67(%rip),%xmm1
mov    $0x2b,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xbe7(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xa70(%rip),%xmm0
mov    %rbx,%rdi
cmovne %rbp,%rdi
cmovp  %rbp,%rdi
call   1070 <puts@plt>
lea    0xbce(%rip),%rdi
call   1070 <puts@plt>
movsd  0xa54(%rip),%xmm0
movsd  0xa54(%rip),%xmm1
mov    $0x2f,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xa24(%rip),%xmm0
mov    %rbx,%rdi
cmovne %rbp,%rdi
cmovp  %rbp,%rdi
call   1070 <puts@plt>
lea    0xb90(%rip),%rdi
call   1070 <puts@plt>
movsd  0x9c0(%rip),%xmm0
movsd  0x9e0(%rip),%xmm1
mov    $0x2f,%edi
call   1080 <testProcessPostfix@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0x9e0(%rip),%xmm0
mov    %rbx,%rdi
cmovne %rbp,%rdi
cmovp  %rbp,%rdi
call   1070 <puts@plt>
lea    0xb4e(%rip),%rdi
call   1070 <puts@plt>
movsd  0x994(%rip),%xmm0
movsd  0x964(%rip),%xmm1
movaps %xmm0,%xmm2
mov    $0x2f,%edi
mov    $0x2b,%esi
call   10b0 <test3ProcessPostfix@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0x98c(%rip),%xmm0
cmovne %rbp,%rbx
cmovp  %rbp,%rbx
mov    %rbx,%rdi
call   1070 <puts@plt>
lea    0xb06(%rip),%rdi
call   1070 <puts@plt>
lea    0xb1b(%rip),%rdi
movsd  0x941(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xb0b(%rip),%rdi
movsd  0x955(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xafd(%rip),%rdi
movsd  0x949(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xaf1(%rip),%rdi
movsd  0x935(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xae9(%rip),%rdi
call   1070 <puts@plt>
lea    0xb06(%rip),%rdi
movsd  0x91d(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
mov    %r15,%rdi
movsd  0x8ed(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xae8(%rip),%rdi
movsd  0x901(%rip),%xmm0
call   1060 <testProcessEquationStr@plt>
lea    0xadb(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Testing calcUserAnswer:\0A\00"
@.str.1 = [22 x i8] c"testing neg numbers:\0A\00"
@.str.2 = [17 x i8] c"-42 + 43 = %.0f\0A\00"
@.str.3 = [16 x i8] c"40 - 80 = %.0f\0A\00"
@.str.4 = [17 x i8] c"-200 / 2 = %.0f\0A\00"
@.str.5 = [17 x i8] c"100 * -1 = %.0f\0A\00"
@.str.6 = [13 x i8] c"-2^5 = %.0f\0A\00"
@.str.7 = [13 x i8] c"-2^6 = %.0f\0A\00"
@.str.8 = [14 x i8] c"-16^3 = %.0f\0A\00"
@.str.9 = [22 x i8] c"testing pos numbers:\0A\00"
@.str.10 = [16 x i8] c"80 + 80 = %.0f\0A\00"
@.str.11 = [12 x i8] c"2^5 = %.0f\0A\00"
@.str.12 = [12 x i8] c"2^6 = %.0f\0A\00"
@.str.13 = [13 x i8] c"16^3 = %.0f\0A\00"
@.str.14 = [28 x i8] c"\0ATesting the number parser:\00"
@.str.15 = [3 x i8] c"16\00"
@.str.16 = [31 x i8] c"Input was %.2f output %.2f %s\0A\00"
@.str.17 = [7 x i8] c"PASSED\00"
@.str.18 = [7 x i8] c"FAILED\00"
@.str.19 = [4 x i8] c"2+2\00"
@.str.20 = [6 x i8] c"2.2+4\00"
@.str.21 = [6 x i8] c"(2+2)\00"
@.str.22 = [5 x i8] c"0.05\00"
@.str.23 = [6 x i8] c"10.10\00"
@.str.24 = [6 x i8] c"12.12\00"
@.str.25 = [6 x i8] c"1.0/2\00"
@.str.26 = [28 x i8] c"\0ATesting processPostfixEqa:\00"
@.str.27 = [22 x i8] c"5.0+2.0 should be 7.0\00"
@.str.28 = [22 x i8] c"The answer is: %.2lf\0A\00"
@.str.29 = [22 x i8] c"144/12 should be 12.0\00"
@.str.30 = [18 x i8] c"1/2 should be 0.5\00"
@.str.31 = [20 x i8] c"1+2/1 should be 1.5\00"
@.str.32 = [33 x i8] c"\0ATesting processEquationString: \00"
@.str.33 = [4 x i8] c"2+5\00"
@.str.34 = [6 x i8] c"2+2*2\00"
@.str.35 = [8 x i8] c"2*(2+2)\00"
@.str.36 = [12 x i8] c"2*((1*2)+2)\00"
@.str.37 = [41 x i8] c"\0ATesting multy digit and floating point:\00"
@.str.38 = [6 x i8] c"16*16\00"
@.str.39 = [7 x i8] c"10.1/2\00"
@.str.40 = [14 x i8] c"\0AEND OF TESTS\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = call double @calcUserAnswer(i32 -42, i8 signext 43, i32 43)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call double @calcUserAnswer(i32 40, i8 signext 45, i32 80)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %11)
%13 = call double @calcUserAnswer(i32 -200, i8 signext 47, i32 2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = call double @calcUserAnswer(i32 100, i8 signext 42, i32 -1)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %15)
%17 = call double @calcUserAnswer(i32 -2, i8 signext 94, i32 5)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %17)
%19 = call double @calcUserAnswer(i32 -2, i8 signext 94, i32 6)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %19)
%21 = call double @calcUserAnswer(i32 -16, i8 signext 94, i32 3)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%24 = call double @calcUserAnswer(i32 80, i8 signext 43, i32 80)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %24)
%26 = call double @calcUserAnswer(i32 2, i8 signext 94, i32 5)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), double %26)
%28 = call double @calcUserAnswer(i32 2, i8 signext 94, i32 6)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double %28)
%30 = call double @calcUserAnswer(i32 16, i8 signext 94, i32 3)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), double %30)
%32 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%33 = call i64 @malloc(i32 80)
%34 = inttoptr i64 %33 to i8*
store i8* %34, i8** %2
%35 = load i8*, i8** %2
store i8* %35, i8** %3
%36 = load i8*, i8** %2
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 1.600000e+01, double* %5
%38 = call double @parseNumber(i8** %2)
store double %38, double* %4
%39 = load double, double* %5
%40 = load double, double* %4
%41 = load double, double* %5
%42 = load double, double* %4
%43 = fcmp oeq double %41, %42
%44 = zext i1 %43 to i64
%45 = select i1 %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %39, double %40, i8* %45)
%47 = load i8*, i8** %2
%48 = call i32 @strcpy(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 2.000000e+00, double* %5
%49 = call double @parseNumber(i8** %2)
store double %49, double* %4
%50 = load double, double* %5
%51 = load double, double* %4
%52 = load double, double* %5
%53 = load double, double* %4
%54 = fcmp oeq double %52, %53
%55 = zext i1 %54 to i64
%56 = select i1 %54, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %50, double %51, i8* %56)
%58 = load i8*, i8** %2
%59 = call i32 @strcpy(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 2.200000e+00, double* %5
%60 = call double @parseNumber(i8** %2)
store double %60, double* %4
%61 = load double, double* %5
%62 = load double, double* %4
%63 = load double, double* %5
%64 = load double, double* %4
%65 = fcmp oeq double %63, %64
%66 = zext i1 %65 to i64
%67 = select i1 %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %61, double %62, i8* %67)
%69 = load i8*, i8** %2
%70 = call i32 @strcpy(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
%71 = call double @parseNumber(i8** %2)
store double %71, double* %4
%72 = load double, double* %5
%73 = load double, double* %4
%74 = load double, double* %5
%75 = load double, double* %4
%76 = fcmp oeq double %74, %75
%77 = zext i1 %76 to i64
%78 = select i1 %76, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %72, double %73, i8* %78)
%80 = load i8*, i8** %2
%81 = call i32 @strcpy(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 5.000000e-02, double* %5
%82 = call double @parseNumber(i8** %2)
store double %82, double* %4
%83 = load double, double* %5
%84 = load double, double* %4
%85 = load double, double* %5
%86 = load double, double* %4
%87 = fcmp oeq double %85, %86
%88 = zext i1 %87 to i64
%89 = select i1 %87, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %83, double %84, i8* %89)
%91 = load i8*, i8** %2
%92 = call i32 @strcpy(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 1.010000e+01, double* %5
%93 = call double @parseNumber(i8** %2)
store double %93, double* %4
%94 = load double, double* %5
%95 = load double, double* %4
%96 = load double, double* %5
%97 = load double, double* %4
%98 = fcmp oeq double %96, %97
%99 = zext i1 %98 to i64
%100 = select i1 %98, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %94, double %95, i8* %100)
%102 = load i8*, i8** %2
%103 = call i32 @strcpy(i8* %102, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 1.212000e+01, double* %5
%104 = call double @parseNumber(i8** %2)
store double %104, double* %4
%105 = load double, double* %5
%106 = load double, double* %4
%107 = load double, double* %5
%108 = load double, double* %4
%109 = fcmp oeq double %107, %108
%110 = zext i1 %109 to i64
%111 = select i1 %109, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %105, double %106, i8* %111)
%113 = load i8*, i8** %2
%114 = call i32 @strcpy(i8* %113, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0))
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
%115 = call double @parseNumber(i8** %2)
store double %115, double* %4
%116 = load double, double* %5
%117 = load double, double* %4
%118 = load double, double* %5
%119 = load double, double* %4
%120 = fcmp oeq double %118, %119
%121 = zext i1 %120 to i64
%122 = select i1 %120, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %116, double %117, i8* %122)
%124 = load i8*, i8** %3
%125 = call i32 @free(i8* %124)
%126 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.26, i64 0, i64 0))
%127 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0))
%128 = call double @testProcessPostfix(double 5.000000e+00, double 2.000000e+00, i8 signext 43)
store double %128, double* %6
%129 = load double, double* %6
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %129)
%131 = load double, double* %6
%132 = fcmp oeq double %131, 7.000000e+00
br i1 %132, label %133, label %135
133: ; preds = %0
%134 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %137
135: ; preds = %0
%136 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
br label %137
137: ; preds = %135, %133
%138 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.29, i64 0, i64 0))
%139 = call double @testProcessPostfix(double 1.200000e+01, double 1.440000e+02, i8 signext 47)
store double %139, double* %6
%140 = load double, double* %6
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %140)
%142 = load double, double* %6
%143 = fcmp oeq double %142, 1.200000e+01
br i1 %143, label %144, label %146
144: ; preds = %137
%145 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %148
146: ; preds = %137
%147 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
br label %148
148: ; preds = %146, %144
%149 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0))
%150 = call double @testProcessPostfix(double 2.000000e+00, double 1.000000e+00, i8 signext 47)
store double %150, double* %6
%151 = load double, double* %6
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %151)
%153 = load double, double* %6
%154 = fcmp oeq double %153, 5.000000e-01
br i1 %154, label %155, label %157
155: ; preds = %148
%156 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %159
157: ; preds = %148
%158 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
br label %159
159: ; preds = %157, %155
%160 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i64 0, i64 0))
%161 = call double @test3ProcessPostfix(double 1.000000e+00, double 2.000000e+00, double 1.000000e+00, i8 signext 47, i8 signext 43)
store double %161, double* %6
%162 = load double, double* %6
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %162)
%164 = load double, double* %6
%165 = fcmp oeq double %164, 3.000000e+00
br i1 %165, label %166, label %168
166: ; preds = %159
%167 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %170
168: ; preds = %159
%169 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
br label %170
170: ; preds = %168, %166
%171 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.32, i64 0, i64 0))
%172 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), double 7.000000e+00)
%173 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.34, i64 0, i64 0), double 6.000000e+00)
%174 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), double 8.000000e+00)
%175 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i64 0, i64 0), double 8.000000e+00)
%176 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.37, i64 0, i64 0))
%177 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.38, i64 0, i64 0), double 2.560000e+02)
%178 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), double 5.000000e-01)
%179 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.39, i64 0, i64 0), double 5.050000e+00)
%180 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.40, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [17 x i8] c"-42 + 43 = %.0f\0A\00"
@.str.3 = [16 x i8] c"40 - 80 = %.0f\0A\00"
@.str.4 = [17 x i8] c"-200 / 2 = %.0f\0A\00"
@.str.5 = [17 x i8] c"100 * -1 = %.0f\0A\00"
@.str.6 = [13 x i8] c"-2^5 = %.0f\0A\00"
@.str.7 = [13 x i8] c"-2^6 = %.0f\0A\00"
@.str.8 = [14 x i8] c"-16^3 = %.0f\0A\00"
@.str.10 = [16 x i8] c"80 + 80 = %.0f\0A\00"
@.str.11 = [12 x i8] c"2^5 = %.0f\0A\00"
@.str.12 = [12 x i8] c"2^6 = %.0f\0A\00"
@.str.13 = [13 x i8] c"16^3 = %.0f\0A\00"
@.str.14 = [28 x i8] c"\0ATesting the number parser:\00"
@.str.15 = [3 x i8] c"16\00"
@.str.16 = [31 x i8] c"Input was %.2f output %.2f %s\0A\00"
@.str.17 = [7 x i8] c"PASSED\00"
@.str.18 = [7 x i8] c"FAILED\00"
@.str.19 = [4 x i8] c"2+2\00"
@.str.20 = [6 x i8] c"2.2+4\00"
@.str.21 = [6 x i8] c"(2+2)\00"
@.str.22 = [5 x i8] c"0.05\00"
@.str.23 = [6 x i8] c"10.10\00"
@.str.24 = [6 x i8] c"12.12\00"
@.str.25 = [6 x i8] c"1.0/2\00"
@.str.26 = [28 x i8] c"\0ATesting processPostfixEqa:\00"
@.str.27 = [22 x i8] c"5.0+2.0 should be 7.0\00"
@.str.28 = [22 x i8] c"The answer is: %.2lf\0A\00"
@.str.29 = [22 x i8] c"144/12 should be 12.0\00"
@.str.30 = [18 x i8] c"1/2 should be 0.5\00"
@.str.31 = [20 x i8] c"1+2/1 should be 1.5\00"
@.str.32 = [33 x i8] c"\0ATesting processEquationString: \00"
@.str.33 = [4 x i8] c"2+5\00"
@.str.34 = [6 x i8] c"2+2*2\00"
@.str.35 = [8 x i8] c"2*(2+2)\00"
@.str.36 = [12 x i8] c"2*((1*2)+2)\00"
@.str.37 = [41 x i8] c"\0ATesting multy digit and floating point:\00"
@.str.38 = [6 x i8] c"16*16\00"
@.str.39 = [7 x i8] c"10.1/2\00"
@.str.40 = [14 x i8] c"\0AEND OF TESTS\00"
@str = [24 x i8] c"Testing calcUserAnswer:\00"
@str.41 = [21 x i8] c"testing neg numbers:\00"
@str.42 = [21 x i8] c"testing pos numbers:\00"
define i32 @main() {
%1 = alloca i8*
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.41, i64 0, i64 0))
%4 = tail call double @calcUserAnswer(i32 -42, i8 signext 43, i32 43)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %4)
%6 = tail call double @calcUserAnswer(i32 40, i8 signext 45, i32 80)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %6)
%8 = tail call double @calcUserAnswer(i32 -200, i8 signext 47, i32 2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %8)
%10 = tail call double @calcUserAnswer(i32 100, i8 signext 42, i32 -1)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %10)
%12 = tail call double @calcUserAnswer(i32 -2, i8 signext 94, i32 5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %12)
%14 = tail call double @calcUserAnswer(i32 -2, i8 signext 94, i32 6)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %14)
%16 = tail call double @calcUserAnswer(i32 -16, i8 signext 94, i32 3)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %16)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.42, i64 0, i64 0))
%19 = tail call double @calcUserAnswer(i32 80, i8 signext 43, i32 80)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %19)
%21 = tail call double @calcUserAnswer(i32 2, i8 signext 94, i32 5)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), double %21)
%23 = tail call double @calcUserAnswer(i32 2, i8 signext 94, i32 6)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double %23)
%25 = tail call double @calcUserAnswer(i32 16, i8 signext 94, i32 3)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), double %25)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%28 = bitcast i8** %1 to i8*
%29 = tail call i64 @malloc(i32 80)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %1
%31 = tail call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%32 = call double @parseNumber(i8** %1)
%33 = fcmp oeq double %32, 1.600000e+01
%34 = select i1 %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 1.600000e+01, double %32, i8* %34)
%36 = load i8*, i8** %1
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
%38 = call double @parseNumber(i8** %1)
%39 = fcmp oeq double %38, 2.000000e+00
%40 = select i1 %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 2.000000e+00, double %38, i8* %40)
%42 = load i8*, i8** %1
%43 = call i32 @strcpy(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%44 = call double @parseNumber(i8** %1)
%45 = fcmp oeq double %44, 2.200000e+00
%46 = select i1 %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 2.200000e+00, double %44, i8* %46)
%48 = load i8*, i8** %1
%49 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%50 = call double @parseNumber(i8** %1)
%51 = fcmp oeq double %50, 0.000000e+00
%52 = select i1 %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 0.000000e+00, double %50, i8* %52)
%54 = load i8*, i8** %1
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
%56 = call double @parseNumber(i8** %1)
%57 = fcmp oeq double %56, 5.000000e-02
%58 = select i1 %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 5.000000e-02, double %56, i8* %58)
%60 = load i8*, i8** %1
%61 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%62 = call double @parseNumber(i8** %1)
%63 = fcmp oeq double %62, 1.010000e+01
%64 = select i1 %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 1.010000e+01, double %62, i8* %64)
%66 = load i8*, i8** %1
%67 = call i32 @strcpy(i8* %66, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%68 = call double @parseNumber(i8** %1)
%69 = fcmp oeq double %68, 1.212000e+01
%70 = select i1 %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 1.212000e+01, double %68, i8* %70)
%72 = load i8*, i8** %1
%73 = call i32 @strcpy(i8* %72, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0))
%74 = call double @parseNumber(i8** %1)
%75 = fcmp oeq double %74, 1.000000e+00
%76 = select i1 %75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double 1.000000e+00, double %74, i8* %76)
%78 = call i32 @free(i8* %30)
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.26, i64 0, i64 0))
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0))
%81 = call double @testProcessPostfix(double 5.000000e+00, double 2.000000e+00, i8 signext 43)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %81)
%83 = fcmp oeq double %81, 7.000000e+00
%84 = select i1 %83, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%85 = call i32 @puts(i8* dereferenceable(1) %84)
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.29, i64 0, i64 0))
%87 = call double @testProcessPostfix(double 1.200000e+01, double 1.440000e+02, i8 signext 47)
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %87)
%89 = fcmp oeq double %87, 1.200000e+01
%90 = select i1 %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%91 = call i32 @puts(i8* dereferenceable(1) %90)
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0))
%93 = call double @testProcessPostfix(double 2.000000e+00, double 1.000000e+00, i8 signext 47)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %93)
%95 = fcmp oeq double %93, 5.000000e-01
%96 = select i1 %95, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%97 = call i32 @puts(i8* dereferenceable(1) %96)
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i64 0, i64 0))
%99 = call double @test3ProcessPostfix(double 1.000000e+00, double 2.000000e+00, double 1.000000e+00, i8 signext 47, i8 signext 43)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), double %99)
%101 = fcmp oeq double %99, 3.000000e+00
%102 = select i1 %101, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
%103 = call i32 @puts(i8* dereferenceable(1) %102)
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.32, i64 0, i64 0))
%105 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), double 7.000000e+00)
%106 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.34, i64 0, i64 0), double 6.000000e+00)
%107 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), double 8.000000e+00)
%108 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i64 0, i64 0), double 8.000000e+00)
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.37, i64 0, i64 0))
%110 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.38, i64 0, i64 0), double 2.560000e+02)
%111 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), double 5.000000e-01)
%112 = call i32 @testProcessEquationStr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.39, i64 0, i64 0), double 5.050000e+00)
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.40, i64 0, i64 0))
ret i32 0
}