#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 */
char *alloc_and_copy(char const *, int);
char **malloc(int);
char **lines_init(const char *args[]) {
  char **lines;
  int i;
  lines = malloc(sizeof(int *) * 9);
  i = 0;
  while (++i < 10) {
    lines[i - 1] = alloc_and_copy(args[i], (sizeof(int) * 9));
  }
  return (lines);
}


x86 assembly (clang, -O0):
<lines_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x48,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
jge    1182 <lines_init+0x62>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1141 <lines_init+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lines_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x48,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,(%rbx)
mov    0x10(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x8(%rbx)
mov    0x18(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x10(%rbx)
mov    0x20(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x18(%rbx)
mov    0x28(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x20(%rbx)
mov    0x30(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x28(%rbx)
mov    0x38(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x30(%rbx)
mov    0x40(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x38(%rbx)
mov    0x48(%r14),%rdi
mov    $0x24,%esi
call   1030 <alloc_and_copy@plt>
mov    %rax,0x40(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @lines_init(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %2
%5 = call i8** @malloc(i32 72)
store i8** %5, i8*** %3
store i32 0, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i8**, i8*** %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i8* @alloc_and_copy(i8* %15, i32 36)
%17 = load i8**, i8*** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %17, i64 %20
store i8* %16, i8** %21
br label %6
22: ; preds = %6
%23 = load i8**, i8*** %3
ret i8** %23
}

LLVM IR (-O2):
define noalias i8** @lines_init(i8** nocapture %0) {
%2 = tail call i8** @malloc(i32 72)
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @alloc_and_copy(i8* %4, i32 36)
store i8* %5, i8** %2
%6 = getelementptr inbounds i8*, i8** %0, i64 2
%7 = load i8*, i8** %6
%8 = tail call i8* @alloc_and_copy(i8* %7, i32 36)
%9 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* %8, i8** %9
%10 = getelementptr inbounds i8*, i8** %0, i64 3
%11 = load i8*, i8** %10
%12 = tail call i8* @alloc_and_copy(i8* %11, i32 36)
%13 = getelementptr inbounds i8*, i8** %2, i64 2
store i8* %12, i8** %13
%14 = getelementptr inbounds i8*, i8** %0, i64 4
%15 = load i8*, i8** %14
%16 = tail call i8* @alloc_and_copy(i8* %15, i32 36)
%17 = getelementptr inbounds i8*, i8** %2, i64 3
store i8* %16, i8** %17
%18 = getelementptr inbounds i8*, i8** %0, i64 5
%19 = load i8*, i8** %18
%20 = tail call i8* @alloc_and_copy(i8* %19, i32 36)
%21 = getelementptr inbounds i8*, i8** %2, i64 4
store i8* %20, i8** %21
%22 = getelementptr inbounds i8*, i8** %0, i64 6
%23 = load i8*, i8** %22
%24 = tail call i8* @alloc_and_copy(i8* %23, i32 36)
%25 = getelementptr inbounds i8*, i8** %2, i64 5
store i8* %24, i8** %25
%26 = getelementptr inbounds i8*, i8** %0, i64 7
%27 = load i8*, i8** %26
%28 = tail call i8* @alloc_and_copy(i8* %27, i32 36)
%29 = getelementptr inbounds i8*, i8** %2, i64 6
store i8* %28, i8** %29
%30 = getelementptr inbounds i8*, i8** %0, i64 8
%31 = load i8*, i8** %30
%32 = tail call i8* @alloc_and_copy(i8* %31, i32 36)
%33 = getelementptr inbounds i8*, i8** %2, i64 7
store i8* %32, i8** %33
%34 = getelementptr inbounds i8*, i8** %0, i64 9
%35 = load i8*, i8** %34
%36 = tail call i8* @alloc_and_copy(i8* %35, i32 36)
%37 = getelementptr inbounds i8*, i8** %2, i64 8
store i8* %36, i8** %37
ret i8** %2
}