#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 *);
main() {
  float foo;
  (void)scanf("%f", &foo);
  (void)printf("%f\n", foo);
  if (foo > 0.0)
    (void)printf("%f > 0\n", foo);
  else if (foo == 0.0)
    (void)printf("%f = 0\n", foo);
  else if (foo < 0.0)
    (void)printf("%f < 0\n", foo);
  else
    (void)printf("%f is not a number\n", foo);
}


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
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    117c <main+0x5c>
movss  -0x8(%rbp),%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <main+0xd5>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11ae <main+0x8e>
jp     11ae <main+0x8e>
movss  -0x8(%rbp),%xmm0
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11da <main+0xba>
movss  -0x8(%rbp),%xmm0
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <main+0xcb>
movss  -0x8(%rbp),%xmm0
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
jmp    11f5 <main+0xd5>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    115b <main+0x3b>
lea    0xeae(%rip),%rdi
jmp    1180 <main+0x60>
jne    1168 <main+0x48>
jp     1168 <main+0x48>
lea    0xea9(%rip),%rdi
jmp    1180 <main+0x60>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
lea    0xea2(%rip),%rax
lea    0xea3(%rip),%rdi
cmova  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [8 x i8] c"%f > 0\0A\00"
@.str.3 = [8 x i8] c"%f = 0\0A\00"
@.str.4 = [8 x i8] c"%f < 0\0A\00"
@.str.5 = [20 x i8] c"%f is not a number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %4)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load float, float* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), float %10)
br label %31
12: ; preds = %0
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load float, float* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), float %17)
br label %30
19: ; preds = %12
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = fcmp olt double %21, 0.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load float, float* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), float %24)
br label %29
26: ; preds = %19
%27 = load float, float* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), float %27)
br label %29
29: ; preds = %26, %23
br label %30
30: ; preds = %29, %16
br label %31
31: ; preds = %30, %9
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [8 x i8] c"%f > 0\0A\00"
@.str.3 = [8 x i8] c"%f = 0\0A\00"
@.str.4 = [8 x i8] c"%f < 0\0A\00"
@.str.5 = [20 x i8] c"%f is not a number\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %4)
%6 = load float, float* %1
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = fcmp oeq float %6, 0.000000e+00
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = fcmp olt float %6, 0.000000e+00
%12 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0)
br label %13
13: ; preds = %10, %8, %0
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %8 ], [ %12, %10 ]
%15 = call i32 @printf(i8* %14, float %6)
ret i32 0
}