#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 /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ float_jh(char *);
int /*<<< orphan*/ other(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ str_del_some_char(char *, char *);
scalar_t__ time(int /*<<< orphan*/ *);
int tiqu(char *);
int main(void) {
  srand((unsigned)time(NULL));
  char input[1000];
  puts("Welcom,you can use :q to quit and use :h to help");
  for (;;) {
    puts("Input a Exp :");
    fgets(input, 1000, stdin);
    if (input[0] == ':') {
      str_del_some_char(input, "\n\r");
      other(input);
      continue;
    }
    str_del_some_char(input, "\n \r\t");
    for (;;) {
      if (tiqu(input) == 1)
        break;
    }
    str_del_some_char(input, "()");
    float_jh(input);
    printf("Value : %s \n", input);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
lea    -0x3f0(%rbp),%rdi
mov    0x2e10(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1080 <fgets@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x3a,%eax
jne    1218 <main+0x88>
lea    -0x3f0(%rbp),%rdi
lea    0xe3d(%rip),%rsi
call   10a0 <str_del_some_char@plt>
lea    -0x3f0(%rbp),%rdi
call   1060 <other@plt>
jmp    11be <main+0x2e>
lea    -0x3f0(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   10a0 <str_del_some_char@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <tiqu@plt>
cmp    $0x1,%eax
jne    1245 <main+0xb5>
jmp    124a <main+0xba>
jmp    122b <main+0x9b>
lea    -0x3f0(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   10a0 <str_del_some_char@plt>
lea    -0x3f0(%rbp),%rdi
call   1090 <float_jh@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xdd3(%rip),%rdi
call   1050 <printf@plt>
jmp    11be <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6f(%rip),%r14
mov    0x2e1f(%rip),%r15
mov    %rsp,%rbx
lea    0xe6f(%rip),%r12
lea    0xe6d(%rip),%r13
lea    0xe69(%rip),%rbp
jmp    1207 <main+0x77>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
lea    0xe45(%rip),%rsi
call   10a0 <str_del_some_char@plt>
mov    %rbx,%rdi
call   1060 <other@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1080 <fgets@plt>
cmpb   $0x3a,(%rsp)
je     11f0 <main+0x60>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <str_del_some_char@plt>
mov    %rbx,%rdi
call   1040 <tiqu@plt>
cmp    $0x1,%eax
jne    1230 <main+0xa0>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <str_del_some_char@plt>
mov    %rbx,%rdi
call   1090 <float_jh@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
jmp    1207 <main+0x77>

LLVM IR (-O0):
@.str = [49 x i8] c"Welcom,you can use :q to quit and use :h to help\00"
@.str.1 = [14 x i8] c"Input a Exp :\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"\0A\0D\00"
@.str.3 = [5 x i8] c"\0A \0D\09\00"
@.str.4 = [3 x i8] c"()\00"
@.str.5 = [13 x i8] c"Value : %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %30, %16, %0
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 1000, i32 %10)
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 58
br i1 %15, label %16, label %21
16: ; preds = %7
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%18 = call i32 @str_del_some_char(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%20 = call i32 @other(i8* %19)
br label %7
21: ; preds = %7
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%23 = call i32 @str_del_some_char(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %29, %21
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%26 = call i32 @tiqu(i8* %25)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %24
br label %30
29: ; preds = %24
br label %24
30: ; preds = %28
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%32 = call i32 @str_del_some_char(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%34 = call i32 @float_jh(i8* %33)
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%36 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %35)
br label %7
}

LLVM IR (-O2):
@.str = [49 x i8] c"Welcom,you can use :q to quit and use :h to help\00"
@.str.1 = [14 x i8] c"Input a Exp :\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"\0A\0D\00"
@.str.3 = [5 x i8] c"\0A \0D\09\00"
@.str.4 = [3 x i8] c"()\00"
@.str.5 = [13 x i8] c"Value : %s \0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @srand(i32 %3)
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %16, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %5, i32 1000, i32 %9)
%11 = load i8, i8* %5
%12 = icmp eq i8 %11, 58
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = call i32 @str_del_some_char(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @other(i8* %5)
br label %16
16: ; preds = %13, %22
br label %7
17: ; preds = %7
%18 = call i32 @str_del_some_char(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %19, %17
%20 = call i32 @tiqu(i8* %5)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %19
22: ; preds = %19
%23 = call i32 @str_del_some_char(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @float_jh(i8* %5)
%25 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %5)
br label %16
}