#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() {
  int numero;
  printf("Me diga um numero e eu te direi o que ele e!\n");
  scanf("%d", &numero);
  printf("O numero informado e par ou impar?\n");
  if ((numero % 2) == 0) {
    printf("Ele e par!\n");
  } else {
    printf("Ele e impar!\n");
  }
  printf("O numero e positivo, negativo ou neutro?\n");
  if (numero > 0) {
    printf("O numero e positivo!\n");
  } else {
    if (numero < 0) {
      printf("O numero e negativo!\n");
    } else {
      printf("Ele e neutro!\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117c <main+0x5c>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11af <main+0x8f>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
cmpl   $0x0,-0x8(%rbp)
jge    11ca <main+0xaa>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
testb  $0x1,0x4(%rsp)
lea    0xf6b(%rip),%rax
lea    0xef6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xf19(%rip),%rax
lea    0xf04(%rip),%rcx
cmovs  %rax,%rcx
lea    0xf1c(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Me diga um numero e eu te direi o que ele e!\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"O numero informado e par ou impar?\0A\00"
@.str.3 = [12 x i8] c"Ele e par!\0A\00"
@.str.4 = [14 x i8] c"Ele e impar!\0A\00"
@.str.5 = [42 x i8] c"O numero e positivo, negativo ou neutro?\0A\00"
@.str.6 = [22 x i8] c"O numero e positivo!\0A\00"
@.str.7 = [22 x i8] c"O numero e negativo!\0A\00"
@.str.8 = [15 x i8] c"Ele e neutro!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 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), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %27
19: ; preds = %13
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %26
24: ; preds = %19
%25 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %17
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [45 x i8] c"Me diga um numero e eu te direi o que ele e!\00"
@str.9 = [35 x i8] c"O numero informado e par ou impar?\00"
@str.10 = [13 x i8] c"Ele e impar!\00"
@str.11 = [41 x i8] c"O numero e positivo, negativo ou neutro?\00"
@str.12 = [14 x i8] c"Ele e neutro!\00"
@str.13 = [21 x i8] c"O numero e negativo!\00"
@str.14 = [21 x i8] c"O numero e positivo!\00"
@str.15 = [11 x i8] c"Ele e par!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 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), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.11, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
%14 = icmp slt i32 %12, 0
%15 = select i1 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.12, i64 0, i64 0)
%16 = select i1 %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.14, i64 0, i64 0), i8* %15
%17 = call i32 @puts(i8* dereferenceable(1) %16)
ret i32 0
}