#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 EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ isalnum(int);
scalar_t__ isascii(int);
scalar_t__ isblank(int);
scalar_t__ iscntrl(int);
scalar_t__ isdigit(int);
scalar_t__ isgraph(int);
scalar_t__ islower(int);
scalar_t__ isprint(int);
scalar_t__ ispunct(int);
scalar_t__ isspace(int);
scalar_t__ isupper(int);
scalar_t__ isxdigit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  FILE *fp;
  const char *set_mode = "r";
  int print_chars = 0;
  int i, tot_alnum, tot_ascii, tot_space, tot_blank, tot_cntrl, tot_lower,
      tot_upper, tot_digit, tot_graph, tot_print, tot_punct, tot_xdgit;
  tot_alnum = tot_ascii = tot_space = tot_blank = tot_cntrl = tot_lower =
      tot_upper = tot_digit = tot_graph = tot_print = tot_punct = tot_xdgit = 0;
  if (argc < 3) {
    fprintf(stderr,
            "Usage: %s <filename><print mode>\n"
            "print mode (0) - print full file at the beginning\n"
            "print mode (1) - print only character informations\n",
            argv[0]);
    exit(EXIT_FAILURE);
  }
  if ((fp = fopen(argv[1], set_mode)) == NULL) {
    fprintf(stderr, "%s: Apertura file.\n", (char *)strerror(errno));
    exit(EXIT_FAILURE);
  }
  while ((i = fgetc(fp)) != EOF) {
    if (isalnum(i))
      tot_alnum++;
    if (isascii(i))
      tot_ascii++;
    if (isblank(i))
      tot_blank++;
    if (iscntrl(i))
      tot_cntrl++;
    if (isspace(i))
      tot_space++;
    if (islower(i))
      tot_lower++;
    if (isupper(i))
      tot_upper++;
    if (isdigit(i))
      tot_digit++;
    if (isgraph(i))
      tot_graph++;
    if (isprint(i))
      tot_print++;
    if (ispunct(i))
      tot_punct++;
    if (isxdigit(i))
      tot_xdgit++;
  }
  print_chars = atoi(argv[2]);
  if (print_chars == 0) {
    fseek(fp, 0, SEEK_SET);
    while ((i = fgetc(fp)) != EOF)
      fputc(i, stdout);
  }
  printf("\nPrint character informations of: \'%s\'\n", argv[1]);
  printf("tot_alnum:%5.d, tot_ascii:%5.d, tot_space:%5.d, tot_blank:%5.d\n"
         "tot_cntrl:%5.d, tot_lower:%5.d, tot_upper:%5.d, tot_digit:%5.d\n"
         "tot_graph:%5.d, tot_print:%5.d, tot_punct:%5.d, tot_xdgit:%5.d\n",
         tot_alnum, tot_ascii, tot_space, tot_blank, tot_cntrl, tot_lower,
         tot_upper, tot_digit, tot_graph, tot_print, tot_punct, tot_xdgit);
  fclose(fp);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa0,%rsp
