#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 *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  char *sep = "";
  while (argc-- > 1) {
    printf("%s%s", sep, argv++[1]);
    sep = "::";
  }
  putchar('\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)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jle    118a <main+0x6a>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %eax,%edx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe84(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <main+0x21>
mov    $0xa,%edi
call   1030 <putchar@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
cmp    $0x2,%edi
jl     1189 <main+0x69>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%edx
lea    0xec5(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <printf@plt>
cmp    $0x2,%ebp
je     1189 <main+0x69>
add    $0x10,%rbx
add    $0x1,%ebp
lea    0xea6(%rip),%r14
lea    0xea4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1170 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [3 x i8] c"::\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp sgt i32 %8, 1
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8*, i8** %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = getelementptr inbounds i8*, i8** %13, i64 1
%16 = load i8*, i8** %15
%17 = ptrtoint i8* %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %12, i32 %17)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
br label %7
19: ; preds = %7
%20 = call i32 @putchar(i8 signext 10)
ret i32 0
}

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