#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
main() {
  setlocale(LC_ALL, "");
  int numero;
  printf("Entre com um número: ");
  scanf("%d", &numero);
  if (numero < 0) {
    printf("O número digitado é NEGATIVO \n");
  } else if (numero > 0) {
    printf("O número digitado é POSITIVO \n");
  } else {
    printf("O número digitado é IGUAL a 0 \n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xf2e(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    118b <main+0x5b>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0x87>
cmpl   $0x0,-0x8(%rbp)
jle    11a6 <main+0x76>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x82>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0x87>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xe9b(%rip),%rax
lea    0xeb5(%rip),%rcx
cmove  %rax,%rcx
lea    0xeca(%rip),%rdi
cmovns %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [23 x i8] c"Entre com um n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [33 x i8] c"O n\C3\BAmero digitado \C3\A9 NEGATIVO \0A\00"
@.str.4 = [33 x i8] c"O n\C3\BAmero digitado \C3\A9 POSITIVO \0A\00"
@.str.5 = [34 x i8] c"O n\C3\BAmero digitado \C3\A9 IGUAL a 0 \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18, %9
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [23 x i8] c"Entre com um n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [33 x i8] c"O n\C3\BAmero digitado \C3\A9 IGUAL a 0 \00"
@str.6 = [32 x i8] c"O n\C3\BAmero digitado \C3\A9 POSITIVO \00"
@str.7 = [32 x i8] c"O n\C3\BAmero digitado \C3\A9 NEGATIVO \00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
%9 = icmp eq i32 %7, 0
%10 = select i1 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0)
%11 = select i1 %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0), i8* %10
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}