#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] = "addm";
  cmd[3] = argv[2];
  cmd[4] = NULL;
  printf("Executing %s - %u\n", cmd[3], 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)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xe9a(%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),%rax
mov    %rax,0x8(%rsp)
lea    0xecd(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0x10(%rsi),%rsi
mov    %rsi,0x18(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xeb4(%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 = [5 x i8] c"addm\00"
@.str.2 = [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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
store i8* %15, i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 4
store i8* null, i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
%19 = load i8*, i8** %18
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %19, i32 %20)
%22 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%23 = load i8*, i8** %22
%24 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%25 = call i32 @execvp(i8* %23, i8** %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/sbin/ifconfig\00"
@.str.1 = [5 x i8] c"addm\00"
@.str.2 = [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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* %11, i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %13
%14 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %11, i32 %0)
%15 = call i32 @execvp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}