#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 /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i = 0;
  int num = 0;
  int x[80] = {0};
  printf("数据个数: ");
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    printf("%d号: ", i + 1);
    scanf("%d", &x[i]);
  }
  putchar('[');
  for (i = 0; i < num - 1; i++) {
    printf("%d,", x[i]);
  }
  printf("%d]\n", x[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x140,%edx
call   1050 <memset@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e4 <main+0xa4>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x150(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe3e(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x58>
mov    $0x5b,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    122d <main+0xed>
movslq -0x8(%rbp),%rax
mov    -0x150(%rbp,%rax,4),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f5 <main+0xb5>
movslq -0x8(%rbp),%rax
mov    -0x150(%rbp,%rax,4),%esi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x158,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%r12
mov    $0x140,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c9 <main+0x89>
lea    0xe7b(%rip),%r14
lea    0xe71(%rip),%r15
xor    %ebx,%ebx
add    $0x1,%rbx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x4,%r12
cmp    %rax,%rbx
jl     11a0 <main+0x60>
mov    $0x5b,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0xc(%rsp)
jl     1212 <main+0xd2>
lea    0xe39(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    %rax,%rbx
jl     11f0 <main+0xb0>
jmp    1214 <main+0xd4>
xor    %ebx,%ebx
mov    0x10(%rsp,%rbx,4),%esi
lea    0xdff(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x158,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\E6\95\B0\E6\8D\AE\E4\B8\AA\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"%d\E5\8F\B7: \00"
@.str.3 = [4 x i8] c"%d,\00"
@.str.4 = [5 x i8] c"%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%5 = bitcast [80 x i32]* %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %8
8: ; preds = %20, %0
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [80 x i32], [80 x i32]* %4, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %8
23: ; preds = %8
%24 = call i32 @putchar(i8 signext 91)
store i32 0, i32* %2
br label %25
25: ; preds = %36, %23
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 1
%29 = icmp slt i32 %26, %28
br i1 %29, label %30, label %39
30: ; preds = %25
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [80 x i32], [80 x i32]* %4, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %30
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %25
39: ; preds = %25
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [80 x i32], [80 x i32]* %4, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"\E6\95\B0\E6\8D\AE\E4\B8\AA\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"%d\E5\8F\B7: \00"
@.str.3 = [4 x i8] c"%d,\00"
@.str.4 = [5 x i8] c"%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i32]
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast [80 x i32]* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %0, %9
%10 = phi i64 [ %11, %9 ], [ 0, %0 ]
%11 = add nuw nsw i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [80 x i32], [80 x i32]* %2, i64 0, i64 %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %11, %17
br i1 %18, label %9, label %19
19: ; preds = %9, %0
%20 = call i32 @putchar(i8 signext 91)
%21 = load i32, i32* %1
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %35
23: ; preds = %19, %23
%24 = phi i64 [ %28, %23 ], [ 0, %19 ]
%25 = getelementptr inbounds [80 x i32], [80 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = add nuw nsw i64 %24, 1
%29 = load i32, i32* %1
%30 = add nsw i32 %29, -1
%31 = sext i32 %30 to i64
%32 = icmp slt i64 %28, %31
br i1 %32, label %23, label %33
33: ; preds = %23
%34 = and i64 %28, 4294967295
br label %35
35: ; preds = %33, %19
%36 = phi i64 [ 0, %19 ], [ %34, %33 ]
%37 = getelementptr inbounds [80 x i32], [80 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %38)
ret i32 0
}