#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 fail2(float *pscore, int *pnum, float *paver, char (*pcourse)[10]) {
  int i, j, k, label;
  printf("      =======Student who is failed======  \n");
  printf("NO.");
  for (i = 0; i < 5; i++)
    printf("%11s", *(pcourse + i));
  printf("   average\n");
  for (i = 0; i < 4; i++) {
    label = 0;
    for (j = 0; j < 5; j++) {
      if (*(pscore + 5 * i + j) < 60.0)
        label++;
    }
    if (label >= 2) {
      printf("%d", *(pnum + i));
      for (k = 0; k < 5; k++)
        printf("%11.2f", *(pscore + 5 * i + k));
      printf("%11.2f\n", *(paver + i));
    }
  }
}


x86 assembly (clang, -O0):
<fail2>:
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    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1180 <fail2+0x70>
mov    -0x20(%rbp),%rsi
movslq -0x24(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <fail2+0x3b>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    12a5 <fail2+0x195>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    1204 <fail2+0xf4>
mov    -0x8(%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,%xmm1
movsd  0xe22(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f1 <fail2+0xe1>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f6 <fail2+0xe6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ad <fail2+0x9d>
cmpl   $0x2,-0x30(%rbp)
jl     1292 <fail2+0x182>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1273 <fail2+0x163>
mov    -0x8(%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    0xdee(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    122e <fail2+0x11e>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1297 <fail2+0x187>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <fail2+0x85>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%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    0xebf(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rbx
movss  0xe48(%rip),%xmm1
movaps 0xe51(%rip),%xmm2
lea    0xe66(%rip),%r13
lea    0xe66(%rip),%rbp
xor    %r12d,%r12d
jmp    11f2 <fail2+0xd2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r12
add    $0x14,%rbx
cmp    $0x4,%r12
je     12c7 <fail2+0x1a7>
xor    %eax,%eax
ucomiss (%rbx),%xmm1
seta   %al
movups -0x10(%rbx),%xmm0
cmpltps %xmm2,%xmm0
movmskps %xmm0,%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    $0x2,%ecx
jb     11e0 <fail2+0xc0>
mov    (%r15,%r12,4),%esi
lea    0xdef(%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>
movaps 0xd56(%rip),%xmm2
movss  0xd3e(%rip),%xmm1
jmp    11e0 <fail2+0xc0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c" =======Student who is failed====== \0A\00"
@.str.1 = [4 x i8] c"NO.\00"
@.str.2 = [5 x i8] c"%11s\00"
@.str.3 = [12 x i8] c" average\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [7 x i8] c"%11.2f\00"
@.str.6 = [8 x i8] c"%11.2f\0A\00"
define void @fail2(float* %0, i32* %1, float* %2, [10 x i8]* %3) {
%5 = alloca float*
%6 = alloca i32*
%7 = alloca float*
%8 = alloca [10 x i8]*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store float* %0, float** %5
store i32* %1, i32** %6
store float* %2, float** %7
store [10 x i8]* %3, [10 x i8]** %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 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]** %8
%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 ([5 x i8], [5 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 ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %30
30: ; preds = %93, %28
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 4
br i1 %32, label %33, label %96
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** %5
%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 olt double %47, 6.000000e+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 sge i32 %57, 2
br i1 %58, label %59, label %92
59: ; preds = %56
%60 = load i32*, i32** %6
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %64)
store i32 0, i32* %11
br label %66
66: ; preds = %81, %59
%67 = load i32, i32* %11
%68 = icmp slt i32 %67, 5
br i1 %68, label %69, label %84
69: ; preds = %66
%70 = load float*, float** %5
%71 = load i32, i32* %9
%72 = mul nsw i32 5, %71
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds float, float* %70, i64 %73
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %74, i64 %76
%78 = load float, float* %77
%79 = fpext float %78 to double
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %79)
br label %81
81: ; preds = %69
%82 = load i32, i32* %11
%83 = add nsw i32 %82, 1
store i32 %83, i32* %11
br label %66
84: ; preds = %66
%85 = load float*, float** %7
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds float, float* %85, i64 %87
%89 = load float, float* %88
%90 = fpext float %89 to double
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), double %90)
br label %92
92: ; preds = %84, %56
br label %93
93: ; preds = %92
%94 = load i32, i32* %9
%95 = add nsw i32 %94, 1
store i32 %95, i32* %9
br label %30
96: ; preds = %30
ret void
}

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