#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 a;
  scanf("%f", &a);
  if (a > 0) {
    printf("%.4f is positive", a);
  } else if (a < 0) {
    printf("%.4f is negative", a);
  } else if (a == '0') {
    printf("input is zero");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    116c <main+0x4c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c9 <main+0xa9>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1195 <main+0x75>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
movss  -0x8(%rbp),%xmm0
movss  0xe5e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11bf <main+0x9f>
jp     11bf <main+0x9f>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
jmp    11c9 <main+0xa9>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    114d <main+0x2d>
cvtss2sd %xmm0,%xmm0
lea    0xebc(%rip),%rdi
jmp    115d <main+0x3d>
ucomiss %xmm0,%xmm1
jbe    1168 <main+0x48>
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
ucomiss 0xe91(%rip),%xmm0
jne    1164 <main+0x44>
jp     1164 <main+0x44>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1164 <main+0x44>

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

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