#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*/ afficherLigne(int, int);
int /*<<< orphan*/ printf(char *);
void afficherHisto(int stats[12]) {
  printf("Histogramme : \n");
  for (int i = 2; i < 13; ++i) {
    afficherLigne(i, stats[i - 1]);
  }
}


x86 assembly (clang, -O0):
<afficherHisto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
movl   $0x2,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jge    116f <afficherHisto+0x4f>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <afficherLigne@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <afficherHisto+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherHisto>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rbx),%esi
mov    $0x2,%edi
call   1030 <afficherLigne@plt>
mov    0x8(%rbx),%esi
mov    $0x3,%edi
call   1030 <afficherLigne@plt>
mov    0xc(%rbx),%esi
mov    $0x4,%edi
call   1030 <afficherLigne@plt>
mov    0x10(%rbx),%esi
mov    $0x5,%edi
call   1030 <afficherLigne@plt>
mov    0x14(%rbx),%esi
mov    $0x6,%edi
call   1030 <afficherLigne@plt>
mov    0x18(%rbx),%esi
mov    $0x7,%edi
call   1030 <afficherLigne@plt>
mov    0x1c(%rbx),%esi
mov    $0x8,%edi
call   1030 <afficherLigne@plt>
mov    0x20(%rbx),%esi
mov    $0x9,%edi
call   1030 <afficherLigne@plt>
mov    0x24(%rbx),%esi
mov    $0xa,%edi
call   1030 <afficherLigne@plt>
mov    0x28(%rbx),%esi
mov    $0xb,%edi
call   1030 <afficherLigne@plt>
mov    0x2c(%rbx),%esi
mov    $0xc,%edi
pop    %rbx
jmp    1030 <afficherLigne@plt>

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

LLVM IR (-O2):
@str = [15 x i8] c"Histogramme : \00"
define void @afficherHisto(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @afficherLigne(i32 2, i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = tail call i32 @afficherLigne(i32 3, i32 %7)
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %9
%11 = tail call i32 @afficherLigne(i32 4, i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = load i32, i32* %12
%14 = tail call i32 @afficherLigne(i32 5, i32 %13)
%15 = getelementptr inbounds i32, i32* %0, i64 5
%16 = load i32, i32* %15
%17 = tail call i32 @afficherLigne(i32 6, i32 %16)
%18 = getelementptr inbounds i32, i32* %0, i64 6
%19 = load i32, i32* %18
%20 = tail call i32 @afficherLigne(i32 7, i32 %19)
%21 = getelementptr inbounds i32, i32* %0, i64 7
%22 = load i32, i32* %21
%23 = tail call i32 @afficherLigne(i32 8, i32 %22)
%24 = getelementptr inbounds i32, i32* %0, i64 8
%25 = load i32, i32* %24
%26 = tail call i32 @afficherLigne(i32 9, i32 %25)
%27 = getelementptr inbounds i32, i32* %0, i64 9
%28 = load i32, i32* %27
%29 = tail call i32 @afficherLigne(i32 10, i32 %28)
%30 = getelementptr inbounds i32, i32* %0, i64 10
%31 = load i32, i32* %30
%32 = tail call i32 @afficherLigne(i32 11, i32 %31)
%33 = getelementptr inbounds i32, i32* %0, i64 11
%34 = load i32, i32* %33
%35 = tail call i32 @afficherLigne(i32 12, i32 %34)
ret void
}