#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 tensu[5];
  int max, min;
  puts("请输入学生的分数");
  for (i = 0; i < 5; i++) {
    printf("%2d号:", i + 1);
    scanf("%d", &tensu[i]);
  }
  min = max = tensu[0];
  for (i = 1; i < 5; i++) {
    if (tensu[i] > max)
      max = tensu[i];
    if (tensu[i] < min)
      min = tensu[i];
  }
  printf("最高分 %d\n", max);
  printf("最低分 %d\n", min);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1197 <main+0x67>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x22>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11fc <main+0xcc>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
jle    11cd <main+0x9d>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x28(%rbp),%eax
jge    11e9 <main+0xb9>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x28(%rbp)
jmp    11ee <main+0xbe>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a7 <main+0x77>
mov    -0x24(%rbp),%esi
lea    0xe1e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xec3(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%ebx
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
mov    %ebx,%esi
cmovg  %eax,%esi
cmovl  %eax,%ebx
mov    0x8(%rsp),%eax
cmp    %esi,%eax
cmovg  %eax,%esi
cmp    %ebx,%eax
cmovl  %eax,%ebx
mov    0xc(%rsp),%eax
cmp    %esi,%eax
cmovg  %eax,%esi
cmp    %ebx,%eax
cmovl  %eax,%ebx
mov    0x10(%rsp),%eax
cmp    %esi,%eax
cmovg  %eax,%esi
cmp    %ebx,%eax
cmovl  %eax,%ebx
lea    0xe11(%rip),%rdi
call   1040 <printf@plt>
lea    0xe13(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
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 = [14 x i8] c"\E6\9C\80\E9\AB\98\E5\88\86 %d\0A\00"
@.str.4 = [14 x i8] c"\E6\9C\80\E4\BD\8E\E5\88\86 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%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 = %18, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = call 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 [5 x i32], [5 x i32]* %3, 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)
br label %18
18: ; preds = %10
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %7
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%23 = load i32, i32* %22
store i32 %23, i32* %4
store i32 %23, i32* %5
store i32 1, i32* %2
br label %24
24: ; preds = %52, %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 5
br i1 %26, label %27, label %55
27: ; preds = %24
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %4
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %39
34: ; preds = %27
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
store i32 %38, i32* %4
br label %39
39: ; preds = %34, %27
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %51
46: ; preds = %39
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %48
%50 = load i32, i32* %49
store i32 %50, i32* %5
br label %51
51: ; preds = %46, %39
br label %52
52: ; preds = %51
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %24
55: ; preds = %24
%56 = load i32, i32* %4
%57 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %5
%59 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %58)
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 = [14 x i8] c"\E6\9C\80\E9\AB\98\E5\88\86 %d\0A\00"
@.str.4 = [14 x i8] c"\E6\9C\80\E4\BD\8E\E5\88\86 %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 2)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 3)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 4)
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 5)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %8
%21 = icmp sgt i32 %20, %19
%22 = select i1 %21, i32 %20, i32 %19
%23 = icmp slt i32 %20, %19
%24 = select i1 %23, i32 %20, i32 %19
%25 = load i32, i32* %11
%26 = icmp sgt i32 %25, %22
%27 = select i1 %26, i32 %25, i32 %22
%28 = icmp slt i32 %25, %24
%29 = select i1 %28, i32 %25, i32 %24
%30 = load i32, i32* %14
%31 = icmp sgt i32 %30, %27
%32 = select i1 %31, i32 %30, i32 %27
%33 = icmp slt i32 %30, %29
%34 = select i1 %33, i32 %30, i32 %29
%35 = load i32, i32* %17
%36 = icmp sgt i32 %35, %32
%37 = select i1 %36, i32 %35, i32 %32
%38 = icmp slt i32 %35, %34
%39 = select i1 %38, i32 %35, i32 %34
%40 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %39)
ret i32 0
}