#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 *, float *, float *, char *);
int main() {
  float a, b, c;
  char i;
  scanf("%f %f %s", &a, &b, &i);
  if (i == 'a')
    c = a + b;
  else if (i == 's')
    c = a - b;
  else if (i == 'm')
    c = a * b;
  else if (i == 'd')
    c = a / b;
  printf("%f", c);
  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
lea    -0xc(%rbp),%rdx
lea    -0x11(%rbp),%rcx
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x61,%eax
jne    1168 <main+0x48>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11d5 <main+0xb5>
movsbl -0x11(%rbp),%eax
cmp    $0x73,%eax
jne    1189 <main+0x69>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11d0 <main+0xb0>
movsbl -0x11(%rbp),%eax
cmp    $0x6d,%eax
jne    11aa <main+0x8a>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11cb <main+0xab>
movsbl -0x11(%rbp),%eax
cmp    $0x64,%eax
jne    11c6 <main+0xa6>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11cb <main+0xab>
jmp    11d0 <main+0xb0>
jmp    11d5 <main+0xb5>
movss  -0x10(%rbp),%xmm0
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf21(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xf(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
add    $0x9f,%al
movzbl %al,%eax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
jmp    118e <main+0x6e>
movss  0x14(%rsp),%xmm0
subss  0x10(%rsp),%xmm0
jmp    118e <main+0x6e>
movss  0x14(%rsp),%xmm0
divss  0x10(%rsp),%xmm0
jmp    118e <main+0x6e>
movss  0x14(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %s\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, i8* %5)
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load float, float* %2
%12 = load float, float* %3
%13 = fadd float %11, %12
store float %13, float* %4
br label %41
14: ; preds = %0
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 115
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fsub float %19, %20
store float %21, float* %4
br label %40
22: ; preds = %14
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 109
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load float, float* %2
%28 = load float, float* %3
%29 = fmul float %27, %28
store float %29, float* %4
br label %39
30: ; preds = %22
%31 = load i8, i8* %5
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 100
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load float, float* %2
%36 = load float, float* %3
%37 = fdiv float %35, %36
store float %37, float* %4
br label %38
38: ; preds = %34, %30
br label %39
39: ; preds = %38, %26
br label %40
40: ; preds = %39, %18
br label %41
41: ; preds = %40, %10
%42 = load float, float* %4
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %s\00"
@.str.1 = [3 x i8] c"%f\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 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, i8* %3)
%7 = load i8, i8* %3
switch i8 %7, label %24 [
i8 97, label %8
i8 115, label %12
i8 109, label %16
i8 100, label %20
]
8: ; preds = %0
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fadd float %9, %10
br label %25
12: ; preds = %0
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fsub float %13, %14
br label %25
16: ; preds = %0
%17 = load float, float* %1
%18 = load float, float* %2
%19 = fmul float %17, %18
br label %25
20: ; preds = %0
%21 = load float, float* %1
%22 = load float, float* %2
%23 = fdiv float %21, %22
br label %25
24: ; preds = %0
unreachable
25: ; preds = %12, %20, %16, %8
%26 = phi float [ %11, %8 ], [ %15, %12 ], [ %19, %16 ], [ %23, %20 ]
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float %26)
ret i32 0
}