#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*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strchr(char *, char);
int main() {
  double r;
  char s[10];
  scanf("%s", s);
  if (strchr(s, '/')) {
    if (((int)(s[2]) - 48) == 0) {
      printf("%s\n", "ERROR");
      goto end;
    }
    r = ((double)((s[0]) - 48)) / ((int)(s[2]) - 48);
  }
  if (strchr(s, '+'))
    r = (int)(s[0]) + (int)(s[2]) - 48 * 2;
  if (strchr(s, '*'))
    r = ((int)(s[0]) - 48) * ((int)(s[2]) - 48);
  if (strchr(s, '-'))
    r = (int)(s[0]) - (int)(s[2]);
  printf("%.2f\n", r);
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1a(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11b0 <main+0x80>
movsbl -0x18(%rbp),%eax
sub    $0x30,%eax
cmp    $0x0,%eax
jne    1191 <main+0x61>
lea    0xe85(%rip),%rdi
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124e <main+0x11e>
movsbl -0x1a(%rbp),%eax
sub    $0x30,%eax
cvtsi2sd %eax,%xmm0
movsbl -0x18(%rbp),%eax
sub    $0x30,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x2b,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11de <main+0xae>
movsbl -0x1a(%rbp),%eax
movsbl -0x18(%rbp),%ecx
add    %ecx,%eax
sub    $0x60,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x2a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1210 <main+0xe0>
movsbl -0x1a(%rbp),%eax
sub    $0x30,%eax
movsbl -0x18(%rbp),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x2d,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     123b <main+0x10b>
movsbl -0x1a(%rbp),%eax
movsbl -0x18(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xdc6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
lea    0xe(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1195 <main+0x55>
movsbl 0x10(%rsp),%eax
add    $0xffffffd0,%eax
je     1236 <main+0xf6>
movsbl 0xe(%rsp),%ecx
add    $0xffffffd0,%ecx
cvtsi2sd %ecx,%xmm1
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
jmp    1195 <main+0x55>
lea    0xe(%rsp),%rdi
mov    $0x2b,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11c5 <main+0x85>
movsbl 0xe(%rsp),%eax
movsbl 0x10(%rsp),%ecx
add    %ecx,%eax
add    $0xffffffa0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xe(%rsp),%rdi
mov    $0x2a,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11f9 <main+0xb9>
movsbl 0xe(%rsp),%eax
add    $0xffffffd0,%eax
movsbl 0x10(%rsp),%ecx
add    $0xffffffd0,%ecx
imul   %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xe(%rsp),%rdi
mov    $0x2d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
movsd  0x18(%rsp),%xmm0
je     1226 <main+0xe6>
movsbl 0xe(%rsp),%eax
movsbl 0x10(%rsp),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1242 <main+0x102>
lea    0xdc6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"ERROR\00"
@.str.3 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i64 @strchr(i8* %6, i8 signext 47)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %74
17: ; preds = %9
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = sitofp i32 %21 to double
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 48
%27 = sitofp i32 %26 to double
%28 = fdiv double %22, %27
store double %28, double* %2
br label %29
29: ; preds = %17, %0
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%31 = call i64 @strchr(i8* %30, i8 signext 43)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %43
33: ; preds = %29
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = add nsw i32 %36, %39
%41 = sub nsw i32 %40, 96
%42 = sitofp i32 %41 to double
store double %42, double* %2
br label %43
43: ; preds = %33, %29
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%45 = call i64 @strchr(i8* %44, i8 signext 42)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %58
47: ; preds = %43
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = sub nsw i32 %50, 48
%52 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = sub nsw i32 %54, 48
%56 = mul nsw i32 %51, %55
%57 = sitofp i32 %56 to double
store double %57, double* %2
br label %58
58: ; preds = %47, %43
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%60 = call i64 @strchr(i8* %59, i8 signext 45)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %71
62: ; preds = %58
%63 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = sub nsw i32 %65, %68
%70 = sitofp i32 %69 to double
store double %70, double* %2
br label %71
71: ; preds = %62, %58
%72 = load double, double* %2
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %72)
br label %74
74: ; preds = %71, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"ERROR\00"
@.str.3 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strchr(i8* %2, i8 signext 47)
%5 = icmp eq i64 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, -48
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %61
14: ; preds = %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = add nsw i32 %16, -48
%18 = sitofp i32 %17 to double
%19 = sitofp i32 %10 to double
%20 = fdiv double %18, %19
br label %21
21: ; preds = %14, %0
%22 = phi double [ %20, %14 ], [ undef, %0 ]
%23 = call i64 @strchr(i8* %2, i8 signext 43)
%24 = icmp eq i64 %23, 0
br i1 %24, label %34, label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = add nsw i32 %27, -96
%32 = add nsw i32 %31, %30
%33 = sitofp i32 %32 to double
br label %34
34: ; preds = %25, %21
%35 = phi double [ %33, %25 ], [ %22, %21 ]
%36 = call i64 @strchr(i8* %2, i8 signext 42)
%37 = icmp eq i64 %36, 0
br i1 %37, label %48, label %38
38: ; preds = %34
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = add nsw i32 %40, -48
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = add nsw i32 %44, -48
%46 = mul nsw i32 %45, %41
%47 = sitofp i32 %46 to double
br label %48
48: ; preds = %38, %34
%49 = phi double [ %47, %38 ], [ %35, %34 ]
%50 = call i64 @strchr(i8* %2, i8 signext 45)
%51 = icmp eq i64 %50, 0
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = sub nsw i32 %53, %56
%58 = sitofp i32 %57 to double
%59 = select i1 %51, double %49, double %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %59)
br label %61
61: ; preds = %48, %12
ret i32 0
}