#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*/ printf(char *, ...);
scalar_t__ strcmp(char *const, char *);
int main(int argc, char *const *argv) {
  int i = 1;
  int nl = 1;
  if (argc > 1) {
    if (strcmp(argv[1], "-n") == 0) {
      nl = 0;
      i++;
    }
    while (i < argc) {
      printf("%s%s", argv[i], (i == argc - 1) ? "" : " ");
      i++;
    }
  }
  if (nl) {
    printf("\n");
  }
  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)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11d7 <main+0xb7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117c <main+0x5c>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x61>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d2 <main+0xb2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
lea    0xe5f(%rip),%rdx
lea    0xe5b(%rip),%rax
cmp    %edi,%ecx
cmove  %rax,%rdx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x61>
jmp    11d7 <main+0xb7>
cmpl   $0x0,-0x18(%rbp)
je     11ef <main+0xcf>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11bf <main+0x8f>
mov    %rsi,%r12
mov    %edi,%r15d
mov    0x8(%rsi),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,(%rsp)
cmp    $0x1,%rax
mov    $0x1,%eax
adc    $0x0,%eax
cmp    %r15d,%eax
jae    11b8 <main+0x88>
lea    -0x1(%r15),%r13d
mov    %eax,%ebx
mov    %r15d,%ebp
lea    0xe8d(%rip),%r14
lea    0xe81(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbx,8),%rsi
cmp    %rbx,%r13
mov    %r14,%rdx
lea    0xe68(%rip),%rax
cmove  %rax,%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1190 <main+0x60>
cmpq   $0x0,(%rsp)
je     11c9 <main+0x99>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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