#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 int_to_alphanum(int);
int max_index(float *, int);
int /*<<< orphan*/ printf(char *, ...);
void print_letters(float *pred, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    int index = max_index(pred + i * 37, 37);
    printf("%c", int_to_alphanum(index));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_letters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1196 <print_letters+0x66>
mov    -0x8(%rbp),%rdi
imul   $0x25,-0x10(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    $0x25,%esi
call   1050 <max_index@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <int_to_alphanum@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <print_letters+0x16>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_letters>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1168 <print_letters+0x38>
mov    %rdi,%rbx
mov    %esi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x25,%esi
call   1050 <max_index@plt>
mov    %eax,%edi
call   1040 <int_to_alphanum@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x94,%rbx
add    $0xffffffffffffffff,%r14
jne    1140 <print_letters+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_letters(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load float*, float** %3
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 37
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %12, i64 %15
%17 = call i32 @max_index(float* %16, i32 37)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @int_to_alphanum(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %11
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @print_letters(float* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = mul nuw nsw i64 %7, 37
%9 = getelementptr inbounds float, float* %0, i64 %8
%10 = tail call i32 @max_index(float* %9, i32 37)
%11 = tail call i32 @int_to_alphanum(i32 %10)
%12 = tail call i32 @putchar(i32 %11)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = tail call i32 @putchar(i32 10)
ret void
}