#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 /*<<< orphan*/);
void main() {
  char *name[] = {"Follow me", "BASIC", "Great Wall", "FORTRAN",
                  "Computer design"};
  char **p = name;
  int i;
  void order(char **);
  order(p);
  for (i = 0; i < 5; 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    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <order@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jge    11cf <main+0x9f>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x38(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1197 <main+0x67>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rax
mov    %rax,(%rsp)
lea    0xed3(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xecd(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xecc(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rdi
call   1040 <order@plt>
mov    (%rsp),%esi
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
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"
@.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
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8** %11, i8*** %2
%12 = load i8**, i8*** %2
store i32 0, i32* %3
br label %13
13: ; preds = %22, %0
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 5
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i8**, i8*** %2
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %2
%19 = load i8*, i8** %17
%20 = ptrtoint i8* %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %13
25: ; preds = %13
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 = alloca [5 x i8*]
%2 = bitcast [5 x i8*]* %1 to i8*
%3 = 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** %3
%4 = 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** %4
%5 = 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** %5
%6 = 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** %6
%7 = 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** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
%14 = load i8*, i8** %8
%15 = ptrtoint i8* %14 to i64
%16 = trunc i64 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
%19 = load i8*, i8** %13
%20 = ptrtoint i8* %19 to i64
%21 = trunc i64 %20 to i32
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
%24 = load i8*, i8** %18
%25 = ptrtoint i8* %24 to i64
%26 = trunc i64 %25 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = load i8*, i8** %23
%29 = ptrtoint i8* %28 to i64
%30 = trunc i64 %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %30)
ret void
}