#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 resolve(float, float, char);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float a, b;
  char op;
  scanf("%f%f", &a, &b);
  scanf("%s", &op);
  while (op != '&') {
    if (op == '/' && b == 0)
      printf("operacao nao pode ser realizada\n");
    else {
      a = resolve(a, b, op);
      printf("%.3f\n", a);
    }
    scanf("%f", &b);
    scanf("%s", &op);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x26,%eax
je     1203 <main+0xd3>
movsbl -0xd(%rbp),%eax
cmp    $0x2f,%eax
jne    11ab <main+0x7b>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11ab <main+0x7b>
jp     11ab <main+0x7b>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xaa>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsbl -0xd(%rbp),%edi
call   1040 <resolve@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe21(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe12(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
jmp    1167 <main+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeaf(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe9c(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x26,%al
jne    1192 <main+0x52>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe79(%rip),%r14
lea    0xe66(%rip),%r15
lea    0x10(%rsp),%r12
lea    0xe5d(%rip),%r13
lea    0xf(%rsp),%rbx
lea    0xe54(%rip),%rbp
jmp    1209 <main+0xc9>
nopw   0x0(%rax,%rax,1)
movss  0x14(%rsp),%xmm0
movsbl %al,%edi
call   1050 <resolve@plt>
movss  %xmm0,0x14(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x26,%al
je     1181 <main+0x41>
movss  0x10(%rsp),%xmm1
cmp    $0x2f,%al
jne    11c0 <main+0x80>
ucomiss 0xde6(%rip),%xmm1
jne    11c0 <main+0x80>
jp     11c0 <main+0x80>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    11e2 <main+0xa2>

LLVM IR (-O0):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"operacao nao pode ser realizada\0A\00"
@.str.3 = [6 x i8] c"%.3f\0A\00"
@.str.4 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %7
7: ; preds = %28, %0
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 38
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load float, float* %3
%17 = fcmp oeq float %16, 0.000000e+00
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %28
20: ; preds = %15, %11
%21 = load float, float* %2
%22 = load float, float* %3
%23 = load i8, i8* %4
%24 = call float @resolve(float %21, float %22, i8 signext %23)
store float %24, float* %2
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %26)
br label %28
28: ; preds = %20, %18
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %7
31: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"%.3f\0A\00"
@.str.4 = [3 x i8] c"%f\00"
@str = [32 x i8] c"operacao nao pode ser realizada\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 38
br i1 %9, label %28, label %10
10: ; preds = %0, %23
%11 = phi i8 [ %26, %23 ], [ %8, %0 ]
%12 = icmp eq i8 %11, 47
%13 = load float, float* %2
%14 = fcmp oeq float %13, 0.000000e+00
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %23
18: ; preds = %10
%19 = load float, float* %1
%20 = call float @resolve(float %19, float %13, i8 signext %11)
store float %20, float* %1
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %21)
br label %23
23: ; preds = %18, %16
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%26 = load i8, i8* %3
%27 = icmp eq i8 %26, 38
br i1 %27, label %28, label %10
28: ; preds = %23, %0
ret i32 0
}