#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, char *);
int main(int argc, char *argv[]) {
  char arr1[] = "123";
  char arr2[] = "qwe";
  char arr3[] = "asd";
  int i = 0;
  char *arr[3] = {arr1, arr2, arr3};
  for (i = 0; i < 3; i++) {
    printf("* arr [ %d ] = %s;\n", i, arr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeca(%rip),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1197 <main+0x87>
mov    -0x20(%rbp),%esi
movslq -0x20(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1167 <main+0x57>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x333231,0xc(%rsp)
movl   $0x657771,0x8(%rsp)
movl   $0x647361,0x4(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr1 = [4 x i8] c"123\00"
@__const.main.arr2 = [4 x i8] c"qwe\00"
@__const.main.arr3 = [4 x i8] c"asd\00"
@.str = [20 x i8] c"* arr [ %d ] = %s;\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
%7 = alloca [4 x i8]
%8 = alloca [4 x i8]
%9 = alloca i32
%10 = alloca [3 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [4 x i8]* %6 to i8*
%12 = bitcast [4 x i8]* %7 to i8*
%13 = bitcast [4 x i8]* %8 to i8*
store i32 0, i32* %9
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* %10, i64 0, i64 0
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
store i8* %15, i8** %14
%16 = getelementptr inbounds i8*, i8** %14, i64 1
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
store i8* %17, i8** %16
%18 = getelementptr inbounds i8*, i8** %16, i64 1
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
store i8* %19, i8** %18
store i32 0, i32* %9
br label %20
20: ; preds = %30, %2
%21 = load i32, i32* %9
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = load i32, i32* %9
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x i8*], [3 x i8*]* %10, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %24, i8* %28)
br label %30
30: ; preds = %23
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %20
33: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"* arr [ %d ] = %s;\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 3355185, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 6649713, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 6583137, i32* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0, i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i8* %7)
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2, i8* %8)
ret i32 0
}