#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*/ strcmp(char const *const, char *);
int strlen(char const *const);
int /*<<< orphan*/ write(int, char const *const, int);
int main(const int argc, const char *const argv[]) {
  int newline;
  if (*++argv && !strcmp(*argv, "-n")) {
    newline = 0;
    ++argv;
  } else {
    newline = 1;
  }
  while (*argv) {
    write(1, *argv, strlen(*argv));
    if (*++argv != 0) {
      write(1, " ", 1);
    }
  }
  if (newline) {
    write(1, "\n", 1);
  }
  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,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1194 <main+0x64>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1194 <main+0x64>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    119b <main+0x6b>
movl   $0x1,-0x14(%rbp)
jmp    11a0 <main+0x70>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1207 <main+0xd7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1202 <main+0xd2>
mov    $0x1,%edx
lea    0xe08(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    11a0 <main+0x70>
cmpl   $0x0,-0x14(%rbp)
je     1224 <main+0xf4>
mov    $0x1,%edx
lea    0xde8(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     11c0 <main+0x90>
mov    %rsi,%rbp
lea    0x8(%rsi),%rbx
lea    0xeae(%rip),%rsi
call   1050 <strcmp@plt>
mov    %eax,%r14d
lea    0x10(%rbp),%rax
xor    %ecx,%ecx
test   %r14d,%r14d
sete   %cl
cmove  %rax,%rbx
mov    0x8(%rbp,%rcx,8),%rbp
test   %rbp,%rbp
je     11bb <main+0x8b>
add    $0x8,%rbx
lea    0xe84(%rip),%r15
nop
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmpq   $0x0,(%rbx)
je     11bb <main+0x8b>
mov    $0x1,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    (%rbx),%rbp
add    $0x8,%rbx
test   %rbp,%rbp
jne    1180 <main+0x50>
test   %r14d,%r14d
je     11d6 <main+0xa6>
lea    0xe3e(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-n\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %11
store i32 0, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %5
br label %20
19: ; preds = %11, %2
store i32 1, i32* %6
br label %20
20: ; preds = %19, %16
br label %21
21: ; preds = %38, %20
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %39
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = call i32 @strlen(i8* %29)
%31 = call i32 @write(i32 1, i8* %27, i32 %30)
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i32 1
store i8** %33, i8*** %5
%34 = load i8*, i8** %33
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %25
%37 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %38
38: ; preds = %36, %25
br label %21
39: ; preds = %21
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %44
44: ; preds = %42, %39
ret i32 0
}

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