#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*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
int my_show_wordtab(char **tab) {
  int lp;
  if (tab == NULL)
    return (0);
  lp = -1;
  while (tab[++lp] != 0) {
    my_putstr(tab[lp]);
    my_putchar('\n');
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_show_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <my_show_wordtab+0x23>
movl   $0x0,-0x4(%rbp)
jmp    118c <my_show_wordtab+0x6c>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1185 <my_show_wordtab+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
jmp    114a <my_show_wordtab+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_show_wordtab>:
push   %rbx
test   %rdi,%rdi
je     115b <my_show_wordtab+0x3b>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     115b <my_show_wordtab+0x3b>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <my_show_wordtab+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_show_wordtab(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = icmp eq i8** %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %26
8: ; preds = %1
store i32 -1, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i8**, i8*** %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %25
17: ; preds = %9
%18 = load i8**, i8*** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @my_putstr(i8* %22)
%24 = call i32 @my_putchar(i8 signext 10)
br label %9
25: ; preds = %9
store i32 0, i32* %2
br label %26
26: ; preds = %25, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @my_show_wordtab(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i8* [ %13, %6 ], [ %4, %3 ]
%9 = tail call i32 @my_putstr(i8* %8)
%10 = tail call i32 @my_putchar(i8 signext 10)
%11 = add nuw i64 %7, 1
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret i32 0
}