#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 /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ parse_opts(int, char **);
int /*<<< orphan*/ run_test();
int /*<<< orphan*/ stderr;
scalar_t__ system(char *);
int main(int argc, char **argv) {
  parse_opts(argc, argv);
  if (system("ip link set dev lo mtu 1500"))
    error(1, errno, "ip link set mtu");
  if (system("ip addr add dev lo 172.17.0.1/24"))
    error(1, errno, "ip addr add");
  run_test();
  fprintf(stderr, "OK\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_opts@plt>
lea    0xe87(%rip),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
je     11a2 <main+0x52>
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    0xe7f(%rip),%rdx
call   1070 <error@plt>
lea    0xe83(%rip),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
je     11d2 <main+0x82>
mov    0x2e19(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    0xe80(%rip),%rdx
call   1070 <error@plt>
mov    $0x0,%al
call   1060 <run_test@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
lea    0xe70(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_opts@plt>
lea    0xea3(%rip),%rdi
call   1040 <system@plt>
test   %rax,%rax
je     1181 <main+0x31>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdx
mov    $0x1,%edi
call   1070 <error@plt>
lea    0xea4(%rip),%rdi
call   1040 <system@plt>
test   %rax,%rax
je     11ac <main+0x5c>
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdx
mov    $0x1,%edi
call   1070 <error@plt>
xor    %eax,%eax
call   1060 <run_test@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"ip link set dev lo mtu 1500\00"
@errno = global i32 0
@.str.1 = [16 x i8] c"ip link set mtu\00"
@.str.2 = [33 x i8] c"ip addr add dev lo 172.17.0.1/24\00"
@.str.3 = [12 x i8] c"ip addr add\00"
@stderr = global i32 0
@.str.4 = [5 x i8] c"OK\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_opts(i32 %6, i8** %7)
%9 = call i64 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i32 @error(i32 1, i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = call i64 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* @errno
%19 = call i32 @error(i32 1, i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
%21 = call i32 (...) @run_test()
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"ip link set dev lo mtu 1500\00"
@errno = global i32 0
@.str.1 = [16 x i8] c"ip link set mtu\00"
@.str.2 = [33 x i8] c"ip addr add dev lo 172.17.0.1/24\00"
@.str.3 = [12 x i8] c"ip addr add\00"
@stderr = global i32 0
@.str.4 = [5 x i8] c"OK\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_opts(i32 %0, i8** %1)
%4 = tail call i64 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 1, i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
%10 = tail call i64 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* @errno
%14 = tail call i32 @error(i32 1, i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
%16 = tail call i32 (...) @run_test()
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}