#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*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("\nUsage:\n");
    printf("\n %s [Program To Run] [Program's Parameters]\n", argv[0]);
    exit(1);
  }
  execvp(argv[1], &argv[1]);
  perror("exec failure");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     118d <main+0x4d>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1050 <execvp@plt>
lea    0xe8e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1180 <main+0x30>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1060 <execvp@plt>
lea    0xe97(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0AUsage:\0A\00"
@.str.1 = [46 x i8] c"\0A %s [Program To Run] [Program's Parameters]\0A\00"
@.str.2 = [13 x i8] c"exec failure\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = call i32 @execvp(i8* %18, i8** %20)
%22 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"\0A %s [Program To Run] [Program's Parameters]\0A\00"
@.str.2 = [13 x i8] c"exec failure\00"
@str = [8 x i8] c"\0AUsage:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @execvp(i8* %11, i8** %10)
%13 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
}