#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 execlp(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main() {
  if (execlp("/sbin/ifconfig", "/sbin/ifconfig", NULL) == -1) {
    if (execlp("ipconfig", "ipconfig", NULL) == -1) {
      fprintf(stderr, "Cannot run ipconfig: %s\n", strerror(errno));
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
jne    11b4 <main+0x84>
lea    0xead(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
jne    11af <main+0x7f>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <main+0x84>
jmp    11b4 <main+0x84>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %ebx,%ebx
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
jne    118e <main+0x5e>
lea    0xebf(%rip),%rdi
xor    %ebx,%ebx
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
jne    118e <main+0x5e>
mov    0x2e78(%rip),%rax
mov    (%rax),%ebx
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe99(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/sbin/ifconfig\00"
@.str.1 = [9 x i8] c"ipconfig\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Cannot run ipconfig: %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = call i32 @execlp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %10)
store i32 1, i32* %1
br label %13
12: ; preds = %4
br label %13
13: ; preds = %7, %12, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"/sbin/ifconfig\00"
@.str.1 = [9 x i8] c"ipconfig\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Cannot run ipconfig: %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 @execlp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %3, %6, %0
%12 = phi i32 [ 1, %6 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %12
}