#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 */
double calc(char *, int /*<<< orphan*/);
double floor(double);
int is_exit(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ read_line(char *);
int main(void) {
  while (1) {
    char input[65536];
    double ans;
    read_line(input);
    if (is_exit(input) == 1) {
      puts("bye!!");
      break;
    }
    ans = calc(input, 0);
    if (floor(ans) == ans) {
      printf("%.0f\n", ans);
    } else {
      printf("%f\n", calc(input, 0));
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10010(%rbp),%rdi
call   1070 <read_line@plt>
lea    -0x10010(%rbp),%rdi
call   1060 <is_exit@plt>
cmp    $0x1,%eax
jne    11a4 <main+0x44>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
jmp    1213 <main+0xb3>
lea    -0x10010(%rbp),%rdi
xor    %esi,%esi
call   1050 <calc@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
call   1080 <floor@plt>
ucomisd -0x10018(%rbp),%xmm0
ff
jne    11f4 <main+0x94>
jp     11f4 <main+0x94>
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
jmp    120e <main+0xae>
lea    -0x10010(%rbp),%rdi
xor    %esi,%esi
call   1050 <calc@plt>
lea    0xe03(%rip),%rdi
call   1040 <printf@plt>
jmp    1172 <main+0x12>
xor    %eax,%eax
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10010,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <read_line@plt>
mov    %rbx,%rdi
call   1060 <is_exit@plt>
cmp    $0x1,%eax
jne    11a1 <main+0x41>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10010,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0x10(%rsp),%rbx
lea    0xe59(%rip),%r14
lea    0xe58(%rip),%r15
jmp    11e7 <main+0x87>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <calc@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <read_line@plt>
mov    %rbx,%rdi
call   1060 <is_exit@plt>
cmp    $0x1,%eax
je     1186 <main+0x26>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <calc@plt>
movsd  %xmm0,0x8(%rsp)
call   1080 <floor@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jne    11c0 <main+0x60>
jp     11c0 <main+0x60>
movapd %xmm1,%xmm0
mov    %r14,%rdi
jmp    11cd <main+0x6d>

LLVM IR (-O0):
@.str = [6 x i8] c"bye!!\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [65536 x i8]
%3 = alloca double
store i32 0, i32* %1
br label %4
4: ; preds = %0, %26
%5 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%6 = call i32 @read_line(i8* %5)
%7 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%8 = call i32 @is_exit(i8* %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %27
12: ; preds = %4
%13 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%14 = call double @calc(i8* %13, i32 0)
store double %14, double* %3
%15 = load double, double* %3
%16 = call double @llvm.floor.f64(double %15)
%17 = load double, double* %3
%18 = fcmp oeq double %16, %17
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load double, double* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %20)
br label %26
22: ; preds = %12
%23 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%24 = call double @calc(i8* %23, i32 0)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %24)
br label %26
26: ; preds = %22, %19
br label %4
27: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"bye!!\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [65536 x i8]
%2 = getelementptr inbounds [65536 x i8], [65536 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_line(i8* %2)
%4 = call i32 @is_exit(i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %19, label %6
6: ; preds = %0, %15
%7 = call double @calc(i8* %2, i32 0)
%8 = call double @llvm.floor.f64(double %7)
%9 = fcmp oeq double %8, %7
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %7)
br label %15
12: ; preds = %6
%13 = call double @calc(i8* %2, i32 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %13)
br label %15
15: ; preds = %10, %12
%16 = call i32 @read_line(i8* %2)
%17 = call i32 @is_exit(i8* %2)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %6
19: ; preds = %15, %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}