#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 /*<<< orphan*/ putchar(char);
void disparray(char *array[]) {
  int i, j;
  i = 0;
  while (*array[i]) {
    printf("%s \n", array[i]);
    j = 0;
    while (array[i][j]) {
      printf("%c* ", array[i][j]);
      j++;
    }
    putchar('\n');
    i++;
  }
}


x86 assembly (clang, -O0):
<disparray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     11cb <disparray+0xab>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     11b3 <disparray+0x93>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <disparray+0x49>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <disparray+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disparray>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%rsi
cmpb   $0x0,(%rsi)
je     11ae <disparray+0x8e>
mov    %rdi,%r15
lea    0xec3(%rip),%r14
lea    0xec1(%rip),%r13
xor    %r12d,%r12d
mov    %rdi,%rbx
jmp    1170 <disparray+0x50>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r15,%r12,8),%rbx
add    $0x8,%rbx
mov    0x8(%r15,%r12,8),%rsi
add    $0x1,%r12
cmpb   $0x0,(%rsi)
je     11ae <disparray+0x8e>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%r12,8),%rax
mov    (%rax),%al
test   %al,%al
je     1150 <disparray+0x30>
mov    $0x1,%ebp
nopl   0x0(%rax)
movsbl %al,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rax
movzbl (%rax,%rbp,1),%eax
add    $0x1,%rbp
test   %al,%al
jne    1190 <disparray+0x70>
jmp    1150 <disparray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [5 x i8] c"%c* \00"
define void @disparray(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %5
5: ; preds = %45, %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 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %49
13: ; preds = %5
%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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 0, i32* %4
br label %20
20: ; preds = %31, %13
%21 = load i8**, i8*** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
br i1 %30, label %31, label %45
31: ; preds = %20
%32 = load i8**, i8*** %2
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %20
45: ; preds = %20
%46 = call i32 @putchar(i8 signext 10)
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %5
49: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [5 x i8] c"%c* \00"
define void @disparray(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %30, label %5
5: ; preds = %1, %23
%6 = phi i64 [ %25, %23 ], [ 0, %1 ]
%7 = phi i8* [ %27, %23 ], [ %2, %1 ]
%8 = phi i8** [ %26, %23 ], [ %0, %1 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = load i8*, i8** %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %5, %13
%14 = phi i64 [ %18, %13 ], [ 0, %5 ]
%15 = phi i8 [ %21, %13 ], [ %11, %5 ]
%16 = sext i8 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = add nuw i64 %14, 1
%19 = load i8*, i8** %8
%20 = getelementptr inbounds i8, i8* %19, i64 %18
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %13
23: ; preds = %13, %5
%24 = tail call i32 @putchar(i8 signext 10)
%25 = add nuw i64 %6, 1
%26 = getelementptr inbounds i8*, i8** %0, i64 %25
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 0
br i1 %29, label %30, label %5
30: ; preds = %23, %1
ret void
}