#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 search(float (*p)[4], int n) {
  int i, j, flag;
  for (j = 0; j < n; j++) {
    flag = 0;
    for (i = 0; i < 4; i++) {
      if (*(*(p + j) + i) < 60)
        flag = 1;
    }
    if (flag == 1) {
      printf("No.%d fails, his scores are:\n", j + 1);
      for (i = 0; i < 4; i++) {
        printf("%5.1f", *(*(p + j) + i));
      }
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1211 <search+0x101>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1189 <search+0x79>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movss  0xe9b(%rip),%xmm0
ucomiss (%rax,%rcx,4),%xmm0
jbe    1176 <search+0x66>
movl   $0x1,-0x18(%rbp)
jmp    117b <search+0x6b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <search+0x30>
cmpl   $0x1,-0x18(%rbp)
jne    11fe <search+0xee>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11f0 <search+0xe0>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ae <search+0x9e>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1203 <search+0xf3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <search+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11f4 <search+0xd4>
mov    %rdi,%r13
mov    %esi,%r12d
shl    $0x4,%r12
mov    $0x1,%ebp
lea    0xec7(%rip),%r14
lea    0xede(%rip),%r15
xor    %ebx,%ebx
jmp    1170 <search+0x50>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x10,%rbx
add    $0x1,%ebp
cmp    %rbx,%r12
je     11f4 <search+0xd4>
movups 0x0(%r13,%rbx,1),%xmm0
cmpltps 0xe82(%rip),%xmm0
01
movmskps %xmm0,%eax
test   %eax,%eax
je     1160 <search+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x0(%r13,%rbx,1),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%r13,%rbx,1),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%r13,%rbx,1),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%r13,%rbx,1),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1160 <search+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"No.%d fails, his scores are:\0A\00"
@.str.1 = [6 x i8] c"%5.1f\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @search([4 x float]* %0, i32 %1) {
%3 = alloca [4 x float]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store [4 x float]* %0, [4 x float]** %3
store i32 %1, i32* %4
store i32 0, i32* %6
br label %8
8: ; preds = %60, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %63
12: ; preds = %8
store i32 0, i32* %7
store i32 0, i32* %5
br label %13
13: ; preds = %29, %12
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 4
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load [4 x float]*, [4 x float]** %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 %19
%21 = getelementptr inbounds [4 x float], [4 x float]* %20, i64 0, i64 0
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
%26 = fcmp olt float %25, 6.000000e+01
br i1 %26, label %27, label %28
27: ; preds = %16
store i32 1, i32* %7
br label %28
28: ; preds = %27, %16
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %13
32: ; preds = %13
%33 = load i32, i32* %7
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %59
35: ; preds = %32
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %37)
store i32 0, i32* %5
br label %39
39: ; preds = %54, %35
%40 = load i32, i32* %5
%41 = icmp slt i32 %40, 4
br i1 %41, label %42, label %57
42: ; preds = %39
%43 = load [4 x float]*, [4 x float]** %3
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [4 x float], [4 x float]* %43, i64 %45
%47 = getelementptr inbounds [4 x float], [4 x float]* %46, i64 0, i64 0
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %47, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %52)
br label %54
54: ; preds = %42
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
br label %39
57: ; preds = %39
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %59
59: ; preds = %57, %32
br label %60
60: ; preds = %59
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %8
63: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"No.%d fails, his scores are:\0A\00"
@.str.1 = [6 x i8] c"%5.1f\00"
define void @search([4 x float]* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %37
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %35
%7 = phi i64 [ 0, %4 ], [ %15, %35 ]
%8 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %7, i64 0
%9 = bitcast float* %8 to <4 x float>*
%10 = load <4 x float>, <4 x float>* %9
%11 = freeze <4 x float> %10
%12 = fcmp olt <4 x float> %11, <float 6.000000e+01, float 6.000000e+01, float 6.000000e+01, float 6.000000e+01>
%13 = bitcast <4 x i1> %12 to i4
%14 = icmp eq i4 %13, 0
%15 = add nuw nsw i64 %7, 1
br i1 %14, label %35, label %16
16: ; preds = %6
%17 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %7, i64 3
%18 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %7, i64 2
%19 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %7, i64 1
%20 = trunc i64 %15 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = load float, float* %19
%26 = fpext float %25 to double
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = load float, float* %18
%29 = fpext float %28 to double
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %29)
%31 = load float, float* %17
%32 = fpext float %31 to double
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %32)
%34 = tail call i32 @putchar(i32 10)
br label %35
35: ; preds = %6, %16
%36 = icmp eq i64 %15, %5
br i1 %36, label %37, label %6
37: ; preds = %35, %2
ret void
}