#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*/ execl(char *, char *, char *, char const *, char const *,
                         char const *, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ geteuid();
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
int main(int argc, const char *argv[]) {
  if (geteuid() != 0) {
    fprintf(stderr, "Must be run as root!\n");
    return 1;
  }
  if (argc == 4 && strcmp(argv[1], "enableauto") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setautoproxyurl", argv[2],
          argv[3], NULL);
  } else if (argc == 5 && strcmp(argv[1], "enablehttp") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setwebproxy", argv[2],
          argv[3], argv[4], NULL);
  } else if (argc == 5 && strcmp(argv[1], "enablehttps") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setsecurewebproxy",
          argv[2], argv[3], argv[4], NULL);
  } else if (argc == 3 && strcmp(argv[1], "disableauto") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setautoproxystate",
          argv[2], "off", NULL);
  } else if (argc == 3 && strcmp(argv[1], "disablehttp") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setwebproxystate",
          argv[2], "off", NULL);
  } else if (argc == 3 && strcmp(argv[1], "disablehttps") == 0) {
    execl("/usr/sbin/networksetup", "networksetup", "-setsecurewebproxystate",
          argv[2], "off", NULL);
  } else {
    fprintf(stderr, "Usage:\n");
    fprintf(stderr, "%s enableauto <networkservice> <url>\n", argv[0]);
    fprintf(stderr, "%s enablehttp <networkservice> <domain> <port number>\n",
            argv[0]);
    fprintf(stderr, "%s enablehttps <networkservice> <domain> <port number>\n",
            argv[0]);
    fprintf(stderr, "%s disableauto <networkservice>\n", argv[0]);
    fprintf(stderr, "%s disablehttp <networkservice>\n", argv[0]);
    fprintf(stderr, "%s disablehttps <networkservice>\n", argv[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
je     118a <main+0x4a>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c0 <main+0x380>
cmpl   $0x4,-0x8(%rbp)
jne    11e8 <main+0xa8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe73(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e8 <main+0xa8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
lea    0xe58(%rip),%rdi
lea    0xe5b(%rip),%rsi
lea    0xe61(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14b9 <main+0x379>
cmpl   $0x5,-0x8(%rbp)
jne    1253 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe48(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1253 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r9
lea    0xdf2(%rip),%rdi
lea    0xdf5(%rip),%rsi
lea    0xe17(%rip),%rdx
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14b4 <main+0x374>
cmpl   $0x5,-0x8(%rbp)
jne    12be <main+0x17e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12be <main+0x17e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r9
lea    0xd87(%rip),%rdi
lea    0xd8a(%rip),%rsi
lea    0xdc5(%rip),%rdx
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14af <main+0x36f>
cmpl   $0x3,-0x8(%rbp)
jne    131b <main+0x1db>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    131b <main+0x1db>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xd2c(%rip),%rdi
lea    0xd2f(%rip),%rsi
lea    0xd89(%rip),%rdx
lea    0xd95(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14aa <main+0x36a>
cmpl   $0x3,-0x8(%rbp)
jne    1378 <main+0x238>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd6f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1378 <main+0x238>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xccf(%rip),%rdi
lea    0xcd2(%rip),%rsi
lea    0xd4f(%rip),%rdx
lea    0xd38(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14a5 <main+0x365>
cmpl   $0x3,-0x8(%rbp)
jne    13d5 <main+0x295>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd30(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13d5 <main+0x295>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xc72(%rip),%rdi
lea    0xc75(%rip),%rsi
lea    0xd11(%rip),%rdx
lea    0xcdb(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1060 <execl@plt>
jmp    14a0 <main+0x360>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bed(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bcf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xcf3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b75(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd29(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b57(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14a5 <main+0x365>
jmp    14aa <main+0x36a>
jmp    14af <main+0x36f>
jmp    14b4 <main+0x374>
jmp    14b9 <main+0x379>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <geteuid@plt>
test   %rax,%rax
je     117b <main+0x3b>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    139d <main+0x25d>
cmp    $0x3,%ebp
je     11cd <main+0x8d>
cmp    $0x5,%ebp
je     1232 <main+0xf2>
cmp    $0x4,%ebp
jne    1264 <main+0x124>
mov    0x8(%rbx),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1264 <main+0x124>
mov    0x10(%rbx),%rcx
mov    0x18(%rbx),%r8
lea    0xe67(%rip),%rdi
lea    0xe6a(%rip),%rsi
lea    0xe70(%rip),%rdx
jmp    1362 <main+0x222>
mov    0x8(%rbx),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12fc <main+0x1bc>
mov    0x8(%rbx),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1342 <main+0x202>
mov    0x8(%rbx),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1264 <main+0x124>
mov    0x10(%rbx),%rcx
lea    0xe02(%rip),%rdi
lea    0xe05(%rip),%rsi
lea    0xea1(%rip),%rdx
jmp    135b <main+0x21b>
mov    0x8(%rbx),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1317 <main+0x1d7>
mov    0x8(%rbx),%rdi
lea    0xe0b(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     136a <main+0x22a>
mov    0x2d75(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe71(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe62(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe74(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xebb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xed5(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    139d <main+0x25d>
mov    0x10(%rbx),%rcx
lea    0xd1a(%rip),%rdi
lea    0xd1d(%rip),%rsi
lea    0xd77(%rip),%rdx
jmp    135b <main+0x21b>
mov    0x10(%rbx),%rcx
mov    0x18(%rbx),%r8
mov    0x20(%rbx),%r9
movq   $0x0,(%rsp)
lea    0xcef(%rip),%rdi
lea    0xcf2(%rip),%rsi
lea    0xd14(%rip),%rdx
jmp    1393 <main+0x253>
mov    0x10(%rbx),%rcx
lea    0xcd4(%rip),%rdi
lea    0xcd7(%rip),%rsi
lea    0xd54(%rip),%rdx
lea    0xd3d(%rip),%r8
xor    %r14d,%r14d
xor    %r9d,%r9d
jmp    1396 <main+0x256>
mov    0x10(%rbx),%rcx
mov    0x18(%rbx),%r8
mov    0x20(%rbx),%r9
movq   $0x0,(%rsp)
lea    0xc9c(%rip),%rdi
lea    0xc9f(%rip),%rsi
lea    0xcda(%rip),%rdx
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <execl@plt>
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Must be run as root!\0A\00"
@.str.1 = [11 x i8] c"enableauto\00"
@.str.2 = [23 x i8] c"/usr/sbin/networksetup\00"
@.str.3 = [13 x i8] c"networksetup\00"
@.str.4 = [17 x i8] c"-setautoproxyurl\00"
@.str.5 = [11 x i8] c"enablehttp\00"
@.str.6 = [13 x i8] c"-setwebproxy\00"
@.str.7 = [12 x i8] c"enablehttps\00"
@.str.8 = [19 x i8] c"-setsecurewebproxy\00"
@.str.9 = [12 x i8] c"disableauto\00"
@.str.10 = [19 x i8] c"-setautoproxystate\00"
@.str.11 = [4 x i8] c"off\00"
@.str.12 = [12 x i8] c"disablehttp\00"
@.str.13 = [18 x i8] c"-setwebproxystate\00"
@.str.14 = [13 x i8] c"disablehttps\00"
@.str.15 = [24 x i8] c"-setsecurewebproxystate\00"
@.str.16 = [8 x i8] c"Usage:\0A\00"
@.str.17 = [38 x i8] c"%s enableauto <networkservice> <url>\0A\00"
@.str.18 = [55 x i8] c"%s enablehttp <networkservice> <domain> <port number>\0A\00"
@.str.19 = [56 x i8] c"%s enablehttps <networkservice> <domain> <port number>\0A\00"
@.str.20 = [33 x i8] c"%s disableauto <networkservice>\0A\00"
@.str.21 = [33 x i8] c"%s disablehttp <networkservice>\0A\00"
@.str.22 = [34 x i8] c"%s disablehttps <networkservice>\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 = call i64 (...) @geteuid()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %149
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 4
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 3
%26 = load i8*, i8** %25
%27 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %23, i8* %26, i8* null)
br label %148
28: ; preds = %14, %11
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 5
br i1 %30, label %31, label %48
31: ; preds = %28
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %48
37: ; preds = %31
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 3
%43 = load i8*, i8** %42
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 4
%46 = load i8*, i8** %45
%47 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %40, i8* %43, i8* %46, i8* null)
br label %147
48: ; preds = %31, %28
%49 = load i32, i32* %4
%50 = icmp eq i32 %49, 5
br i1 %50, label %51, label %68
51: ; preds = %48
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %68
57: ; preds = %51
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 2
%60 = load i8*, i8** %59
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 3
%63 = load i8*, i8** %62
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 4
%66 = load i8*, i8** %65
%67 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %60, i8* %63, i8* %66, i8* null)
br label %146
68: ; preds = %51, %48
%69 = load i32, i32* %4
%70 = icmp eq i32 %69, 3
br i1 %70, label %71, label %82
71: ; preds = %68
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 1
%74 = load i8*, i8** %73
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %82
77: ; preds = %71
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 2
%80 = load i8*, i8** %79
%81 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %145
82: ; preds = %71, %68
%83 = load i32, i32* %4
%84 = icmp eq i32 %83, 3
br i1 %84, label %85, label %96
85: ; preds = %82
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %85
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 2
%94 = load i8*, i8** %93
%95 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %144
96: ; preds = %85, %82
%97 = load i32, i32* %4
%98 = icmp eq i32 %97, 3
br i1 %98, label %99, label %110
99: ; preds = %96
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 1
%102 = load i8*, i8** %101
%103 = call i64 @strcmp(i8* %102, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %99
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 2
%108 = load i8*, i8** %107
%109 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %108, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %143
110: ; preds = %99, %96
%111 = load i32, i32* @stderr
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%113 = load i32, i32* @stderr
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 0
%116 = load i8*, i8** %115
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.17, i64 0, i64 0), i8* %116)
%118 = load i32, i32* @stderr
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 0
%121 = load i8*, i8** %120
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.18, i64 0, i64 0), i8* %121)
%123 = load i32, i32* @stderr
%124 = load i8**, i8*** %5
%125 = getelementptr inbounds i8*, i8** %124, i64 0
%126 = load i8*, i8** %125
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.19, i64 0, i64 0), i8* %126)
%128 = load i32, i32* @stderr
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 0
%131 = load i8*, i8** %130
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.20, i64 0, i64 0), i8* %131)
%133 = load i32, i32* @stderr
%134 = load i8**, i8*** %5
%135 = getelementptr inbounds i8*, i8** %134, i64 0
%136 = load i8*, i8** %135
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %136)
%138 = load i32, i32* @stderr
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 0
%141 = load i8*, i8** %140
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.22, i64 0, i64 0), i8* %141)
br label %143
143: ; preds = %110, %105
br label %144
144: ; preds = %143, %91
br label %145
145: ; preds = %144, %77
br label %146
146: ; preds = %145, %57
br label %147
147: ; preds = %146, %37
br label %148
148: ; preds = %147, %20
store i32 0, i32* %3
br label %149
149: ; preds = %148, %8
%150 = load i32, i32* %3
ret i32 %150
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Must be run as root!\0A\00"
@.str.1 = [11 x i8] c"enableauto\00"
@.str.2 = [23 x i8] c"/usr/sbin/networksetup\00"
@.str.3 = [13 x i8] c"networksetup\00"
@.str.4 = [17 x i8] c"-setautoproxyurl\00"
@.str.5 = [11 x i8] c"enablehttp\00"
@.str.6 = [13 x i8] c"-setwebproxy\00"
@.str.7 = [12 x i8] c"enablehttps\00"
@.str.8 = [19 x i8] c"-setsecurewebproxy\00"
@.str.9 = [12 x i8] c"disableauto\00"
@.str.10 = [19 x i8] c"-setautoproxystate\00"
@.str.11 = [4 x i8] c"off\00"
@.str.12 = [12 x i8] c"disablehttp\00"
@.str.13 = [18 x i8] c"-setwebproxystate\00"
@.str.14 = [13 x i8] c"disablehttps\00"
@.str.15 = [24 x i8] c"-setsecurewebproxystate\00"
@.str.16 = [8 x i8] c"Usage:\0A\00"
@.str.17 = [38 x i8] c"%s enableauto <networkservice> <url>\0A\00"
@.str.18 = [55 x i8] c"%s enablehttp <networkservice> <domain> <port number>\0A\00"
@.str.19 = [56 x i8] c"%s enablehttps <networkservice> <domain> <port number>\0A\00"
@.str.20 = [33 x i8] c"%s disableauto <networkservice>\0A\00"
@.str.21 = [33 x i8] c"%s disablehttp <networkservice>\0A\00"
@.str.22 = [34 x i8] c"%s disablehttps <networkservice>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @geteuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %91
8: ; preds = %2
switch i32 %0, label %70 [
i32 4, label %9
i32 5, label %20
i32 3, label %45
]
9: ; preds = %8
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %70
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %16, i8* %18, i8* null)
br label %91
20: ; preds = %8
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %20
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8*, i8** %1, i64 4
%31 = load i8*, i8** %30
%32 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %27, i8* %29, i8* %31, i8* null)
br label %91
33: ; preds = %20
%34 = load i8*, i8** %21
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %70
37: ; preds = %33
%38 = getelementptr inbounds i8*, i8** %1, i64 2
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8*, i8** %1, i64 3
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8*, i8** %1, i64 4
%43 = load i8*, i8** %42
%44 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %39, i8* %41, i8* %43, i8* null)
br label %91
45: ; preds = %8
%46 = getelementptr inbounds i8*, i8** %1, i64 1
%47 = load i8*, i8** %46
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %45
%51 = getelementptr inbounds i8*, i8** %1, i64 2
%52 = load i8*, i8** %51
%53 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %91
54: ; preds = %45
%55 = load i8*, i8** %46
%56 = tail call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = getelementptr inbounds i8*, i8** %1, i64 2
%60 = load i8*, i8** %59
%61 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %91
62: ; preds = %54
%63 = load i8*, i8** %46
%64 = tail call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = getelementptr inbounds i8*, i8** %1, i64 2
%68 = load i8*, i8** %67
%69 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %91
70: ; preds = %8, %9, %33, %62
%71 = load i32, i32* @stderr
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%73 = load i32, i32* @stderr
%74 = load i8*, i8** %1
%75 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.17, i64 0, i64 0), i8* %74)
%76 = load i32, i32* @stderr
%77 = load i8*, i8** %1
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.18, i64 0, i64 0), i8* %77)
%79 = load i32, i32* @stderr
%80 = load i8*, i8** %1
%81 = tail call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.19, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @stderr
%83 = load i8*, i8** %1
%84 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.20, i64 0, i64 0), i8* %83)
%85 = load i32, i32* @stderr
%86 = load i8*, i8** %1
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %86)
%88 = load i32, i32* @stderr
%89 = load i8*, i8** %1
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.22, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %14, %37, %58, %70, %66, %50, %25, %5
%92 = phi i32 [ 1, %5 ], [ 0, %25 ], [ 0, %50 ], [ 0, %66 ], [ 0, %70 ], [ 0, %58 ], [ 0, %37 ], [ 0, %14 ]
ret i32 %92
}