#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *arqv[]) {
  int comecopalavra = 0, cp = 0, cl = 0, cb = 0;
  FILE *descritor;
  char *arq;
  char c;
  descritor = fopen(arqv[1], "r");
  c = getc(descritor);
  while (!feof(descritor)) {
    fread(arq, 1, 1, descritor);
    cb++;
    if ((*arq != ' ') && (*arq != '\n') && (!comecopalavra)) {
      comecopalavra = 1;
    }
    if ((*arq != ' ') || (*arq != '\n') && (!comecopalavra)) {
      comecopalavra = 0;
      cp++;
    }
    if (*arq = '\n') {
      cl++;
    }
  }
  fclose(descritor);
  printf("Linhas = %i. \n", cl);
  printf("Palavras = %i. \n", cp);
  printf("Bytes = %i. \n", cb);
  printf("Nome do arquivo = %s", arqv[1]);
  printf("Quantos argumentos? %i", argc);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11e4 <main+0x74>
jmp    1290 <main+0x120>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1232 <main+0xc2>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1232 <main+0xc2>
cmpl   $0x0,-0x14(%rbp)
jne    1232 <main+0xc2>
movl   $0x1,-0x14(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    125c <main+0xec>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     126c <main+0xfc>
cmpl   $0x0,-0x14(%rbp)
jne    126c <main+0xfc>
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
movb   $0xa,(%rax)
mov    $0x1,%al
test   $0x1,%al
jne    1282 <main+0x112>
jmp    128b <main+0x11b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c6 <main+0x56>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%esi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    0x8(%rsi),%rdi
lea    0xe7b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1090 <getc@plt>
mov    %rbp,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     120a <main+0x9a>
mov    %rbp,%rdi
call   1040 <fclose@plt>
lea    0xe52(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe51(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe52(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [15 x i8] c"Linhas = %i. \0A\00"
@.str.2 = [17 x i8] c"Palavras = %i. \0A\00"
@.str.3 = [14 x i8] c"Bytes = %i. \0A\00"
@.str.4 = [21 x i8] c"Nome do arquivo = %s\00"
@.str.5 = [23 x i8] c"Quantos argumentos? %i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %16, i32** %10
%17 = load i32*, i32** %10
%18 = call signext i8 @getc(i32* %17)
store i8 %18, i8* %12
br label %19
19: ; preds = %64, %2
%20 = load i32*, i32** %10
%21 = call i32 @feof(i32* %20)
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
br i1 %23, label %24, label %65
24: ; preds = %19
%25 = load i8*, i8** %11
%26 = load i32*, i32** %10
%27 = call i32 @fread(i8* %25, i32 1, i32 1, i32* %26)
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
%30 = load i8*, i8** %11
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 32
br i1 %33, label %34, label %43
34: ; preds = %24
%35 = load i8*, i8** %11
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 10
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %39
store i32 1, i32* %6
br label %43
43: ; preds = %42, %39, %34, %24
%44 = load i8*, i8** %11
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 32
br i1 %47, label %56, label %48
48: ; preds = %43
%49 = load i8*, i8** %11
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 10
br i1 %52, label %53, label %59
53: ; preds = %48
%54 = load i32, i32* %6
%55 = icmp ne i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %53, %43
store i32 0, i32* %6
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %59
59: ; preds = %56, %53, %48
%60 = load i8*, i8** %11
store i8 10, i8* %60
br i1 true, label %61, label %64
61: ; preds = %59
%62 = load i32, i32* %8
%63 = add nsw i32 %62, 1
store i32 %63, i32* %8
br label %64
64: ; preds = %61, %59
br label %19
65: ; preds = %19
%66 = load i32*, i32** %10
%67 = call i32 @fclose(i32* %66)
%68 = load i32, i32* %8
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %7
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %9
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %72)
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %76)
%78 = load i32, i32* %4
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %78)
%80 = call i32 (...) @getchar()
%81 = load i32, i32* %3
ret i32 %81
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [15 x i8] c"Linhas = %i. \0A\00"
@.str.2 = [17 x i8] c"Palavras = %i. \0A\00"
@.str.3 = [14 x i8] c"Bytes = %i. \0A\00"
@.str.4 = [21 x i8] c"Nome do arquivo = %s\00"
@.str.5 = [23 x i8] c"Quantos argumentos? %i\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call signext i8 @getc(i32* %5)
%7 = tail call i32 @feof(i32* %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @fread(i8* undef, i32 1, i32 1, i32* %5)
unreachable
11: ; preds = %2
%12 = tail call i32 @fclose(i32* %5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 0)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
%16 = load i8*, i8** %3
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %0)
%19 = tail call i32 (...) @getchar()
ret i32 0
}