#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 *, ...);
int main(int argc, char *argv[]) {
  ++argc;
  while (*++argv) {
    printf("%s", *argv);
    if (*argv)
      printf(" ");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     117f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     117a <main+0x6a>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0x1f>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
test   %rsi,%rsi
je     1169 <main+0x49>
add    $0x10,%rbx
lea    0xec5(%rip),%r14
jmp    114c <main+0x2c>
nopl   (%rax)
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
je     1169 <main+0x49>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpq   $0x0,-0x8(%rbx)
je     1140 <main+0x20>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
br label %8
8: ; preds = %22, %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %13
br label %8
23: ; preds = %8
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\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 %18, label %6
6: ; preds = %2, %14
%7 = phi i8* [ %16, %14 ], [ %4, %2 ]
%8 = phi i8** [ %15, %14 ], [ %3, %2 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = tail call i32 @putchar(i32 32)
br label %14
14: ; preds = %12, %6
%15 = getelementptr inbounds i8*, i8** %8, i64 1
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %6
18: ; preds = %14, %2
%19 = tail call i32 @putchar(i32 10)
ret i32 0
}