#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*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, char *, double *);
int main() {
  double a, b, total;
  char operador;
  scanf("%lf %c %lf", &a, &operador, &b);
  switch (operador) {
  case '+':
    total = a + b;
    break;
  case '-':
    total = a - b;
    break;
  case '*':
    total = a * b;
    break;
  case '/':
    total = a / b;
    break;
  case '%':
    total = (100 * a) / b;
    break;
  }
  printf("%lf", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefe(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x21(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
movsbl -0x21(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0xa,%eax
ja     11d8 <main+0xb8>
mov    -0x30(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11d8 <main+0xb8>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11d8 <main+0xb8>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11d8 <main+0xb8>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11d8 <main+0xb8>
movsd  0xe37(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf09(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x7(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%eax
add    $0xffffffdb,%eax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0x10(%rsp),%xmm0
mulsd  0xe9b(%rip),%xmm0
jmp    1197 <main+0x77>
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
jmp    119d <main+0x7d>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
jmp    119d <main+0x7d>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
jmp    119d <main+0x7d>
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%lf %c %lf\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double* %2, i8* %5, double* %3)
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %30 [
i32 43, label %9
i32 45, label %13
i32 42, label %17
i32 47, label %21
i32 37, label %25
]
9: ; preds = %0
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fadd double %10, %11
store double %12, double* %4
br label %30
13: ; preds = %0
%14 = load double, double* %2
%15 = load double, double* %3
%16 = fsub double %14, %15
store double %16, double* %4
br label %30
17: ; preds = %0
%18 = load double, double* %2
%19 = load double, double* %3
%20 = fmul double %18, %19
store double %20, double* %4
br label %30
21: ; preds = %0
%22 = load double, double* %2
%23 = load double, double* %3
%24 = fdiv double %22, %23
store double %24, double* %4
br label %30
25: ; preds = %0
%26 = load double, double* %2
%27 = fmul double 1.000000e+02, %26
%28 = load double, double* %3
%29 = fdiv double %27, %28
store double %29, double* %4
br label %30
30: ; preds = %0, %25, %21, %17, %13, %9
%31 = load double, double* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%lf %c %lf\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i8
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double* %1, i8* %3, double* %2)
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
switch i32 %8, label %30 [
i32 43, label %9
i32 45, label %13
i32 42, label %17
i32 47, label %21
i32 37, label %25
]
9: ; preds = %0
%10 = load double, double* %1
%11 = load double, double* %2
%12 = fadd double %10, %11
br label %31
13: ; preds = %0
%14 = load double, double* %1
%15 = load double, double* %2
%16 = fsub double %14, %15
br label %31
17: ; preds = %0
%18 = load double, double* %1
%19 = load double, double* %2
%20 = fmul double %18, %19
br label %31
21: ; preds = %0
%22 = load double, double* %1
%23 = load double, double* %2
%24 = fdiv double %22, %23
br label %31
25: ; preds = %0
%26 = load double, double* %1
%27 = fmul double %26, 1.000000e+02
%28 = load double, double* %2
%29 = fdiv double %27, %28
br label %31
30: ; preds = %0
unreachable
31: ; preds = %25, %21, %17, %13, %9
%32 = phi double [ %29, %25 ], [ %24, %21 ], [ %20, %17 ], [ %16, %13 ], [ %12, %9 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %32)
ret i32 0
}