#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 printStrings(char **strs) {
  int index = 0;
  if (strs != 0) {
    for (index = 0; strs[index] != 0; ++index) {
      if (index == 0) {
        printf("Strings:");
      } else {
        printf(",");
      }
      printf("'%s'", strs[index]);
    }
  }
  if (index == 0) {
    printf("No strings");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11a0 <printStrings+0x90>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     119b <printStrings+0x8b>
cmpl   $0x0,-0xc(%rbp)
jne    1165 <printStrings+0x55>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <printStrings+0x63>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <printStrings+0x25>
jmp    11a0 <printStrings+0x90>
cmpl   $0x0,-0xc(%rbp)
jne    11b8 <printStrings+0xa8>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStrings>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1197 <printStrings+0x77>
mov    %rdi,%rbx
mov    (%rdi),%r15
test   %r15,%r15
je     1197 <printStrings+0x77>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpq   $0x0,0x8(%rbx)
je     11a5 <printStrings+0x85>
add    $0x10,%rbx
lea    0xea3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbx),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpq   $0x0,(%rbx)
lea    0x8(%rbx),%rbx
jne    1170 <printStrings+0x50>
test   %r15,%r15
jne    11a5 <printStrings+0x85>
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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