#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void echo_command_line(FILE *F, int argc, char **argv) {
  fprintf(F, "%%");
  while (--argc >= 0)
    fprintf(F, "%s%s", *argv++, (argc > 0) ? " " : "");
  fprintf(F, "\n");
}


x86 assembly (clang, -O0):
<echo_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1188 <echo_command_line+0x78>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rdx
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rcx
lea    0xe9a(%rip),%rax
cmp    $0x0,%esi
cmovg  %rax,%rcx
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1135 <echo_command_line+0x25>
mov    -0x8(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_command_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %ebp,%ebp
jle    1186 <echo_command_line+0x66>
add    $0x1,%ebp
lea    0xeba(%rip),%r12
lea    0xeb2(%rip),%r13
lea    0xea6(%rip),%r15
nopl   (%rax)
mov    (%rbx),%rdx
add    $0x8,%rbx
cmp    $0x2,%ebp
mov    %r13,%rcx
cmove  %r12,%rcx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1160 <echo_command_line+0x40>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%%\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"\0A\00"
define void @echo_command_line(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %13, %3
%10 = load i32, i32* %5
%11 = add nsw i32 %10, -1
store i32 %11, i32* %5
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %6
%17 = load i8*, i8** %15
%18 = load i32, i32* %5
%19 = icmp sgt i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %21)
br label %9
23: ; preds = %9
%24 = load i32*, i32** %4
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%%\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [1 x i8] zeroinitializer
define void @echo_command_line(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %3, %6
%7 = phi i8** [ %10, %6 ], [ %2, %3 ]
%8 = phi i32 [ %9, %6 ], [ %1, %3 ]
%9 = add nsw i32 %8, -1
%10 = getelementptr inbounds i8*, i8** %7, i64 1
%11 = load i8*, i8** %7
%12 = icmp eq i32 %8, 1
%13 = select i1 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %13)
%15 = icmp ugt i32 %8, 1
br i1 %15, label %6, label %16
16: ; preds = %6, %3
%17 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}