#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*/ write(int, char *, int);
main(int argc, char **argv) {
  char **arg = argv;
  char *s;
  while (*arg) {
    s = *arg;
    while (*s) {
      write(1, s, 1);
      s++;
    }
    write(1, "\n", 1);
    ++arg;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1199 <main+0x89>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <main+0x65>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1147 <main+0x37>
mov    $0x1,%edx
lea    0xe7f(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rbx
test   %rbx,%rbx
je     117e <main+0x6e>
mov    %rsi,%r15
lea    0xed9(%rip),%r14
jmp    114f <main+0x3f>
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x8(%r15),%rbx
add    $0x8,%r15
test   %rbx,%rbx
je     117e <main+0x6e>
cmpb   $0x0,(%rbx)
je     1130 <main+0x20>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1160 <main+0x50>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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