#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 acos(double);
double asin(double);
double atan(double);
double ceil(double);
double cos(double);
double cosh(double);
double exp(double);
double floor(double);
double log(double);
double log10(double);
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
double sin(double);
double sinh(double);
double sqrt(double);
scalar_t__ strcmp(char *, char *);
double tan(double);
double tanh(double);
double mathfunctions(char s[]) {
  double pop(void);
  double op1, op2;
  op1 = op2 = 0;
  if (strcmp(s, "sin") == 0) {
    return sin(pop());
  } else if (strcmp(s, "cos") == 0) {
    return cos(pop());
  } else if (strcmp(s, "tan") == 0) {
    return tan(pop());
  } else if (strcmp(s, "asin") == 0) {
    op1 = pop();
    if (op1 <= 1.0 && op1 >= -1.0) {
      return asin(op1);
    } else {
      printf("Input outside of function range");
      return 0.0;
    }
  } else if (strcmp(s, "acos") == 0) {
    op1 = pop();
    if (op1 <= 1.0 && op1 >= -1.0) {
      return acos(op1);
    } else {
      printf("Input outside of function range");
    }
  } else if (strcmp(s, "atan") == 0) {
    return atan(pop());
  } else if (strcmp(s, "sinh") == 0) {
    return sinh(pop());
  } else if (strcmp(s, "cosh") == 0) {
    return cosh(pop());
  } else if (strcmp(s, "tanh") == 0) {
    return tanh(pop());
  } else if (strcmp(s, "exp") == 0) {
    return exp(pop());
  } else if (strcmp(s, "log") == 0) {
    op1 = pop();
    if (op1 > 0) {
      return log(op1);
    } else {
      printf("Input must be greater than zero");
      return 0.0;
    }
  } else if (strcmp(s, "log10") == 0) {
    op1 = pop();
    if (op1 > 0) {
      return log10(op1);
    } else {
      printf("Input must be greater than zero");
      return 0.0;
    }
  } else if (strcmp(s, "sqrt") == 0) {
    op1 = pop();
    if (op1 >= 0) {
      return sqrt(op1);
    } else {
      printf("Input must be equal or greater than zero");
      return 0.0;
    }
  } else if (strcmp(s, "ceil") == 0) {
    return ceil(op1);
  } else if (strcmp(s, "floor") == 0) {
    return floor(op1);
  } else if (strcmp(s, "pow") == 0) {
    op1 = pop();
    op2 = pop();
    if ((op1 != 0 || op2 >= 0) && (op1 > 0 || (op2 - (int)op2) == 0.0)) {
      return pow(op1, op2);
    } else {
      printf("Domain error");
    }
  } else {
    printf("error: unkown command %s\n", s);
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<mathfunctions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    127a <mathfunctions+0x4a>
call   1090 <pop@plt>
call   10b0 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12a8 <mathfunctions+0x78>
call   1090 <pop@plt>
call   1100 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12d6 <mathfunctions+0xa6>
call   1090 <pop@plt>
call   10f0 <tan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xd2f(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1353 <mathfunctions+0x123>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xcfe(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1338 <mathfunctions+0x108>
movsd  -0x18(%rbp),%xmm0
movsd  0xcee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1338 <mathfunctions+0x108>
movsd  -0x18(%rbp),%xmm0
call   10d0 <asin@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xcd7(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13c8 <mathfunctions+0x198>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xc81(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     13b5 <mathfunctions+0x185>
movsd  -0x18(%rbp),%xmm0
movsd  0xc71(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13b5 <mathfunctions+0x185>
movsd  -0x18(%rbp),%xmm0
call   1080 <acos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0xc59(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    173d <mathfunctions+0x50d>
mov    -0x10(%rbp),%rdi
lea    0xc67(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13f6 <mathfunctions+0x1c6>
call   1090 <pop@plt>
call   10c0 <atan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xc3e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1424 <mathfunctions+0x1f4>
call   1090 <pop@plt>
call   1030 <sinh@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xc15(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1452 <mathfunctions+0x222>
call   1090 <pop@plt>
call   1060 <cosh@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xbec(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1480 <mathfunctions+0x250>
call   1090 <pop@plt>
call   1050 <tanh@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xbc3(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    14ae <mathfunctions+0x27e>
call   1090 <pop@plt>
call   10e0 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xb99(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1513 <mathfunctions+0x2e3>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14f8 <mathfunctions+0x2c8>
movsd  -0x18(%rbp),%xmm0
call   1110 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0xb57(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xb58(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1578 <mathfunctions+0x348>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    155d <mathfunctions+0x32d>
movsd  -0x18(%rbp),%xmm0
call   1130 <log10@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xaf9(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    15dd <mathfunctions+0x3ad>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     15c2 <mathfunctions+0x392>
movsd  -0x18(%rbp),%xmm0
call   1140 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0xab8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xac2(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    160b <mathfunctions+0x3db>
movsd  -0x18(%rbp),%xmm0
call   1040 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xa99(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1639 <mathfunctions+0x409>
movsd  -0x18(%rbp),%xmm0
call   1150 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
mov    -0x10(%rbp),%rdi
lea    0xa71(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    16f4 <mathfunctions+0x4c4>
call   1090 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
call   1090 <pop@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1691 <mathfunctions+0x461>
jp     1691 <mathfunctions+0x461>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     16e1 <mathfunctions+0x4b1>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     16c8 <mathfunctions+0x498>
movsd  -0x20(%rbp),%xmm0
cvttsd2si -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    16e1 <mathfunctions+0x4b1>
jp     16e1 <mathfunctions+0x4b1>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1120 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1759 <mathfunctions+0x529>
lea    0x9d1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1706 <mathfunctions+0x4d6>
mov    -0x10(%rbp),%rsi
lea    0x9c7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    170b <mathfunctions+0x4db>
jmp    1710 <mathfunctions+0x4e0>
jmp    1715 <mathfunctions+0x4e5>
jmp    171a <mathfunctions+0x4ea>
jmp    171f <mathfunctions+0x4ef>
jmp    1724 <mathfunctions+0x4f4>
jmp    1729 <mathfunctions+0x4f9>
jmp    172e <mathfunctions+0x4fe>
jmp    1733 <mathfunctions+0x503>
jmp    1738 <mathfunctions+0x508>
jmp    173d <mathfunctions+0x50d>
jmp    1742 <mathfunctions+0x512>
jmp    1747 <mathfunctions+0x517>
jmp    174c <mathfunctions+0x51c>
jmp    1751 <mathfunctions+0x521>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mathfunctions>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xdf2(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13af <mathfunctions+0x19f>
lea    0xe02(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13be <mathfunctions+0x1ae>
lea    0xdef(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13cd <mathfunctions+0x1bd>
lea    0xdac(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13dc <mathfunctions+0x1cc>
lea    0xdb9(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1403 <mathfunctions+0x1f3>
lea    0xda6(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1442 <mathfunctions+0x232>
lea    0xd93(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1451 <mathfunctions+0x241>
lea    0xd80(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1460 <mathfunctions+0x250>
lea    0xd6d(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     146f <mathfunctions+0x25f>
lea    0xd5a(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     147e <mathfunctions+0x26e>
lea    0xd46(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     148d <mathfunctions+0x27d>
lea    0xd52(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14a6 <mathfunctions+0x296>
lea    0xd40(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14cb <mathfunctions+0x2bb>
lea    0xd56(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
xorpd  %xmm0,%xmm0
test   %rax,%rax
je     143c <mathfunctions+0x22c>
lea    0xd3f(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1438 <mathfunctions+0x228>
lea    0xd2d(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14fb <mathfunctions+0x2eb>
lea    0xd26(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1438 <mathfunctions+0x228>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    10a0 <sin@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    10f0 <cos@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    10e0 <tan@plt>
call   1080 <pop@plt>
movsd  0xc17(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     142a <mathfunctions+0x21a>
ucomisd 0xc11(%rip),%xmm0
jb     142a <mathfunctions+0x21a>
add    $0x10,%rsp
pop    %rbx
jmp    10c0 <asin@plt>
call   1080 <pop@plt>
movsd  0xbf0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     142a <mathfunctions+0x21a>
ucomisd 0xbea(%rip),%xmm0
jb     142a <mathfunctions+0x21a>
add    $0x10,%rsp
pop    %rbx
jmp    1070 <acos@plt>
lea    0xbe4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xorpd  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    10b0 <atan@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    1030 <sinh@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    1050 <cosh@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    1040 <tanh@plt>
call   1080 <pop@plt>
add    $0x10,%rsp
pop    %rbx
jmp    10d0 <exp@plt>
call   1080 <pop@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14bf <mathfunctions+0x2af>
add    $0x10,%rsp
pop    %rbx
jmp    1100 <log@plt>
call   1080 <pop@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14bf <mathfunctions+0x2af>
add    $0x10,%rsp
pop    %rbx
jmp    1120 <log10@plt>
lea    0xb90(%rip),%rdi
jmp    1431 <mathfunctions+0x221>
call   1080 <pop@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    14e6 <mathfunctions+0x2d6>
lea    0xba0(%rip),%rdi
jmp    1431 <mathfunctions+0x221>
jb     14f1 <mathfunctions+0x2e1>
sqrtsd %xmm0,%xmm0
jmp    143c <mathfunctions+0x22c>
add    $0x10,%rsp
pop    %rbx
jmp    1130 <sqrt@plt>
call   1080 <pop@plt>
movsd  %xmm0,0x8(%rsp)
call   1080 <pop@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    1533 <mathfunctions+0x323>
jp     1533 <mathfunctions+0x323>
ucomisd %xmm0,%xmm1
jae    1533 <mathfunctions+0x323>
lea    0xb8b(%rip),%rdi
jmp    1431 <mathfunctions+0x221>
ucomisd %xmm0,%xmm3
ja     1555 <mathfunctions+0x345>
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    1527 <mathfunctions+0x317>
jp     1527 <mathfunctions+0x317>
movapd %xmm3,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1110 <pow@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"cos\00"
@.str.2 = [4 x i8] c"tan\00"
@.str.3 = [5 x i8] c"asin\00"
@.str.4 = [32 x i8] c"Input outside of function range\00"
@.str.5 = [5 x i8] c"acos\00"
@.str.6 = [5 x i8] c"atan\00"
@.str.7 = [5 x i8] c"sinh\00"
@.str.8 = [5 x i8] c"cosh\00"
@.str.9 = [5 x i8] c"tanh\00"
@.str.10 = [4 x i8] c"exp\00"
@.str.11 = [4 x i8] c"log\00"
@.str.12 = [32 x i8] c"Input must be greater than zero\00"
@.str.13 = [6 x i8] c"log10\00"
@.str.14 = [5 x i8] c"sqrt\00"
@.str.15 = [41 x i8] c"Input must be equal or greater than zero\00"
@.str.16 = [5 x i8] c"ceil\00"
@.str.17 = [6 x i8] c"floor\00"
@.str.18 = [4 x i8] c"pow\00"
@.str.19 = [13 x i8] c"Domain error\00"
@.str.20 = [26 x i8] c"error: unkown command %s\0A\00"
define double @mathfunctions(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca double
%5 = alloca double
store i8* %0, i8** %3
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %4
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call double @pop()
%11 = call double @sin(double %10)
store double %11, double* %2
br label %195
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call double @pop()
%18 = call double @cos(double %17)
store double %18, double* %2
br label %195
19: ; preds = %12
%20 = load i8*, i8** %3
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call double @pop()
%25 = call double @tan(double %24)
store double %25, double* %2
br label %195
26: ; preds = %19
%27 = load i8*, i8** %3
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %42
30: ; preds = %26
%31 = call double @pop()
store double %31, double* %4
%32 = load double, double* %4
%33 = fcmp ole double %32, 1.000000e+00
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = load double, double* %4
%36 = fcmp oge double %35, -1.000000e+00
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load double, double* %4
%39 = call double @asin(double %38)
store double %39, double* %2
br label %195
40: ; preds = %34, %30
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %195
42: ; preds = %26
%43 = load i8*, i8** %3
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %59
46: ; preds = %42
%47 = call double @pop()
store double %47, double* %4
%48 = load double, double* %4
%49 = fcmp ole double %48, 1.000000e+00
br i1 %49, label %50, label %56
50: ; preds = %46
%51 = load double, double* %4
%52 = fcmp oge double %51, -1.000000e+00
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load double, double* %4
%55 = call double @acos(double %54)
store double %55, double* %2
br label %195
56: ; preds = %50, %46
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56
br label %190
59: ; preds = %42
%60 = load i8*, i8** %3
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = call double @pop()
%65 = call double @atan(double %64)
store double %65, double* %2
br label %195
66: ; preds = %59
%67 = load i8*, i8** %3
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = call double @pop()
%72 = call double @sinh(double %71)
store double %72, double* %2
br label %195
73: ; preds = %66
%74 = load i8*, i8** %3
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %73
%78 = call double @pop()
%79 = call double @cosh(double %78)
store double %79, double* %2
br label %195
80: ; preds = %73
%81 = load i8*, i8** %3
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %80
%85 = call double @pop()
%86 = call double @tanh(double %85)
store double %86, double* %2
br label %195
87: ; preds = %80
%88 = load i8*, i8** %3
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %87
%92 = call double @pop()
%93 = call double @exp(double %92)
store double %93, double* %2
br label %195
94: ; preds = %87
%95 = load i8*, i8** %3
%96 = call i64 @strcmp(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %107
98: ; preds = %94
%99 = call double @pop()
store double %99, double* %4
%100 = load double, double* %4
%101 = fcmp ogt double %100, 0.000000e+00
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load double, double* %4
%104 = call double @log(double %103)
store double %104, double* %2
br label %195
105: ; preds = %98
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %195
107: ; preds = %94
%108 = load i8*, i8** %3
%109 = call i64 @strcmp(i8* %108, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %120
111: ; preds = %107
%112 = call double @pop()
store double %112, double* %4
%113 = load double, double* %4
%114 = fcmp ogt double %113, 0.000000e+00
br i1 %114, label %115, label %118
115: ; preds = %111
%116 = load double, double* %4
%117 = call double @log10(double %116)
store double %117, double* %2
br label %195
118: ; preds = %111
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %195
120: ; preds = %107
%121 = load i8*, i8** %3
%122 = call i64 @strcmp(i8* %121, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %133
124: ; preds = %120
%125 = call double @pop()
store double %125, double* %4
%126 = load double, double* %4
%127 = fcmp oge double %126, 0.000000e+00
br i1 %127, label %128, label %131
128: ; preds = %124
%129 = load double, double* %4
%130 = call double @sqrt(double %129)
store double %130, double* %2
br label %195
131: ; preds = %124
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.15, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %195
133: ; preds = %120
%134 = load i8*, i8** %3
%135 = call i64 @strcmp(i8* %134, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %133
%138 = load double, double* %4
%139 = call double @llvm.ceil.f64(double %138)
store double %139, double* %2
br label %195
140: ; preds = %133
%141 = load i8*, i8** %3
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %140
%145 = load double, double* %4
%146 = call double @llvm.floor.f64(double %145)
store double %146, double* %2
br label %195
147: ; preds = %140
%148 = load i8*, i8** %3
%149 = call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %176
151: ; preds = %147
%152 = call double @pop()
store double %152, double* %4
%153 = call double @pop()
store double %153, double* %5
%154 = load double, double* %4
%155 = fcmp une double %154, 0.000000e+00
br i1 %155, label %159, label %156
156: ; preds = %151
%157 = load double, double* %5
%158 = fcmp oge double %157, 0.000000e+00
br i1 %158, label %159, label %173
159: ; preds = %156, %151
%160 = load double, double* %4
%161 = fcmp ogt double %160, 0.000000e+00
br i1 %161, label %169, label %162
162: ; preds = %159
%163 = load double, double* %5
%164 = load double, double* %5
%165 = fptosi double %164 to i32
%166 = sitofp i32 %165 to double
%167 = fsub double %163, %166
%168 = fcmp oeq double %167, 0.000000e+00
br i1 %168, label %169, label %173
169: ; preds = %162, %159
%170 = load double, double* %4
%171 = load double, double* %5
%172 = call double @pow(double %170, double %171)
store double %172, double* %2
br label %195
173: ; preds = %162, %156
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
br label %175
175: ; preds = %173
br label %179
176: ; preds = %147
%177 = load i8*, i8** %3
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0), i8* %177)
br label %179
179: ; preds = %176, %175
br label %180
180: ; preds = %179
br label %181
181: ; preds = %180
br label %182
182: ; preds = %181
br label %183
183: ; preds = %182
br label %184
184: ; preds = %183
br label %185
185: ; preds = %184
br label %186
186: ; preds = %185
br label %187
187: ; preds = %186
br label %188
188: ; preds = %187
br label %189
189: ; preds = %188
br label %190
190: ; preds = %189, %58
br label %191
191: ; preds = %190
br label %192
192: ; preds = %191
br label %193
193: ; preds = %192
br label %194
194: ; preds = %193
store double 0.000000e+00, double* %2
br label %195
195: ; preds = %194, %169, %144, %137, %131, %128, %118, %115, %105, %102, %91, %84, %77, %70, %63, %53, %40, %37, %23, %16, %9
%196 = load double, double* %2
ret double %196
}

LLVM IR (-O2):
@.str = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"cos\00"
@.str.2 = [4 x i8] c"tan\00"
@.str.3 = [5 x i8] c"asin\00"
@.str.4 = [32 x i8] c"Input outside of function range\00"
@.str.5 = [5 x i8] c"acos\00"
@.str.6 = [5 x i8] c"atan\00"
@.str.7 = [5 x i8] c"sinh\00"
@.str.8 = [5 x i8] c"cosh\00"
@.str.9 = [5 x i8] c"tanh\00"
@.str.10 = [4 x i8] c"exp\00"
@.str.11 = [4 x i8] c"log\00"
@.str.12 = [32 x i8] c"Input must be greater than zero\00"
@.str.13 = [6 x i8] c"log10\00"
@.str.14 = [5 x i8] c"sqrt\00"
@.str.15 = [41 x i8] c"Input must be equal or greater than zero\00"
@.str.16 = [5 x i8] c"ceil\00"
@.str.17 = [6 x i8] c"floor\00"
@.str.18 = [4 x i8] c"pow\00"
@.str.19 = [13 x i8] c"Domain error\00"
@.str.20 = [26 x i8] c"error: unkown command %s\0A\00"
define double @mathfunctions(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call double @pop()
%6 = tail call double @sin(double %5)
br label %131
7: ; preds = %1
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = tail call double @pop()
%12 = tail call double @cos(double %11)
br label %131
13: ; preds = %7
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = tail call double @pop()
%18 = tail call double @tan(double %17)
br label %131
19: ; preds = %13
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = tail call double @pop()
%24 = fcmp ole double %23, 1.000000e+00
%25 = fcmp oge double %23, -1.000000e+00
%26 = and i1 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = tail call double @asin(double %23)
br label %131
29: ; preds = %22
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %131
31: ; preds = %19
%32 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = tail call double @pop()
%36 = fcmp ole double %35, 1.000000e+00
%37 = fcmp oge double %35, -1.000000e+00
%38 = and i1 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = tail call double @acos(double %35)
br label %131
41: ; preds = %34
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %131
43: ; preds = %31
%44 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = tail call double @pop()
%48 = tail call double @atan(double %47)
br label %131
49: ; preds = %43
%50 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = tail call double @pop()
%54 = tail call double @sinh(double %53)
br label %131
55: ; preds = %49
%56 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = tail call double @pop()
%60 = tail call double @cosh(double %59)
br label %131
61: ; preds = %55
%62 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = tail call double @pop()
%66 = tail call double @tanh(double %65)
br label %131
67: ; preds = %61
%68 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = tail call double @pop()
%72 = tail call double @exp(double %71)
br label %131
73: ; preds = %67
%74 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %83
76: ; preds = %73
%77 = tail call double @pop()
%78 = fcmp ogt double %77, 0.000000e+00
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = tail call double @log(double %77)
br label %131
81: ; preds = %76
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
br label %131
83: ; preds = %73
%84 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %93
86: ; preds = %83
%87 = tail call double @pop()
%88 = fcmp ogt double %87, 0.000000e+00
br i1 %88, label %89, label %91
89: ; preds = %86
%90 = tail call double @log10(double %87)
br label %131
91: ; preds = %86
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
br label %131
93: ; preds = %83
%94 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %103
96: ; preds = %93
%97 = tail call double @pop()
%98 = fcmp ult double %97, 0.000000e+00
br i1 %98, label %101, label %99
99: ; preds = %96
%100 = tail call double @sqrt(double %97)
br label %131
101: ; preds = %96
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.15, i64 0, i64 0))
br label %131
103: ; preds = %93
%104 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %131, label %106
106: ; preds = %103
%107 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%108 = icmp eq i64 %107, 0
br i1 %108, label %131, label %109
109: ; preds = %106
%110 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %129
112: ; preds = %109
%113 = tail call double @pop()
%114 = tail call double @pop()
%115 = fcmp une double %113, 0.000000e+00
%116 = fcmp oge double %114, 0.000000e+00
%117 = select i1 %115, i1 true, i1 %116
br i1 %117, label %118, label %127
118: ; preds = %112
%119 = fcmp ogt double %113, 0.000000e+00
br i1 %119, label %125, label %120
120: ; preds = %118
%121 = fptosi double %114 to i32
%122 = sitofp i32 %121 to double
%123 = fsub double %114, %122
%124 = fcmp oeq double %123, 0.000000e+00
br i1 %124, label %125, label %127
125: ; preds = %120, %118
%126 = tail call double @pow(double %113, double %114)
br label %131
127: ; preds = %112, %120
%128 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
br label %131
129: ; preds = %109
%130 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0), i8* %0)
br label %131
131: ; preds = %41, %129, %127, %106, %103, %125, %101, %99, %91, %89, %81, %79, %70, %64, %58, %52, %46, %39, %29, %27, %16, %10, %4
%132 = phi double [ %6, %4 ], [ %12, %10 ], [ %18, %16 ], [ %28, %27 ], [ 0.000000e+00, %29 ], [ %40, %39 ], [ %48, %46 ], [ %54, %52 ], [ %60, %58 ], [ %66, %64 ], [ %72, %70 ], [ %80, %79 ], [ 0.000000e+00, %81 ], [ %90, %89 ], [ 0.000000e+00, %91 ], [ %100, %99 ], [ 0.000000e+00, %101 ], [ %126, %125 ], [ 0.000000e+00, %103 ], [ 0.000000e+00, %106 ], [ 0.000000e+00, %127 ], [ 0.000000e+00, %129 ], [ 0.000000e+00, %41 ]
ret double %132
}