#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 *, int, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  int snum = 0;
  int tensu[3];
  int succs[3];
  puts("请输入学生的分数");
  for (i = 0; i < 3; i++) {
    printf("%2d号:", i + 1);
    scanf("%d", &tensu[i]);
    if (tensu[i] >= 60)
      succs[snum++] = i;
  }
  puts("及格学生一览表");
  puts("-------------------------");
  for (i = 0; i < snum; i++)
    printf("%2d 号 (%3d分) \n", succs[i] + 1, tensu[succs[i]]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c8 <main+0x98>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x18(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe94(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x8(%rbp),%rax
cmpl   $0x3c,-0x18(%rbp,%rax,4)
jl     11b5 <main+0x85>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %ecx,-0x24(%rbp,%rax,4)
jmp    11ba <main+0x8a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x29>
lea    0xe55(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1227 <main+0xf7>
movslq -0x8(%rbp),%rax
mov    -0x24(%rbp,%rax,4),%esi
add    $0x1,%esi
movslq -0x8(%rbp),%rax
movslq -0x24(%rbp,%rax,4),%rax
mov    -0x18(%rbp,%rax,4),%edx
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e7 <main+0xb7>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %ebx,%ebx
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x3c,0x8(%rsp)
jl     117f <main+0x4f>
movl   $0x0,0x14(%rsp)
mov    $0x1,%ebx
lea    0xe93(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
lea    0xe83(%rip),%rdi
call   1050 <scanf@plt>
cmpl   $0x3c,0xc(%rsp)
jl     11b7 <main+0x87>
mov    %ebx,%eax
add    $0x1,%ebx
movl   $0x1,0x14(%rsp,%rax,4)
lea    0xe5b(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xe4b(%rip),%rdi
call   1050 <scanf@plt>
cmpl   $0x3c,0x10(%rsp)
jl     11ef <main+0xbf>
mov    %ebx,%eax
add    $0x1,%ebx
movl   $0x2,0x14(%rsp,%rax,4)
lea    0xe2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
je     123f <main+0x10f>
mov    %ebx,%r15d
lea    0xe3f(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movslq 0x14(%rsp,%rbx,4),%rax
lea    0x1(%rax),%esi
mov    0x8(%rsp,%rax,4),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1220 <main+0xf0>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AD\A6\E7\94\9F\E7\9A\84\E5\88\86\E6\95\B0\00"
@.str.1 = [8 x i8] c"%2d\E5\8F\B7:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"\E5\8F\8A\E6\A0\BC\E5\AD\A6\E7\94\9F\E4\B8\80\E8\A7\88\E8\A1\A8\00"
@.str.4 = [26 x i8] c"-------------------------\00"
@.str.5 = [19 x i8] c"%2d \E5\8F\B7 (%3d\E5\88\86) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %33
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp sge i32 %21, 60
br i1 %22, label %23, label %29
23: ; preds = %10
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = sext i32 %25 to i64
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %27
store i32 %24, i32* %28
br label %29
29: ; preds = %23, %10
br label %30
30: ; preds = %29
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %7
33: ; preds = %7
%34 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %36
36: ; preds = %54, %33
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %57
40: ; preds = %36
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = add nsw i32 %44, 1
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %45, i32 %52)
br label %54
54: ; preds = %40
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %36
57: ; preds = %36
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AD\A6\E7\94\9F\E7\9A\84\E5\88\86\E6\95\B0\00"
@.str.1 = [8 x i8] c"%2d\E5\8F\B7:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"\E5\8F\8A\E6\A0\BC\E5\AD\A6\E7\94\9F\E4\B8\80\E8\A7\88\E8\A1\A8\00"
@.str.4 = [26 x i8] c"-------------------------\00"
@.str.5 = [19 x i8] c"%2d \E5\8F\B7 (%3d\E5\88\86) \0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %7
%10 = icmp sgt i32 %9, 59
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 0, i32* %12
br label %13
13: ; preds = %0, %11
%14 = phi i32 [ 1, %11 ], [ 0, %0 ]
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 2)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %16
%19 = icmp sgt i32 %18, 59
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = add nuw nsw i32 %14, 1
%22 = zext i32 %14 to i64
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %22
store i32 1, i32* %23
br label %24
24: ; preds = %20, %13
%25 = phi i32 [ %21, %20 ], [ %14, %13 ]
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 3)
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %27)
%29 = load i32, i32* %27
%30 = icmp sgt i32 %29, 59
br i1 %30, label %31, label %35
31: ; preds = %24
%32 = add nuw nsw i32 %25, 1
%33 = zext i32 %25 to i64
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %33
store i32 2, i32* %34
br label %35
35: ; preds = %31, %24
%36 = phi i32 [ %32, %31 ], [ %25, %24 ]
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i32 %36, 0
br i1 %39, label %53, label %40
40: ; preds = %35
%41 = zext i32 %36 to i64
br label %42
42: ; preds = %40, %42
%43 = phi i64 [ 0, %40 ], [ %51, %42 ]
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 1
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %46, i32 %49)
%51 = add nuw nsw i64 %43, 1
%52 = icmp eq i64 %51, %41
br i1 %52, label %53, label %42
53: ; preds = %42, %35
ret i32 0
}