#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*/ free(char **);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
char **my_str_to_wordtab(char *);
int my_show_wordtab(int argc, char **argv) {
  int i;
  char **new;
  i = 0;
  new = my_str_to_wordtab(argv[1]);
  while (new[i]) {
    my_putstr(new[i]);
    my_putchar('\n');
    ++i;
  }
  free(new);
  return (0);
}


x86 assembly (clang, -O0):
<my_show_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <my_str_to_wordtab@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11a3 <my_show_wordtab+0x63>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <my_putstr@plt>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <my_show_wordtab+0x27>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_show_wordtab>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <my_str_to_wordtab@plt>
mov    %rax,%r14
mov    (%rax),%rdi
test   %rdi,%rdi
je     117b <my_show_wordtab+0x3b>
mov    %r14,%rbx
add    $0x8,%rbx
nop
call   1060 <my_putstr@plt>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1160 <my_show_wordtab+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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