void three() {
  char str[4][20] = {"zhangrongxiang", "zhangrxiang", "zing", "zrx"};
  printf("str[0]  -->  %s\n", str[0]);
  printf("str[0][0]  --> %c\n", str[0][0]);
  char *p = (char *)str;
  char *p2 = (char *)str;
  char **pp = &p2;
  printf("p  -->  %s\n", p);
  p++;
  printf("p++  -->  %s\n", p);
  printf("*pp  -->  %s\n", *pp);
  printf("**pp  -->  %c\n", **pp);
}


x86 assembly (clang, -O0):
<three>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x50(%rbp),%esi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rax
mov    (%rax),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<three>:
push   %rbx
sub    $0x50,%rsp
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xef9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl (%rsp),%esi
lea    0xef2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rsp),%rsi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl (%rsp),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.three.str = [4 x [20 x i8]] [[20 x i8] c"zhangrongxiang\00\00\00\00\00\00", [20 x i8] c"zhangrxiang\00\00\00\00\00\00\00\00\00", [20 x i8] c"zing\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"zrx\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [17 x i8] c"str[0] --> %s\0A\00"
@.str.1 = [19 x i8] c"str[0][0] --> %c\0A\00"
@.str.2 = [12 x i8] c"p --> %s\0A\00"
@.str.3 = [14 x i8] c"p++ --> %s\0A\00"
@.str.4 = [14 x i8] c"*pp --> %s\0A\00"
@.str.5 = [15 x i8] c"**pp --> %c\0A\00"
define void @three() {
%1 = alloca [4 x [20 x i8]]
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8**
%5 = bitcast [4 x [20 x i8]]* %1 to i8*
%6 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0
%15 = bitcast [20 x i8]* %14 to i8*
store i8* %15, i8** %2
%16 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0
%17 = bitcast [20 x i8]* %16 to i8*
store i8* %17, i8** %3
store i8** %3, i8*** %4
%18 = load i8*, i8** %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
%22 = load i8*, i8** %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %4
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = load i8**, i8*** %4
%28 = load i8*, i8** %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %30)
ret void
}

LLVM IR (-O2):
@__const.three.str = [4 x [20 x i8]] [[20 x i8] c"zhangrongxiang\00\00\00\00\00\00", [20 x i8] c"zhangrxiang\00\00\00\00\00\00\00\00\00", [20 x i8] c"zing\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"zrx\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [17 x i8] c"str[0] --> %s\0A\00"
@.str.1 = [19 x i8] c"str[0][0] --> %c\0A\00"
@.str.2 = [12 x i8] c"p --> %s\0A\00"
@.str.3 = [14 x i8] c"p++ --> %s\0A\00"
@.str.4 = [14 x i8] c"*pp --> %s\0A\00"
@.str.5 = [15 x i8] c"**pp --> %c\0A\00"
define void @three() {
%1 = alloca [4 x [20 x i8]]
%2 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%8 = getelementptr inbounds [4 x [20 x i8]], [4 x [20 x i8]]* %1, i64 0, i64 0, i64 1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %12)
ret void
}