#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 *, ...);
void display_genres(int alphagenreindex[], char *typegenre[]) {
  int i, j, index;
  printf("Extended MP3 ID3 Genres\n=======================\n");
  for (i = 0; i < 50; i++) {
    for (j = 0; j < 3; j++) {
      index = (50 * j) + i;
      if (index <= 147) {
        printf("%3d %-21s ", alphagenreindex[index],
               typegenre[alphagenreindex[index]]);
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<display_genres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    11c3 <display_genres+0xb3>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11a7 <display_genres+0x97>
imul   $0x32,-0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x93,-0x1c(%rbp)
jg     1194 <display_genres+0x84>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <display_genres+0x89>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <display_genres+0x36>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <display_genres+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_genres>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%r15
xor    %ebx,%ebx
jmp    1174 <display_genres+0x44>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
je     11ba <display_genres+0x8a>
movslq (%r12,%rbx,4),%rsi
mov    (%r14,%rsi,8),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0xc8(%r12,%rbx,4),%rsi
mov    (%r14,%rsi,8),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2f,%rbx
ja     1160 <display_genres+0x30>
movslq 0x190(%r12,%rbx,4),%rsi
mov    (%r14,%rsi,8),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1160 <display_genres+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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