#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*/ execute(char **);
int /*<<< orphan*/ printf(char *);
void NetworkRoutine() {
  char *eth0up[] = {"/usr/bin/busybox", "ifconfig", "eth0", "up", NULL};
  char *udhcpc[] = {"/usr/bin/busybox", "udhcpc", "-b", NULL};
  printf("Bringing up eth0\n");
  execute(eth0up);
  printf("Starting udhcpc\n");
  execute(udhcpc);
}


x86 assembly (clang, -O0):
<NetworkRoutine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeb5(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c85(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c82(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c7f(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2c7c(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <execute@plt>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <execute@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetworkRoutine>:
sub    $0x58,%rsp
movq   $0x0,0x20(%rsp)
lea    0xecc(%rip),%rax
mov    %rax,(%rsp)
lea    0xed2(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xee1(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec3(%rip),%rax
mov    %rax,0x18(%rsp)
movaps 0x2cad(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c91(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <execute@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rdi
call   1040 <execute@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/usr/bin/busybox\00"
@.str.1 = [9 x i8] c"ifconfig\00"
@.str.2 = [5 x i8] c"eth0\00"
@.str.3 = [3 x i8] c"up\00"
@.str.4 = [7 x i8] c"udhcpc\00"
@.str.5 = [3 x i8] c"-b\00"
@__const.NetworkRoutine.udhcpc = [4 x i8*] [i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* null]
@.str.6 = [18 x i8] c"Bringing up eth0\0A\00"
@.str.7 = [17 x i8] c"Starting udhcpc\0A\00"
define void @NetworkRoutine() {
%1 = alloca [5 x i8*]
%2 = alloca [4 x i8*]
%3 = bitcast [5 x i8*]* %1 to i8*
%4 = bitcast i8* %3 to [5 x i8*]*
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i32 0, i32 0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i32 0, i32 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i32 0, i32 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8** %8
%9 = bitcast [4 x i8*]* %2 to i8*
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
%12 = call i32 @execute(i8** %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%14 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%15 = call i32 @execute(i8** %14)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/usr/bin/busybox\00"
@.str.1 = [9 x i8] c"ifconfig\00"
@.str.2 = [5 x i8] c"eth0\00"
@.str.3 = [3 x i8] c"up\00"
@.str.4 = [7 x i8] c"udhcpc\00"
@.str.5 = [3 x i8] c"-b\00"
@__const.NetworkRoutine.udhcpc = [4 x i8*] [i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* null]
@str = [17 x i8] c"Bringing up eth0\00"
@str.8 = [16 x i8] c"Starting udhcpc\00"
define void @NetworkRoutine() {
%1 = alloca [5 x i8*]
%2 = alloca [4 x i8*]
%3 = bitcast [5 x i8*]* %1 to i8*
%4 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
%5 = bitcast i8** %4 to i64*
store i64 0, i64* %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = bitcast [4 x i8*]* %2 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%12 = call i32 @execute(i8** %6)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
%14 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%15 = call i32 @execute(i8** %14)
ret void
}