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


x86 assembly (clang, -O0):
<glue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1192 <glue+0x62>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1050 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <glue+0x16>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glue>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
lea    -0x1(%rdi),%r14d
cmp    $0x3,%edi
jl     1182 <glue+0x52>
mov    %r14d,%r12d
mov    $0x1,%ebx
mov    0x2e8d(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbx,8),%rdi
mov    0x0(%rbp),%esi
call   1040 <fputs@plt>
mov    0x0(%rbp),%esi
mov    $0x20,%edi
call   1050 <fputc@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1160 <glue+0x30>
movslq %r14d,%rax
mov    (%r15,%rax,8),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

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

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