#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*/ charControle(int /*<<< orphan*/, int *, int *);
int /*<<< orphan*/ charTipo(char);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char texto[] = "LISTA PARA A PROVA UM,\tVALENDO PONTO.\nMELHOR ESTUDAR E "
                 "TIRAR BOA NOTA.";
  int tipo = 0, controle = 0;
  int cnt[3] = {0, 0, 1};
  int pos = 0;
  for (pos = 0; pos < 71; pos++)
    charControle(charTipo(texto[pos]), cnt, &controle);
  printf("Contador:\n");
  printf("\tLetras => %d\n", cnt[0]);
  printf("\tPalavras => %d\n", cnt[1]);
  printf("\tLinhas => %d\n", cnt[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x47,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x64(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x47,-0x68(%rbp)
jge    11c9 <main+0x89>
movslq -0x68(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%edi
call   1030 <charTipo@plt>
mov    %eax,%edi
lea    -0x64(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1050 <charControle@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1194 <main+0x54>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
mov    0xef7(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xee4(%rip),%rax
mov    %rax,0x8(%rsp)
xor    %ebx,%ebx
lea    0xe8e(%rip),%r12
lea    0x8(%rsp),%r14
lea    0x14(%rsp),%r15
nopl   0x0(%rax)
movsbl (%rbx,%r12,1),%edi
call   1030 <charTipo@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <charControle@plt>
add    $0x1,%rbx
cmp    $0x47,%rbx
jne    1180 <main+0x40>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%esi
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.texto = [71 x i8] c"LISTA PARA A PROVA UM,\09VALENDO PONTO.\0AMELHOR ESTUDAR E TIRAR BOA NOTA.\00"
@__const.main.cnt = [3 x i32] [i32 0, i32 0, i32 1]
@.str = [11 x i8] c"Contador:\0A\00"
@.str.1 = [15 x i8] c"\09Letras => %d\0A\00"
@.str.2 = [17 x i8] c"\09Palavras => %d\0A\00"
@.str.3 = [15 x i8] c"\09Linhas => %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [71 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [71 x i8]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
%8 = bitcast [3 x i32]* %5 to i8*
store i32 0, i32* %6
store i32 0, i32* %6
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 71
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @charTipo(i8 signext %16)
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%19 = call i32 @charControle(i32 %17, i32* %18, i32* %4)
br label %20
20: ; preds = %12
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %9
23: ; preds = %9
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@__const.main.texto = [71 x i8] c"LISTA PARA A PROVA UM,\09VALENDO PONTO.\0AMELHOR ESTUDAR E TIRAR BOA NOTA.\00"
@__const.main.cnt = [3 x i32] [i32 0, i32 0, i32 1]
@.str.1 = [15 x i8] c"\09Letras => %d\0A\00"
@.str.2 = [17 x i8] c"\09Palavras => %d\0A\00"
@.str.3 = [15 x i8] c"\09Linhas => %d\0A\00"
@str = [10 x i8] c"Contador:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %12, %6 ]
%8 = getelementptr inbounds [71 x i8], [71 x i8]* @__const.main.texto, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = call i32 @charTipo(i8 signext %9)
%11 = call i32 @charControle(i32 %10, i32* %5, i32* %1)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, 71
br i1 %13, label %14, label %6
14: ; preds = %6
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %22)
ret i32 0
}