void main() {
  char *name[] = {"Follow me", "BASIC", "Great Wall", "FORTRAN",
                  "Computer design"};
  char **p = name;
  char str[5][80] = {"Follow me", "BASIC", "Great Wall", "FORTRAN",
                     "Computer design"};
  char(*pa)[80] = str;
  int i;
  void order_array(char **);
  void order_str(char(*)[]);
  order_array(p);
  printf("Use the pointer array:\n");
  for (i = 0; i < 5; i++) {
    printf("%d\n", *p++);
  }
  order_str(str);
  printf("Use the array pointer:\n");
  for (i = 0; i < 5; i++) {
    printf("%d\n", *pa++);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    0xe8e(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe8d(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe85(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x1d0(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x190,%edx
call   1070 <memcpy@plt>
lea    -0x1d0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <order_array@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1dc(%rbp)
cmpl   $0x5,-0x1dc(%rbp)
jge    1232 <main+0xe2>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x38(%rbp)
mov    (%rax),%rsi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1dc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1dc(%rbp)
jmp    11f1 <main+0xa1>
lea    -0x1d0(%rbp),%rdi
call   1040 <order_str@plt>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1dc(%rbp)
cmpl   $0x5,-0x1dc(%rbp)
jge    129a <main+0x14a>
mov    -0x1d8(%rbp),%rsi
mov    %rsi,%rax
add    $0x50,%rax
mov    %rax,-0x1d8(%rbp)
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1dc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1dc(%rbp)
jmp    1256 <main+0x106>
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1c8,%rsp
lea    0xe9f(%rip),%rax
mov    %rax,(%rsp)
lea    0xe9e(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe98(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe97(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe93(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xed4(%rip),%rsi
lea    0x30(%rsp),%r14
mov    $0x190,%edx
mov    %r14,%rdi
call   1070 <memcpy@plt>
mov    %rsp,%rdi
call   1030 <order_array@plt>
lea    0xe7a(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%rsi
lea    0xe66(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1040 <order_str@plt>
lea    0xe2c(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x80(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd0(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x120(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x170(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Follow me\00"
@.str.1 = [6 x i8] c"BASIC\00"
@.str.2 = [11 x i8] c"Great Wall\00"
@.str.3 = [8 x i8] c"FORTRAN\00"
@.str.4 = [16 x i8] c"Computer design\00"
@__const.main.str = [5 x [80 x i8]] [[80 x i8] c"Follow me\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"BASIC\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"Great Wall\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"FORTRAN\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"Computer design\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str.5 = [24 x i8] c"Use the pointer array:\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [24 x i8] c"Use the array pointer:\0A\00"
define void @main() {
%1 = alloca [5 x i8*]
%2 = alloca i8**
%3 = alloca [5 x [80 x i8]]
%4 = alloca [80 x i8]*
%5 = alloca i32
%6 = bitcast [5 x i8*]* %1 to i8*
%7 = bitcast i8* %6 to [5 x i8*]*
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 4
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8** %13, i8*** %2
%14 = bitcast [5 x [80 x i8]]* %3 to i8*
%15 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %3, i64 0, i64 0
store [80 x i8]* %15, [80 x i8]** %4
%16 = load i8**, i8*** %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %5
br label %18
18: ; preds = %26, %0
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i8**, i8*** %2
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %2
%24 = load i8*, i8** %22
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %21
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %18
29: ; preds = %18
%30 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %3, i64 0, i64 0
%31 = bitcast [80 x i8]* %30 to [0 x i8]*
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %5
br label %33
33: ; preds = %41, %29
%34 = load i32, i32* %5
%35 = icmp slt i32 %34, 5
br i1 %35, label %36, label %44
36: ; preds = %33
%37 = load [80 x i8]*, [80 x i8]** %4
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %37, i32 1
store [80 x i8]* %38, [80 x i8]** %4
%39 = getelementptr inbounds [80 x i8], [80 x i8]* %37, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %36
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %33
44: ; preds = %33
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Follow me\00"
@.str.1 = [6 x i8] c"BASIC\00"
@.str.2 = [11 x i8] c"Great Wall\00"
@.str.3 = [8 x i8] c"FORTRAN\00"
@.str.4 = [16 x i8] c"Computer design\00"
@__const.main.str = [5 x [80 x i8]] [[80 x i8] c"Follow me\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"BASIC\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"Great Wall\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"FORTRAN\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [80 x i8] c"Computer design\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str.6 = [4 x i8] c"%d\0A\00"
@str = [23 x i8] c"Use the pointer array:\00"
@str.8 = [23 x i8] c"Use the array pointer:\00"
define void @main() {
%1 = alloca [5 x i8*]
%2 = alloca [5 x [80 x i8]]
%3 = bitcast [5 x i8*]* %1 to i8*
%4 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 0, i64 0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
%15 = load i8*, i8** %11
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
%18 = load i8*, i8** %14
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
%21 = load i8*, i8** %17
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %20
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%25 = bitcast [5 x [80 x i8]]* %2 to [0 x i8]*
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%27 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 1, i64 0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 2, i64 0
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 3, i64 0
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 4, i64 0
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %35)
ret void
}