#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 fscanf(int /*<<< orphan*/ *, char *, char *);
void arrayScan(FILE *in, int arrayLetters[], int size) {
  int temp, symbolCode;
  char symbol;
  temp = fscanf(in, "%c", &symbol);
  for (; temp != EOF;) {
    if (symbol > 64 && symbol < 123) {
      if (symbol > 64 && symbol < 91) {
        symbol -= 65;
      }
      if (symbol > 96) {
        symbol -= 97;
      }
      if (symbol < size) {
        symbolCode = symbol;
        arrayLetters[symbolCode] += 1;
      }
    }
    temp = fscanf(in, "%c", &symbol);
  }
}


x86 assembly (clang, -O0):
<arrayScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0x1d(%rbp),%rdx
call   1030 <fscanf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%eax
je     11e7 <arrayScan+0xd7>
movsbl -0x1d(%rbp),%eax
cmp    $0x40,%eax
jle    11cb <arrayScan+0xbb>
movsbl -0x1d(%rbp),%eax
cmp    $0x7b,%eax
jge    11cb <arrayScan+0xbb>
movsbl -0x1d(%rbp),%eax
cmp    $0x40,%eax
jle    118a <arrayScan+0x7a>
movsbl -0x1d(%rbp),%eax
cmp    $0x5b,%eax
jge    118a <arrayScan+0x7a>
movsbl -0x1d(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    $0x60,%eax
jle    11a1 <arrayScan+0x91>
movsbl -0x1d(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c6 <arrayScan+0xb6>
movsbl -0x1d(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    11cb <arrayScan+0xbb>
mov    -0x8(%rbp),%rdi
lea    0xe2a(%rip),%rsi
lea    -0x1d(%rbp),%rdx
call   1030 <fscanf@plt>
mov    %eax,-0x18(%rbp)
jmp    113a <arrayScan+0x2a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayScan>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0x7(%rsp),%rdx
call   1030 <fscanf@plt>
mov    0x2eac(%rip),%r13
cmp    0x0(%r13),%eax
jne    1151 <arrayScan+0x41>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea8(%rip),%r12
lea    0x7(%rsp),%rbp
jmp    1174 <arrayScan+0x64>
nop
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%r13),%eax
je     1142 <arrayScan+0x32>
movzbl 0x7(%rsp),%eax
lea    -0x41(%rax),%ecx
cmp    $0x39,%cl
ja     1160 <arrayScan+0x50>
cmp    $0x5a,%al
ja     1190 <arrayScan+0x80>
mov    %cl,0x7(%rsp)
jmp    119c <arrayScan+0x8c>
nopl   0x0(%rax,%rax,1)
cmp    $0x61,%al
jb     119a <arrayScan+0x8a>
add    $0x9f,%al
mov    %al,0x7(%rsp)
mov    %eax,%ecx
movzbl %cl,%eax
cmp    %r15d,%eax
jge    1160 <arrayScan+0x50>
addl   $0x1,(%r14,%rax,4)
jmp    1160 <arrayScan+0x50>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i32 0
define void @arrayScan(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 %11, i32* %7
br label %12
12: ; preds = %61, %3
%13 = load i32, i32* %7
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %64
16: ; preds = %12
%17 = load i8, i8* %9
%18 = sext i8 %17 to i32
%19 = icmp sgt i32 %18, 64
br i1 %19, label %20, label %61
20: ; preds = %16
%21 = load i8, i8* %9
%22 = sext i8 %21 to i32
%23 = icmp slt i32 %22, 123
br i1 %23, label %24, label %61
24: ; preds = %20
%25 = load i8, i8* %9
%26 = sext i8 %25 to i32
%27 = icmp sgt i32 %26, 64
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = load i8, i8* %9
%30 = sext i8 %29 to i32
%31 = icmp slt i32 %30, 91
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i8, i8* %9
%34 = sext i8 %33 to i32
%35 = sub nsw i32 %34, 65
%36 = trunc i32 %35 to i8
store i8 %36, i8* %9
br label %37
37: ; preds = %32, %28, %24
%38 = load i8, i8* %9
%39 = sext i8 %38 to i32
%40 = icmp sgt i32 %39, 96
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load i8, i8* %9
%43 = sext i8 %42 to i32
%44 = sub nsw i32 %43, 97
%45 = trunc i32 %44 to i8
store i8 %45, i8* %9
br label %46
46: ; preds = %41, %37
%47 = load i8, i8* %9
%48 = sext i8 %47 to i32
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %60
51: ; preds = %46
%52 = load i8, i8* %9
%53 = sext i8 %52 to i32
store i32 %53, i32* %8
%54 = load i32*, i32** %5
%55 = load i32, i32* %8
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, 1
store i32 %59, i32* %57
br label %60
60: ; preds = %51, %46
br label %61
61: ; preds = %60, %20, %16
%62 = load i32*, i32** %4
%63 = call i32 @fscanf(i32* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 %63, i32* %7
br label %12
64: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i32 0
define void @arrayScan(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = alloca i8
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %32, label %8
8: ; preds = %3, %28
%9 = load i8, i8* %4
%10 = add i8 %9, -65
%11 = icmp ult i8 %10, 58
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = icmp ult i8 %9, 91
br i1 %13, label %14, label %15
14: ; preds = %12
store i8 %10, i8* %4
br label %19
15: ; preds = %12
%16 = icmp ugt i8 %9, 96
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = add nsw i8 %9, -97
store i8 %18, i8* %4
br label %19
19: ; preds = %14, %17, %15
%20 = phi i8 [ %10, %14 ], [ %18, %17 ], [ %9, %15 ]
%21 = zext i8 %20 to i32
%22 = icmp slt i32 %21, %2
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = zext i8 %20 to i64
%25 = getelementptr inbounds i32, i32* %1, i64 %24
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %25
br label %28
28: ; preds = %19, %23, %8
%29 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %8
32: ; preds = %28, %3
ret void
}