#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 /*<<< orphan*/ ungetch(int);
int main() {
  int type;
  double op2;
  char s[100];
  char ltr;
  ungetch(EOF);
  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)
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   1110 <ungetch@plt>
lea    -0x80(%rbp),%rdi
call   10f0 <getop@plt>
mov    %eax,-0x8(%rbp)
mov    0x2d75(%rip),%rcx
cmp    (%rcx),%eax
je     15ff <main+0x3bf>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1120 <isalpha@plt>
cmp    $0x0,%rax
je     12ba <main+0x7a>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1070 <islower@plt>
cmp    $0x0,%rax
je     12ba <main+0x7a>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1060 <fetch_var@plt>
call   1140 <push@plt>
jmp    1260 <main+0x20>
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x74,%eax
ja     15e8 <main+0x3a8>
mov    -0x90(%rbp),%rax
lea    0xd20(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x80(%rbp),%rdi
call   1080 <atof@plt>
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
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   1140 <push@plt>
jmp    15fa <main+0x3ba>
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   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <pop@plt>
subsd  -0x10(%rbp),%xmm0
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13a5 <main+0x165>
jp     13a5 <main+0x165>
jmp    13bb <main+0x17b>
mov    $0x0,%al
call   10c0 <pop@plt>
divsd  -0x10(%rbp),%xmm0
call   1140 <push@plt>
jmp    13c9 <main+0x189>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13f7 <main+0x1b7>
jp     13f7 <main+0x1b7>
jmp    1418 <main+0x1d8>
mov    $0x0,%al
call   10c0 <pop@plt>
cvttsd2si %xmm0,%eax
cvttsd2si -0x10(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
call   1140 <push@plt>
jmp    1426 <main+0x1e6>
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   1050 <stack_top@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   1030 <dupe_top@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   1040 <swap_top_two@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   1130 <clear_stack@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
call   10e0 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
call   1100 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  -0x10(%rbp),%xmm1
call   1150 <pow@plt>
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   1090 <fetch_last@plt>
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10d0 <getchar@plt>
mov    %al,-0x81(%rbp)
movsbl -0x81(%rbp),%edi
call   1120 <isalpha@plt>
cmp    $0x0,%rax
je     1535 <main+0x2f5>
movsbl -0x81(%rbp),%edi
call   1070 <islower@plt>
cmp    $0x0,%rax
je     1535 <main+0x2f5>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x81(%rbp),%al
movsd  -0x10(%rbp),%xmm0
movsbl %al,%edi
call   1160 <store_var@plt>
movsd  -0x10(%rbp),%xmm0
call   1140 <push@plt>
jmp    15fa <main+0x3ba>
mov    $0x0,%al
call   10c0 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xcc0(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
movb   $0x61,-0x81(%rbp)
movsbl -0x81(%rbp),%eax
cmp    $0x7a,%eax
jg     15d9 <main+0x399>
movsbl -0x81(%rbp),%edi
call   1060 <fetch_var@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1594 <main+0x354>
jp     1594 <main+0x354>
jmp    15c1 <main+0x381>
movsbl -0x81(%rbp),%eax
mov    %eax,-0xa4(%rbp)
movsbl -0x81(%rbp),%edi
call   1060 <fetch_var@plt>
mov    -0xa4(%rbp),%esi
lea    0xc5f(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
jmp    15c6 <main+0x386>
mov    -0x81(%rbp),%al
add    $0x1,%al
mov    %al,-0x81(%rbp)
jmp    1560 <main+0x320>
movsd  -0x10(%rbp),%xmm0
call   10b0 <store_last@plt>
jmp    15fa <main+0x3ba>
lea    -0x80(%rbp),%rsi
lea    0xc31(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1260 <main+0x20>
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
mov    0x2d83(%rip),%r14
mov    (%r14),%edi
call   1120 <ungetch@plt>
lea    0x10(%rsp),%rdi
call   1100 <getop@plt>
cmp    (%r14),%eax
jne    128d <main+0x3d>
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    0xd6c(%rip),%r15
lea    0xf40(%rip),%r12
jmp    12cc <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1060 <fetch_var@plt>
call   1150 <push@plt>
mov    %rbx,%rdi
call   1100 <getop@plt>
mov    %eax,%r13d
cmp    (%r14),%eax
je     127c <main+0x2c>
movsbl %r13b,%ebp
mov    %ebp,%edi
call   1130 <isalpha@plt>
test   %rax,%rax
je     12e8 <main+0x98>
mov    %ebp,%edi
call   1070 <islower@plt>
test   %rax,%rax
jne    12b0 <main+0x60>
add    $0xfffffff6,%r13d
cmp    $0x74,%r13d
ja     1358 <main+0x108>
movslq (%r15,%r13,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   10d0 <pop@plt>
lea    0xed3(%rip),%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   10b0 <printf@plt>
mov    $0x61,%ebp
jmp    132c <main+0xdc>
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x7b,%ebp
je     150f <main+0x2bf>
movsbl %bpl,%edi
call   1060 <fetch_var@plt>
ucomisd 0xcc3(%rip),%xmm0
jne    1341 <main+0xf1>
jnp    1320 <main+0xd0>
movsbl %bpl,%edi
call   1060 <fetch_var@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   10b0 <printf@plt>
jmp    1320 <main+0xd0>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
jmp    12bc <main+0x6c>
xor    %eax,%eax
call   1140 <clear_stack@plt>
jmp    12bc <main+0x6c>
xor    %eax,%eax
call   1030 <dupe_top@plt>
jmp    12bc <main+0x6c>
xor    %eax,%eax
call   10d0 <pop@plt>
ucomisd 0xc6b(%rip),%xmm0
jne    139d <main+0x14d>
jnp    151f <main+0x2cf>
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    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
call   10f0 <sin@plt>
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
mulsd  0x8(%rsp),%xmm0
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
addsd  0x8(%rsp),%xmm0
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
subsd  0x8(%rsp),%xmm0
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
ucomisd 0xbc0(%rip),%xmm0
jne    1448 <main+0x1f8>
jnp    1530 <main+0x2e0>
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   10d0 <pop@plt>
divsd  0x8(%rsp),%xmm0
jmp    12b7 <main+0x67>
mov    %rbx,%rdi
call   1090 <atof@plt>
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10e0 <getchar@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1130 <isalpha@plt>
test   %rax,%rax
je     12bc <main+0x6c>
mov    %ebp,%edi
call   1070 <islower@plt>
test   %rax,%rax
je     12bc <main+0x6c>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1170 <store_var@plt>
movsd  0x8(%rsp),%xmm0
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   1050 <stack_top@plt>
jmp    12bc <main+0x6c>
xor    %eax,%eax
call   10a0 <fetch_last@plt>
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10d0 <pop@plt>
movsd  0x8(%rsp),%xmm1
call   1160 <pow@plt>
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   10d0 <pop@plt>
call   1110 <exp@plt>
jmp    12b7 <main+0x67>
xor    %eax,%eax
call   1040 <swap_top_two@plt>
jmp    12bc <main+0x6c>
movsd  0x8(%rsp),%xmm0
call   10c0 <store_last@plt>
jmp    12bc <main+0x6c>
lea    0xce3(%rip),%rdi
call   1080 <puts@plt>
jmp    12bc <main+0x6c>
lea    0xcf0(%rip),%rdi
call   1080 <puts@plt>
jmp    12bc <main+0x6c>

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