#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*/ ft_putchar(char);
void ft_print_array(char **arr) {
  int i;
  int j;
  i = 0;
  j = 0;
  while (arr[i] != 0) {
    while (arr[i][j] != '\0') {
      ft_putchar(arr[i][j]);
      j++;
    }
    ft_putchar('\n');
    j = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11a5 <ft_print_array+0x95>
jmp    1142 <ft_print_array+0x32>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1186 <ft_print_array+0x76>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <ft_print_array+0x32>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <ft_print_array+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%rax
test   %rax,%rax
je     117a <ft_print_array+0x6a>
mov    %rdi,%r14
xor    %r15d,%r15d
mov    %rdi,%r12
jmp    1150 <ft_print_array+0x40>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
lea    (%r14,%r15,8),%r12
add    $0x8,%r12
mov    0x8(%r14,%r15,8),%rax
add    $0x1,%r15
test   %rax,%rax
je     117a <ft_print_array+0x6a>
mov    (%rax),%al
test   %al,%al
je     1130 <ft_print_array+0x20>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    (%r12),%rax
movzbl (%rax,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <ft_print_array+0x50>
jmp    1130 <ft_print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_print_array(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %38, %1
%6 = load i8**, i8*** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %42
12: ; preds = %5
br label %13
13: ; preds = %25, %12
%14 = load i8**, i8*** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %38
25: ; preds = %13
%26 = load i8**, i8*** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = call i32 @ft_putchar(i8 signext %34)
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %13
38: ; preds = %13
%39 = call i32 @ft_putchar(i8 signext 10)
store i32 0, i32* %4
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %5
42: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_print_array(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %25, label %4
4: ; preds = %1, %19
%5 = phi i8* [ %23, %19 ], [ %2, %1 ]
%6 = phi i64 [ %21, %19 ], [ 0, %1 ]
%7 = phi i8** [ %22, %19 ], [ %0, %1 ]
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %4, %10
%11 = phi i64 [ %14, %10 ], [ 0, %4 ]
%12 = phi i8 [ %17, %10 ], [ %8, %4 ]
%13 = tail call i32 @ft_putchar(i8 signext %12)
%14 = add nuw i64 %11, 1
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 %14
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %4
%20 = tail call i32 @ft_putchar(i8 signext 10)
%21 = add nuw i64 %6, 1
%22 = getelementptr inbounds i8*, i8** %0, i64 %21
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %4
25: ; preds = %19, %1
ret void
}