#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*/ execve(char *, char **, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int ArgCount, char *ArgVals[], char *EnvVals[]) {
  if (ArgCount < 2) {
    fprintf(stderr, "Usage: %s FileToCompile\n", ArgVals[0]);
    exit(1);
  }
  char *Arguments[] = {"gcc", ArgVals[1], 0};
  execve("/usr/bin/gcc", Arguments, EnvVals);
  return 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    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117a <main+0x4a>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe71(%rip),%rdi
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
cmp    $0x1,%edi
jle    116c <main+0x3c>
lea    0xee2(%rip),%rax
mov    %rax,(%rsp)
mov    0x8(%rsi),%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe81(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s FileToCompile\0A\00"
@.str.1 = [4 x i8] c"gcc\00"
@.str.2 = [13 x i8] c"/usr/bin/gcc\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca [3 x i8*]
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
%19 = getelementptr inbounds [3 x i8*], [3 x i8*]* %8, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %20
%24 = getelementptr inbounds i8*, i8** %20, i64 1
store i8* null, i8** %24
%25 = getelementptr inbounds [3 x i8*], [3 x i8*]* %8, i64 0, i64 0
%26 = load i8**, i8*** %7
%27 = call i32 @execve(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %25, i8** %26)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s FileToCompile\0A\00"
@.str.1 = [4 x i8] c"gcc\00"
@.str.2 = [13 x i8] c"/usr/bin/gcc\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** %2) {
%4 = alloca [3 x i8*]
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = bitcast [3 x i8*]* %4 to i8*
%13 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 1
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %14
%17 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 2
store i8* null, i8** %17
%18 = call i32 @execve(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %13, i8** %2)
ret i32 0
}