#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 *, float);
void search(float (*p)[4], int n) {
  int i;
  printf("The score of NO.%d are:\n", n);
  for (i = 0; i < 4; i++) {
    printf("%5.2f ", *(*(p + n) + i));
  }
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1173 <search+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <search+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
cvtsi2ss %esi,%xmm0
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movslq %ebp,%rbp
shl    $0x4,%rbp
movss  (%rbx,%rbp,1),%xmm0
lea    0xedd(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x4(%rbx,%rbp,1),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x8(%rbx,%rbp,1),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0xc(%rbx,%rbp,1),%xmm0
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"The score of NO.%d are:\0A\00"
@.str.1 = [7 x i8] c"%5.2f \00"
define void @search([4 x float]* nocapture %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %3)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %5, i64 0
%7 = load float, float* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %5, i64 1
%10 = load float, float* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %5, i64 2
%13 = load float, float* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %13)
%15 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %5, i64 3
%16 = load float, float* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %16)
ret void
}