#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 printScores(int judgeNo, double scores[]) {
  printf("Loaded scores:\n");
  for (int n = 0; n < judgeNo; n++) {
    printf("Judge %d: %.1lf\n", (n + 1), scores[n]);
  }
}


x86 assembly (clang, -O0):
<printScores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <printScores+0x5f>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <printScores+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printScores>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    116b <printScores+0x4b>
mov    %ebx,%r12d
xor    %ebx,%ebx
lea    0xeb7(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    %rbx,%r12
jne    1150 <printScores+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Judge %d: %.1lf\0A\00"
@str = [15 x i8] c"Loaded scores:\00"
define void @printScores(i32 %0, double* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %10, %8 ]
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds double, double* %1, i64 %9
%12 = load double, double* %11
%13 = trunc i64 %10 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %13, double %12)
%15 = icmp eq i64 %10, %6
br i1 %15, label %7, label %8
}