#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*/ scanf(char *, double *);
void input_scores(double student_scores[10][5]) {
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 5; j++) {
      scanf("%lf", *(student_scores + i) + j);
    }
  }
}


x86 assembly (clang, -O0):
<input_scores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1185 <input_scores+0x75>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1172 <input_scores+0x62>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x28,%rax,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xea1(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <input_scores+0x24>
jmp    1177 <input_scores+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <input_scores+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_scores>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%r15d
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x10(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x18(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x28,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <input_scores+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @input_scores([5 x double]* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %14, %2 ]
%4 = getelementptr inbounds [5 x double], [5 x double]* %0, i64 %3, i64 0
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%6 = getelementptr inbounds [5 x double], [5 x double]* %0, i64 %3, i64 1
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = getelementptr inbounds [5 x double], [5 x double]* %0, i64 %3, i64 2
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%10 = getelementptr inbounds [5 x double], [5 x double]* %0, i64 %3, i64 3
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %10)
%12 = getelementptr inbounds [5 x double], [5 x double]* %0, i64 %3, i64 4
%13 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %12)
%14 = add nuw nsw i64 %3, 1
%15 = icmp eq i64 %14, 10
br i1 %15, label %16, label %2
16: ; preds = %2
ret void
}