#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 good(char course[5][10], int num[4], float *pscore, float aver[4]) {
  int i, j, k, n;
  printf("=====Students whose score is good=====\n");
  printf("NO.");
  for (i = 0; i < 5; i++)
    printf("%s ", course[i]);
  printf("  average\n");
  for (i = 0; i < 4; i++) {
    n = 0;
    for (j = 0; j < 5; j++) {
      if (*(pscore + 5 * i + j) > 85.0)
        n++;
    }
    if (n == 5 || (aver[i] >= 90)) {
      printf("%d ", num[i]);
      for (k = 0; k < 5; k++)
        printf("%f ", *(pscore + 5 * i + k));
      printf("%f\n", aver[i]);
    }
  }
}


x86 assembly (clang, -O0):
<good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1180 <good+0x70>
mov    -0x8(%rbp),%rsi
movslq -0x24(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <good+0x3b>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    12c3 <good+0x1b3>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    1204 <good+0xf4>
mov    -0x18(%rbp),%rax
imul   $0x5,-0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f1 <good+0xe1>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f6 <good+0xe6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ad <good+0x9d>
cmpl   $0x5,-0x30(%rbp)
je     122c <good+0x11c>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  0xddd(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12b0 <good+0x1a0>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1291 <good+0x181>
mov    -0x18(%rbp),%rax
imul   $0x5,-0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    124c <good+0x13c>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12b5 <good+0x1a5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <good+0x85>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%rbp
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xa(%rbp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rbp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1e(%rbp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x28,%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rbx
lea    0xe6d(%rip),%r13
lea    0xe6a(%rip),%rbp
xor    %r12d,%r12d
jmp    1262 <good+0x142>
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%r12,4),%esi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  -0x10(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%r14,%r12,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r12
add    $0x14,%rbx
cmp    $0x4,%r12
je     12c7 <good+0x1a7>
movups -0x10(%rbx),%xmm0
movaps 0xd93(%rip),%xmm1
cmpltps %xmm0,%xmm1
movss  (%rbx),%xmm0
xor    %eax,%eax
ucomiss 0xd92(%rip),%xmm0
seta   %al
movmskps %xmm1,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
add    %eax,%ecx
cmp    $0x5,%ecx
je     11d0 <good+0xb0>
movss  (%r14,%r12,4),%xmm0
ucomiss 0xd55(%rip),%xmm0
jae    11d0 <good+0xb0>
jmp    1254 <good+0x134>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"=====Students whose score is good=====\0A\00"
@.str.1 = [4 x i8] c"NO.\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [11 x i8] c" average\0A\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [4 x i8] c"%f \00"
@.str.6 = [4 x i8] c"%f\0A\00"
define void @good([10 x i8]* %0, i32* %1, float* %2, float* %3) {
%5 = alloca [10 x i8]*
%6 = alloca i32*
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store [10 x i8]* %0, [10 x i8]** %5
store i32* %1, i32** %6
store float* %2, float** %7
store float* %3, float** %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %9
br label %15
15: ; preds = %25, %4
%16 = load i32, i32* %9
%17 = icmp slt i32 %16, 5
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load [10 x i8]*, [10 x i8]** %5
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %19, i64 %21
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %22, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %15
28: ; preds = %15
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %30
30: ; preds = %100, %28
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 4
br i1 %32, label %33, label %103
33: ; preds = %30
store i32 0, i32* %12
store i32 0, i32* %10
br label %34
34: ; preds = %53, %33
%35 = load i32, i32* %10
%36 = icmp slt i32 %35, 5
br i1 %36, label %37, label %56
37: ; preds = %34
%38 = load float*, float** %7
%39 = load i32, i32* %9
%40 = mul nsw i32 5, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %38, i64 %41
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %42, i64 %44
%46 = load float, float* %45
%47 = fpext float %46 to double
%48 = fcmp ogt double %47, 8.500000e+01
br i1 %48, label %49, label %52
49: ; preds = %37
%50 = load i32, i32* %12
%51 = add nsw i32 %50, 1
store i32 %51, i32* %12
br label %52
52: ; preds = %49, %37
br label %53
53: ; preds = %52
%54 = load i32, i32* %10
%55 = add nsw i32 %54, 1
store i32 %55, i32* %10
br label %34
56: ; preds = %34
%57 = load i32, i32* %12
%58 = icmp eq i32 %57, 5
br i1 %58, label %66, label %59
59: ; preds = %56
%60 = load float*, float** %8
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float, float* %60, i64 %62
%64 = load float, float* %63
%65 = fcmp oge float %64, 9.000000e+01
br i1 %65, label %66, label %99
66: ; preds = %59, %56
%67 = load i32*, i32** %6
%68 = load i32, i32* %9
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %67, i64 %69
%71 = load i32, i32* %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %71)
store i32 0, i32* %11
br label %73
73: ; preds = %88, %66
%74 = load i32, i32* %11
%75 = icmp slt i32 %74, 5
br i1 %75, label %76, label %91
76: ; preds = %73
%77 = load float*, float** %7
%78 = load i32, i32* %9
%79 = mul nsw i32 5, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %77, i64 %80
%82 = load i32, i32* %11
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %81, i64 %83
%85 = load float, float* %84
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %86)
br label %88
88: ; preds = %76
%89 = load i32, i32* %11
%90 = add nsw i32 %89, 1
store i32 %90, i32* %11
br label %73
91: ; preds = %73
%92 = load float*, float** %8
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds float, float* %92, i64 %94
%96 = load float, float* %95
%97 = fpext float %96 to double
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %97)
br label %99
99: ; preds = %91, %59
br label %100
100: ; preds = %99
%101 = load i32, i32* %9
%102 = add nsw i32 %101, 1
store i32 %102, i32* %9
br label %30
103: ; preds = %30
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"NO.\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [4 x i8] c"%f \00"
@.str.6 = [4 x i8] c"%f\0A\00"
@str = [39 x i8] c"=====Students whose score is good=====\00"
@str.7 = [10 x i8] c" average\00"
define void @good([10 x i8]* %0, i32* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 1, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 2, i64 0
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 3, i64 0
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 4, i64 0
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0))
br label %18
18: ; preds = %4, %64
%19 = phi i64 [ 0, %4 ], [ %65, %64 ]
%20 = mul nuw nsw i64 %19, 5
%21 = getelementptr inbounds float, float* %2, i64 %20
%22 = getelementptr inbounds float, float* %21, i64 1
%23 = getelementptr inbounds float, float* %21, i64 2
%24 = getelementptr inbounds float, float* %21, i64 3
%25 = bitcast float* %21 to <4 x float>*
%26 = load <4 x float>, <4 x float>* %25
%27 = fcmp ogt <4 x float> %26, <float 8.500000e+01, float 8.500000e+01, float 8.500000e+01, float 8.500000e+01>
%28 = getelementptr inbounds float, float* %21, i64 4
%29 = load float, float* %28
%30 = fcmp ogt float %29, 8.500000e+01
%31 = zext i1 %30 to i32
%32 = bitcast <4 x i1> %27 to i4
%33 = call i4 @llvm.ctpop.i4(i4 %32)
%34 = zext i4 %33 to i32
%35 = add nuw nsw i32 %34, %31
%36 = icmp eq i32 %35, 5
br i1 %36, label %41, label %37
37: ; preds = %18
%38 = getelementptr inbounds float, float* %3, i64 %19
%39 = load float, float* %38
%40 = fcmp ult float %39, 9.000000e+01
br i1 %40, label %64, label %41
41: ; preds = %37, %18
%42 = getelementptr inbounds i32, i32* %1, i64 %19
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = load float, float* %21
%46 = fpext float %45 to double
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %46)
%48 = load float, float* %22
%49 = fpext float %48 to double
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %49)
%51 = load float, float* %23
%52 = fpext float %51 to double
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %52)
%54 = load float, float* %24
%55 = fpext float %54 to double
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %55)
%57 = load float, float* %28
%58 = fpext float %57 to double
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %58)
%60 = getelementptr inbounds float, float* %3, i64 %19
%61 = load float, float* %60
%62 = fpext float %61 to double
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %62)
br label %64
64: ; preds = %37, %41
%65 = add nuw nsw i64 %19, 1
%66 = icmp eq i64 %65, 4
br i1 %66, label %67, label %18
67: ; preds = %64
ret void
}