#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*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  for (int i = 1; i < argc; i++) {
    fputs(argv[i], stdout);
    if (i + 1 < argc) {
      fputc(' ', stdout);
    }
  }
  fputc('\n', stdout);
}


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)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1198 <main+0x78>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1185 <main+0x65>
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <fputc@plt>
jmp    118a <main+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     1185 <main+0x65>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%r12d
sub    %r15,%r12
mov    $0x2,%ebx
mov    0x2e97(%rip),%r13
jmp    1162 <main+0x42>
nopl   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x2,%rax
je     1185 <main+0x65>
mov    -0x8(%r14,%rbx,8),%rdi
mov    0x0(%r13),%esi
call   1030 <fputs@plt>
cmp    %r15,%rbx
jae    1150 <main+0x30>
mov    0x0(%r13),%esi
mov    $0x20,%edi
call   1040 <fputc@plt>
jmp    1150 <main+0x30>
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
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
store i32 1, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* %16, i32 %17)
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %11
%24 = load i32, i32* @stdout
%25 = call i32 @fputc(i8 signext 32, i32 %24)
br label %26
26: ; preds = %23, %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
%31 = load i32, i32* @stdout
%32 = call i32 @fputc(i8 signext 10, i32 %31)
%33 = load i32, i32* %3
ret i32 %33
}

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