#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  char *str[30] = {NULL};
  char str2[30][26] = {0};
  int i, j;
  for (i = 0; i < 20; ++i) {
    char *buf = (char *)malloc(sizeof(char) * 10);
    *buf = i + 97;
    str[i] = buf;
  }
  for (j = 0; j < 30; ++j) {
    printf("%d  --> %s \n", j, str[j]);
    printf("%d  --> %s \n", j, str2[j]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0xf0,%edx
call   1040 <memset@plt>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x30c,%edx
call   1040 <memset@plt>
movl   $0x0,-0x414(%rbp)
cmpl   $0x14,-0x414(%rbp)
jge    11ce <main+0x9e>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x420(%rbp)
mov    -0x414(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x420(%rbp),%rax
mov    %cl,(%rax)
mov    -0x420(%rbp),%rcx
movslq -0x414(%rbp),%rax
mov    %rcx,-0x100(%rbp,%rax,8)
ff
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1172 <main+0x42>
movl   $0x0,-0x418(%rbp)
cmpl   $0x1e,-0x418(%rbp)
jge    1241 <main+0x111>
mov    -0x418(%rbp),%esi
movslq -0x418(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rdx
ff
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
mov    -0x418(%rbp),%esi
movslq -0x418(%rbp),%rax
lea    -0x410(%rbp),%rdx
imul   $0x1a,%rax,%rax
add    %rax,%rdx
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    11d8 <main+0xa8>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
lea    0xf0(%rsp),%r14
xor    %ebx,%ebx
mov    $0x30c,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x61,(%rax)
mov    %rax,(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x62,(%rax)
mov    %rax,0x8(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x63,(%rax)
mov    %rax,0x10(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x64,(%rax)
mov    %rax,0x18(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x65,(%rax)
mov    %rax,0x20(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x66,(%rax)
mov    %rax,0x28(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x67,(%rax)
mov    %rax,0x30(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x68,(%rax)
mov    %rax,0x38(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x69,(%rax)
mov    %rax,0x40(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6a,(%rax)
mov    %rax,0x48(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6b,(%rax)
mov    %rax,0x50(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6c,(%rax)
mov    %rax,0x58(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6d,(%rax)
mov    %rax,0x60(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6e,(%rax)
mov    %rax,0x68(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x6f,(%rax)
mov    %rax,0x70(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x70,(%rax)
mov    %rax,0x78(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x71,(%rax)
mov    %rax,0x80(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x72,(%rax)
mov    %rax,0x88(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x73,(%rax)
mov    %rax,0x90(%rsp)
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x74,(%rax)
mov    %rax,0x98(%rsp)
lea    0xd06(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x1a,%r14
cmp    $0x1e,%rbx
jne    1300 <main+0x1d0>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d --> %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8*]
%3 = alloca [30 x [26 x i8]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
%7 = bitcast [30 x i8*]* %2 to i8*
%8 = bitcast [30 x [26 x i8]]* %3 to i8*
store i32 0, i32* %4
br label %9
9: ; preds = %23, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = call i64 @malloc(i32 10)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 97
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %6
store i8 %17, i8* %18
%19 = load i8*, i8** %6
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [30 x i8*], [30 x i8*]* %2, i64 0, i64 %21
store i8* %19, i8** %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %9
26: ; preds = %9
store i32 0, i32* %5
br label %27
27: ; preds = %43, %26
%28 = load i32, i32* %5
%29 = icmp slt i32 %28, 30
br i1 %29, label %30, label %46
30: ; preds = %27
%31 = load i32, i32* %5
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [30 x i8*], [30 x i8*]* %2, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %31, i8* %35)
%37 = load i32, i32* %5
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [30 x [26 x i8]], [30 x [26 x i8]]* %3, i64 0, i64 %39
%41 = getelementptr inbounds [26 x i8], [26 x i8]* %40, i64 0, i64 0
%42 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %37, i8* %41)
br label %43
43: ; preds = %30
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %27
46: ; preds = %27
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d --> %s \0A\00"
define i32 @main() {
%1 = alloca [30 x i8*]
%2 = alloca [30 x [26 x i8]]
%3 = bitcast [30 x i8*]* %1 to i8*
%4 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 20
%5 = bitcast i8** %4 to i8*
%6 = getelementptr inbounds [30 x [26 x i8]], [30 x [26 x i8]]* %2, i64 0, i64 0, i64 0
%7 = tail call i64 @malloc(i32 10)
%8 = inttoptr i64 %7 to i8*
store i8 97, i8* %8
%9 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 0
store i8* %8, i8** %9
%10 = tail call i64 @malloc(i32 10)
%11 = inttoptr i64 %10 to i8*
store i8 98, i8* %11
%12 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 1
store i8* %11, i8** %12
%13 = tail call i64 @malloc(i32 10)
%14 = inttoptr i64 %13 to i8*
store i8 99, i8* %14
%15 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 2
store i8* %14, i8** %15
%16 = tail call i64 @malloc(i32 10)
%17 = inttoptr i64 %16 to i8*
store i8 100, i8* %17
%18 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 3
store i8* %17, i8** %18
%19 = tail call i64 @malloc(i32 10)
%20 = inttoptr i64 %19 to i8*
store i8 101, i8* %20
%21 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 4
store i8* %20, i8** %21
%22 = tail call i64 @malloc(i32 10)
%23 = inttoptr i64 %22 to i8*
store i8 102, i8* %23
%24 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 5
store i8* %23, i8** %24
%25 = tail call i64 @malloc(i32 10)
%26 = inttoptr i64 %25 to i8*
store i8 103, i8* %26
%27 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 6
store i8* %26, i8** %27
%28 = tail call i64 @malloc(i32 10)
%29 = inttoptr i64 %28 to i8*
store i8 104, i8* %29
%30 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 7
store i8* %29, i8** %30
%31 = tail call i64 @malloc(i32 10)
%32 = inttoptr i64 %31 to i8*
store i8 105, i8* %32
%33 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 8
store i8* %32, i8** %33
%34 = tail call i64 @malloc(i32 10)
%35 = inttoptr i64 %34 to i8*
store i8 106, i8* %35
%36 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 9
store i8* %35, i8** %36
%37 = tail call i64 @malloc(i32 10)
%38 = inttoptr i64 %37 to i8*
store i8 107, i8* %38
%39 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 10
store i8* %38, i8** %39
%40 = tail call i64 @malloc(i32 10)
%41 = inttoptr i64 %40 to i8*
store i8 108, i8* %41
%42 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 11
store i8* %41, i8** %42
%43 = tail call i64 @malloc(i32 10)
%44 = inttoptr i64 %43 to i8*
store i8 109, i8* %44
%45 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 12
store i8* %44, i8** %45
%46 = tail call i64 @malloc(i32 10)
%47 = inttoptr i64 %46 to i8*
store i8 110, i8* %47
%48 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 13
store i8* %47, i8** %48
%49 = tail call i64 @malloc(i32 10)
%50 = inttoptr i64 %49 to i8*
store i8 111, i8* %50
%51 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 14
store i8* %50, i8** %51
%52 = tail call i64 @malloc(i32 10)
%53 = inttoptr i64 %52 to i8*
store i8 112, i8* %53
%54 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 15
store i8* %53, i8** %54
%55 = tail call i64 @malloc(i32 10)
%56 = inttoptr i64 %55 to i8*
store i8 113, i8* %56
%57 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 16
store i8* %56, i8** %57
%58 = tail call i64 @malloc(i32 10)
%59 = inttoptr i64 %58 to i8*
store i8 114, i8* %59
%60 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 17
store i8* %59, i8** %60
%61 = tail call i64 @malloc(i32 10)
%62 = inttoptr i64 %61 to i8*
store i8 115, i8* %62
%63 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 18
store i8* %62, i8** %63
%64 = tail call i64 @malloc(i32 10)
%65 = inttoptr i64 %64 to i8*
store i8 116, i8* %65
%66 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 19
store i8* %65, i8** %66
br label %67
67: ; preds = %0, %67
%68 = phi i64 [ 0, %0 ], [ %75, %67 ]
%69 = getelementptr inbounds [30 x i8*], [30 x i8*]* %1, i64 0, i64 %68
%70 = load i8*, i8** %69
%71 = trunc i64 %68 to i32
%72 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %71, i8* %70)
%73 = getelementptr inbounds [30 x [26 x i8]], [30 x [26 x i8]]* %2, i64 0, i64 %68, i64 0
%74 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %71, i8* %73)
%75 = add nuw nsw i64 %68, 1
%76 = icmp eq i64 %75, 30
br i1 %76, label %77, label %67
77: ; preds = %67
ret i32 0
}