#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 */
scalar_t__ cal_add(char *);
scalar_t__ cal_cos(char *);
scalar_t__ cal_max(char *);
scalar_t__ cal_min(char *);
scalar_t__ cal_pow(char *);
scalar_t__ cal_rand(char *);
scalar_t__ cal_sin(char *);
scalar_t__ cal_sqrt(char *);
scalar_t__ fun_rgb_hex(char *);
int /*<<< orphan*/ str_del_char_ch(char *, char);
scalar_t__ strcmp(char *, char *);
double fun_jisuan(char *fun_name, char *list_arg) {
  str_del_char_ch(list_arg, '(');
  str_del_char_ch(list_arg, ')');
  if (strcmp(fun_name, "add") == 0) {
    return (double)cal_add(list_arg);
  }
  if (strcmp(fun_name, "sin") == 0) {
    return (double)cal_sin(list_arg);
  }
  if (strcmp(fun_name, "cos") == 0) {
    return (double)cal_cos(list_arg);
  }
  if (strcmp(fun_name, "pow") == 0) {
    return (double)cal_pow(list_arg);
  }
  if (strcmp(fun_name, "max") == 0) {
    return (double)cal_max(list_arg);
  }
  if (strcmp(fun_name, "min") == 0) {
    return (double)cal_min(list_arg);
  }
  if (strcmp(fun_name, "sqrt") == 0) {
    return (double)cal_sqrt(list_arg);
  }
  if (strcmp(fun_name, "rand") == 0) {
    return (double)cal_rand(list_arg);
  }
  if (strcmp(fun_name, "rgb_hex") == 0) {
    return (double)fun_rgb_hex(list_arg);
  }
  return -1.0;
}


