#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*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  char *cmd[5];
  cmd[0] = "/sbin/ifconfig";
  cmd[1] = argv[1];
  cmd[2] = "create";
  cmd[3] = "up";
  cmd[4] = NULL;
  printf("Executing %s - %u\n", cmd[1], argc);
  execvp(cmd[0], cmd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
lea    0xebb(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rbx
mov    %rbx,(%rsp)
mov    0x8(%rsi),%rsi
mov    %rsi,0x8(%rsp)
lea    0xecd(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x18(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/sbin/ifconfig\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [3 x i8] c"up\00"
@.str.3 = [19 x i8] c"Executing %s - %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 1
store i8* %10, i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 4
store i8* null, i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 1
%16 = load i8*, i8** %15
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %16, i32 %17)
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%20 = load i8*, i8** %19
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%22 = call i32 @execvp(i8* %20, i8** %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/sbin/ifconfig\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [3 x i8] c"up\00"
@.str.3 = [19 x i8] c"Executing %s - %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5 x i8*]
%4 = bitcast [5 x i8*]* %3 to i8*
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* %7, i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %11
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %7, i32 %0)
%13 = call i32 @execvp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}