#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  float score[][4] = {{60, 70, 80, 90}, {45, 98, 34, 99}, {34, 66, 90, 11}};
  float *search(float(*pointer)[4], int n);
  float *p;
  int i, k;
  printf("enter the number of student;");
  scanf("%d", &k);
  printf("The score of No,%d are;\n", k);
  p = search(score, k);
  for (i = 0; i < 4; i++)
    printf("%5.2f\t", *(p + i));
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x50(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x50(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%esi
call   1040 <search@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jge    11e1 <main+0xa1>
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11aa <main+0x6a>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1050 <search@plt>
mov    %rax,%rbx
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.000000e+01, float 7.000000e+01, float 8.000000e+01, float 9.000000e+01], [4 x float] [float 4.500000e+01, float 9.800000e+01, float 3.400000e+01, float 9.900000e+01], [4 x float] [float 3.400000e+01, float 6.600000e+01, float 9.000000e+01, float 1.100000e+01]]
@.str = [29 x i8] c"enter the number of student;\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"The score of No,%d are;\0A\00"
@.str.3 = [7 x i8] c"%5.2f\09\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [4 x float]]
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x [4 x float]]* %2 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %2, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call float* @search([4 x float]* %11, i32 %12)
store float* %13, float** %3
store i32 0, i32* %4
br label %14
14: ; preds = %25, %0
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load float*, float** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %14
28: ; preds = %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.000000e+01, float 7.000000e+01, float 8.000000e+01, float 9.000000e+01], [4 x float] [float 4.500000e+01, float 9.800000e+01, float 3.400000e+01, float 9.900000e+01], [4 x float] [float 3.400000e+01, float 6.600000e+01, float 9.000000e+01, float 1.100000e+01]]
@.str = [29 x i8] c"enter the number of student;\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"The score of No,%d are;\0A\00"
@.str.3 = [7 x i8] c"%5.2f\09\00"
define i32 @main() {
%1 = alloca [3 x [4 x float]]
%2 = alloca i32
%3 = bitcast [3 x [4 x float]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call float* @search([4 x float]* %9, i32 %10)
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = getelementptr inbounds float, float* %11, i64 1
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %17)
%19 = getelementptr inbounds float, float* %11, i64 2
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = getelementptr inbounds float, float* %11, i64 3
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %25)
%27 = call i32 @putchar(i32 10)
ret i32 0
}