#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 *);
int main() {
  float a;
  float b = 0;
  scanf("%f", &a);
  if (a < b) {
    printf("%f is negative", a);
  }
  if (a > b) {
    printf("%f is positive", a);
  }
  if (a == b) {
    printf("%f is zero", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    116b <main+0x4b>
movss  -0x8(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    118b <main+0x6b>
movss  -0x8(%rbp),%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    11b1 <main+0x91>
jp     11b1 <main+0x91>
movss  -0x8(%rbp),%xmm0
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1155 <main+0x35>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
movss  0x4(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jbe    116c <main+0x4c>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1182 <main+0x62>
jp     1182 <main+0x62>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [15 x i8] c"%f is negative\00"
@.str.2 = [15 x i8] c"%f is positive\00"
@.str.3 = [11 x i8] c"%f is zero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %3
%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 = load float, float* %3
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load float, float* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %9)
br label %11
11: ; preds = %8, %0
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load float, float* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), float %16)
br label %18
18: ; preds = %15, %11
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fcmp oeq float %19, %20
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load float, float* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), float %23)
br label %25
25: ; preds = %22, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [15 x i8] c"%f is negative\00"
@.str.2 = [15 x i8] c"%f is positive\00"
@.str.3 = [11 x i8] c"%f is zero\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 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %4)
%8 = load float, float* %1
br label %9
9: ; preds = %6, %0
%10 = phi float [ %8, %6 ], [ %4, %0 ]
%11 = fcmp ogt float %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), float %10)
%14 = load float, float* %1
br label %15
15: ; preds = %12, %9
%16 = phi float [ %14, %12 ], [ %10, %9 ]
%17 = fcmp oeq float %16, 0.000000e+00
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), float %16)
br label %20
20: ; preds = %18, %15
ret i32 0
}