#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 AF_INET;
int AF_INET6;
int AF_UNSPEC;
int EXIT_SUCCESS;
int EX_USAGE;
int /*<<< orphan*/ errx(int, char *);
int getopt(int, char **, char const *);
int main_c(int, char *, char *, char *);
int main_d(int, int, int, int, char *, char *, char *);
char *optarg;
int /*<<< orphan*/ optopt;
int /*<<< orphan*/ print_usage(int, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ warnx(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  bool daemon = false;
  int net_fam = AF_UNSPEC;
  bool detach = false;
  bool safe = false;
  bool keep = false;
  char *rootdir = NULL;
  char *host = NULL;
  char *port = NULL;
  {
    int ch = 0;
    const char *opts = NULL;
    if (argc <= 1) {
    usage:
      print_usage(true, true);
      return (EX_USAGE);
    } else if (strcmp(argv[1], "-h") == 0) {
      print_usage(true, true);
      return (EXIT_SUCCESS);
    } else if (strcmp(argv[1], "c") == 0) {
      opts = ":h46r:a:p:";
      daemon = false;
    } else if (strcmp(argv[1], "d") == 0) {
      opts = ":h46dskr:a:p:";
      daemon = true;
    } else {
      goto usage;
    }
    while ((ch = getopt(argc - 1, argv + 1, opts)) != -1) {
      if (ch == '4')
        net_fam = net_fam == AF_INET6 ? AF_UNSPEC : AF_INET;
      else if (ch == '6')
        net_fam = net_fam == AF_INET ? AF_UNSPEC : AF_INET6;
      else if (ch == 'd')
        detach = true;
      else if (ch == 's')
        safe = true;
      else if (ch == 'k')
        keep = true;
      else if (ch == 'r') {
        if (rootdir != NULL)
          errx(EX_USAGE, "multiple -r arguments are not supported");
        rootdir = optarg;
      } else if (ch == 'a') {
        if (host != NULL)
          errx(EX_USAGE, "multiple -a arguments are not supported");
        host = optarg;
      } else if (ch == 'p') {
        if (port != NULL)
          errx(EX_USAGE, "multiple -p arguments are not supported");
        port = optarg;
      } else if (ch == 'h') {
        print_usage(!daemon, daemon);
        return (EXIT_SUCCESS);
      } else if (ch == ':') {
        warnx("argument -%c requires a parameter\n", optopt);
        goto ex_usage;
      } else if (ch == '?') {
        warnx("unrecognized flag or argument -%c\n", optopt);
        goto ex_usage;
      } else {
      ex_usage:
        print_usage(!daemon, daemon);
        return (EX_USAGE);
      }
    }
  }
  if (rootdir == NULL || port == NULL || (daemon == false && host == NULL)) {
    print_usage(!daemon, daemon);
    return (EX_USAGE);
  }
  return daemon ? main_d(detach, safe, keep, net_fam, rootdir, host, port)
                : main_c(net_fam, rootdir, host, port);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movq   $0x0,-0x50(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1201 <main+0x91>
jmp    11e4 <main+0x74>
mov    $0x1,%esi
mov    %esi,%edi
call   1090 <print_usage@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15d2 <main+0x462>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    123c <main+0xcc>
mov    $0x1,%esi
mov    %esi,%edi
call   1090 <print_usage@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15d2 <main+0x462>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1271 <main+0x101>
lea    0xda4(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    12b0 <main+0x140>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdec(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12a6 <main+0x136>
lea    0xd7a(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    12ab <main+0x13b>
jmp    11e4 <main+0x74>
jmp    12b0 <main+0x140>
jmp    12b5 <main+0x145>
jmp    12ba <main+0x14a>
jmp    12bf <main+0x14f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x50(%rbp),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
je     1530 <main+0x3c0>
cmpl   $0x34,-0x44(%rbp)
jne    1326 <main+0x1b6>
mov    -0x18(%rbp),%eax
mov    0x2cca(%rip),%rcx
cmp    (%rcx),%eax
jne    130f <main+0x19f>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    131b <main+0x1ab>
mov    0x2cca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    152b <main+0x3bb>
cmpl   $0x36,-0x44(%rbp)
jne    136a <main+0x1fa>
mov    -0x18(%rbp),%eax
mov    0x2ca6(%rip),%rcx
cmp    (%rcx),%eax
jne    1353 <main+0x1e3>
mov    0x2c8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
jmp    135f <main+0x1ef>
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1526 <main+0x3b6>
cmpl   $0x64,-0x44(%rbp)
jne    1380 <main+0x210>
movl   $0x1,-0x1c(%rbp)
jmp    1521 <main+0x3b1>
cmpl   $0x73,-0x44(%rbp)
jne    1396 <main+0x226>
movl   $0x1,-0x20(%rbp)
jmp    151c <main+0x3ac>
cmpl   $0x6b,-0x44(%rbp)
jne    13ac <main+0x23c>
movl   $0x1,-0x24(%rbp)
jmp    1517 <main+0x3a7>
cmpl   $0x72,-0x44(%rbp)
jne    13e9 <main+0x279>
cmpq   $0x0,-0x30(%rbp)
je     13d6 <main+0x266>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
lea    0xc4d(%rip),%rsi
call   1030 <errx@plt>
mov    0x2c1b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1512 <main+0x3a2>
cmpl   $0x61,-0x44(%rbp)
jne    1426 <main+0x2b6>
cmpq   $0x0,-0x38(%rbp)
je     1413 <main+0x2a3>
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
lea    0xc38(%rip),%rsi
call   1030 <errx@plt>
mov    0x2bde(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    150d <main+0x39d>
cmpl   $0x70,-0x44(%rbp)
jne    1463 <main+0x2f3>
cmpq   $0x0,-0x40(%rbp)
je     1450 <main+0x2e0>
mov    0x2b8e(%rip),%rax
mov    (%rax),%edi
lea    0xc23(%rip),%rsi
call   1030 <errx@plt>
mov    0x2ba1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    1508 <main+0x398>
cmpl   $0x68,-0x44(%rbp)
jne    1494 <main+0x324>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x14(%rbp),%esi
call   1090 <print_usage@plt>
mov    0x2b26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15d2 <main+0x462>
cmpl   $0x3a,-0x44(%rbp)
jne    14b8 <main+0x348>
mov    0x2b23(%rip),%rax
mov    (%rax),%esi
lea    0xbe8(%rip),%rdi
call   1040 <warnx@plt>
jmp    14e1 <main+0x371>
cmpl   $0x3f,-0x44(%rbp)
jne    14dc <main+0x36c>
mov    0x2aff(%rip),%rax
mov    (%rax),%esi
lea    0xbe7(%rip),%rdi
call   1040 <warnx@plt>
jmp    14e1 <main+0x371>
jmp    14e1 <main+0x371>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x14(%rbp),%esi
call   1090 <print_usage@plt>
mov    0x2ad2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15d2 <main+0x462>
jmp    150d <main+0x39d>
jmp    1512 <main+0x3a2>
jmp    1517 <main+0x3a7>
jmp    151c <main+0x3ac>
jmp    1521 <main+0x3b1>
jmp    1526 <main+0x3b6>
jmp    152b <main+0x3bb>
jmp    12bf <main+0x14f>
cmpq   $0x0,-0x30(%rbp)
je     155b <main+0x3eb>
cmpq   $0x0,-0x40(%rbp)
je     155b <main+0x3eb>
cmpl   $0x0,-0x14(%rbp)
jne    1582 <main+0x412>
cmpq   $0x0,-0x38(%rbp)
jne    1582 <main+0x412>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x14(%rbp),%esi
call   1090 <print_usage@plt>
mov    0x2a58(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15d2 <main+0x462>
cmpl   $0x0,-0x14(%rbp)
je     15b5 <main+0x445>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <main_d@plt>
mov    %eax,-0x5c(%rbp)
jmp    15cc <main+0x45c>
mov    -0x18(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   1070 <main_c@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x1,%edi
jg     119e <main+0x2e>
mov    $0x1,%edi
mov    $0x1,%esi
call   1090 <print_usage@plt>
mov    0x2e37(%rip),%rax
jmp    1225 <main+0xb5>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e2e(%rip),%rax
mov    (%rax),%r15d
mov    0x8(%rsi),%rdi
lea    0x101c(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     120f <main+0x9f>
add    $0x8,%rbx
mov    (%rbx),%rdi
lea    0x1007(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%r14
xor    %r12d,%r12d
test   %rax,%rax
je     1236 <main+0xc6>
mov    (%rbx),%rdi
lea    0x1056(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1183 <main+0x13>
mov    %r15d,0x8(%rsp)
mov    %r14,0x28(%rsp)
lea    0xfdf(%rip),%r15
movl   $0x1,0xc(%rsp)
jmp    124f <main+0xdf>
mov    $0x1,%edi
mov    $0x1,%esi
call   1090 <print_usage@plt>
mov    0x2d8b(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,0x8(%rsp)
mov    %r14,0x28(%rsp)
lea    0xf92(%rip),%r15
movl   $0x0,0xc(%rsp)
add    $0xffffffff,%ebp
lea    0xda7(%rip),%r14
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    1290 <main+0x120>
movl   $0x1,0x20(%rsp)
mov    %r13d,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r12d,%r13d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1080 <getopt@plt>
add    $0x1,%eax
cmp    $0x74,%eax
ja     13f0 <main+0x280>
mov    $0x1,%r12d
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x2d1e(%rip),%rax
mov    0x8(%rsp),%ecx
mov    0x2cf3(%rip),%rdx
cmp    (%rdx),%ecx
je     12e9 <main+0x179>
jmp    12f0 <main+0x180>
mov    0x2ce6(%rip),%rax
mov    0x8(%rsp),%ecx
mov    0x2cfb(%rip),%rdx
cmp    (%rdx),%ecx
jne    12f0 <main+0x180>
mov    0x2ce8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    %r13d,%r12d
jmp    1290 <main+0x120>
cmpq   $0x0,0x10(%rsp)
je     1318 <main+0x1a8>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
lea    0xf07(%rip),%rsi
call   1030 <errx@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
mov    %r13d,%r12d
jmp    1290 <main+0x120>
cmpq   $0x0,0x18(%rsp)
je     134c <main+0x1dc>
mov    0x2c92(%rip),%rax
mov    (%rax),%edi
lea    0xefb(%rip),%rsi
call   1030 <errx@plt>
mov    0x2ca5(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
mov    %r13d,%r12d
jmp    1290 <main+0x120>
cmpq   $0x0,0x30(%rsp)
je     1380 <main+0x210>
mov    0x2c5e(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
call   1030 <errx@plt>
mov    0x2c71(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x30(%rsp)
mov    %r13d,%r12d
jmp    1290 <main+0x120>
movl   $0x1,0x24(%rsp)
mov    %r13d,%r12d
jmp    1290 <main+0x120>
mov    0x30(%rsp),%r8
test   %r8,%r8
mov    0x28(%rsp),%rax
je     13cb <main+0x25b>
cmpq   $0x0,0x18(%rsp)
je     13cb <main+0x25b>
test   %rax,%rax
jne    141a <main+0x2aa>
cmpq   $0x0,0x10(%rsp)
jne    141a <main+0x2aa>
xor    %edi,%edi
test   %rax,%rax
jmp    13f8 <main+0x288>
lea    0xe91(%rip),%rdi
jmp    13e2 <main+0x272>
lea    0xeab(%rip),%rdi
mov    0x2bdf(%rip),%rax
mov    (%rax),%esi
call   1040 <warnx@plt>
xor    %edi,%edi
cmpq   $0x0,0x28(%rsp)
sete   %dil
mov    0xc(%rsp),%esi
jmp    118d <main+0x1d>
xor    %edi,%edi
cmpq   $0x0,0x28(%rsp)
sete   %dil
mov    0xc(%rsp),%esi
jmp    1219 <main+0xa9>
test   %rax,%rax
je     1446 <main+0x2d6>
mov    0x18(%rsp),%rax
mov    %rax,(%rsp)
mov    %r13d,%edi
mov    0x24(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%r9
call   1060 <main_d@plt>
jmp    1227 <main+0xb7>
mov    0x8(%rsp),%edi
mov    %r8,%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <main_c@plt>

LLVM IR (-O0):
@AF_UNSPEC = global i32 0
@EX_USAGE = global i32 0
@.str = [3 x i8] c"-h\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [11 x i8] c":h46r:a:p:\00"
@.str.3 = [2 x i8] c"d\00"
@.str.4 = [14 x i8] c":h46dskr:a:p:\00"
@AF_INET6 = global i32 0
@AF_INET = global i32 0
@.str.5 = [40 x i8] c"multiple -r arguments are not supported\00"
@optarg = global i8* null
@.str.6 = [40 x i8] c"multiple -a arguments are not supported\00"
@.str.7 = [40 x i8] c"multiple -p arguments are not supported\00"
@.str.8 = [35 x i8] c"argument -%c requires a parameter\0A\00"
@optopt = global i32 0
@.str.9 = [35 x i8] c"unrecognized flag or argument -%c\0A\00"
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 i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%16 = load i32, i32* @AF_UNSPEC
store i32 %16, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8* null, i8** %11
store i8* null, i8** %12
store i8* null, i8** %13
store i32 0, i32* %14
store i8* null, i8** %15
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 1
br i1 %18, label %19, label %23
19: ; preds = %2
br label %20
20: ; preds = %46, %19
%21 = call i32 @print_usage(i32 1, i32 1)
%22 = load i32, i32* @EX_USAGE
store i32 %22, i32* %3
br label %210
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = call i32 @print_usage(i32 1, i32 1)
%31 = load i32, i32* @EXIT_SUCCESS
store i32 %31, i32* %3
br label %210
32: ; preds = %23
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %32
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 0, i32* %6
br label %48
39: ; preds = %32
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %39
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8** %15
store i32 1, i32* %6
br label %47
46: ; preds = %39
br label %20
47: ; preds = %45
br label %48
48: ; preds = %47, %38
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
br label %51
51: ; preds = %169, %50
%52 = load i32, i32* %4
%53 = sub nsw i32 %52, 1
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %15
%57 = call i32 @getopt(i32 %53, i8** %55, i8* %56)
store i32 %57, i32* %14
%58 = icmp ne i32 %57, -1
br i1 %58, label %59, label %170
59: ; preds = %51
%60 = load i32, i32* %14
%61 = icmp eq i32 %60, 52
br i1 %61, label %62, label %72
62: ; preds = %59
%63 = load i32, i32* %7
%64 = load i32, i32* @AF_INET6
%65 = icmp eq i32 %63, %64
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = load i32, i32* @AF_UNSPEC
br label %70
68: ; preds = %62
%69 = load i32, i32* @AF_INET
br label %70
70: ; preds = %68, %66
%71 = phi i32 [ %67, %66 ], [ %69, %68 ]
store i32 %71, i32* %7
br label %169
72: ; preds = %59
%73 = load i32, i32* %14
%74 = icmp eq i32 %73, 54
br i1 %74, label %75, label %85
75: ; preds = %72
%76 = load i32, i32* %7
%77 = load i32, i32* @AF_INET
%78 = icmp eq i32 %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = load i32, i32* @AF_UNSPEC
br label %83
81: ; preds = %75
%82 = load i32, i32* @AF_INET6
br label %83
83: ; preds = %81, %79
%84 = phi i32 [ %80, %79 ], [ %82, %81 ]
store i32 %84, i32* %7
br label %168
85: ; preds = %72
%86 = load i32, i32* %14
%87 = icmp eq i32 %86, 100
br i1 %87, label %88, label %89
88: ; preds = %85
store i32 1, i32* %8
br label %167
89: ; preds = %85
%90 = load i32, i32* %14
%91 = icmp eq i32 %90, 115
br i1 %91, label %92, label %93
92: ; preds = %89
store i32 1, i32* %9
br label %166
93: ; preds = %89
%94 = load i32, i32* %14
%95 = icmp eq i32 %94, 107
br i1 %95, label %96, label %97
96: ; preds = %93
store i32 1, i32* %10
br label %165
97: ; preds = %93
%98 = load i32, i32* %14
%99 = icmp eq i32 %98, 114
br i1 %99, label %100, label %108
100: ; preds = %97
%101 = load i8*, i8** %11
%102 = icmp ne i8* %101, null
br i1 %102, label %103, label %106
103: ; preds = %100
%104 = load i32, i32* @EX_USAGE
%105 = call i32 @errx(i32 %104, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %106
106: ; preds = %103, %100
%107 = load i8*, i8** @optarg
store i8* %107, i8** %11
br label %164
108: ; preds = %97
%109 = load i32, i32* %14
%110 = icmp eq i32 %109, 97
br i1 %110, label %111, label %119
111: ; preds = %108
%112 = load i8*, i8** %12
%113 = icmp ne i8* %112, null
br i1 %113, label %114, label %117
114: ; preds = %111
%115 = load i32, i32* @EX_USAGE
%116 = call i32 @errx(i32 %115, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %117
117: ; preds = %114, %111
%118 = load i8*, i8** @optarg
store i8* %118, i8** %12
br label %163
119: ; preds = %108
%120 = load i32, i32* %14
%121 = icmp eq i32 %120, 112
br i1 %121, label %122, label %130
122: ; preds = %119
%123 = load i8*, i8** %13
%124 = icmp ne i8* %123, null
br i1 %124, label %125, label %128
125: ; preds = %122
%126 = load i32, i32* @EX_USAGE
%127 = call i32 @errx(i32 %126, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %128
128: ; preds = %125, %122
%129 = load i8*, i8** @optarg
store i8* %129, i8** %13
br label %162
130: ; preds = %119
%131 = load i32, i32* %14
%132 = icmp eq i32 %131, 104
br i1 %132, label %133, label %141
133: ; preds = %130
%134 = load i32, i32* %6
%135 = icmp ne i32 %134, 0
%136 = xor i1 %135, true
%137 = zext i1 %136 to i32
%138 = load i32, i32* %6
%139 = call i32 @print_usage(i32 %137, i32 %138)
%140 = load i32, i32* @EXIT_SUCCESS
store i32 %140, i32* %3
br label %210
141: ; preds = %130
%142 = load i32, i32* %14
%143 = icmp eq i32 %142, 58
br i1 %143, label %144, label %147
144: ; preds = %141
%145 = load i32, i32* @optopt
%146 = call i32 @warnx(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %145)
br label %154
147: ; preds = %141
%148 = load i32, i32* %14
%149 = icmp eq i32 %148, 63
br i1 %149, label %150, label %153
150: ; preds = %147
%151 = load i32, i32* @optopt
%152 = call i32 @warnx(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i32 %151)
br label %154
153: ; preds = %147
br label %154
154: ; preds = %153, %150, %144
%155 = load i32, i32* %6
%156 = icmp ne i32 %155, 0
%157 = xor i1 %156, true
%158 = zext i1 %157 to i32
%159 = load i32, i32* %6
%160 = call i32 @print_usage(i32 %158, i32 %159)
%161 = load i32, i32* @EX_USAGE
store i32 %161, i32* %3
br label %210
162: ; preds = %128
br label %163
163: ; preds = %162, %117
br label %164
164: ; preds = %163, %106
br label %165
165: ; preds = %164, %96
br label %166
166: ; preds = %165, %92
br label %167
167: ; preds = %166, %88
br label %168
168: ; preds = %167, %83
br label %169
169: ; preds = %168, %70
br label %51
170: ; preds = %51
%171 = load i8*, i8** %11
%172 = icmp eq i8* %171, null
br i1 %172, label %182, label %173
173: ; preds = %170
%174 = load i8*, i8** %13
%175 = icmp eq i8* %174, null
br i1 %175, label %182, label %176
176: ; preds = %173
%177 = load i32, i32* %6
%178 = icmp eq i32 %177, 0
br i1 %178, label %179, label %190
179: ; preds = %176
%180 = load i8*, i8** %12
%181 = icmp eq i8* %180, null
br i1 %181, label %182, label %190
182: ; preds = %179, %173, %170
%183 = load i32, i32* %6
%184 = icmp ne i32 %183, 0
%185 = xor i1 %184, true
%186 = zext i1 %185 to i32
%187 = load i32, i32* %6
%188 = call i32 @print_usage(i32 %186, i32 %187)
%189 = load i32, i32* @EX_USAGE
store i32 %189, i32* %3
br label %210
190: ; preds = %179, %176
%191 = load i32, i32* %6
%192 = icmp ne i32 %191, 0
br i1 %192, label %193, label %202
193: ; preds = %190
%194 = load i32, i32* %8
%195 = load i32, i32* %9
%196 = load i32, i32* %10
%197 = load i32, i32* %7
%198 = load i8*, i8** %11
%199 = load i8*, i8** %12
%200 = load i8*, i8** %13
%201 = call i32 @main_d(i32 %194, i32 %195, i32 %196, i32 %197, i8* %198, i8* %199, i8* %200)
br label %208
202: ; preds = %190
%203 = load i32, i32* %7
%204 = load i8*, i8** %11
%205 = load i8*, i8** %12
%206 = load i8*, i8** %13
%207 = call i32 @main_c(i32 %203, i8* %204, i8* %205, i8* %206)
br label %208
208: ; preds = %202, %193
%209 = phi i32 [ %201, %193 ], [ %207, %202 ]
store i32 %209, i32* %3
br label %210
210: ; preds = %208, %182, %154, %133, %29, %20
%211 = load i32, i32* %3
ret i32 %211
}

LLVM IR (-O2):
@AF_UNSPEC = global i32 0
@EX_USAGE = global i32 0
@.str = [3 x i8] c"-h\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [11 x i8] c":h46r:a:p:\00"
@.str.3 = [2 x i8] c"d\00"
@.str.4 = [14 x i8] c":h46dskr:a:p:\00"
@AF_INET6 = global i32 0
@AF_INET = global i32 0
@.str.5 = [40 x i8] c"multiple -r arguments are not supported\00"
@optarg = global i8* null
@.str.6 = [40 x i8] c"multiple -a arguments are not supported\00"
@.str.7 = [40 x i8] c"multiple -p arguments are not supported\00"
@.str.8 = [35 x i8] c"argument -%c requires a parameter\0A\00"
@optopt = global i32 0
@.str.9 = [35 x i8] c"unrecognized flag or argument -%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @AF_UNSPEC
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %8
5: ; preds = %20, %2
%6 = tail call i32 @print_usage(i32 1, i32 1)
%7 = load i32, i32* @EX_USAGE
br label %109
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = tail call i32 @print_usage(i32 1, i32 1)
%15 = load i32, i32* @EXIT_SUCCESS
br label %109
16: ; preds = %8
%17 = load i8*, i8** %9
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i8*, i8** %9
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %5
24: ; preds = %20, %16
%25 = phi i32 [ 0, %16 ], [ 1, %20 ]
%26 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), %16 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %20 ]
%27 = add nsw i32 %0, -1
br label %28
28: ; preds = %37, %24
%29 = phi i32 [ %3, %24 ], [ %38, %37 ]
%30 = phi i32 [ 0, %24 ], [ %39, %37 ]
%31 = phi i32 [ 0, %24 ], [ %40, %37 ]
%32 = phi i32 [ 0, %24 ], [ %41, %37 ]
%33 = phi i8* [ null, %24 ], [ %42, %37 ]
%34 = phi i8* [ null, %24 ], [ %43, %37 ]
%35 = phi i8* [ null, %24 ], [ %44, %37 ]
%36 = tail call i32 @getopt(i32 %27, i8** %9, i8* %26)
switch i32 %36, label %89 [
i32 -1, label %93
i32 52, label %45
i32 54, label %51
i32 100, label %37
i32 115, label %57
i32 107, label %58
i32 114, label %59
i32 97, label %66
i32 112, label %73
i32 104, label %80
i32 58, label %85
i32 63, label %84
]
37: ; preds = %28, %51, %57, %64, %78, %71, %58, %45
%38 = phi i32 [ %50, %45 ], [ %56, %51 ], [ %29, %57 ], [ %29, %58 ], [ %29, %64 ], [ %29, %71 ], [ %29, %78 ], [ %29, %28 ]
%39 = phi i32 [ %30, %45 ], [ %30, %51 ], [ %30, %57 ], [ %30, %58 ], [ %30, %64 ], [ %30, %71 ], [ %30, %78 ], [ 1, %28 ]
%40 = phi i32 [ %31, %45 ], [ %31, %51 ], [ 1, %57 ], [ %31, %58 ], [ %31, %64 ], [ %31, %71 ], [ %31, %78 ], [ %31, %28 ]
%41 = phi i32 [ %32, %45 ], [ %32, %51 ], [ %32, %57 ], [ 1, %58 ], [ %32, %64 ], [ %32, %71 ], [ %32, %78 ], [ %32, %28 ]
%42 = phi i8* [ %33, %45 ], [ %33, %51 ], [ %33, %57 ], [ %33, %58 ], [ %65, %64 ], [ %33, %71 ], [ %33, %78 ], [ %33, %28 ]
%43 = phi i8* [ %34, %45 ], [ %34, %51 ], [ %34, %57 ], [ %34, %58 ], [ %34, %64 ], [ %72, %71 ], [ %34, %78 ], [ %34, %28 ]
%44 = phi i8* [ %35, %45 ], [ %35, %51 ], [ %35, %57 ], [ %35, %58 ], [ %35, %64 ], [ %35, %71 ], [ %79, %78 ], [ %35, %28 ]
br label %28
45: ; preds = %28
%46 = load i32, i32* @AF_INET6
%47 = icmp eq i32 %29, %46
%48 = load i32, i32* @AF_UNSPEC
%49 = load i32, i32* @AF_INET
%50 = select i1 %47, i32 %48, i32 %49
br label %37
51: ; preds = %28
%52 = load i32, i32* @AF_INET
%53 = icmp eq i32 %29, %52
%54 = load i32, i32* @AF_UNSPEC
%55 = load i32, i32* @AF_INET6
%56 = select i1 %53, i32 %54, i32 %55
br label %37
57: ; preds = %28
br label %37
58: ; preds = %28
br label %37
59: ; preds = %28
%60 = icmp eq i8* %33, null
br i1 %60, label %64, label %61
61: ; preds = %59
%62 = load i32, i32* @EX_USAGE
%63 = tail call i32 @errx(i32 %62, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %61, %59
%65 = load i8*, i8** @optarg
br label %37
66: ; preds = %28
%67 = icmp eq i8* %34, null
br i1 %67, label %71, label %68
68: ; preds = %66
%69 = load i32, i32* @EX_USAGE
%70 = tail call i32 @errx(i32 %69, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %71
71: ; preds = %68, %66
%72 = load i8*, i8** @optarg
br label %37
73: ; preds = %28
%74 = icmp eq i8* %35, null
br i1 %74, label %78, label %75
75: ; preds = %73
%76 = load i32, i32* @EX_USAGE
%77 = tail call i32 @errx(i32 %76, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %78
78: ; preds = %75, %73
%79 = load i8*, i8** @optarg
br label %37
80: ; preds = %28
%81 = zext i1 %19 to i32
%82 = tail call i32 @print_usage(i32 %81, i32 %25)
%83 = load i32, i32* @EXIT_SUCCESS
br label %109
84: ; preds = %28
br label %85
85: ; preds = %28, %84
%86 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), %84 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), %28 ]
%87 = load i32, i32* @optopt
%88 = tail call i32 @warnx(i8* %86, i32 %87)
br label %89
89: ; preds = %28, %85
%90 = zext i1 %19 to i32
%91 = tail call i32 @print_usage(i32 %90, i32 %25)
%92 = load i32, i32* @EX_USAGE
br label %109
93: ; preds = %28
%94 = icmp eq i8* %33, null
%95 = icmp eq i8* %35, null
%96 = select i1 %94, i1 true, i1 %95
br i1 %96, label %100, label %97
97: ; preds = %93
%98 = icmp eq i8* %34, null
%99 = select i1 %19, i1 %98, i1 false
br i1 %99, label %100, label %104
100: ; preds = %97, %93
%101 = zext i1 %19 to i32
%102 = tail call i32 @print_usage(i32 %101, i32 %25)
%103 = load i32, i32* @EX_USAGE
br label %109
104: ; preds = %97
br i1 %19, label %107, label %105
105: ; preds = %104
%106 = tail call i32 @main_d(i32 %30, i32 %31, i32 %32, i32 %29, i8* %33, i8* %34, i8* %35)
br label %109
107: ; preds = %104
%108 = tail call i32 @main_c(i32 %29, i8* %33, i8* %34, i8* %35)
br label %109
109: ; preds = %89, %80, %13, %5, %105, %107, %100
%110 = phi i32 [ %103, %100 ], [ %106, %105 ], [ %108, %107 ], [ %92, %89 ], [ %83, %80 ], [ %15, %13 ], [ %7, %5 ]
ret i32 %110
}