int *max_score(double student_scores[10][5]) {
  int poss[2];
  int *pos;
  int max_i, max_j;
  double current_max = -1;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 5; j++) {
      if (student_scores[i][j] > current_max) {
        current_max = student_scores[i][j];
        max_i = i;
        max_j = j;
      }
    }
  }
  poss[0] = max_i;
  poss[1] = max_j;
  pos = poss;
  return pos;
}


x86 assembly (clang, -O0):
<max_score>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xa,-0x2c(%rbp)
jge    11a9 <max_score+0xa9>
movl   $0x0,-0x30(%rbp)
cmpl   $0x5,-0x30(%rbp)
jge    1196 <max_score+0x96>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1183 <max_score+0x83>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1188 <max_score+0x88>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    112d <max_score+0x2d>
jmp    119b <max_score+0x9b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111c <max_score+0x1c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_score>:
lea    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @max_score([5 x double]* %0) {
%2 = alloca [5 x double]*
%3 = alloca [2 x i32]
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
store [5 x double]* %0, [5 x double]** %2
store double -1.000000e+00, double* %7
store i32 0, i32* %8
br label %10
10: ; preds = %44, %1
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %47
13: ; preds = %10
store i32 0, i32* %9
br label %14
14: ; preds = %40, %13
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %43
17: ; preds = %14
%18 = load [5 x double]*, [5 x double]** %2
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 %20
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x double], [5 x double]* %21, i64 0, i64 %23
%25 = load double, double* %24
%26 = load double, double* %7
%27 = fcmp ogt double %25, %26
br i1 %27, label %28, label %39
28: ; preds = %17
%29 = load [5 x double]*, [5 x double]** %2
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [5 x double], [5 x double]* %29, i64 %31
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [5 x double], [5 x double]* %32, i64 0, i64 %34
%36 = load double, double* %35
store double %36, double* %7
%37 = load i32, i32* %8
store i32 %37, i32* %5
%38 = load i32, i32* %9
store i32 %38, i32* %6
br label %39
39: ; preds = %28, %17
br label %40
40: ; preds = %39
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %14
43: ; preds = %14
br label %44
44: ; preds = %43
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %10
47: ; preds = %10
%48 = load i32, i32* %5
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %48, i32* %49
%50 = load i32, i32* %6
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %50, i32* %51
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %52, i32** %4
%53 = load i32*, i32** %4
ret i32* %53
}

LLVM IR (-O2):
define noalias i32* @max_score([5 x double]* nocapture %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
ret i32* %4
}