#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  char *progname;
  char *prefix;
  int i;
  progname = argv[0];
  argc--, argv++;
  if (argc < 1) {
    fprintf(stderr,
            "Usage: %s PREFIX ARGS...\nEcho each ARG preceded by PREFIX and a "
            "space.\n",
            progname);
    exit(2);
  }
  prefix = argv[0];
  argc--, argv++;
  for (i = 0; argc > 0; argc--, argv++) {
    printf("%s %s%c", prefix, argv[0], (argc > 1) ? ' ' : '\n');
    i++;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1193 <main+0x63>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe7c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1214 <main+0xe4>
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%edi
mov    $0xa,%eax
mov    $0x20,%ecx
cmp    $0x1,%edi
cmovg  %ecx,%eax
lea    0xe5f(%rip),%rdi
movsbl %al,%ecx
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11ba <main+0x8a>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1162 <main+0x32>
mov    (%rbx),%rdx
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    %edi,%ebp
cmp    $0x2,%edi
je     11b6 <main+0x86>
mov    0x8(%rbx),%r14
add    $0x10,%rbx
add    $0xffffffff,%ebp
mov    $0xa,%r12d
lea    0xec7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%rdx
cmp    $0x2,%ebp
mov    $0x20,%ecx
cmove  %r12d,%ecx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1190 <main+0x60>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: %s PREFIX ARGS...\0AEcho each ARG preceded by PREFIX and a space.\0A\00"
@.str.1 = [8 x i8] c"%s %s%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i32 1
store i8** %15, i8*** %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %6
%21 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 2)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
store i8* %26, i8** %7
%27 = load i32, i32* %4
%28 = add nsw i32 %27, -1
store i32 %28, i32* %4
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i32 1
store i8** %30, i8*** %5
store i32 0, i32* %8
br label %31
31: ; preds = %47, %23
%32 = load i32, i32* %4
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %52
34: ; preds = %31
%35 = load i8*, i8** %7
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = load i32, i32* %4
%40 = icmp sgt i32 %39, 1
%41 = zext i1 %40 to i64
%42 = select i1 %40, i32 32, i32 10
%43 = trunc i32 %42 to i8
%44 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %35, i8* %38, i8 signext %43)
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %47
47: ; preds = %34
%48 = load i32, i32* %4
%49 = add nsw i32 %48, -1
store i32 %49, i32* %4
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i32 1
store i8** %51, i8*** %5
br label %31
52: ; preds = %31
%53 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: %s PREFIX ARGS...\0AEcho each ARG preceded by PREFIX and a space.\0A\00"
@.str.1 = [8 x i8] c"%s %s%c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i32 %0, 2
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = add nsw i32 %0, -2
br label %16
16: ; preds = %13, %16
%17 = phi i32 [ %23, %16 ], [ %15, %13 ]
%18 = phi i8** [ %24, %16 ], [ %14, %13 ]
%19 = load i8*, i8** %18
%20 = icmp eq i32 %17, 1
%21 = select i1 %20, i8 10, i8 32
%22 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %19, i8 signext %21)
%23 = add nsw i32 %17, -1
%24 = getelementptr inbounds i8*, i8** %18, i64 1
%25 = icmp ugt i32 %17, 1
br i1 %25, label %16, label %26
26: ; preds = %16, %9
%27 = tail call i32 @exit(i32 0)
unreachable
}