#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 *, char *);
void main() {
  char *name[] = {"Follow me", "BASIC", "Great Wall", "FORTRAN",
                  "Computer design"};
  char **p;
  int i;
  for (i = 0; i < 5; i++) {
    p = name + i;
    printf("%s\n", name[i]);
    printf("%s\n", *p);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xec1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xebb(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jge    11c9 <main+0xa9>
lea    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1176 <main+0x56>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf18(%rip),%rbx
lea    0xede(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xecb(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xeb4(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xea2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xe8d(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [5 x i8*]
%2 = alloca i8**
%3 = alloca i32
%4 = bitcast [5 x i8*]* %1 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i32 0, i32 0), i8** %10
store i32 0, i32* %3
br label %11
11: ; preds = %27, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
store i8** %18, i8*** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %2
%25 = load i8*, i8** %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %14
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %11
30: ; preds = %11
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"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret void
}