#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 EOF;
double atof(char *);
int /*<<< orphan*/ clear_stack();
int /*<<< orphan*/ dupe_top();
double exp(double);
double fetch_last();
double fetch_var(char);
char getchar();
int getop(char *);
scalar_t__ isalpha(char);
scalar_t__ islower(char);
double pop();
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ push(double);
double sin(double);
int /*<<< orphan*/ stack_top();
int /*<<< orphan*/ store_last(double);
int /*<<< orphan*/ store_var(char, double);
int /*<<< orphan*/ swap_top_two();
int main() {
  int type;
  double op2;
  char s[100];
  char ltr;
  while ((type = getop(s)) != EOF) {
    if (isalpha(type) && islower(type)) {
      push(fetch_var(type));
      continue;
    }
    switch (type) {
    case '0':
      push(atof(s));
      break;
    case '+':
      push(pop() + pop());
      break;
    case '*':
      push(pop() * pop());
      break;
    case '-':
      op2 = pop();
      push(pop() - op2);
      break;
    case '/':
      op2 = pop();
      if (op2 != 0.0) {
        push(pop() / op2);
      } else {
        printf("Error: Cannot divide by zero.\n");
      }
      break;
    case '%':
      op2 = pop();
      if (op2 != 0.0) {
        push((int)pop() % (int)op2);
      } else {
        printf("Error: Cannot modulo by zero.\n");
      }
      break;
    case '?':
      stack_top();
      break;
    case '#':
      dupe_top();
      break;
    case '~':
      swap_top_two();
      break;
    case '!':
      clear_stack();
      break;
    case '(':
      op2 = sin(pop());
      push(op2);
      break;
    case '{':
      op2 = exp(pop());
      push(op2);
      break;
    case '^':
      op2 = pop();
      push(pow(pop(), op2));
      break;
    case '@':
      push(fetch_last());
      break;
    case '=':
      ltr = getchar();
      if (isalpha(ltr) && islower(ltr)) {
        op2 = pop();
        store_var(ltr, op2);
        push(op2);
      }
      break;
    case '\n':
      op2 = pop();
      printf("\t%.8g\n", op2);
      for (ltr = 'a'; ltr <= 'z'; ltr++) {
        if (fetch_var(ltr) != 0) {
          printf("\t%c: %.8g\n", ltr, fetch_var(ltr));
        }
      }
      store_last(op2);
      break;
    default:
      printf("Error: Unknown command %s\n", s);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
call   10f0 <getop@plt>
mov    %eax,-0x8(%rbp)
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
je     15e1 <main+0x3b1>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1110 <isalpha@plt>
cmp    $0x0,%rax
je     129c <main+0x6c>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1070 <islower@plt>
cmp    $0x0,%rax
je     129c <main+0x6c>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1060 <fetch_var@plt>
call   1130 <push@plt>
jmp    1242 <main+0x12>
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x74,%eax
ja     15ca <main+0x39a>
mov    -0x90(%rbp),%rax
lea    0xd3e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x80(%rbp),%rdi
call   1080 <atof@plt>
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x98(%rbp)
ff
mov    $0x0,%al
call   10c0 <pop@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
mov    $0x0,%al
call   10c0 <pop@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <pop@plt>
subsd  -0x10(%rbp),%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1387 <main+0x157>
jp     1387 <main+0x157>
jmp    139d <main+0x16d>
mov    $0x0,%al
call   10c0 <pop@plt>
divsd  -0x10(%rbp),%xmm0
call   1130 <push@plt>
jmp    13ab <main+0x17b>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13d9 <main+0x1a9>
jp     13d9 <main+0x1a9>
jmp    13fa <main+0x1ca>
mov    $0x0,%al
call   10c0 <pop@plt>
cvttsd2si %xmm0,%eax
cvttsd2si -0x10(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
call   1130 <push@plt>
jmp    1408 <main+0x1d8>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   1050 <stack_top@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   1030 <dupe_top@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   1040 <swap_top_two@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   1120 <clear_stack@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
call   10e0 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
call   1100 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  -0x10(%rbp),%xmm1
call   1140 <pow@plt>
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   1090 <fetch_last@plt>
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10d0 <getchar@plt>
mov    %al,-0x81(%rbp)
movsbl -0x81(%rbp),%edi
call   1110 <isalpha@plt>
cmp    $0x0,%rax
je     1517 <main+0x2e7>
movsbl -0x81(%rbp),%edi
call   1070 <islower@plt>
cmp    $0x0,%rax
je     1517 <main+0x2e7>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x81(%rbp),%al
movsd  -0x10(%rbp),%xmm0
movsbl %al,%edi
call   1150 <store_var@plt>
movsd  -0x10(%rbp),%xmm0
call   1130 <push@plt>
jmp    15dc <main+0x3ac>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xcde(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
movb   $0x61,-0x81(%rbp)
movsbl -0x81(%rbp),%eax
cmp    $0x7a,%eax
jg     15bb <main+0x38b>
movsbl -0x81(%rbp),%edi
call   1060 <fetch_var@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1576 <main+0x346>
jp     1576 <main+0x346>
jmp    15a3 <main+0x373>
movsbl -0x81(%rbp),%eax
mov    %eax,-0xa4(%rbp)
movsbl -0x81(%rbp),%edi
call   1060 <fetch_var@plt>
mov    -0xa4(%rbp),%esi
lea    0xc7d(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
jmp    15a8 <main+0x378>
mov    -0x81(%rbp),%al
add    $0x1,%al
mov    %al,-0x81(%rbp)
jmp    1542 <main+0x312>
movsd  -0x10(%rbp),%xmm0
call   10b0 <store_last@plt>
jmp    15dc <main+0x3ac>
lea    -0x80(%rbp),%rsi
lea    0xc4f(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1242 <main+0x12>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%rdi
call   1100 <getop@plt>
mov    0x2d89(%rip),%r14
cmp    (%r14),%eax
jne    1275 <main+0x35>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r13d
lea    0x10(%rsp),%rbx
lea    0xd84(%rip),%r15
lea    0xf58(%rip),%r12
jmp    12ac <main+0x6c>
nopl   (%rax)
mov    %ebp,%edi
call   1060 <fetch_var@plt>
call   1140 <push@plt>
mov    %rbx,%rdi
call   1100 <getop@plt>
mov    %eax,%r13d
cmp    (%r14),%eax
je     1264 <main+0x24>
movsbl %r13b,%ebp
mov    %ebp,%edi
call   1120 <isalpha@plt>
test   %rax,%rax
je     12c8 <main+0x88>
mov    %ebp,%edi
call   1070 <islower@plt>
test   %rax,%rax
jne    1290 <main+0x50>
add    $0xfffffff6,%r13d
cmp    $0x74,%r13d
ja     1338 <main+0xf8>
movslq (%r15,%r13,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   10d0 <pop@plt>
lea    0xef3(%rip),%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   10b0 <printf@plt>
mov    $0x61,%ebp
jmp    130c <main+0xcc>
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x7b,%ebp
je     14ef <main+0x2af>
movsbl %bpl,%edi
call   1060 <fetch_var@plt>
ucomisd 0xce3(%rip),%xmm0
jne    1321 <main+0xe1>
jnp    1300 <main+0xc0>
movsbl %bpl,%edi
call   1060 <fetch_var@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   10b0 <printf@plt>
jmp    1300 <main+0xc0>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
jmp    129c <main+0x5c>
xor    %eax,%eax
call   1130 <clear_stack@plt>
jmp    129c <main+0x5c>
xor    %eax,%eax
call   1030 <dupe_top@plt>
jmp    129c <main+0x5c>
xor    %eax,%eax
call   10d0 <pop@plt>
ucomisd 0xc8b(%rip),%xmm0
jne    137d <main+0x13d>
jnp    14ff <main+0x2bf>
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   10d0 <pop@plt>
cvttsd2si %xmm0,%eax
cvttsd2si 0x8(%rsp),%ecx
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
call   10f0 <sin@plt>
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
mulsd  0x8(%rsp),%xmm0
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
addsd  0x8(%rsp),%xmm0
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
subsd  0x8(%rsp),%xmm0
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
ucomisd 0xbe0(%rip),%xmm0
jne    1428 <main+0x1e8>
jnp    1510 <main+0x2d0>
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   10d0 <pop@plt>
divsd  0x8(%rsp),%xmm0
jmp    1297 <main+0x57>
mov    %rbx,%rdi
call   1090 <atof@plt>
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10e0 <getchar@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1120 <isalpha@plt>
test   %rax,%rax
je     129c <main+0x5c>
mov    %ebp,%edi
call   1070 <islower@plt>
test   %rax,%rax
je     129c <main+0x5c>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1160 <store_var@plt>
movsd  0x8(%rsp),%xmm0
jmp    1297 <main+0x57>
xor    %eax,%eax
call   1050 <stack_top@plt>
jmp    129c <main+0x5c>
xor    %eax,%eax
call   10a0 <fetch_last@plt>
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  0x8(%rsp),%xmm1
call   1150 <pow@plt>
jmp    1297 <main+0x57>
xor    %eax,%eax
call   10d0 <pop@plt>
call   1110 <exp@plt>
jmp    1297 <main+0x57>
xor    %eax,%eax
call   1040 <swap_top_two@plt>
jmp    129c <main+0x5c>
movsd  0x8(%rsp),%xmm0
call   10c0 <store_last@plt>
jmp    129c <main+0x5c>
lea    0xd03(%rip),%rdi
call   1080 <puts@plt>
jmp    129c <main+0x5c>
lea    0xd10(%rip),%rdi
call   1080 <puts@plt>
jmp    129c <main+0x5c>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [31 x i8] c"Error: Cannot divide by zero.\0A\00"
@.str.1 = [31 x i8] c"Error: Cannot modulo by zero.\0A\00"
@.str.2 = [7 x i8] c"\09%.8g\0A\00"
@.str.3 = [11 x i8] c"\09%c: %.8g\0A\00"
@.str.4 = [27 x i8] c"Error: Unknown command %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [100 x i8]
%5 = alloca i8
store i32 0, i32* %1
br label %6
6: ; preds = %147, %21, %0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = call i32 @getop(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %148
11: ; preds = %6
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i8
%14 = call i64 @isalpha(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %11
%17 = load i32, i32* %2
%18 = trunc i32 %17 to i8
%19 = call i64 @islower(i8 signext %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %16
%22 = load i32, i32* %2
%23 = trunc i32 %22 to i8
%24 = call double @fetch_var(i8 signext %23)
%25 = call i32 @push(double %24)
br label %6
26: ; preds = %16, %11
%27 = load i32, i32* %2
switch i32 %27, label %144 [
i32 48, label %28
i32 43, label %32
i32 42, label %37
i32 45, label %42
i32 47, label %48
i32 37, label %60
i32 63, label %75
i32 35, label %77
i32 126, label %79
i32 33, label %81
i32 40, label %83
i32 123, label %88
i32 94, label %93
i32 64, label %99
i32 61, label %102
i32 10, label %119
]
28: ; preds = %26
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%30 = call double @atof(i8* %29)
%31 = call i32 @push(double %30)
br label %147
32: ; preds = %26
%33 = call double (...) @pop()
%34 = call double (...) @pop()
%35 = fadd double %33, %34
%36 = call i32 @push(double %35)
br label %147
37: ; preds = %26
%38 = call double (...) @pop()
%39 = call double (...) @pop()
%40 = fmul double %38, %39
%41 = call i32 @push(double %40)
br label %147
42: ; preds = %26
%43 = call double (...) @pop()
store double %43, double* %3
%44 = call double (...) @pop()
%45 = load double, double* %3
%46 = fsub double %44, %45
%47 = call i32 @push(double %46)
br label %147
48: ; preds = %26
%49 = call double (...) @pop()
store double %49, double* %3
%50 = load double, double* %3
%51 = fcmp une double %50, 0.000000e+00
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = call double (...) @pop()
%54 = load double, double* %3
%55 = fdiv double %53, %54
%56 = call i32 @push(double %55)
br label %59
57: ; preds = %48
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %57, %52
br label %147
60: ; preds = %26
%61 = call double (...) @pop()
store double %61, double* %3
%62 = load double, double* %3
%63 = fcmp une double %62, 0.000000e+00
br i1 %63, label %64, label %72
64: ; preds = %60
%65 = call double (...) @pop()
%66 = fptosi double %65 to i32
%67 = load double, double* %3
%68 = fptosi double %67 to i32
%69 = srem i32 %66, %68
%70 = sitofp i32 %69 to double
%71 = call i32 @push(double %70)
br label %74
72: ; preds = %60
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %74
74: ; preds = %72, %64
br label %147
75: ; preds = %26
%76 = call i32 (...) @stack_top()
br label %147
77: ; preds = %26
%78 = call i32 (...) @dupe_top()
br label %147
79: ; preds = %26
%80 = call i32 (...) @swap_top_two()
br label %147
81: ; preds = %26
%82 = call i32 (...) @clear_stack()
br label %147
83: ; preds = %26
%84 = call double (...) @pop()
%85 = call double @sin(double %84)
store double %85, double* %3
%86 = load double, double* %3
%87 = call i32 @push(double %86)
br label %147
88: ; preds = %26
%89 = call double (...) @pop()
%90 = call double @exp(double %89)
store double %90, double* %3
%91 = load double, double* %3
%92 = call i32 @push(double %91)
br label %147
93: ; preds = %26
%94 = call double (...) @pop()
store double %94, double* %3
%95 = call double (...) @pop()
%96 = load double, double* %3
%97 = call double @pow(double %95, double %96)
%98 = call i32 @push(double %97)
br label %147
99: ; preds = %26
%100 = call double (...) @fetch_last()
%101 = call i32 @push(double %100)
br label %147
102: ; preds = %26
%103 = call signext i8 (...) @getchar()
store i8 %103, i8* %5
%104 = load i8, i8* %5
%105 = call i64 @isalpha(i8 signext %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %118
107: ; preds = %102
%108 = load i8, i8* %5
%109 = call i64 @islower(i8 signext %108)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %118
111: ; preds = %107
%112 = call double (...) @pop()
store double %112, double* %3
%113 = load i8, i8* %5
%114 = load double, double* %3
%115 = call i32 @store_var(i8 signext %113, double %114)
%116 = load double, double* %3
%117 = call i32 @push(double %116)
br label %118
118: ; preds = %111, %107, %102
br label %147
119: ; preds = %26
%120 = call double (...) @pop()
store double %120, double* %3
%121 = load double, double* %3
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %121)
store i8 97, i8* %5
br label %123
123: ; preds = %138, %119
%124 = load i8, i8* %5
%125 = sext i8 %124 to i32
%126 = icmp sle i32 %125, 122
br i1 %126, label %127, label %141
127: ; preds = %123
%128 = load i8, i8* %5
%129 = call double @fetch_var(i8 signext %128)
%130 = fcmp une double %129, 0.000000e+00
br i1 %130, label %131, label %137
131: ; preds = %127
%132 = load i8, i8* %5
%133 = sext i8 %132 to i32
%134 = load i8, i8* %5
%135 = call double @fetch_var(i8 signext %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %133, double %135)
br label %137
137: ; preds = %131, %127
br label %138
138: ; preds = %137
%139 = load i8, i8* %5
%140 = add i8 %139, 1
store i8 %140, i8* %5
br label %123
141: ; preds = %123
%142 = load double, double* %3
%143 = call i32 @store_last(double %142)
br label %147
144: ; preds = %26
%145 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %145)
br label %147
147: ; preds = %144, %141, %118, %99, %93, %88, %83, %81, %79, %77, %75, %74, %59, %42, %37, %32, %28
br label %6
148: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str.2 = [7 x i8] c"\09%.8g\0A\00"
@.str.3 = [11 x i8] c"\09%c: %.8g\0A\00"
@.str.4 = [27 x i8] c"Error: Unknown command %s\0A\00"
@str = [30 x i8] c"Error: Cannot modulo by zero.\00"
@str.5 = [30 x i8] c"Error: Cannot divide by zero.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getop(i8* %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %114, label %6
6: ; preds = %0, %17
%7 = phi i32 [ %18, %17 ], [ %3, %0 ]
%8 = trunc i32 %7 to i8
%9 = call i64 @isalpha(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %21, label %11
11: ; preds = %6
%12 = call i64 @islower(i8 signext %8)
%13 = icmp eq i64 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = call double @fetch_var(i8 signext %8)
%16 = call i32 @push(double %15)
br label %17
17: ; preds = %22, %25, %30, %35, %61, %63, %65, %67, %69, %73, %77, %82, %110, %112, %47, %43, %59, %52, %92, %89, %85, %14
%18 = call i32 @getop(i8* %2)
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %18, %19
br i1 %20, label %114, label %6
21: ; preds = %11, %6
switch i32 %7, label %112 [
i32 48, label %22
i32 43, label %25
i32 42, label %30
i32 45, label %35
i32 47, label %40
i32 37, label %49
i32 63, label %61
i32 35, label %63
i32 126, label %65
i32 33, label %67
i32 40, label %69
i32 123, label %73
i32 94, label %77
i32 64, label %82
i32 61, label %85
i32 10, label %96
]
22: ; preds = %21
%23 = call double @atof(i8* %2)
%24 = call i32 @push(double %23)
br label %17
25: ; preds = %21
%26 = call double (...) @pop()
%27 = call double (...) @pop()
%28 = fadd double %26, %27
%29 = call i32 @push(double %28)
br label %17
30: ; preds = %21
%31 = call double (...) @pop()
%32 = call double (...) @pop()
%33 = fmul double %31, %32
%34 = call i32 @push(double %33)
br label %17
35: ; preds = %21
%36 = call double (...) @pop()
%37 = call double (...) @pop()
%38 = fsub double %37, %36
%39 = call i32 @push(double %38)
br label %17
40: ; preds = %21
%41 = call double (...) @pop()
%42 = fcmp une double %41, 0.000000e+00
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = call double (...) @pop()
%45 = fdiv double %44, %41
%46 = call i32 @push(double %45)
br label %17
47: ; preds = %40
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.5, i64 0, i64 0))
br label %17
49: ; preds = %21
%50 = call double (...) @pop()
%51 = fcmp une double %50, 0.000000e+00
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = call double (...) @pop()
%54 = fptosi double %53 to i32
%55 = fptosi double %50 to i32
%56 = srem i32 %54, %55
%57 = sitofp i32 %56 to double
%58 = call i32 @push(double %57)
br label %17
59: ; preds = %49
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %17
61: ; preds = %21
%62 = call i32 (...) @stack_top()
br label %17
63: ; preds = %21
%64 = call i32 (...) @dupe_top()
br label %17
65: ; preds = %21
%66 = call i32 (...) @swap_top_two()
br label %17
67: ; preds = %21
%68 = call i32 (...) @clear_stack()
br label %17
69: ; preds = %21
%70 = call double (...) @pop()
%71 = call double @sin(double %70)
%72 = call i32 @push(double %71)
br label %17
73: ; preds = %21
%74 = call double (...) @pop()
%75 = call double @exp(double %74)
%76 = call i32 @push(double %75)
br label %17
77: ; preds = %21
%78 = call double (...) @pop()
%79 = call double (...) @pop()
%80 = call double @pow(double %79, double %78)
%81 = call i32 @push(double %80)
br label %17
82: ; preds = %21
%83 = call double (...) @fetch_last()
%84 = call i32 @push(double %83)
br label %17
85: ; preds = %21
%86 = call signext i8 (...) @getchar()
%87 = call i64 @isalpha(i8 signext %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %17, label %89
89: ; preds = %85
%90 = call i64 @islower(i8 signext %86)
%91 = icmp eq i64 %90, 0
br i1 %91, label %17, label %92
92: ; preds = %89
%93 = call double (...) @pop()
%94 = call i32 @store_var(i8 signext %86, double %93)
%95 = call i32 @push(double %93)
br label %17
96: ; preds = %21
%97 = call double (...) @pop()
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %97)
br label %99
99: ; preds = %96, %107
%100 = phi i32 [ 97, %96 ], [ %108, %107 ]
%101 = trunc i32 %100 to i8
%102 = call double @fetch_var(i8 signext %101)
%103 = fcmp une double %102, 0.000000e+00
br i1 %103, label %104, label %107
104: ; preds = %99
%105 = call double @fetch_var(i8 signext %101)
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %100, double %105)
br label %107
107: ; preds = %99, %104
%108 = add nuw nsw i32 %100, 1
%109 = icmp eq i32 %108, 123
br i1 %109, label %110, label %99
110: ; preds = %107
%111 = call i32 @store_last(double %97)
br label %17
112: ; preds = %21
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %2)
br label %17
114: ; preds = %17, %0
ret i32 0
}