#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__ aux_isNumber(char);
char getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
void testa_isNumber() {
  printf("Digite um valor: ");
  char digitado = getch();
  printf("%c", digitado);
  if (aux_isNumber(digitado)) {
    printf("\nÉ número.\n");
  } else {
    printf("\nNão é número!\n");
  }
  system("pause");
}


x86 assembly (clang, -O0):
<testa_isNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1030 <aux_isNumber@plt>
cmp    $0x0,%rax
je     1198 <testa_isNumber+0x58>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11a6 <testa_isNumber+0x66>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe89(%rip),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testa_isNumber>:
push   %rbx
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1080 <getch@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1050 <aux_isNumber@plt>
test   %rax,%rax
lea    0xe87(%rip),%rax
lea    0xe92(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xe6a(%rip),%rdi
pop    %rbx
jmp    1060 <system@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [14 x i8] c"\0A\C3\89 n\C3\BAmero.\0A\00"
@.str.3 = [19 x i8] c"\0AN\C3\A3o \C3\A9 n\C3\BAmero!\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define void @testa_isNumber() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i8, i8* %1
%8 = call i64 @aux_isNumber(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.4 = [6 x i8] c"pause\00"
@str = [18 x i8] c"\0AN\C3\A3o \C3\A9 n\C3\BAmero!\00"
@str.5 = [13 x i8] c"\0A\C3\89 n\C3\BAmero.\00"
define void @testa_isNumber() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getch()
%3 = sext i8 %2 to i32
%4 = tail call i32 @putchar(i32 %3)
%5 = tail call i64 @aux_isNumber(i8 signext %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}