#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*/ log_info(char *, ...);
void dump_strings(const char *key, const char **values) {
  const char **value;
  if (values == NULL || *values == NULL)
    return;
  log_info("  %s: [", key);
  value = values;
  while (*value) {
    log_info("   '%s'", *value);
    value++;
  }
  log_info("   ]");
}


x86 assembly (clang, -O0):
<dump_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <dump_strings+0x29>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113e <dump_strings+0x2e>
jmp    119a <dump_strings+0x8a>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <log_info@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     118c <dump_strings+0x7c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <log_info@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <dump_strings+0x48>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <log_info@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_strings>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %rsi,%rsi
je     117b <dump_strings+0x6b>
cmpq   $0x0,(%rbx)
je     117b <dump_strings+0x6b>
mov    %rdi,%rsi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <log_info@plt>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1166 <dump_strings+0x56>
add    $0x8,%rbx
lea    0xec2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <log_info@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1150 <dump_strings+0x40>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <log_info@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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