#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 main(void) {
  int i = 0, j = 0;
  int sum = 0;
  int a[5] = {0};
  int b[5] = {1, 2, 3};
  int c[2][3] = {
      {11, 22, 33},
      {44, 55, 66},
  };
  for (i = 0; i < 5; i++) {
    a[i] = b[i];
  }
  for (i = 0; i < 5; i++) {
    printf("a[%d] = %d\n", i, a[i]);
  }
  for (i = 0; i < 5; i++) {
    printf("b[%d] = %d\n", i, b[i]);
  }
  for (i = 0; i < 5; i++) {
    sum += a[i];
  }
  printf("数组a的所有元素的和=%d\n", sum);
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++) {
      printf("c[%d][%d] = %d\n", i, j, c[i][j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    0xea5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea0(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11c3 <main+0xa3>
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119b <main+0x7b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11fb <main+0xdb>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <main+0xaa>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1233 <main+0x113>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%edx
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1202 <main+0xe2>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1260 <main+0x140>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123a <main+0x11a>
mov    -0x10(%rbp),%esi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    12de <main+0x1be>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    12cb <main+0x1ab>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movslq -0x8(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1289 <main+0x169>
jmp    12d0 <main+0x1b0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1278 <main+0x158>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe92(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe4a(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x16,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x21,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x2c,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x37,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x42,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.b = [5 x i32] [i32 1, i32 2, i32 3, i32 0, i32 0]
@__const.main.c = [2 x [3 x i32]] [[3 x i32] [i32 11, i32 22, i32 33], [3 x i32] [i32 44, i32 55, i32 66]]
@.str = [12 x i8] c"a[%d] = %d\0A\00"
@.str.1 = [12 x i8] c"b[%d] = %d\0A\00"
@.str.2 = [33 x i8] c"\E6\95\B0\E7\BB\84a\E7\9A\84\E6\89\80\E6\9C\89\E5\85\83\E7\B4\A0\E7\9A\84\E5\92\8C=%d\0A\00"
@.str.3 = [16 x i8] c"c[%d][%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i32]
%6 = alloca [5 x i32]
%7 = alloca [2 x [3 x i32]]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%8 = bitcast [5 x i32]* %5 to i8*
%9 = bitcast [5 x i32]* %6 to i8*
%10 = bitcast [2 x [3 x i32]]* %7 to i8*
store i32 0, i32* %2
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 %20
store i32 %18, i32* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %11
25: ; preds = %11
store i32 0, i32* %2
br label %26
26: ; preds = %36, %25
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 5
br i1 %28, label %29, label %39
29: ; preds = %26
%30 = load i32, i32* %2
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %30, i32 %34)
br label %36
36: ; preds = %29
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %26
39: ; preds = %26
store i32 0, i32* %2
br label %40
40: ; preds = %50, %39
%41 = load i32, i32* %2
%42 = icmp slt i32 %41, 5
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32, i32* %2
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %48)
br label %50
50: ; preds = %43
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %40
53: ; preds = %40
store i32 0, i32* %2
br label %54
54: ; preds = %64, %53
%55 = load i32, i32* %2
%56 = icmp slt i32 %55, 5
br i1 %56, label %57, label %67
57: ; preds = %54
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = load i32, i32* %4
%63 = add nsw i32 %62, %61
store i32 %63, i32* %4
br label %64
64: ; preds = %57
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %54
67: ; preds = %54
%68 = load i32, i32* %4
%69 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %68)
store i32 0, i32* %2
br label %70
70: ; preds = %92, %67
%71 = load i32, i32* %2
%72 = icmp slt i32 %71, 2
br i1 %72, label %73, label %95
73: ; preds = %70
store i32 0, i32* %3
br label %74
74: ; preds = %88, %73
%75 = load i32, i32* %3
%76 = icmp slt i32 %75, 3
br i1 %76, label %77, label %91
77: ; preds = %74
%78 = load i32, i32* %2
%79 = load i32, i32* %3
%80 = load i32, i32* %2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %7, i64 0, i64 %81
%83 = load i32, i32* %3
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [3 x i32], [3 x i32]* %82, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %78, i32 %79, i32 %86)
br label %88
88: ; preds = %77
%89 = load i32, i32* %3
%90 = add nsw i32 %89, 1
store i32 %90, i32* %3
br label %74
91: ; preds = %74
br label %92
92: ; preds = %91
%93 = load i32, i32* %2
%94 = add nsw i32 %93, 1
store i32 %94, i32* %2
br label %70
95: ; preds = %70
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a[%d] = %d\0A\00"
@.str.1 = [12 x i8] c"b[%d] = %d\0A\00"
@.str.2 = [33 x i8] c"\E6\95\B0\E7\BB\84a\E7\9A\84\E6\89\80\E6\9C\89\E5\85\83\E7\B4\A0\E7\9A\84\E5\92\8C=%d\0A\00"
@.str.3 = [16 x i8] c"c[%d][%d] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 0)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4, i32 0)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 3)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 0)
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 0)
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 6)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 11)
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 1, i32 22)
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 2, i32 33)
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 0, i32 44)
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 1, i32 55)
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 66)
ret i32 0
}