#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 /*<<< orphan*/ system(char *);
int main() {
  float x;
  printf("Digite um numero: ");
  scanf("%f", &x);
  if (x > 0) {
    printf("\nEste numero e positivo.\n\n");
  } else if (x < 0) {
    printf("\nEste numero e negativo\n\n");
  } else {
    printf("\nEste numero e o zero.\n\n");
  }
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    117d <main+0x4d>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
jmp    11ac <main+0x7c>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    119b <main+0x6b>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
jmp    11a7 <main+0x77>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
jmp    11ac <main+0x7c>
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
lea    0xec3(%rip),%rax
lea    0xea4(%rip),%rcx
cmova  %rax,%rcx
ucomiss %xmm1,%xmm0
lea    0xec7(%rip),%rdi
cmovbe %rcx,%rdi
call   1030 <puts@plt>
lea    0xe80(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"\0AEste numero e positivo.\0A\0A\00"
@.str.3 = [26 x i8] c"\0AEste numero e negativo\0A\0A\00"
@.str.4 = [25 x i8] c"\0AEste numero e o zero.\0A\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fcmp ogt float %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %17
9: ; preds = %0
%10 = load float, float* %2
%11 = fcmp olt float %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %7
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.5 = [6 x i8] c"pause\00"
@str = [24 x i8] c"\0AEste numero e o zero.\0A\00"
@str.6 = [25 x i8] c"\0AEste numero e negativo\0A\00"
@str.7 = [26 x i8] c"\0AEste numero e positivo.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp ogt float %5, 0.000000e+00
%7 = fcmp olt float %5, 0.000000e+00
%8 = select i1 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0)
%9 = select i1 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0), i8* %8
%10 = call i32 @puts(i8* dereferenceable(1) %9)
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}