#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *p0 = "This is p0";
  char *p1 = "This is p1";
  char *p2 = "This is p2";
  char *ptrs[3];
  int i;
  ptrs[0] = p0;
  ptrs[1] = p1;
  ptrs[2] = p2;
  for (i = 0; i < 3; i++)
    printf("%s\n", ptrs[i]);
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    119e <main+0x7e>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    116f <main+0x4f>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"This is p0\00"
@.str.1 = [11 x i8] c"This is p1\00"
@.str.2 = [11 x i8] c"This is p2\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [3 x i8*]
%6 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %4
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
store i8* %7, i8** %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 1
store i8* %9, i8** %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 2
store i8* %11, i8** %12
store i32 0, i32* %6
br label %13
13: ; preds = %22, %0
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %13
25: ; preds = %13
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 (...) @getchar()
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [11 x i8] c"This is p0\00"
@.str.1 = [11 x i8] c"This is p1\00"
@.str.2 = [11 x i8] c"This is p2\00"
@.str.4 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
ret i32 0
}