#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 */
scalar_t__ impar(int);
scalar_t__ par(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Informe um valor inteiro: ");
  scanf("%d", &num);
  if (par(num)) {
    printf("Numero par!\n");
  } else if (impar(num)) {
    printf("Numero impar!\n");
  } else {
    printf("Erro!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <par@plt>
cmp    $0x0,%rax
je     118e <main+0x4e>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0x82>
mov    -0x8(%rbp),%edi
call   1060 <impar@plt>
cmp    $0x0,%rax
je     11b1 <main+0x71>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x7d>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0x82>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <par@plt>
test   %rax,%rax
je     1185 <main+0x35>
lea    0xeaf(%rip),%rdi
jmp    11a3 <main+0x53>
mov    0x4(%rsp),%edi
call   1070 <impar@plt>
test   %rax,%rax
lea    0xe86(%rip),%rax
lea    0xe85(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Informe um valor inteiro: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Numero par!\0A\00"
@.str.3 = [15 x i8] c"Numero impar!\0A\00"
@.str.4 = [7 x i8] c"Erro!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 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 = load i32, i32* %2
%6 = call i64 @par(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %19
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i64 @impar(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Informe um valor inteiro: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [6 x i8] c"Erro!\00"
@str.5 = [14 x i8] c"Numero impar!\00"
@str.6 = [12 x i8] c"Numero par!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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 = call i64 @par(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i64 @impar(i32 %9)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0)
br label %13
13: ; preds = %8, %0
%14 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0), %0 ], [ %12, %8 ]
%15 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}