#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*/ printf(char *, char, int);
void output(int i, int count, int letters, int maximum, char alphabet[26],
            int times[200]) {
  for (i = maximum; i >= 0; i++) {
    for (count = 0; count < letters; count++) {
      if (times[count] == i) {
        printf("%c: %d\n", alphabet[i], count);
      }
    }
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     11a6 <output+0x96>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1193 <output+0x83>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jne    1180 <output+0x70>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%edx
lea    0xe88(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1185 <output+0x75>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <output+0x33>
jmp    1198 <output+0x88>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <output+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
js     1171 <output+0x61>
mov    %r9,%r13
mov    %r8,%r14
mov    %ecx,%ebx
mov    %edx,%r15d
lea    0xecf(%rip),%r12
mov    %edx,0x4(%rsp)
jmp    1148 <output+0x38>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    0x4(%rsp),%edx
test   %edx,%edx
jle    1140 <output+0x30>
xor    %ebp,%ebp
jmp    1159 <output+0x49>
add    $0x1,%rbp
cmp    %rbp,%r15
je     1140 <output+0x30>
cmp    %ebx,0x0(%r13,%rbp,4)
jne    1150 <output+0x40>
movsbl (%r14,%rbx,1),%esi
mov    %r12,%rdi
mov    %ebp,%edx
call   1030 <printf@plt>
jmp    1150 <output+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%c: %d\0A\00"
define void @output(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32* %5, i32** %12
%13 = load i32, i32* %10
store i32 %13, i32* %7
br label %14
14: ; preds = %43, %6
%15 = load i32, i32* %7
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %46
17: ; preds = %14
store i32 0, i32* %8
br label %18
18: ; preds = %39, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %42
22: ; preds = %18
%23 = load i32*, i32** %12
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %7
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %38
30: ; preds = %22
%31 = load i8*, i8** %11
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = load i32, i32* %8
%37 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %35, i32 %36)
br label %38
38: ; preds = %30, %22
br label %39
39: ; preds = %38
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %18
42: ; preds = %18
br label %43
43: ; preds = %42
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %14
46: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%c: %d\0A\00"
define void @output(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i32* nocapture %5) {
%7 = icmp sgt i32 %3, -1
br i1 %7, label %8, label %31
8: ; preds = %6
%9 = icmp sgt i32 %2, 0
%10 = zext i32 %3 to i64
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %29, %8
%13 = phi i64 [ %10, %8 ], [ %30, %29 ]
br i1 %9, label %14, label %29
14: ; preds = %12
%15 = getelementptr inbounds i8, i8* %4, i64 %13
%16 = trunc i64 %13 to i32
br label %17
17: ; preds = %14, %26
%18 = phi i64 [ 0, %14 ], [ %27, %26 ]
%19 = getelementptr inbounds i32, i32* %5, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, %16
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = load i8, i8* %15
%24 = trunc i64 %18 to i32
%25 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %23, i32 %24)
br label %26
26: ; preds = %17, %22
%27 = add nuw nsw i64 %18, 1
%28 = icmp eq i64 %27, %11
br i1 %28, label %29, label %17
29: ; preds = %26, %12
%30 = add i64 %13, 1
br label %12
31: ; preds = %6
ret void
}