#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;
  scanf("%f", &a);
  if (a > 0) {
    printf("%.4f is positive.", a);
  } else if (a < 0) {
    printf("%.4f is negative.", a);
  } else {
    printf("input is zero.", a);
  }
  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
jbe    1166 <main+0x46>
movss  -0x8(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x7f>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1189 <main+0x69>
movss  -0x8(%rbp),%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    119a <main+0x7a>
movss  -0x8(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x7f>
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
lea    0xed0(%rip),%rax
lea    0xedb(%rip),%rcx
cmova  %rax,%rcx
ucomiss %xmm1,%xmm0
lea    0xea9(%rip),%rdi
cmovbe %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [18 x i8] c"%.4f is positive.\00"
@.str.2 = [18 x i8] c"%.4f is negative.\00"
@.str.3 = [15 x i8] c"input 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 ogt float %4, 0.000000e+00
%6 = fcmp olt float %4, 0.000000e+00
%7 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0)
%8 = select i1 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7
%9 = call i32 @printf(i8* %8, float %4)
ret i32 0
}