#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 *, int *);
int main(void) {
  int num;
  scanf("%d", &num);
  if (num > 0) {
    printf("Positivo.\n");
  } else if (num < 0) {
    printf("Negativo.\n");
  } else {
    return 1;
  }
  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>
cmpl   $0x0,-0x8(%rbp)
jle    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
cmpl   $0x0,-0x8(%rbp)
jge    1175 <main+0x55>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
movl   $0x1,-0x4(%rbp)
jmp    118d <main+0x6d>
jmp    1186 <main+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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>
cmpl   $0x0,0x4(%rsp)
jle    1149 <main+0x29>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    1150 <main+0x30>
mov    $0x1,%eax
js     1152 <main+0x32>
pop    %rcx
ret
lea    0xeaa(%rip),%rdi
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [10 x i8] c"Negativo.\00"
@str.3 = [10 x i8] c"Positivo.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = icmp slt i32 %4, 0
br i1 %7, label %8, label %11
8: ; preds = %6, %0
%9 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), %6 ]
%10 = call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 1, %6 ], [ 0, %8 ]
ret i32 %12
}