#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*/ execl(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ execle(char *, int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ execlp(char *, char *, ...);
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ execvp(char *, char **);
int main(int argc, char **argv, char **env) {
  execl("./fltest_execl", NULL);
  execlp("./fltest_execlp", NULL);
  execle("./fltest_execle", NULL, env);
  execv("./fltest_execv", argv);
  execvp("./fltest_execvp", argv);
  execve("./fltest_execve", argv, env);
  execlp("ls", "ls", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe86(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <execl@plt>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1060 <execlp@plt>
mov    -0x18(%rbp),%rdx
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <execle@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1080 <execv@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <execvp@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe76(%rip),%rdi
call   1030 <execve@plt>
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
mov    $0x0,%al
call   1060 <execlp@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xe8f(%rip),%rdi
xor    %esi,%esi
call   1070 <execl@plt>
lea    0xe90(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <execlp@plt>
lea    0xe90(%rip),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <execle@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1080 <execv@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <execvp@plt>
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <execve@plt>
lea    0xe8e(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1060 <execlp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"./fltest_execl\00"
@.str.1 = [16 x i8] c"./fltest_execlp\00"
@.str.2 = [16 x i8] c"./fltest_execle\00"
@.str.3 = [15 x i8] c"./fltest_execv\00"
@.str.4 = [16 x i8] c"./fltest_execvp\00"
@.str.5 = [16 x i8] c"./fltest_execve\00"
@.str.6 = [3 x i8] c"ls\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @execl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null)
%8 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* null)
%9 = load i8**, i8*** %6
%10 = call i32 @execle(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %9)
%11 = load i8**, i8*** %5
%12 = call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %11)
%13 = load i8**, i8*** %5
%14 = call i32 @execvp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %13)
%15 = load i8**, i8*** %5
%16 = load i8**, i8*** %6
%17 = call i32 @execve(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %15, i8** %16)
%18 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"./fltest_execl\00"
@.str.1 = [16 x i8] c"./fltest_execlp\00"
@.str.2 = [16 x i8] c"./fltest_execle\00"
@.str.3 = [15 x i8] c"./fltest_execv\00"
@.str.4 = [16 x i8] c"./fltest_execvp\00"
@.str.5 = [16 x i8] c"./fltest_execve\00"
@.str.6 = [3 x i8] c"ls\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @execl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null)
%5 = tail call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* null)
%6 = tail call i32 @execle(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %2)
%7 = tail call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %1)
%8 = tail call i32 @execvp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %1)
%9 = tail call i32 @execve(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %1, i8** %2)
%10 = tail call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* null)
ret i32 0
}