#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 *);
void checaNumero() {
  int num;
  printf("\nEntre com o numero: ");
  scanf("%d", &num);
  if (num == 0) {
    printf("NULO!!!");
  } else {
    if (num % 2 == 0) {
      printf("Par.");
    } else {
      printf("Impar.");
    }
  }
}


x86 assembly (clang, -O0):
<checaNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    115f <checaNumero+0x3f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1195 <checaNumero+0x75>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1184 <checaNumero+0x64>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <checaNumero+0x70>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    1195 <checaNumero+0x75>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checaNumero>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x1,%al
lea    0xed6(%rip),%rcx
lea    0xed4(%rip),%rdx
cmove  %rcx,%rdx
test   %eax,%eax
lea    0xeba(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0AEntre com o numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"NULO!!!\00"
@.str.3 = [5 x i8] c"Par.\00"
@.str.4 = [7 x i8] c"Impar.\00"
define void @checaNumero() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %17
8: ; preds = %0
%9 = load i32, i32* %1
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AEntre com o numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"NULO!!!\00"
@.str.3 = [5 x i8] c"Par.\00"
@.str.4 = [7 x i8] c"Impar.\00"
define void @checaNumero() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%10 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %9
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret void
}