#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 fchar(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  int y;
  char letra;
  printf("Digite um caracter: ");
  scanf("%c", &letra);
  y = fchar(letra);
  if (y == 1)
    printf("É uma Letra!!\n\n");
  else
    printf("Não é uma Letra!!\n\n");
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x9(%rbp),%edi
call   1050 <fchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1192 <main+0x52>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    119e <main+0x5e>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1060 <fchar@plt>
cmp    $0x1,%eax
lea    0xeb1(%rip),%rax
lea    0xe95(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Digite um caracter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"\C3\89 uma Letra!!\0A\0A\00"
@.str.3 = [22 x i8] c"N\C3\A3o \C3\A9 uma Letra!!\0A\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = call i32 @fchar(i8 signext %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 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 i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Digite um caracter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.4 = [6 x i8] c"pause\00"
@str = [21 x i8] c"N\C3\A3o \C3\A9 uma Letra!!\0A\00"
@str.5 = [16 x i8] c"\C3\89 uma Letra!!\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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), i8* %1)
%4 = load i8, i8* %1
%5 = call i32 @fchar(i8 signext %4)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}