#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*/ addToCount(int *, char *);
int /*<<< orphan*/ getLine(char *, int);
int /*<<< orphan*/ printResult(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char str[80];
  int count[26] = {0};
  int i;
  for (i = 0; i < 3; i++) {
    printf("Enter line #%d: ", i);
    getLine(str, 80);
    addToCount(count, str);
  }
  printResult(count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1050 <memset@plt>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    11d0 <main+0x80>
mov    -0xd4(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1070 <getLine@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <addToCount@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    117f <main+0x2f>
lea    -0xd0(%rbp),%rdi
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
lea    0xe84(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <getLine@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <addToCount@plt>
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <getLine@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <addToCount@plt>
mov    %r15,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <getLine@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <addToCount@plt>
mov    %r14,%rdi
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter line #%d: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [26 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [26 x i32]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = call i32 @getLine(i8* %12, i32 80)
%14 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%16 = call i32 @addToCount(i32* %14, i8* %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
%21 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%22 = call i32 @printResult(i32* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter line #%d: \00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [26 x i32]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast [26 x i32]* %2 to i8*
%5 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = call i32 @getLine(i8* %3, i32 80)
%8 = call i32 @addToCount(i32* %5, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = call i32 @getLine(i8* %3, i32 80)
%11 = call i32 @addToCount(i32* %5, i8* %3)
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = call i32 @getLine(i8* %3, i32 80)
%14 = call i32 @addToCount(i32* %5, i8* %3)
%15 = call i32 @printResult(i32* %5)
ret i32 0
}