#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);
int main(int argc, char **argv) {
  int i;
  char *s, newline[] = "\n";
  for (i = 0; i < argc; ++i) {
    for (s = argv[i]; *s != '\0'; ++s)
      write(1, s, 1);
    write(1, newline, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x22(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a3 <main+0x93>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1185 <main+0x75>
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    1154 <main+0x44>
lea    -0x22(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1138 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movw   $0xa,0xe(%rsp)
test   %edi,%edi
jle    118e <main+0x7e>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %r13d,%r13d
lea    0xe(%rsp),%r14
jmp    115b <main+0x4b>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%r13
cmp    %r12,%r13
je     118e <main+0x7e>
mov    (%r15,%r13,8),%rbx
cmpb   $0x0,(%rbx)
je     1140 <main+0x30>
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    1170 <main+0x60>
jmp    1140 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
store i16 10, i16* %3
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %24
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %20
%9 = phi i64 [ 0, %6 ], [ %22, %20 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %8, %14
%15 = phi i8* [ %17, %14 ], [ %11, %8 ]
%16 = tail call i32 @write(i32 1, i8* %15, i32 1)
%17 = getelementptr inbounds i8, i8* %15, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %14
20: ; preds = %14, %8
%21 = call i32 @write(i32 1, i8* %4, i32 1)
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, %7
br i1 %23, label %24, label %8
24: ; preds = %20, %2
ret i32 0
}