#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 *, ...);
void ll_list_print(char **list) {
  if (list == NULL) {
    printf("(null)\n");
    return;
  }
  printf("[ ");
  if (list[0] != NULL) {
    int i;
    printf("'%s'", list[0]);
    i = 1;
    while (list[i] != NULL)
      printf(", '%s'", list[i++]);
  }
  printf(" ]\n");
}


x86 assembly (clang, -O0):
<ll_list_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <ll_list_print+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c1 <ll_list_print+0xb1>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     11b3 <ll_list_print+0xa3>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11ae <ll_list_print+0x9e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1172 <ll_list_print+0x62>
jmp    11b3 <ll_list_print+0xa3>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_list_print>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1188 <ll_list_print+0x68>
mov    %rdi,%rbx
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xec5(%rip),%r14
test   %rsi,%rsi
je     118f <ll_list_print+0x6f>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
test   %rsi,%rsi
je     118f <ll_list_print+0x6f>
add    $0x10,%rbx
lea    0xe97(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1170 <ll_list_print+0x50>
jmp    118f <ll_list_print+0x6f>
lea    0xe7e(%rip),%r14
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"(null)\0A\00"
@.str.1 = [3 x i8] c"[ \00"
@.str.2 = [5 x i8] c"'%s'\00"
@.str.3 = [7 x i8] c", '%s'\00"
@.str.4 = [4 x i8] c" ]\0A\00"
define void @ll_list_print(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp eq i8** %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %37
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %35
14: ; preds = %8
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %19
19: ; preds = %26, %14
%20 = load i8**, i8*** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %34
26: ; preds = %19
%27 = load i8**, i8*** %2
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i8*, i8** %27, i64 %30
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %19
34: ; preds = %19
br label %35
35: ; preds = %34, %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"[ \00"
@.str.2 = [5 x i8] c"'%s'\00"
@.str.3 = [7 x i8] c", '%s'\00"
@str = [3 x i8] c" ]\00"
@str.5 = [7 x i8] c"(null)\00"
define void @ll_list_print(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %20, label %7
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%9 = getelementptr inbounds i8*, i8** %0, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %7, %12
%13 = phi i64 [ %15, %12 ], [ 1, %7 ]
%14 = phi i8* [ %18, %12 ], [ %10, %7 ]
%15 = add nuw i64 %13, 1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%17 = getelementptr inbounds i8*, i8** %0, i64 %15
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %12
20: ; preds = %12, %3, %7, %1
%21 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %12 ]
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
ret void
}