#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 */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
double exp(double);
scalar_t__ getline(char *, int);
int /*<<< orphan*/ isspace(char);
double pop();
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ push(double);
int /*<<< orphan*/ replace();
double sin(double);
int sscanf(char *, char *, ...);
double watch();
int main() {
  char type;
  double op1, op2;
  double dval;
  char line[100], *p;
  while (getline(line, sizeof(line)) > 0) {
    p = line;
    while (*p != '\0') {
      if (sscanf(p, "%lf", &dval) == 1) {
        push(dval);
        while (!isspace(*++p))
          ;
      } else if (sscanf(p, "%1s", &type) == 1) {
        switch (type) {
        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: zero divisor\n");
          break;
        case '%':
          op2 = pop();
          if (op2 != 0.0)
            push((int)pop() % (int)op2);
          else
            printf("error: zero divisor\n");
          break;
        case 'w':
          printf("\t%.8g\n", watch());
          break;
        case 'd':
          push(watch());
          break;
        case 'r':
          replace();
          break;
        case 's':
          push(sin(pop()));
          break;
        case 'e':
          push(exp(pop()));
          break;
        case 'p':
          op1 = pop();
          op2 = pop();
          if (op2 == 0 && op1 <= 0)
            printf("error: over field\n");
          else if (op2 < 0) {
            op1 = (int)op1;
            push(pow(op2, op1));
          } else
            push(pow(op2, op1));
          break;
        default:
          printf("error: unknown command %s\n", line);
          return -1;
        }
        while (!isspace(*++p))
          ;
        if (*p++ == '\n')
          printf("\t%.8g\n", pop());
      } else
        p++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x64,%esi
call   10d0 <getline@plt>
cmp    $0x0,%rax
jle    15a9 <main+0x3f9>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     15a4 <main+0x3f4>
mov    -0x98(%rbp),%rdi
lea    0xf40(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1267 <main+0xb7>
movsd  -0x20(%rbp),%xmm0
call   10a0 <push@plt>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x98(%rbp)
movsbl 0x1(%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    125d <main+0xad>
jmp    1262 <main+0xb2>
jmp    122a <main+0x7a>
jmp    159f <main+0x3ef>
mov    -0x98(%rbp),%rdi
lea    0xedb(%rip),%rsi
lea    -0x5(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1588 <main+0x3d8>
movsbl -0x5(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0xa0(%rbp)
sub    $0x52,%eax
ja     14ef <main+0x33f>
mov    -0xa0(%rbp),%rax
lea    0xd50(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
mov    $0x0,%al
call   1060 <pop@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
mov    $0x0,%al
call   1060 <pop@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1060 <pop@plt>
subsd  -0x18(%rbp),%xmm0
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1362 <main+0x1b2>
jp     1362 <main+0x1b2>
jmp    1378 <main+0x1c8>
mov    $0x0,%al
call   1060 <pop@plt>
divsd  -0x18(%rbp),%xmm0
call   10a0 <push@plt>
jmp    1386 <main+0x1d6>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13b4 <main+0x204>
jp     13b4 <main+0x204>
jmp    13d5 <main+0x225>
mov    $0x0,%al
call   1060 <pop@plt>
cvttsd2si %xmm0,%eax
cvttsd2si -0x18(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
call   10a0 <push@plt>
jmp    13e3 <main+0x233>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1030 <watch@plt>
lea    0xd73(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1030 <watch@plt>
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   10b0 <replace@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
call   1070 <sin@plt>
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
call   1080 <exp@plt>
call   10a0 <push@plt>
jmp    1510 <main+0x360>
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1060 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    149c <main+0x2ec>
jp     149c <main+0x2ec>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     149c <main+0x2ec>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14ea <main+0x33a>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    14d1 <main+0x321>
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   10c0 <pow@plt>
call   10a0 <push@plt>
jmp    14e5 <main+0x335>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   10c0 <pow@plt>
call   10a0 <push@plt>
jmp    14ea <main+0x33a>
jmp    1510 <main+0x360>
lea    -0x90(%rbp),%rsi
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15b0 <main+0x400>
jmp    1515 <main+0x365>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x98(%rbp)
movsbl 0x1(%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1548 <main+0x398>
jmp    154d <main+0x39d>
jmp    1515 <main+0x365>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x98(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1583 <main+0x3d3>
mov    $0x0,%al
call   1060 <pop@plt>
lea    0xbed(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    159a <main+0x3ea>
mov    -0x98(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x98(%rbp)
jmp    159f <main+0x3ef>
jmp    11eb <main+0x3b>
jmp    11c2 <main+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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    $0x98,%rsp
lea    0x30(%rsp),%rdi
mov    $0x64,%esi
call   10e0 <getline@plt>
test   %rax,%rax
jle    1476 <main+0x2b6>
lea    0xf64(%rip),%r15
lea    0x28(%rsp),%rbx
lea    0xf5c(%rip),%r12
lea    0xf(%rsp),%r13
lea    0xe00(%rip),%rbp
jmp    1228 <main+0x68>
nopw   0x0(%rax,%rax,1)
lea    0x30(%rsp),%rdi
mov    $0x64,%esi
call   10e0 <getline@plt>
test   %rax,%rax
jle    1476 <main+0x2b6>
cmpb   $0x0,0x30(%rsp)
je     1210 <main+0x50>
lea    0x30(%rsp),%r14
jmp    124a <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14
cmpb   $0x0,(%r14)
je     1210 <main+0x50>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    1290 <main+0xd0>
movsd  0x28(%rsp),%xmm0
call   10b0 <push@plt>
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%r14),%edi
add    $0x1,%r14
call   1060 <isspace@plt>
test   %eax,%eax
je     1270 <main+0xb0>
jmp    1244 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    1240 <main+0x80>
movsbl 0xf(%rsp),%eax
add    $0xffffffdb,%eax
cmp    $0x52,%eax
ja     147a <main+0x2ba>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <pop@plt>
ucomisd 0xd31(%rip),%xmm0
jne    12d7 <main+0x117>
jnp    140e <main+0x24e>
xor    %eax,%eax
movsd  %xmm0,0x10(%rsp)
call   1070 <pop@plt>
cvttsd2si %xmm0,%eax
cvttsd2si 0x10(%rsp),%ecx
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1070 <pop@plt>
mulsd  0x10(%rsp),%xmm0
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1070 <pop@plt>
addsd  0x10(%rsp),%xmm0
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1070 <pop@plt>
subsd  0x10(%rsp),%xmm0
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
ucomisd 0xc97(%rip),%xmm0
jne    1371 <main+0x1b1>
jnp    140e <main+0x24e>
xor    %eax,%eax
movsd  %xmm0,0x10(%rsp)
call   1070 <pop@plt>
divsd  0x10(%rsp),%xmm0
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1030 <watch@plt>
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
call   1090 <exp@plt>
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1070 <pop@plt>
movapd %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1070 <pop@plt>
movapd 0x10(%rsp),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    141c <main+0x25c>
jp     141c <main+0x25c>
ucomisd %xmm1,%xmm2
jb     141c <main+0x25c>
lea    0xda5(%rip),%rdi
call   1040 <puts@plt>
jmp    1434 <main+0x274>
xor    %eax,%eax
call   10c0 <replace@plt>
jmp    1434 <main+0x274>
xor    %eax,%eax
call   1070 <pop@plt>
call   1080 <sin@plt>
jmp    142f <main+0x26f>
xor    %eax,%eax
call   1030 <watch@plt>
lea    0xd57(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1434 <main+0x274>
lea    0xd7b(%rip),%rdi
call   1040 <puts@plt>
jmp    1434 <main+0x274>
ucomisd %xmm0,%xmm2
jbe    142a <main+0x26a>
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
call   10d0 <pow@plt>
call   10b0 <push@plt>
add    $0x1,%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r14),%edi
call   1060 <isspace@plt>
add    $0x1,%r14
test   %eax,%eax
je     1440 <main+0x280>
cmpb   $0xa,-0x1(%r14)
jne    1244 <main+0x84>
xor    %eax,%eax
call   1070 <pop@plt>
lea    0xcf2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1244 <main+0x84>
xor    %eax,%eax
jmp    1492 <main+0x2d2>
lea    0xce2(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [4 x i8] c"%1s\00"
@.str.3 = [7 x i8] c"\09%.8g\0A\00"
@.str.5 = [27 x i8] c"error: unknown command %s\0A\00"
@str = [18 x i8] c"error: over field\00"
@str.7 = [20 x i8] c"error: zero divisor\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca double
%3 = alloca [100 x i8]
%4 = bitcast double* %2 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i64 @getline(i8* %5, i32 100)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %11, label %125
8: ; preds = %121, %11
%9 = call i64 @getline(i8* %5, i32 100)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %125
11: ; preds = %0, %8
%12 = load i8, i8* %5
%13 = icmp eq i8 %12, 0
br i1 %13, label %8, label %14
14: ; preds = %11, %121
%15 = phi i8* [ %122, %121 ], [ %5, %11 ]
%16 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load double, double* %2
%20 = call i32 @push(double %19)
br label %21
21: ; preds = %21, %18
%22 = phi i8* [ %15, %18 ], [ %23, %21 ]
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = call i32 @isspace(i8 signext %24)
%26 = icmp eq i32 %25, 0
br i1 %26, label %21, label %121
27: ; preds = %14
%28 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %119
30: ; preds = %27
%31 = load i8, i8* %1
%32 = sext i8 %31 to i32
switch i32 %32, label %104 [
i32 43, label %33
i32 42, label %39
i32 45, label %44
i32 47, label %49
i32 37, label %58
i32 119, label %70
i32 100, label %73
i32 114, label %76
i32 115, label %78
i32 101, label %82
i32 112, label %86
]
33: ; preds = %30
%34 = call double (...) @pop()
%35 = call double (...) @pop()
%36 = fadd double %34, %35
%37 = call i32 @push(double %36)
br label %38
38: ; preds = %92, %101, %96, %61, %68, %52, %56, %82, %78, %76, %73, %70, %44, %39, %33
br label %106
39: ; preds = %30
%40 = call double (...) @pop()
%41 = call double (...) @pop()
%42 = fmul double %40, %41
%43 = call i32 @push(double %42)
br label %38
44: ; preds = %30
%45 = call double (...) @pop()
%46 = call double (...) @pop()
%47 = fsub double %46, %45
%48 = call i32 @push(double %47)
br label %38
49: ; preds = %30
%50 = call double (...) @pop()
%51 = fcmp une double %50, 0.000000e+00
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = call double (...) @pop()
%54 = fdiv double %53, %50
%55 = call i32 @push(double %54)
br label %38
56: ; preds = %49
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
br label %38
58: ; preds = %30
%59 = call double (...) @pop()
%60 = fcmp une double %59, 0.000000e+00
br i1 %60, label %61, label %68
61: ; preds = %58
%62 = call double (...) @pop()
%63 = fptosi double %62 to i32
%64 = fptosi double %59 to i32
%65 = srem i32 %63, %64
%66 = sitofp i32 %65 to double
%67 = call i32 @push(double %66)
br label %38
68: ; preds = %58
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
br label %38
70: ; preds = %30
%71 = call double (...) @watch()
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %71)
br label %38
73: ; preds = %30
%74 = call double (...) @watch()
%75 = call i32 @push(double %74)
br label %38
76: ; preds = %30
%77 = call i32 (...) @replace()
br label %38
78: ; preds = %30
%79 = call double (...) @pop()
%80 = call double @sin(double %79)
%81 = call i32 @push(double %80)
br label %38
82: ; preds = %30
%83 = call double (...) @pop()
%84 = call double @exp(double %83)
%85 = call i32 @push(double %84)
br label %38
86: ; preds = %30
%87 = call double (...) @pop()
%88 = call double (...) @pop()
%89 = fcmp oeq double %88, 0.000000e+00
%90 = fcmp ole double %87, 0.000000e+00
%91 = select i1 %89, i1 %90, i1 false
br i1 %91, label %92, label %94
92: ; preds = %86
%93 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %38
94: ; preds = %86
%95 = fcmp olt double %88, 0.000000e+00
br i1 %95, label %96, label %101
96: ; preds = %94
%97 = fptosi double %87 to i32
%98 = sitofp i32 %97 to double
%99 = call double @pow(double %88, double %98)
%100 = call i32 @push(double %99)
br label %38
101: ; preds = %94
%102 = call double @pow(double %88, double %87)
%103 = call i32 @push(double %102)
br label %38
104: ; preds = %30
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %5)
br label %125
106: ; preds = %38, %106
%107 = phi i8* [ %108, %106 ], [ %15, %38 ]
%108 = getelementptr inbounds i8, i8* %107, i64 1
%109 = load i8, i8* %108
%110 = call i32 @isspace(i8 signext %109)
%111 = icmp eq i32 %110, 0
br i1 %111, label %106, label %112
112: ; preds = %106
%113 = getelementptr inbounds i8, i8* %107, i64 2
%114 = load i8, i8* %108
%115 = icmp eq i8 %114, 10
br i1 %115, label %116, label %121
116: ; preds = %112
%117 = call double (...) @pop()
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %117)
br label %121
119: ; preds = %27
%120 = getelementptr inbounds i8, i8* %15, i64 1
br label %121
121: ; preds = %21, %119, %116, %112
%122 = phi i8* [ %113, %116 ], [ %113, %112 ], [ %120, %119 ], [ %23, %21 ]
%123 = load i8, i8* %122
%124 = icmp eq i8 %123, 0
br i1 %124, label %8, label %14
125: ; preds = %8, %0, %104
%126 = phi i32 [ -1, %104 ], [ 0, %0 ], [ 0, %8 ]
ret i32 %126
}