#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 EXIT_SUCCESS;
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int initialize(char *matrix[]) {
  int i = 0;
  for (i = 0; i < 50; i++) {
    matrix[i] = malloc(50);
    strcpy(matrix[i], "                                                  \n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1183 <initialize+0x63>
mov    $0x32,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <initialize+0x1a>
mov    0x2e56(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x32,%edi
call   1040 <malloc@plt>
mov    %rax,(%r15,%rbx,8)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1140 <initialize+0x20>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [52 x i8] c" \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @initialize(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = call i8* @malloc(i32 50)
%9 = load i8**, i8*** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
store i8* %8, i8** %12
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@.str = [52 x i8] c" \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @initialize(i8** nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = tail call dereferenceable_or_null(50) i8* @malloc(i32 50)
%5 = getelementptr inbounds i8*, i8** %0, i64 %3
store i8* %4, i8** %5
%6 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 50
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}