x86 assembly (clang, -O0):
<fun_jisuan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x28,%esi
call   10c0 <str_del_char_ch@plt>
mov    -0x18(%rbp),%rdi
mov    $0x29,%esi
call   10c0 <str_del_char_ch@plt>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    120e <fun_jisuan+0x5e>
mov    -0x18(%rbp),%rdi
call   10a0 <cal_add@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xdf3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1240 <fun_jisuan+0x90>
mov    -0x18(%rbp),%rdi
call   10b0 <cal_sin@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1272 <fun_jisuan+0xc2>
mov    -0x18(%rbp),%rdi
call   10d0 <cal_cos@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12a4 <fun_jisuan+0xf4>
mov    -0x18(%rbp),%rdi
call   1040 <cal_pow@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xd69(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12d6 <fun_jisuan+0x126>
mov    -0x18(%rbp),%rdi
call   1030 <cal_max@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xd3b(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1308 <fun_jisuan+0x158>
mov    -0x18(%rbp),%rdi
call   1060 <cal_min@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xd0d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    133a <fun_jisuan+0x18a>
mov    -0x18(%rbp),%rdi
call   1070 <cal_sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    136c <fun_jisuan+0x1bc>
mov    -0x18(%rbp),%rdi
call   1050 <cal_rand@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
mov    -0x10(%rbp),%rdi
lea    0xcb3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    139e <fun_jisuan+0x1ee>
mov    -0x18(%rbp),%rdi
call   1080 <fun_rgb_hex@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13ab <fun_jisuan+0x1fb>
movsd  0xc5a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_jisuan>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x28,%esi
call   10c0 <str_del_char_ch@plt>
mov    %r14,%rdi
mov    $0x29,%esi
call   10c0 <str_del_char_ch@plt>
lea    0xe2d(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12a6 <fun_jisuan+0xf6>
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12b0 <fun_jisuan+0x100>
lea    0xe05(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12ba <fun_jisuan+0x10a>
lea    0xdf1(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12c4 <fun_jisuan+0x114>
lea    0xddd(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12ce <fun_jisuan+0x11e>
lea    0xdc9(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12d8 <fun_jisuan+0x128>
lea    0xdb9(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12e2 <fun_jisuan+0x132>
lea    0xdaa(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12ec <fun_jisuan+0x13c>
lea    0xd9b(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12f6 <fun_jisuan+0x146>
movsd  0xd5c(%rip),%xmm0
jmp    1303 <fun_jisuan+0x153>
mov    %r14,%rdi
call   10a0 <cal_add@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   10b0 <cal_sin@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   10d0 <cal_cos@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1040 <cal_pow@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1030 <cal_max@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1060 <cal_min@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1070 <cal_sqrt@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1050 <cal_rand@plt>
jmp    12fe <fun_jisuan+0x14e>
mov    %r14,%rdi
call   1080 <fun_rgb_hex@plt>
cvtsi2sd %rax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
@.str.1 = [4 x i8] c"sin\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"pow\00"
@.str.4 = [4 x i8] c"max\00"
@.str.5 = [4 x i8] c"min\00"
@.str.6 = [5 x i8] c"sqrt\00"
@.str.7 = [5 x i8] c"rand\00"
@.str.8 = [8 x i8] c"rgb_hex\00"
define double @fun_jisuan(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @str_del_char_ch(i8* %6, i8 signext 40)
%8 = load i8*, i8** %5
%9 = call i32 @str_del_char_ch(i8* %8, i8 signext 41)
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = call i64 @cal_add(i8* %14)
%16 = sitofp i64 %15 to double
store double %16, double* %3
br label %82
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i8*, i8** %5
%23 = call i64 @cal_sin(i8* %22)
%24 = sitofp i64 %23 to double
store double %24, double* %3
br label %82
25: ; preds = %17
%26 = load i8*, i8** %4
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i8*, i8** %5
%31 = call i64 @cal_cos(i8* %30)
%32 = sitofp i64 %31 to double
store double %32, double* %3
br label %82
33: ; preds = %25
%34 = load i8*, i8** %4
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i8*, i8** %5
%39 = call i64 @cal_pow(i8* %38)
%40 = sitofp i64 %39 to double
store double %40, double* %3
br label %82
41: ; preds = %33
%42 = load i8*, i8** %4
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i8*, i8** %5
%47 = call i64 @cal_max(i8* %46)
%48 = sitofp i64 %47 to double
store double %48, double* %3
br label %82
49: ; preds = %41
%50 = load i8*, i8** %4
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i8*, i8** %5
%55 = call i64 @cal_min(i8* %54)
%56 = sitofp i64 %55 to double
store double %56, double* %3
br label %82
57: ; preds = %49
%58 = load i8*, i8** %4
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %65
61: ; preds = %57
%62 = load i8*, i8** %5
%63 = call i64 @cal_sqrt(i8* %62)
%64 = sitofp i64 %63 to double
store double %64, double* %3
br label %82
65: ; preds = %57
%66 = load i8*, i8** %4
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %65
%70 = load i8*, i8** %5
%71 = call i64 @cal_rand(i8* %70)
%72 = sitofp i64 %71 to double
store double %72, double* %3
br label %82
73: ; preds = %65
%74 = load i8*, i8** %4
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %81
77: ; preds = %73
%78 = load i8*, i8** %5
%79 = call i64 @fun_rgb_hex(i8* %78)
%80 = sitofp i64 %79 to double
store double %80, double* %3
br label %82
81: ; preds = %73
store double -1.000000e+00, double* %3
br label %82
82: ; preds = %81, %77, %69, %61, %53, %45, %37, %29, %21, %13
%83 = load double, double* %3
ret double %83
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
@.str.1 = [4 x i8] c"sin\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"pow\00"
@.str.4 = [4 x i8] c"max\00"
@.str.5 = [4 x i8] c"min\00"
@.str.6 = [5 x i8] c"sqrt\00"
@.str.7 = [5 x i8] c"rand\00"
@.str.8 = [8 x i8] c"rgb_hex\00"
define double @fun_jisuan(i8* %0, i8* %1) {
%3 = tail call i32 @str_del_char_ch(i8* %1, i8 signext 40)
%4 = tail call i32 @str_del_char_ch(i8* %1, i8 signext 41)
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i64 @cal_add(i8* %1)
%9 = sitofp i64 %8 to double
br label %58
10: ; preds = %2
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i64 @cal_sin(i8* %1)
%15 = sitofp i64 %14 to double
br label %58
16: ; preds = %10
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = tail call i64 @cal_cos(i8* %1)
%21 = sitofp i64 %20 to double
br label %58
22: ; preds = %16
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = tail call i64 @cal_pow(i8* %1)
%27 = sitofp i64 %26 to double
br label %58
28: ; preds = %22
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = tail call i64 @cal_max(i8* %1)
%33 = sitofp i64 %32 to double
br label %58
34: ; preds = %28
%35 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = tail call i64 @cal_min(i8* %1)
%39 = sitofp i64 %38 to double
br label %58
40: ; preds = %34
%41 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = tail call i64 @cal_sqrt(i8* %1)
%45 = sitofp i64 %44 to double
br label %58
46: ; preds = %40
%47 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = tail call i64 @cal_rand(i8* %1)
%51 = sitofp i64 %50 to double
br label %58
52: ; preds = %46
%53 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = tail call i64 @fun_rgb_hex(i8* %1)
%57 = sitofp i64 %56 to double
br label %58
58: ; preds = %52, %55, %49, %43, %37, %31, %25, %19, %13, %7
%59 = phi double [ %9, %7 ], [ %15, %13 ], [ %21, %19 ], [ %27, %25 ], [ %33, %31 ], [ %39, %37 ], [ %45, %43 ], [ %51, %49 ], [ %57, %55 ], [ -1.000000e+00, %52 ]
ret double %59
}