#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 *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  float a, b, res;
  int fa, fb;
  char c;
  scanf("%f", &a);
  scanf("%f", &b);
  scanf(" %c", &c);
  fa = (int)a;
  fb = (int)b;
  if (c == '+') {
    res = a + b;
  } else if (c == '-') {
    res = a - b;
  } else if (c == '*') {
    res = a * b;
  } else if (c == '/') {
    res = a / b;
  } else if (c == '%') {
    res = fa % fb;
  }
  printf("%.1f", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x2b,%eax
jne    1196 <main+0x76>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    122a <main+0x10a>
movsbl -0x19(%rbp),%eax
cmp    $0x2d,%eax
jne    11b7 <main+0x97>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1225 <main+0x105>
movsbl -0x19(%rbp),%eax
cmp    $0x2a,%eax
jne    11d8 <main+0xb8>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1220 <main+0x100>
movsbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
jne    11f9 <main+0xd9>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    121b <main+0xfb>
movsbl -0x19(%rbp),%eax
cmp    $0x25,%eax
jne    1216 <main+0xf6>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    121b <main+0xfb>
jmp    1220 <main+0x100>
jmp    1225 <main+0x105>
jmp    122a <main+0x10a>
movss  -0x10(%rbp),%xmm0
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf00(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xede(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mov    0x7(%rsp),%al
add    $0xdb,%al
movzbl %al,%eax
lea    0xe87(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cvttss2si %xmm1,%ecx
cvttss2si %xmm0,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
jmp    11ac <main+0x8c>
subss  %xmm1,%xmm0
jmp    11ac <main+0x8c>
mulss  %xmm1,%xmm0
jmp    11ac <main+0x8c>
addss  %xmm1,%xmm0
jmp    11ac <main+0x8c>
divss  %xmm1,%xmm0
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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