#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 *, double *);
int main() {
  double valor;
  do {
    scanf("%lf", &valor);
    if (valor > 0) {
      printf("Positivo");
    } else {
      printf("Negativo");
    }
  } while (valor != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <main+0x42>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112f <main+0xf>
jp     112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed9(%rip),%r14
mov    %rsp,%r15
lea    0xed3(%rip),%r12
lea    0xed5(%rip),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %rbx,%rdi
cmova  %r12,%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
ucomisd 0xe8f(%rip),%xmm0
jne    1140 <main+0x20>
jp     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"Positivo\00"
@.str.2 = [9 x i8] c"Negativo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
br label %12
12: ; preds = %11
%13 = load double, double* %2
%14 = fcmp une double %13, 0.000000e+00
br i1 %14, label %3, label %15
15: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"Positivo\00"
@.str.2 = [9 x i8] c"Negativo\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp ogt double %5, 0.000000e+00
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
%9 = load double, double* %1
%10 = fcmp une double %9, 0.000000e+00
br i1 %10, label %3, label %11
11: ; preds = %3
ret i32 0
}