void main(void) {
  char *name[] = {"ravi", "shobhit", "nitin"};
  printf("%lu\n", &name);
  printf("%lu\n", &name[0]);
  printf("%lu\n", &(*name));
  printf("%lu\n", sizeof(char *(*)[]));
  printf("%lu\n", &name[1]);
  printf("%lu\n", &name[2]);
  printf("%lu\n", *name);
  printf("%lu\n", *(name + 1));
  printf("%lu\n", *(name + 2));
  printf("%s\n", *(name + 1) + 4);
  char arr[3][13] = {"ravi", "ravindra", "ravindrababu"};
  printf("%s\n", *arr + 14);
  printf(
      "It prints ravindra after 14 places so it follows Row major ordering\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x8,%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x10,%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe5b(%rip),%rsi
mov    $0x27,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rsi
add    $0xe,%rsi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ce0(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cc4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
lea    0xec7(%rip),%rbx
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x8,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rdi
add    $0x4,%rdi
call   1030 <puts@plt>
mov    0xe9d(%rip),%rax
mov    %rax,0x3f(%rsp)
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe66(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x2e(%rsp),%rdi
call   1030 <puts@plt>
lea    0xe08(%rip),%rdi
call   1030 <puts@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ravi\00"
@.str.1 = [8 x i8] c"shobhit\00"
@.str.2 = [6 x i8] c"nitin\00"
@__const.main.name = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [5 x i8] c"%lu\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@__const.main.arr = [3 x [13 x i8]] [[13 x i8] c"ravi\00\00\00\00\00\00\00\00\00", [13 x i8] c"ravindra\00\00\00\00\00", [13 x i8] c"ravindrababu\00"]
@.str.5 = [69 x i8] c"It prints ravindra after 14 places so it follows Row major ordering\0A\00"
define void @main() {
%1 = alloca [3 x i8*]
%2 = alloca [3 x [13 x i8]]
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), [3 x i8*]* %1)
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %5)
%7 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 8)
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %10)
%12 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %12)
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %28)
%30 = bitcast [3 x [13 x i8]]* %2 to i8*
%31 = getelementptr inbounds [3 x [13 x i8]], [3 x [13 x i8]]* %2, i64 0, i64 0
%32 = getelementptr inbounds [13 x i8], [13 x i8]* %31, i64 0, i64 0
%33 = getelementptr inbounds i8, i8* %32, i64 14
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ravi\00"
@.str.1 = [8 x i8] c"shobhit\00"
@.str.2 = [6 x i8] c"nitin\00"
@__const.main.name = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [5 x i8] c"%lu\0A\00"
@__const.main.arr = [3 x [13 x i8]] [[13 x i8] c"ravi\00\00\00\00\00\00\00\00\00", [13 x i8] c"ravindra\00\00\00\00\00", [13 x i8] c"ravindrababu\00"]
@str = [68 x i8] c"It prints ravindra after 14 places so it follows Row major ordering\00"
define void @main() {
%1 = alloca [3 x i8*]
%2 = alloca [3 x [13 x i8]]
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), [3 x i8*]* %1)
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 8)
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %9)
%11 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %11)
%13 = load i8*, i8** %5
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %9
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %11
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i8*, i8** %9
%20 = getelementptr inbounds i8, i8* %19, i64 4
%21 = call i32 @puts(i8* %20)
%22 = getelementptr inbounds [3 x [13 x i8]], [3 x [13 x i8]]* %2, i64 0, i64 0, i64 0
%23 = getelementptr inbounds [3 x [13 x i8]], [3 x [13 x i8]]* %2, i64 0, i64 0, i64 14
%24 = call i32 @puts(i8* %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}