#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 */
struct option {
  char *member_0;
  int member_1;
  int /*<<< orphan*/ name;
  int /*<<< orphan*/ member_3;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ autodctl_usage();
int /*<<< orphan*/ exit(int);
int getopt_long(int, char **, char *, struct option *, int *);
char *optarg;
int /*<<< orphan*/ show_configuration(char *);
int /*<<< orphan*/ show_version();
int /*<<< orphan*/ start_daemons(char *, int, int);
int /*<<< orphan*/ stop_daemons(char *, int);
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int main(int argc, char **argv) {
  int c;
  int mode = 0;
  int debug = 0;
  int show_conf = 0;
  int programs = 0;
  char *filename = NULL;
  while (1) {
    int option_index = 0;
    static struct option long_options[] = {
        {"start", 0, 0, 0},     {"stop", 0, 0, 0},    {"debug", 0, 0, 0},
        {"config", 1, 0, 0},    {"all", 0, 0, 0},     {"process", 0, 0, 0},
        {"sshkey", 0, 0, 0},    {"runner", 0, 0, 0},  {"help", 0, 0, 0},
        {"show-conf", 0, 0, 0}, {"version", 0, 0, 0}, {0, 0, 0, 0}};
    c = getopt_long(argc, argv, "", long_options, &option_index);
    if (c == -1) {
      break;
    }
    switch (c) {
    case 0:
      if (!strcmp(long_options[option_index].name, "start") && !mode)
        mode = 1;
      else if (!strcmp(long_options[option_index].name, "stop") && !mode)
        mode = 2;
      else if (!strcmp(long_options[option_index].name, "debug") && !debug)
        debug = 1;
      else if (!strcmp(long_options[option_index].name, "config"))
        filename = optarg;
      else if (!strcmp(long_options[option_index].name, "all"))
        programs |= 2 | 1 | 4;
      else if (!strcmp(long_options[option_index].name, "process"))
        programs |= 1;
      else if (!strcmp(long_options[option_index].name, "sshkey"))
        programs |= 2;
      else if (!strcmp(long_options[option_index].name, "runner"))
        programs |= 4;
      else if (!strcmp(long_options[option_index].name, "version")) {
        show_version();
        exit(EXIT_SUCCESS);
      } else if (!strcmp(long_options[option_index].name, "show-conf")) {
        show_conf = 1;
      } else {
        autodctl_usage();
        exit(EXIT_SUCCESS);
      }
      break;
    default:
      autodctl_usage();
      exit(EXIT_SUCCESS);
    }
  }
  if (show_conf) {
    if (filename == NULL) {
      autodctl_usage();
      exit(EXIT_SUCCESS);
    }
    show_configuration(filename);
    exit(EXIT_SUCCESS);
  }
  if (!mode) {
    autodctl_usage();
    exit(EXIT_SUCCESS);
  }
  if (programs == 0) {
    autodctl_usage();
    exit(EXIT_SUCCESS);
  }
  if (mode == 1) {
    if (filename == NULL) {
      autodctl_usage();
      exit(EXIT_SUCCESS);
    }
    start_daemons(filename, programs, debug);
  } else if (mode == 2) {
    if (filename == NULL) {
      autodctl_usage();
      exit(EXIT_SUCCESS);
    }
    stop_daemons(filename, programs);
  }
  return (EXIT_SUCCESS);
}


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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe71(%rip),%rdx
lea    0x2e9a(%rip),%rcx
lea    -0x34(%rbp),%r8
call   1050 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    11f1 <main+0x71>
jmp    14b4 <main+0x334>
mov    -0x14(%rbp),%eax
test   %eax,%eax
jne    149a <main+0x31a>
jmp    1201 <main+0x81>
movslq -0x34(%rbp),%rcx
lea    0x2e64(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xde3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1241 <main+0xc1>
cmpl   $0x0,-0x18(%rbp)
jne    1241 <main+0xc1>
movl   $0x1,-0x18(%rbp)
jmp    1495 <main+0x315>
movslq -0x34(%rbp),%rcx
lea    0x2e24(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xda9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1281 <main+0x101>
cmpl   $0x0,-0x18(%rbp)
jne    1281 <main+0x101>
movl   $0x2,-0x18(%rbp)
jmp    1490 <main+0x310>
movslq -0x34(%rbp),%rcx
lea    0x2de4(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xd6e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12c1 <main+0x141>
cmpl   $0x0,-0x1c(%rbp)
jne    12c1 <main+0x141>
movl   $0x1,-0x1c(%rbp)
jmp    148b <main+0x30b>
movslq -0x34(%rbp),%rcx
lea    0x2da4(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xd34(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12fe <main+0x17e>
mov    0x2d06(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1486 <main+0x306>
movslq -0x34(%rbp),%rcx
lea    0x2d67(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xcfe(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1336 <main+0x1b6>
mov    -0x24(%rbp),%eax
or     $0x7,%eax
mov    %eax,-0x24(%rbp)
jmp    1481 <main+0x301>
movslq -0x34(%rbp),%rcx
lea    0x2d2f(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xcca(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    136e <main+0x1ee>
mov    -0x24(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    147c <main+0x2fc>
movslq -0x34(%rbp),%rcx
lea    0x2cf7(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xc9a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13a6 <main+0x226>
mov    -0x24(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1477 <main+0x2f7>
movslq -0x34(%rbp),%rcx
lea    0x2cbf(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xc69(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13de <main+0x25e>
mov    -0x24(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x24(%rbp)
jmp    1472 <main+0x2f2>
movslq -0x34(%rbp),%rcx
lea    0x2c87(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xc47(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    141d <main+0x29d>
mov    $0x0,%al
call   1030 <show_version@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
movslq -0x34(%rbp),%rcx
lea    0x2c48(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
lea    0xbfe(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1453 <main+0x2d3>
movl   $0x1,-0x20(%rbp)
jmp    1468 <main+0x2e8>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    146d <main+0x2ed>
jmp    1472 <main+0x2f2>
jmp    1477 <main+0x2f7>
jmp    147c <main+0x2fc>
jmp    1481 <main+0x301>
jmp    1486 <main+0x306>
jmp    148b <main+0x30b>
jmp    1490 <main+0x310>
jmp    1495 <main+0x315>
jmp    14af <main+0x32f>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2b30(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    11ba <main+0x3a>
cmpl   $0x0,-0x20(%rbp)
je     14f5 <main+0x375>
cmpq   $0x0,-0x30(%rbp)
jne    14de <main+0x35e>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2b01(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x30(%rbp),%rdi
call   10a0 <show_configuration@plt>
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1514 <main+0x394>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2acb(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1533 <main+0x3b3>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2aac(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
cmpl   $0x1,-0x18(%rbp)
jne    1571 <main+0x3f1>
cmpq   $0x0,-0x30(%rbp)
jne    155d <main+0x3dd>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2a82(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1090 <start_daemons@plt>
jmp    15ac <main+0x42c>
cmpl   $0x2,-0x18(%rbp)
jne    15a7 <main+0x427>
cmpq   $0x0,-0x30(%rbp)
jne    159b <main+0x41b>
mov    $0x0,%al
call   1060 <autodctl_usage@plt>
mov    0x2a44(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <stop_daemons@plt>
jmp    15ac <main+0x42c>
mov    0x2a25(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %r12d,%r12d
lea    0xea3(%rip),%r13
lea    0x2ecc(%rip),%r14
lea    0xc(%rsp),%r15
movl   $0x0,0x14(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x10(%rsp)
xor    %eax,%eax
jmp    11da <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2e21(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    11f6 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%r12d
movl   $0x0,0xc(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1050 <getopt_long@plt>
test   %eax,%eax
jne    13c0 <main+0x240>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xdd2(%rip),%rsi
call   1070 <strcmp@plt>
or     %r12d,%eax
je     11f0 <main+0x70>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xdb9(%rip),%rsi
call   1070 <strcmp@plt>
or     %r12d,%eax
je     1380 <main+0x200>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd9b(%rip),%rsi
call   1070 <strcmp@plt>
or     0x14(%rsp),%eax
je     138b <main+0x20b>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd7d(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     11d0 <main+0x50>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd62(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1398 <main+0x218>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd44(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13a2 <main+0x222>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd2a(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13ac <main+0x22c>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd0f(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13b6 <main+0x236>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xd03(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1444 <main+0x2c4>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
mov    0xc(%r14,%rax,8),%edi
lea    0xcd7(%rip),%rsi
call   1070 <strcmp@plt>
movl   $0x1,0x24(%rsp)
test   %eax,%eax
je     11f6 <main+0x76>
jmp    1423 <main+0x2a3>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%r12d
jmp    11f6 <main+0x76>
movl   $0x1,0x14(%rsp)
jmp    11f6 <main+0x76>
orl    $0x7,0x10(%rsp)
jmp    11f6 <main+0x76>
orl    $0x1,0x10(%rsp)
jmp    11f6 <main+0x76>
orl    $0x2,0x10(%rsp)
jmp    11f6 <main+0x76>
orl    $0x4,0x10(%rsp)
jmp    11f6 <main+0x76>
cmp    $0xffffffff,%eax
jne    1423 <main+0x2a3>
cmpl   $0x0,0x24(%rsp)
mov    0x10(%rsp),%esi
jne    141b <main+0x29b>
test   %r12d,%r12d
je     1423 <main+0x2a3>
test   %esi,%esi
je     1423 <main+0x2a3>
cmp    $0x1,%r12d
jne    13f4 <main+0x274>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     1423 <main+0x2a3>
mov    0x14(%rsp),%edx
call   1090 <start_daemons@plt>
jmp    1403 <main+0x283>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     1423 <main+0x2a3>
call   1040 <stop_daemons@plt>
mov    0x2bce(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmpq   $0x0,0x18(%rsp)
jne    1438 <main+0x2b8>
xor    %eax,%eax
call   1060 <autodctl_usage@plt>
mov    0x2ba7(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x18(%rsp),%rdi
call   10a0 <show_configuration@plt>
jmp    142a <main+0x2aa>
xor    %eax,%eax
call   1030 <show_version@plt>
jmp    142a <main+0x2aa>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i32, i32, i32 }
@main.long_options = internal global [12 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i32 1, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"start\00"
@.str.1 = [5 x i8] c"stop\00"
@.str.2 = [6 x i8] c"debug\00"
@.str.3 = [7 x i8] c"config\00"
@.str.4 = [4 x i8] c"all\00"
@.str.5 = [8 x i8] c"process\00"
@.str.6 = [7 x i8] c"sshkey\00"
@.str.7 = [7 x i8] c"runner\00"
@.str.8 = [5 x i8] c"help\00"
@.str.9 = [10 x i8] c"show-conf\00"
@.str.10 = [8 x i8] c"version\00"
@.str.11 = [1 x i8] zeroinitializer
@optarg = global i8* null
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8* null, i8** %11
br label %13
13: ; preds = %2, %151
store i32 0, i32* %12
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt_long(i32 %14, i8** %15, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), %struct.option* getelementptr inbounds ([12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %12)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %13
br label %152
20: ; preds = %13
%21 = load i32, i32* %6
switch i32 %21, label %147 [
i32 0, label %22
]
22: ; preds = %20
%23 = load i32, i32* %12
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %24
%26 = getelementptr inbounds %struct.option, %struct.option* %25, i32 0, i32 2
%27 = load i32, i32* %26
%28 = call i32 @strcmp(i32 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %22
%31 = load i32, i32* %7
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %30
store i32 1, i32* %7
br label %146
34: ; preds = %30, %22
%35 = load i32, i32* %12
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %36
%38 = getelementptr inbounds %struct.option, %struct.option* %37, i32 0, i32 2
%39 = load i32, i32* %38
%40 = call i32 @strcmp(i32 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %46, label %42
42: ; preds = %34
%43 = load i32, i32* %7
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %42
store i32 2, i32* %7
br label %145
46: ; preds = %42, %34
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %48
%50 = getelementptr inbounds %struct.option, %struct.option* %49, i32 0, i32 2
%51 = load i32, i32* %50
%52 = call i32 @strcmp(i32 %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %58, label %54
54: ; preds = %46
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %54
store i32 1, i32* %8
br label %144
58: ; preds = %54, %46
%59 = load i32, i32* %12
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %60
%62 = getelementptr inbounds %struct.option, %struct.option* %61, i32 0, i32 2
%63 = load i32, i32* %62
%64 = call i32 @strcmp(i32 %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %58
%67 = load i8*, i8** @optarg
store i8* %67, i8** %11
br label %143
68: ; preds = %58
%69 = load i32, i32* %12
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %70
%72 = getelementptr inbounds %struct.option, %struct.option* %71, i32 0, i32 2
%73 = load i32, i32* %72
%74 = call i32 @strcmp(i32 %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%75 = icmp ne i32 %74, 0
br i1 %75, label %79, label %76
76: ; preds = %68
%77 = load i32, i32* %10
%78 = or i32 %77, 7
store i32 %78, i32* %10
br label %142
79: ; preds = %68
%80 = load i32, i32* %12
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %81
%83 = getelementptr inbounds %struct.option, %struct.option* %82, i32 0, i32 2
%84 = load i32, i32* %83
%85 = call i32 @strcmp(i32 %84, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%86 = icmp ne i32 %85, 0
br i1 %86, label %90, label %87
87: ; preds = %79
%88 = load i32, i32* %10
%89 = or i32 %88, 1
store i32 %89, i32* %10
br label %141
90: ; preds = %79
%91 = load i32, i32* %12
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %92
%94 = getelementptr inbounds %struct.option, %struct.option* %93, i32 0, i32 2
%95 = load i32, i32* %94
%96 = call i32 @strcmp(i32 %95, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%97 = icmp ne i32 %96, 0
br i1 %97, label %101, label %98
98: ; preds = %90
%99 = load i32, i32* %10
%100 = or i32 %99, 2
store i32 %100, i32* %10
br label %140
101: ; preds = %90
%102 = load i32, i32* %12
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %103
%105 = getelementptr inbounds %struct.option, %struct.option* %104, i32 0, i32 2
%106 = load i32, i32* %105
%107 = call i32 @strcmp(i32 %106, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%108 = icmp ne i32 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %101
%110 = load i32, i32* %10
%111 = or i32 %110, 4
store i32 %111, i32* %10
br label %139
112: ; preds = %101
%113 = load i32, i32* %12
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %114
%116 = getelementptr inbounds %struct.option, %struct.option* %115, i32 0, i32 2
%117 = load i32, i32* %116
%118 = call i32 @strcmp(i32 %117, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%119 = icmp ne i32 %118, 0
br i1 %119, label %124, label %120
120: ; preds = %112
%121 = call i32 (...) @show_version()
%122 = load i32, i32* @EXIT_SUCCESS
%123 = call i32 @exit(i32 %122)
unreachable
124: ; preds = %112
%125 = load i32, i32* %12
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %126
%128 = getelementptr inbounds %struct.option, %struct.option* %127, i32 0, i32 2
%129 = load i32, i32* %128
%130 = call i32 @strcmp(i32 %129, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%131 = icmp ne i32 %130, 0
br i1 %131, label %133, label %132
132: ; preds = %124
store i32 1, i32* %9
br label %137
133: ; preds = %124
%134 = call i32 (...) @autodctl_usage()
%135 = load i32, i32* @EXIT_SUCCESS
%136 = call i32 @exit(i32 %135)
unreachable
137: ; preds = %132
br label %138
138: ; preds = %137
br label %139
139: ; preds = %138, %109
br label %140
140: ; preds = %139, %98
br label %141
141: ; preds = %140, %87
br label %142
142: ; preds = %141, %76
br label %143
143: ; preds = %142, %66
br label %144
144: ; preds = %143, %57
br label %145
145: ; preds = %144, %45
br label %146
146: ; preds = %145, %33
br label %151
147: ; preds = %20
%148 = call i32 (...) @autodctl_usage()
%149 = load i32, i32* @EXIT_SUCCESS
%150 = call i32 @exit(i32 %149)
unreachable
151: ; preds = %146
br label %13
152: ; preds = %19
%153 = load i32, i32* %9
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %167
155: ; preds = %152
%156 = load i8*, i8** %11
%157 = icmp eq i8* %156, null
br i1 %157, label %158, label %162
158: ; preds = %155
%159 = call i32 (...) @autodctl_usage()
%160 = load i32, i32* @EXIT_SUCCESS
%161 = call i32 @exit(i32 %160)
unreachable
162: ; preds = %155
%163 = load i8*, i8** %11
%164 = call i32 @show_configuration(i8* %163)
%165 = load i32, i32* @EXIT_SUCCESS
%166 = call i32 @exit(i32 %165)
unreachable
167: ; preds = %152
%168 = load i32, i32* %7
%169 = icmp ne i32 %168, 0
br i1 %169, label %174, label %170
170: ; preds = %167
%171 = call i32 (...) @autodctl_usage()
%172 = load i32, i32* @EXIT_SUCCESS
%173 = call i32 @exit(i32 %172)
unreachable
174: ; preds = %167
%175 = load i32, i32* %10
%176 = icmp eq i32 %175, 0
br i1 %176, label %177, label %181
177: ; preds = %174
%178 = call i32 (...) @autodctl_usage()
%179 = load i32, i32* @EXIT_SUCCESS
%180 = call i32 @exit(i32 %179)
unreachable
181: ; preds = %174
%182 = load i32, i32* %7
%183 = icmp eq i32 %182, 1
br i1 %183, label %184, label %196
184: ; preds = %181
%185 = load i8*, i8** %11
%186 = icmp eq i8* %185, null
br i1 %186, label %187, label %191
187: ; preds = %184
%188 = call i32 (...) @autodctl_usage()
%189 = load i32, i32* @EXIT_SUCCESS
%190 = call i32 @exit(i32 %189)
unreachable
191: ; preds = %184
%192 = load i8*, i8** %11
%193 = load i32, i32* %10
%194 = load i32, i32* %8
%195 = call i32 @start_daemons(i8* %192, i32 %193, i32 %194)
br label %211
196: ; preds = %181
%197 = load i32, i32* %7
%198 = icmp eq i32 %197, 2
br i1 %198, label %199, label %210
199: ; preds = %196
%200 = load i8*, i8** %11
%201 = icmp eq i8* %200, null
br i1 %201, label %202, label %206
202: ; preds = %199
%203 = call i32 (...) @autodctl_usage()
%204 = load i32, i32* @EXIT_SUCCESS
%205 = call i32 @exit(i32 %204)
unreachable
206: ; preds = %199
%207 = load i8*, i8** %11
%208 = load i32, i32* %10
%209 = call i32 @stop_daemons(i8* %207, i32 %208)
br label %210
210: ; preds = %206, %196
br label %211
211: ; preds = %210, %191
%212 = load i32, i32* @EXIT_SUCCESS
ret i32 %212
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i32, i32, i32 }
@main.long_options = internal global [12 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i32 1, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i32 0, i32 0), i32 0, i32 0, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"start\00"
@.str.1 = [5 x i8] c"stop\00"
@.str.2 = [6 x i8] c"debug\00"
@.str.3 = [7 x i8] c"config\00"
@.str.4 = [4 x i8] c"all\00"
@.str.5 = [8 x i8] c"process\00"
@.str.6 = [7 x i8] c"sshkey\00"
@.str.7 = [7 x i8] c"runner\00"
@.str.8 = [5 x i8] c"help\00"
@.str.9 = [10 x i8] c"show-conf\00"
@.str.10 = [8 x i8] c"version\00"
@.str.11 = [1 x i8] zeroinitializer
@optarg = global i8* null
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %109, %2
%6 = phi i32 [ 0, %2 ], [ %110, %109 ]
%7 = phi i32 [ 0, %2 ], [ %111, %109 ]
%8 = phi i32 [ 0, %2 ], [ %112, %109 ]
%9 = phi i32 [ 0, %2 ], [ %113, %109 ]
%10 = phi i8* [ null, %2 ], [ %114, %109 ]
store i32 0, i32* %3
%11 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), %struct.option* getelementptr inbounds ([12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
switch i32 %11, label %105 [
i32 -1, label %115
i32 0, label %12
]
12: ; preds = %5
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %14, i32 2
%16 = load i32, i32* %15
%17 = call i32 @strcmp(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
%19 = icmp ne i32 %6, 0
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %21, label %109
21: ; preds = %12
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %23, i32 2
%25 = load i32, i32* %24
%26 = call i32 @strcmp(i32 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
%28 = select i1 %27, i1 true, i1 %19
br i1 %28, label %29, label %109
29: ; preds = %21
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %31, i32 2
%33 = load i32, i32* %32
%34 = call i32 @strcmp(i32 %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
%36 = icmp ne i32 %7, 0
%37 = select i1 %35, i1 true, i1 %36
br i1 %37, label %38, label %109
38: ; preds = %29
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %40, i32 2
%42 = load i32, i32* %41
%43 = call i32 @strcmp(i32 %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %38
%46 = load i8*, i8** @optarg
br label %109
47: ; preds = %38
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %49, i32 2
%51 = load i32, i32* %50
%52 = call i32 @strcmp(i32 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %47
%55 = or i32 %9, 7
br label %109
56: ; preds = %47
%57 = load i32, i32* %3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %58, i32 2
%60 = load i32, i32* %59
%61 = call i32 @strcmp(i32 %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %56
%64 = or i32 %9, 1
br label %109
65: ; preds = %56
%66 = load i32, i32* %3
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %67, i32 2
%69 = load i32, i32* %68
%70 = call i32 @strcmp(i32 %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = or i32 %9, 2
br label %109
74: ; preds = %65
%75 = load i32, i32* %3
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %76, i32 2
%78 = load i32, i32* %77
%79 = call i32 @strcmp(i32 %78, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %74
%82 = or i32 %9, 4
br label %109
83: ; preds = %74
%84 = load i32, i32* %3
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %85, i32 2
%87 = load i32, i32* %86
%88 = call i32 @strcmp(i32 %87, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %83
%91 = call i32 (...) @show_version()
%92 = load i32, i32* @EXIT_SUCCESS
%93 = call i32 @exit(i32 %92)
unreachable
94: ; preds = %83
%95 = load i32, i32* %3
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [12 x %struct.option], [12 x %struct.option]* @main.long_options, i64 0, i64 %96, i32 2
%98 = load i32, i32* %97
%99 = call i32 @strcmp(i32 %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%100 = icmp eq i32 %99, 0
br i1 %100, label %109, label %101
101: ; preds = %94
%102 = call i32 (...) @autodctl_usage()
%103 = load i32, i32* @EXIT_SUCCESS
%104 = call i32 @exit(i32 %103)
unreachable
105: ; preds = %5
%106 = call i32 (...) @autodctl_usage()
%107 = load i32, i32* @EXIT_SUCCESS
%108 = call i32 @exit(i32 %107)
unreachable
109: ; preds = %45, %63, %81, %72, %54, %12, %21, %29, %94
%110 = phi i32 [ %6, %81 ], [ %6, %72 ], [ %6, %63 ], [ %6, %54 ], [ %6, %45 ], [ 1, %12 ], [ 2, %21 ], [ %6, %29 ], [ %6, %94 ]
%111 = phi i32 [ %7, %81 ], [ %7, %72 ], [ %7, %63 ], [ %7, %54 ], [ %7, %45 ], [ %7, %12 ], [ %7, %21 ], [ 1, %29 ], [ %7, %94 ]
%112 = phi i32 [ %8, %81 ], [ %8, %72 ], [ %8, %63 ], [ %8, %54 ], [ %8, %45 ], [ %8, %12 ], [ %8, %21 ], [ %8, %29 ], [ 1, %94 ]
%113 = phi i32 [ %82, %81 ], [ %73, %72 ], [ %64, %63 ], [ %55, %54 ], [ %9, %45 ], [ %9, %12 ], [ %9, %21 ], [ %9, %29 ], [ %9, %94 ]
%114 = phi i8* [ %10, %81 ], [ %10, %72 ], [ %10, %63 ], [ %10, %54 ], [ %46, %45 ], [ %10, %12 ], [ %10, %21 ], [ %10, %29 ], [ %10, %94 ]
br label %5
115: ; preds = %5
%116 = icmp eq i32 %8, 0
br i1 %116, label %127, label %117
117: ; preds = %115
%118 = icmp eq i8* %10, null
br i1 %118, label %119, label %123
119: ; preds = %117
%120 = call i32 (...) @autodctl_usage()
%121 = load i32, i32* @EXIT_SUCCESS
%122 = call i32 @exit(i32 %121)
unreachable
123: ; preds = %117
%124 = call i32 @show_configuration(i8* %10)
%125 = load i32, i32* @EXIT_SUCCESS
%126 = call i32 @exit(i32 %125)
unreachable
127: ; preds = %115
%128 = icmp eq i32 %6, 0
br i1 %128, label %129, label %133
129: ; preds = %127
%130 = call i32 (...) @autodctl_usage()
%131 = load i32, i32* @EXIT_SUCCESS
%132 = call i32 @exit(i32 %131)
unreachable
133: ; preds = %127
%134 = icmp eq i32 %9, 0
br i1 %134, label %135, label %139
135: ; preds = %133
%136 = call i32 (...) @autodctl_usage()
%137 = load i32, i32* @EXIT_SUCCESS
%138 = call i32 @exit(i32 %137)
unreachable
139: ; preds = %133
%140 = icmp eq i32 %6, 1
%141 = icmp eq i8* %10, null
br i1 %140, label %142, label %149
142: ; preds = %139
br i1 %141, label %143, label %147
143: ; preds = %142
%144 = call i32 (...) @autodctl_usage()
%145 = load i32, i32* @EXIT_SUCCESS
%146 = call i32 @exit(i32 %145)
unreachable
147: ; preds = %142
%148 = call i32 @start_daemons(i8* %10, i32 %9, i32 %7)
br label %156
149: ; preds = %139
br i1 %141, label %150, label %154
150: ; preds = %149
%151 = call i32 (...) @autodctl_usage()
%152 = load i32, i32* @EXIT_SUCCESS
%153 = call i32 @exit(i32 %152)
unreachable
154: ; preds = %149
%155 = call i32 @stop_daemons(i8* %10, i32 %9)
br label %156
156: ; preds = %154, %147
%157 = load i32, i32* @EXIT_SUCCESS
ret i32 %157
}