#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*/ errno;
int execle(char *, char *, char *, int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void my_execle() {
  char *envv[] = {"CONTENT_LENGTH=1024", NULL};
  if (execle("/bin/ls", "ls", "-l", NULL, envv) == -1) {
    fprintf(stderr, "error : %s\n", strerror(errno));
  }
}


x86 assembly (clang, -O0):
<my_execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cc1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cbe(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xeb9(%rip),%rsi
lea    0xeb5(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execle@plt>
cmp    $0xffffffff,%eax
jne    11a5 <my_execle+0x75>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_execle>:
push   %rbx
sub    $0x10,%rsp
movaps 0x2cc4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecd(%rip),%rdi
lea    0xecb(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rsp,%r8
xor    %ecx,%ecx
call   1040 <execle@plt>
cmp    $0xffffffff,%eax
jne    118c <my_execle+0x5c>
mov    0x2e75(%rip),%rax
mov    (%rax),%ebx
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe9d(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"CONTENT_LENGTH=1024\00"
@__const.my_execle.envv = [2 x i8*] [i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.4 = [12 x i8] c"error : %s\0A\00"
@errno = global i32 0
define void @my_execle() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execle(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null, i8** %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"CONTENT_LENGTH=1024\00"
@__const.my_execle.envv = [2 x i8*] [i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.4 = [12 x i8] c"error : %s\0A\00"
@errno = global i32 0
define void @my_execle() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execle(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null, i8** %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %0
ret void
}