#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 *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  {
    float f;
    while (1) {
      scanf("%f", &f);
      if (f == 0.f)
        printf("flaot: == 0\n");
      if (f == 0.)
        printf("double: == 0\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1162 <main+0x42>
jp     1162 <main+0x42>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118a <main+0x6a>
jp     118a <main+0x6a>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x4(%rsp),%rbx
lea    0xed9(%rip),%r15
lea    0xec5(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe98(%rip),%xmm0
jne    117a <main+0x5a>
jp     117a <main+0x5a>
mov    %r15,%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe7f(%rip),%xmm0
jne    1150 <main+0x30>
jp     1150 <main+0x30>
mov    %r12,%rdi
call   1030 <puts@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [13 x i8] c"flaot: == 0\0A\00"
@.str.2 = [14 x i8] c"double: == 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
br label %3
3: ; preds = %0, %15
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fcmp oeq float %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [13 x i8] c"double: == 0\00"
@str.3 = [12 x i8] c"flaot: == 0\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %15, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp oeq float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%9 = load float, float* %1
br label %10
10: ; preds = %7, %3
%11 = phi float [ %9, %7 ], [ %5, %3 ]
%12 = fcmp oeq float %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
br label %3
}