movl   $0x0,-0x24(%rbp)
mov    %edi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
lea    0xd79(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    131a <main+0xba>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%rdx
lea    0xcfb(%rip),%rsi
call   10e0 <fprintf@plt>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
call   1140 <exit@plt>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x40(%rbp),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1373 <main+0x113>
mov    0x2c98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    -0x7c(%rbp),%edi
mov    %rax,%rdx
lea    0xd29(%rip),%rsi
call   10e0 <fprintf@plt>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
call   1140 <exit@plt>
jmp    1378 <main+0x118>
mov    -0x38(%rbp),%rdi
call   10a0 <fgetc@plt>
mov    %eax,-0x48(%rbp)
mov    0x2c5d(%rip),%rcx
cmp    (%rcx),%eax
je     14dc <main+0x27c>
mov    -0x48(%rbp),%edi
call   1080 <isalnum@plt>
cmp    $0x0,%rax
je     13ae <main+0x14e>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%edi
call   1150 <isascii@plt>
cmp    $0x0,%rax
je     13c9 <main+0x169>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%edi
call   1090 <isblank@plt>
cmp    $0x0,%rax
je     13e4 <main+0x184>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x48(%rbp),%edi
call   1050 <iscntrl@plt>
cmp    $0x0,%rax
je     13ff <main+0x19f>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x48(%rbp),%edi
call   10c0 <isspace@plt>
cmp    $0x0,%rax
je     141a <main+0x1ba>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     1435 <main+0x1d5>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x48(%rbp),%edi
call   1100 <isupper@plt>
cmp    $0x0,%rax
je     1450 <main+0x1f0>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x48(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     146b <main+0x20b>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x48(%rbp),%edi
call   1180 <isgraph@plt>
cmp    $0x0,%rax
je     1486 <main+0x226>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x48(%rbp),%edi
call   1110 <isprint@plt>
cmp    $0x0,%rax
je     14a1 <main+0x241>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
mov    -0x48(%rbp),%edi
call   10b0 <ispunct@plt>
cmp    $0x0,%rax
je     14bc <main+0x25c>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    -0x48(%rbp),%edi
call   1160 <isxdigit@plt>
cmp    $0x0,%rax
je     14d7 <main+0x277>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1378 <main+0x118>
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rdi
call   1130 <atoi@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    1540 <main+0x2e0>
mov    -0x38(%rbp),%rdi
mov    0x2ac7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10f0 <fseek@plt>
mov    -0x38(%rbp),%rdi
call   10a0 <fgetc@plt>
mov    %eax,-0x48(%rbp)
mov    0x2acb(%rip),%rcx
cmp    (%rcx),%eax
je     153b <main+0x2db>
mov    -0x48(%rbp),%edi
mov    0x2a89(%rip),%rax
mov    (%rax),%esi
call   10d0 <fputc@plt>
jmp    150a <main+0x2aa>
jmp    1540 <main+0x2e0>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xb4e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%r8d
mov    -0x5c(%rbp),%r9d
mov    -0x60(%rbp),%r12d
mov    -0x64(%rbp),%r15d
mov    -0x68(%rbp),%r14d
mov    -0x6c(%rbp),%ebx
mov    -0x70(%rbp),%r11d
mov    -0x74(%rbp),%r10d
mov    -0x78(%rbp),%eax
lea    0xb3d(%rip),%rdi
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r11d,0x20(%rsp)
mov    %r10d,0x28(%rsp)
mov    %eax,0x30(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1060 <fclose@plt>
mov    0x29f1(%rip),%rax
mov    (%rax),%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x2,%edi
jle    1524 <main+0x2c4>
mov    %rsi,0x30(%rsp)
mov    0x8(%rsi),%rdi
lea    0xd79(%rip),%rsi
call   1120 <fopen@plt>
test   %rax,%rax
je     1539 <main+0x2d9>
mov    %rax,%rdi
mov    %rax,0x18(%rsp)
call   10a0 <fgetc@plt>
mov    %eax,%r15d
mov    0x2d3c(%rip),%rax
movl   $0x0,0xc(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    $0x0,%r12d
mov    $0x0,%r13d
mov    $0x0,%ebx
mov    $0x0,%ebp
mov    $0x0,%r14d
mov    $0x0,%ecx
mov    %rcx,0x28(%rsp)
mov    $0x0,%ecx
mov    %rcx,0x20(%rsp)
cmp    (%rax),%r15d
je     1442 <main+0x1e2>
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %r14d,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %r12d,%r12d
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
mov    %r15d,%edi
call   1080 <isalnum@plt>
cmp    $0x1,%rax
sbbl   $0xffffffff,0xc(%rsp)
mov    %r15d,%edi
call   1150 <isascii@plt>
cmp    $0x1,%rax
sbbl   $0xffffffff,0x4(%rsp)
mov    %r15d,%edi
call   1090 <isblank@plt>
cmp    $0x1,%rax
sbbl   $0xffffffff,0x10(%rsp)
mov    %r15d,%edi
call   1050 <iscntrl@plt>
cmp    $0x1,%rax
sbbl   $0xffffffff,0x14(%rsp)
mov    %r15d,%edi
call   10c0 <isspace@plt>
cmp    $0x1,%rax
sbbl   $0xffffffff,0x8(%rsp)
mov    %r15d,%edi
call   1040 <islower@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r12d
mov    %r15d,%edi
call   1100 <isupper@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r13d
mov    %r15d,%edi
call   1030 <isdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
mov    %r15d,%edi
call   1180 <isgraph@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
mov    %r15d,%edi
call   1110 <isprint@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r14d
mov    %r15d,%edi
call   10b0 <ispunct@plt>
cmp    $0x1,%rax
mov    0x28(%rsp),%rax
sbb    $0xffffffff,%eax
mov    %rax,0x28(%rsp)
mov    %r15d,%edi
call   1160 <isxdigit@plt>
cmp    $0x1,%rax
mov    0x20(%rsp),%rax
sbb    $0xffffffff,%eax
mov    %rax,0x20(%rsp)
mov    0x18(%rsp),%rdi
call   10a0 <fgetc@plt>
mov    %eax,%r15d
mov    0x2baf(%rip),%rax
cmp    (%rax),%r15d
jne    1350 <main+0xf0>
mov    0x30(%rsp),%rax
mov    0x10(%rax),%rdi
call   1130 <atoi@plt>
test   %eax,%eax
jne    14af <main+0x24f>
mov    0x2b6d(%rip),%rax
mov    (%rax),%edx
mov    0x18(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
mov    %r15,%rdi
call   10a0 <fgetc@plt>
mov    0x2b6d(%rip),%rcx
cmp    (%rcx),%eax
je     14af <main+0x24f>
mov    0x2b32(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    (%r15),%esi
mov    %eax,%edi
call   10d0 <fputc@plt>
mov    0x18(%rsp),%rdi
call   10a0 <fgetc@plt>
mov    0x2b3d(%rip),%rcx
cmp    (%rcx),%eax
jne    1490 <main+0x230>
mov    0x30(%rsp),%rax
mov    0x8(%rax),%rsi
lea    0xbde(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
sub    $0x8,%rsp
lea    0xbf4(%rip),%rdi
mov    0x14(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x1c(%rsp),%r9d
xor    %eax,%eax
push   0x28(%rsp)
push   0x38(%rsp)
push   %r14
push   %rbp
push   %rbx
push   %r13
push   %r12
call   1070 <printf@plt>
add    $0x40,%rsp
mov    0x18(%rsp),%rdi
call   1060 <fclose@plt>
mov    0x2a9d(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2aad(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xacb(%rip),%rsi
jmp    155c <main+0x2fc>
mov    0x2a98(%rip),%rax
mov    (%rax),%ebx
mov    0x2a87(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0xb32(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10e0 <fprintf@plt>
mov    0x2a58(%rip),%rax
mov    (%rax),%edi
call   1140 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [135 x i8] c"Usage: %s <filename><print mode>\0Aprint mode (0) - print full file at the beginning\0Aprint mode (1) - print only character informations\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"%s: Apertura file.\0A\00"
@errno = global i32 0
@EOF = global i32 0
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.3 = [40 x i8] c"\0APrint character informations of: '%s'\0A\00"
@.str.4 = [190 x i8] c"tot_alnum:%5.d, tot_ascii:%5.d, tot_space:%5.d, tot_blank:%5.d\0Atot_cntrl:%5.d, tot_lower:%5.d, tot_upper:%5.d, tot_digit:%5.d\0Atot_graph:%5.d, tot_print:%5.d, tot_punct:%5.d, tot_xdgit:%5.d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 0, i32* %8
store i32 0, i32* %21
store i32 0, i32* %20
store i32 0, i32* %19
store i32 0, i32* %18
store i32 0, i32* %17
store i32 0, i32* %16
store i32 0, i32* %15
store i32 0, i32* %14
store i32 0, i32* %13
store i32 0, i32* %12
store i32 0, i32* %11
store i32 0, i32* %10
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 3
br i1 %23, label %24, label %32
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %2
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = load i8*, i8** %7
%37 = call i32* @fopen(i8* %35, i8* %36)
store i32* %37, i32** %6
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %47
39: ; preds = %32
%40 = load i32, i32* @stderr
%41 = load i32, i32* @errno
%42 = call i64 @strerror(i32 %41)
%43 = inttoptr i64 %42 to i8*
%44 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %32
br label %48
48: ; preds = %137, %47
%49 = load i32*, i32** %6
%50 = call i32 @fgetc(i32* %49)
store i32 %50, i32* %9
%51 = load i32, i32* @EOF
%52 = icmp ne i32 %50, %51
br i1 %52, label %53, label %138
53: ; preds = %48
%54 = load i32, i32* %9
%55 = call i64 @isalnum(i32 %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* %10
%59 = add nsw i32 %58, 1
store i32 %59, i32* %10
br label %60
60: ; preds = %57, %53
%61 = load i32, i32* %9
%62 = call i64 @isascii(i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load i32, i32* %11
%66 = add nsw i32 %65, 1
store i32 %66, i32* %11
br label %67
67: ; preds = %64, %60
%68 = load i32, i32* %9
%69 = call i64 @isblank(i32 %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %67
%72 = load i32, i32* %13
%73 = add nsw i32 %72, 1
store i32 %73, i32* %13
br label %74
74: ; preds = %71, %67
%75 = load i32, i32* %9
%76 = call i64 @iscntrl(i32 %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %74
%79 = load i32, i32* %14
%80 = add nsw i32 %79, 1
store i32 %80, i32* %14
br label %81
81: ; preds = %78, %74
%82 = load i32, i32* %9
%83 = call i64 @isspace(i32 %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %81
%86 = load i32, i32* %12
%87 = add nsw i32 %86, 1
store i32 %87, i32* %12
br label %88
88: ; preds = %85, %81
%89 = load i32, i32* %9
%90 = call i64 @islower(i32 %89)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %95
92: ; preds = %88
%93 = load i32, i32* %15
%94 = add nsw i32 %93, 1
store i32 %94, i32* %15
br label %95
95: ; preds = %92, %88
%96 = load i32, i32* %9
%97 = call i64 @isupper(i32 %96)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = load i32, i32* %16
%101 = add nsw i32 %100, 1
store i32 %101, i32* %16
br label %102
102: ; preds = %99, %95
%103 = load i32, i32* %9
%104 = call i64 @isdigit(i32 %103)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %102
%107 = load i32, i32* %17
%108 = add nsw i32 %107, 1
store i32 %108, i32* %17
br label %109
109: ; preds = %106, %102
%110 = load i32, i32* %9
%111 = call i64 @isgraph(i32 %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %109
%114 = load i32, i32* %18
%115 = add nsw i32 %114, 1
store i32 %115, i32* %18
br label %116
116: ; preds = %113, %109
%117 = load i32, i32* %9
%118 = call i64 @isprint(i32 %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %116
%121 = load i32, i32* %19
%122 = add nsw i32 %121, 1
store i32 %122, i32* %19
br label %123
123: ; preds = %120, %116
%124 = load i32, i32* %9
%125 = call i64 @ispunct(i32 %124)
%126 = icmp ne i64 %125, 0
br i1 %126, label %127, label %130
127: ; preds = %123
%128 = load i32, i32* %20
%129 = add nsw i32 %128, 1
store i32 %129, i32* %20
br label %130
130: ; preds = %127, %123
%131 = load i32, i32* %9
%132 = call i64 @isxdigit(i32 %131)
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = load i32, i32* %21
%136 = add nsw i32 %135, 1
store i32 %136, i32* %21
br label %137
137: ; preds = %134, %130
br label %48
138: ; preds = %48
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 2
%141 = load i8*, i8** %140
%142 = call i32 @atoi(i8* %141)
store i32 %142, i32* %8
%143 = load i32, i32* %8
%144 = icmp eq i32 %143, 0
br i1 %144, label %145, label %159
145: ; preds = %138
%146 = load i32*, i32** %6
%147 = load i32, i32* @SEEK_SET
%148 = call i32 @fseek(i32* %146, i32 0, i32 %147)
br label %149
149: ; preds = %154, %145
%150 = load i32*, i32** %6
%151 = call i32 @fgetc(i32* %150)
store i32 %151, i32* %9
%152 = load i32, i32* @EOF
%153 = icmp ne i32 %151, %152
br i1 %153, label %154, label %158
154: ; preds = %149
%155 = load i32, i32* %9
%156 = load i32, i32* @stdout
%157 = call i32 @fputc(i32 %155, i32 %156)
br label %149
158: ; preds = %149
br label %159
159: ; preds = %158, %138
%160 = load i8**, i8*** %5
%161 = getelementptr inbounds i8*, i8** %160, i64 1
%162 = load i8*, i8** %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %162)
%164 = load i32, i32* %10
%165 = load i32, i32* %11
%166 = load i32, i32* %12
%167 = load i32, i32* %13
%168 = load i32, i32* %14
%169 = load i32, i32* %15
%170 = load i32, i32* %16
%171 = load i32, i32* %17
%172 = load i32, i32* %18
%173 = load i32, i32* %19
%174 = load i32, i32* %20
%175 = load i32, i32* %21
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.4, i64 0, i64 0), i32 %164, i32 %165, i32 %166, i32 %167, i32 %168, i32 %169, i32 %170, i32 %171, i32 %172, i32 %173, i32 %174, i32 %175)
%177 = load i32*, i32** %6
%178 = call i32 @fclose(i32* %177)
%179 = load i32, i32* @EXIT_SUCCESS
ret i32 %179
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [135 x i8] c"Usage: %s <filename><print mode>\0Aprint mode (0) - print full file at the beginning\0Aprint mode (1) - print only character informations\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"%s: Apertura file.\0A\00"
@errno = global i32 0
@EOF = global i32 0
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.3 = [40 x i8] c"\0APrint character informations of: '%s'\0A\00"
@.str.4 = [190 x i8] c"tot_alnum:%5.d, tot_ascii:%5.d, tot_space:%5.d, tot_blank:%5.d\0Atot_cntrl:%5.d, tot_lower:%5.d, tot_upper:%5.d, tot_digit:%5.d\0Atot_graph:%5.d, tot_print:%5.d, tot_punct:%5.d, tot_xdgit:%5.d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = tail call i32 @fgetc(i32* %13)
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %92, label %27
19: ; preds = %10
%20 = load i32, i32* @stderr
%21 = load i32, i32* @errno
%22 = tail call i64 @strerror(i32 %21)
%23 = inttoptr i64 %22 to i8*
%24 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @EXIT_FAILURE
%26 = tail call i32 @exit(i32 %25)
unreachable
27: ; preds = %15, %27
%28 = phi i32 [ %89, %27 ], [ %16, %15 ]
%29 = phi i32 [ %88, %27 ], [ 0, %15 ]
%30 = phi i32 [ %84, %27 ], [ 0, %15 ]
%31 = phi i32 [ %80, %27 ], [ 0, %15 ]
%32 = phi i32 [ %76, %27 ], [ 0, %15 ]
%33 = phi i32 [ %72, %27 ], [ 0, %15 ]
%34 = phi i32 [ %68, %27 ], [ 0, %15 ]
%35 = phi i32 [ %64, %27 ], [ 0, %15 ]
%36 = phi i32 [ %56, %27 ], [ 0, %15 ]
%37 = phi i32 [ %52, %27 ], [ 0, %15 ]
%38 = phi i32 [ %60, %27 ], [ 0, %15 ]
%39 = phi i32 [ %48, %27 ], [ 0, %15 ]
%40 = phi i32 [ %44, %27 ], [ 0, %15 ]
%41 = tail call i64 @isalnum(i32 %28)
%42 = icmp ne i64 %41, 0
%43 = zext i1 %42 to i32
%44 = add nuw nsw i32 %40, %43
%45 = tail call i64 @isascii(i32 %28)
%46 = icmp ne i64 %45, 0
%47 = zext i1 %46 to i32
%48 = add nuw nsw i32 %39, %47
%49 = tail call i64 @isblank(i32 %28)
%50 = icmp ne i64 %49, 0
%51 = zext i1 %50 to i32
%52 = add nuw nsw i32 %37, %51
%53 = tail call i64 @iscntrl(i32 %28)
%54 = icmp ne i64 %53, 0
%55 = zext i1 %54 to i32
%56 = add nuw nsw i32 %36, %55
%57 = tail call i64 @isspace(i32 %28)
%58 = icmp ne i64 %57, 0
%59 = zext i1 %58 to i32
%60 = add nuw nsw i32 %38, %59
%61 = tail call i64 @islower(i32 %28)
%62 = icmp ne i64 %61, 0
%63 = zext i1 %62 to i32
%64 = add nuw nsw i32 %35, %63
%65 = tail call i64 @isupper(i32 %28)
%66 = icmp ne i64 %65, 0
%67 = zext i1 %66 to i32
%68 = add nuw nsw i32 %34, %67
%69 = tail call i64 @isdigit(i32 %28)
%70 = icmp ne i64 %69, 0
%71 = zext i1 %70 to i32
%72 = add nuw nsw i32 %33, %71
%73 = tail call i64 @isgraph(i32 %28)
%74 = icmp ne i64 %73, 0
%75 = zext i1 %74 to i32
%76 = add nuw nsw i32 %32, %75
%77 = tail call i64 @isprint(i32 %28)
%78 = icmp ne i64 %77, 0
%79 = zext i1 %78 to i32
%80 = add nuw nsw i32 %31, %79
%81 = tail call i64 @ispunct(i32 %28)
%82 = icmp ne i64 %81, 0
%83 = zext i1 %82 to i32
%84 = add nuw nsw i32 %30, %83
%85 = tail call i64 @isxdigit(i32 %28)
%86 = icmp ne i64 %85, 0
%87 = zext i1 %86 to i32
%88 = add nuw nsw i32 %29, %87
%89 = tail call i32 @fgetc(i32* %13)
%90 = load i32, i32* @EOF
%91 = icmp eq i32 %89, %90
br i1 %91, label %92, label %27
92: ; preds = %27, %15
%93 = phi i32 [ 0, %15 ], [ %44, %27 ]
%94 = phi i32 [ 0, %15 ], [ %48, %27 ]
%95 = phi i32 [ 0, %15 ], [ %60, %27 ]
%96 = phi i32 [ 0, %15 ], [ %52, %27 ]
%97 = phi i32 [ 0, %15 ], [ %56, %27 ]
%98 = phi i32 [ 0, %15 ], [ %64, %27 ]
%99 = phi i32 [ 0, %15 ], [ %68, %27 ]
%100 = phi i32 [ 0, %15 ], [ %72, %27 ]
%101 = phi i32 [ 0, %15 ], [ %76, %27 ]
%102 = phi i32 [ 0, %15 ], [ %80, %27 ]
%103 = phi i32 [ 0, %15 ], [ %84, %27 ]
%104 = phi i32 [ 0, %15 ], [ %88, %27 ]
%105 = getelementptr inbounds i8*, i8** %1, i64 2
%106 = load i8*, i8** %105
%107 = tail call i32 @atoi(i8* %106)
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %122
109: ; preds = %92
%110 = load i32, i32* @SEEK_SET
%111 = tail call i32 @fseek(i32* %13, i32 0, i32 %110)
%112 = tail call i32 @fgetc(i32* %13)
%113 = load i32, i32* @EOF
%114 = icmp eq i32 %112, %113
br i1 %114, label %122, label %115
115: ; preds = %109, %115
%116 = phi i32 [ %119, %115 ], [ %112, %109 ]
%117 = load i32, i32* @stdout
%118 = tail call i32 @fputc(i32 %116, i32 %117)
%119 = tail call i32 @fgetc(i32* %13)
%120 = load i32, i32* @EOF
%121 = icmp eq i32 %119, %120
br i1 %121, label %122, label %115
122: ; preds = %115, %109, %92
%123 = load i8*, i8** %11
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %123)
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([190 x i8], [190 x i8]* @.str.4, i64 0, i64 0), i32 %93, i32 %94, i32 %95, i32 %96, i32 %97, i32 %98, i32 %99, i32 %100, i32 %101, i32 %102, i32 %103, i32 %104)
%126 = tail call i32 @fclose(i32* %13)
%127 = load i32, i32* @EXIT_SUCCESS
ret i32 %127
}