#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 const, ...);
void print_string_array(void *lines, const int size, const int line_size) {
  char(*src)[line_size] = lines;
  printf("Number of words: %d\nList of words:\n", size);
  for (int i = 0; i < size; ++i) {
    printf("%d) %s\n", i, src[i]);
  }
}


x86 assembly (clang, -O0):
<print_string_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1187 <print_string_array+0x77>
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
movslq -0x1c(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <print_string_array+0x39>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_array>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    115b <print_string_array+0x4b>
mov    %ebp,%r12d
mov    %ebx,%ebp
lea    0xee7(%rip),%r14
xor    %ebx,%ebx
nop
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
add    %r12,%r15
cmp    %rbx,%rbp
jne    1140 <print_string_array+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Number of words: %d\0AList of words:\0A\00"
@.str.1 = [8 x i8] c"%d) %s\0A\00"
define void @print_string_array(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = load i8*, i8** %4
store i8* %11, i8** %7
%12 = load i32, i32* %5
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 0, i32* %8
br label %14
14: ; preds = %26, %3
%15 = load i32, i32* %8
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i32, i32* %8
%20 = load i8*, i8** %7
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = mul nsw i64 %22, %10
%24 = getelementptr inbounds i8, i8* %20, i64 %23
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %19, i8* %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
br label %14
29: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Number of words: %d\0AList of words:\0A\00"
@.str.1 = [8 x i8] c"%d) %s\0A\00"
define void @print_string_array(i8* %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = zext i32 %1 to i64
br label %10
9: ; preds = %10, %3
ret void
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %16, %10 ]
%12 = mul nuw nsw i64 %11, %4
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = trunc i64 %11 to i32
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %14, i8* %13)
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, %8
br i1 %17, label %9, label %10
}