#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);
int /*<<< orphan*/ 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")) {
      print_usage(true, true);
      return (EXIT_SUCCESS);
    } else if (!strcmp(argv[1], "c")) {
      opts = ":h46r:a:p:";
      daemon = false;
    } else if (!strcmp(argv[1], "d")) {
      opts = ":h46dskr:a:p:";
      daemon = true;
    } else {
      goto usage;
    }
    while ((ch = getopt(argc - 1, argv + 1, opts)) != -1) {
      switch (ch) {
      case '4':
        net_fam = net_fam == AF_INET6 ? AF_UNSPEC : AF_INET;
        break;
      case '6':
        net_fam = net_fam == AF_INET ? AF_UNSPEC : AF_INET6;
        break;
      case 'd':
        detach = true;
        break;
      case 's':
        safe = true;
        break;
      case 'k':
        keep = true;
        break;
      case 'r':
        if (rootdir)
          errx(EX_USAGE, "multiple -r arguments are not supported");
        rootdir = optarg;
        break;
      case 'a':
        if (host)
          errx(EX_USAGE, "multiple -a arguments are not supported");
        host = optarg;
        break;
      case 'p':
        if (port)
          errx(EX_USAGE, "multiple -p arguments are not supported");
        port = optarg;
        break;
      case 'h':
        print_usage(!daemon, daemon);
        return (EXIT_SUCCESS);
      case ':':
        warnx("argument -%c requires a parameter\n", optopt);
        goto ex_usage;
      case '?':
        warnx("unrecognized flag or argument -%c\n", optopt);
        goto ex_usage;
      default:
      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    1567 <main+0x3f7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xef0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    123b <main+0xcb>
mov    $0x1,%esi
mov    %esi,%edi
call   1090 <print_usage@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1567 <main+0x3f7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    126f <main+0xff>
lea    0xea6(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    12ad <main+0x13d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeee(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12a3 <main+0x133>
lea    0xe7d(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    12a8 <main+0x138>
jmp    11e4 <main+0x74>
jmp    12ad <main+0x13d>
jmp    12b2 <main+0x142>
jmp    12b7 <main+0x147>
jmp    12bc <main+0x14c>
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     14c5 <main+0x355>
mov    -0x44(%rbp),%eax
add    $0xffffffcc,%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
sub    $0x3f,%eax
ja     1494 <main+0x324>
mov    -0x58(%rbp),%rax
lea    0xd01(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%eax
mov    0x2cae(%rip),%rcx
cmp    (%rcx),%eax
jne    132b <main+0x1bb>
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
jmp    1337 <main+0x1c7>
mov    0x2cae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    14c0 <main+0x350>
mov    -0x18(%rbp),%eax
mov    0x2c94(%rip),%rcx
cmp    (%rcx),%eax
jne    1365 <main+0x1f5>
mov    0x2c7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
jmp    1371 <main+0x201>
mov    0x2c54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    14c0 <main+0x350>
movl   $0x1,-0x1c(%rbp)
jmp    14c0 <main+0x350>
movl   $0x1,-0x20(%rbp)
jmp    14c0 <main+0x350>
movl   $0x1,-0x24(%rbp)
jmp    14c0 <main+0x350>
cmpq   $0x0,-0x30(%rbp)
je     13c0 <main+0x250>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
lea    0xd63(%rip),%rsi
call   1030 <errx@plt>
mov    0x2c31(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    14c0 <main+0x350>
cmpq   $0x0,-0x38(%rbp)
je     13f3 <main+0x283>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
lea    0xd58(%rip),%rsi
call   1030 <errx@plt>
mov    0x2bfe(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    14c0 <main+0x350>
cmpq   $0x0,-0x40(%rbp)
je     1426 <main+0x2b6>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
call   1030 <errx@plt>
mov    0x2bcb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    14c0 <main+0x350>
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    0x2b5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1567 <main+0x3f7>
mov    0x2b61(%rip),%rax
mov    (%rax),%esi
lea    0xd26(%rip),%rdi
call   1040 <warnx@plt>
jmp    1499 <main+0x329>
mov    0x2b47(%rip),%rax
mov    (%rax),%esi
lea    0xd2f(%rip),%rdi
call   1040 <warnx@plt>
jmp    1499 <main+0x329>
jmp    1499 <main+0x329>
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    0x2b1a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1567 <main+0x3f7>
jmp    12bc <main+0x14c>
cmpq   $0x0,-0x30(%rbp)
je     14f0 <main+0x380>
cmpq   $0x0,-0x40(%rbp)
je     14f0 <main+0x380>
cmpl   $0x0,-0x14(%rbp)
jne    1517 <main+0x3a7>
cmpq   $0x0,-0x38(%rbp)
jne    1517 <main+0x3a7>
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    0x2ac3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1567 <main+0x3f7>
cmpl   $0x0,-0x14(%rbp)
je     154a <main+0x3da>
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,-0x64(%rbp)
jmp    1561 <main+0x3f1>
mov    -0x18(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   1070 <main_c@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%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    1221 <main+0xb1>
mov    %rsi,%r13
mov    %edi,%ebp
mov    0x2e2e(%rip),%rax
mov    (%rax),%r15d
mov    0x8(%rsi),%rbx
lea    0x101c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     120b <main+0x9b>
lea    0x100c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
mov    %eax,%r14d
xor    %r12d,%r12d
test   %eax,%eax
je     1232 <main+0xc2>
lea    0x105c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1183 <main+0x13>
mov    %r15d,0xc(%rsp)
mov    %r14d,0x14(%rsp)
lea    0xfe3(%rip),%rbx
movl   $0x1,0x10(%rsp)
jmp    124b <main+0xdb>
mov    $0x1,%edi
mov    $0x1,%esi
call   1090 <print_usage@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,0xc(%rsp)
mov    %r14d,0x14(%rsp)
lea    0xf96(%rip),%rbx
movl   $0x0,0x10(%rsp)
add    $0x8,%r13
add    $0xffffffff,%ebp
lea    0xda7(%rip),%r14
movl   $0x0,0x2c(%rsp)
movl   $0x0,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    1290 <main+0x120>
movl   $0x1,0x28(%rsp)
mov    %r15d,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r12d,%r15d
mov    %ebp,%edi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1080 <getopt@plt>
add    $0x1,%eax
cmp    $0x74,%eax
ja     13ed <main+0x27d>
mov    $0x1,%r12d
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x2d1e(%rip),%rax
mov    0xc(%rsp),%ecx
mov    0x2cf3(%rip),%rdx
cmp    (%rdx),%ecx
je     12e9 <main+0x179>
jmp    12f0 <main+0x180>
mov    0x2ce6(%rip),%rax
mov    0xc(%rsp),%ecx
mov    0x2cfb(%rip),%rdx
cmp    (%rdx),%ecx
jne    12f0 <main+0x180>
mov    0x2ce8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    %r15d,%r12d
jmp    1290 <main+0x120>
cmpq   $0x0,0x18(%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,0x18(%rsp)
mov    %r15d,%r12d
jmp    1290 <main+0x120>
cmpq   $0x0,0x20(%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,0x20(%rsp)
mov    %r15d,%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    %r15d,%r12d
jmp    1290 <main+0x120>
movl   $0x1,0x2c(%rsp)
mov    %r15d,%r12d
jmp    1290 <main+0x120>
mov    0x30(%rsp),%r8
test   %r8,%r8
mov    0x14(%rsp),%eax
je     13c9 <main+0x259>
cmpq   $0x0,0x20(%rsp)
je     13c9 <main+0x259>
test   %eax,%eax
jne    1415 <main+0x2a5>
cmpq   $0x0,0x18(%rsp)
jne    1415 <main+0x2a5>
xor    %edi,%edi
test   %eax,%eax
jmp    13f4 <main+0x284>
lea    0xe94(%rip),%rdi
jmp    13df <main+0x26f>
lea    0xeae(%rip),%rdi
mov    0x2be2(%rip),%rax
mov    (%rax),%esi
call   1040 <warnx@plt>
xor    %edi,%edi
cmpl   $0x0,0x14(%rsp)
sete   %dil
mov    0x10(%rsp),%esi
jmp    118d <main+0x1d>
xor    %edi,%edi
cmpl   $0x0,0x14(%rsp)
sete   %dil
mov    0x10(%rsp),%esi
jmp    1215 <main+0xa5>
test   %eax,%eax
je     1440 <main+0x2d0>
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
mov    %r15d,%edi
mov    0x2c(%rsp),%esi
mov    0x28(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x18(%rsp),%r9
call   1060 <main_d@plt>
jmp    1223 <main+0xb3>
mov    0xc(%rsp),%edi
mov    %r8,%rsi
mov    0x18(%rsp),%rdx
mov    0x20(%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 %172
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %32, label %29
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 %172
32: ; preds = %23
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
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 i32 @strcmp(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
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 = %131, %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 %132
59: ; preds = %51
%60 = load i32, i32* %14
switch i32 %60, label %122 [
i32 52, label %61
i32 54, label %71
i32 100, label %81
i32 115, label %82
i32 107, label %83
i32 114, label %84
i32 97, label %92
i32 112, label %100
i32 104, label %108
i32 58, label %116
i32 63, label %119
]
61: ; preds = %59
%62 = load i32, i32* %7
%63 = load i32, i32* @AF_INET6
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = load i32, i32* @AF_UNSPEC
br label %69
67: ; preds = %61
%68 = load i32, i32* @AF_INET
br label %69
69: ; preds = %67, %65
%70 = phi i32 [ %66, %65 ], [ %68, %67 ]
store i32 %70, i32* %7
br label %131
71: ; preds = %59
%72 = load i32, i32* %7
%73 = load i32, i32* @AF_INET
%74 = icmp eq i32 %72, %73
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = load i32, i32* @AF_UNSPEC
br label %79
77: ; preds = %71
%78 = load i32, i32* @AF_INET6
br label %79
79: ; preds = %77, %75
%80 = phi i32 [ %76, %75 ], [ %78, %77 ]
store i32 %80, i32* %7
br label %131
81: ; preds = %59
store i32 1, i32* %8
br label %131
82: ; preds = %59
store i32 1, i32* %9
br label %131
83: ; preds = %59
store i32 1, i32* %10
br label %131
84: ; preds = %59
%85 = load i8*, i8** %11
%86 = icmp ne i8* %85, null
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load i32, i32* @EX_USAGE
%89 = call i32 @errx(i32 %88, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %90
90: ; preds = %87, %84
%91 = load i8*, i8** @optarg
store i8* %91, i8** %11
br label %131
92: ; preds = %59
%93 = load i8*, i8** %12
%94 = icmp ne i8* %93, null
br i1 %94, label %95, label %98
95: ; preds = %92
%96 = load i32, i32* @EX_USAGE
%97 = call i32 @errx(i32 %96, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %98
98: ; preds = %95, %92
%99 = load i8*, i8** @optarg
store i8* %99, i8** %12
br label %131
100: ; preds = %59
%101 = load i8*, i8** %13
%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.7, i64 0, i64 0))
br label %106
106: ; preds = %103, %100
%107 = load i8*, i8** @optarg
store i8* %107, i8** %13
br label %131
108: ; preds = %59
%109 = load i32, i32* %6
%110 = icmp ne i32 %109, 0
%111 = xor i1 %110, true
%112 = zext i1 %111 to i32
%113 = load i32, i32* %6
%114 = call i32 @print_usage(i32 %112, i32 %113)
%115 = load i32, i32* @EXIT_SUCCESS
store i32 %115, i32* %3
br label %172
116: ; preds = %59
%117 = load i32, i32* @optopt
%118 = call i32 @warnx(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %117)
br label %123
119: ; preds = %59
%120 = load i32, i32* @optopt
%121 = call i32 @warnx(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i32 %120)
br label %123
122: ; preds = %59
br label %123
123: ; preds = %122, %119, %116
%124 = load i32, i32* %6
%125 = icmp ne i32 %124, 0
%126 = xor i1 %125, true
%127 = zext i1 %126 to i32
%128 = load i32, i32* %6
%129 = call i32 @print_usage(i32 %127, i32 %128)
%130 = load i32, i32* @EX_USAGE
store i32 %130, i32* %3
br label %172
131: ; preds = %106, %98, %90, %83, %82, %81, %79, %69
br label %51
132: ; preds = %51
%133 = load i8*, i8** %11
%134 = icmp eq i8* %133, null
br i1 %134, label %144, label %135
135: ; preds = %132
%136 = load i8*, i8** %13
%137 = icmp eq i8* %136, null
br i1 %137, label %144, label %138
138: ; preds = %135
%139 = load i32, i32* %6
%140 = icmp eq i32 %139, 0
br i1 %140, label %141, label %152
141: ; preds = %138
%142 = load i8*, i8** %12
%143 = icmp eq i8* %142, null
br i1 %143, label %144, label %152
144: ; preds = %141, %135, %132
%145 = load i32, i32* %6
%146 = icmp ne i32 %145, 0
%147 = xor i1 %146, true
%148 = zext i1 %147 to i32
%149 = load i32, i32* %6
%150 = call i32 @print_usage(i32 %148, i32 %149)
%151 = load i32, i32* @EX_USAGE
store i32 %151, i32* %3
br label %172
152: ; preds = %141, %138
%153 = load i32, i32* %6
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %164
155: ; preds = %152
%156 = load i32, i32* %8
%157 = load i32, i32* %9
%158 = load i32, i32* %10
%159 = load i32, i32* %7
%160 = load i8*, i8** %11
%161 = load i8*, i8** %12
%162 = load i8*, i8** %13
%163 = call i32 @main_d(i32 %156, i32 %157, i32 %158, i32 %159, i8* %160, i8* %161, i8* %162)
br label %170
164: ; preds = %152
%165 = load i32, i32* %7
%166 = load i8*, i8** %11
%167 = load i8*, i8** %12
%168 = load i8*, i8** %13
%169 = call i32 @main_c(i32 %165, i8* %166, i8* %167, i8* %168)
br label %170
170: ; preds = %164, %155
%171 = phi i32 [ %163, %155 ], [ %169, %164 ]
store i32 %171, i32* %3
br label %172
172: ; preds = %170, %144, %123, %108, %29, %20
%173 = load i32, i32* %3
ret i32 %173
}

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 = %19, %2
%6 = tail call i32 @print_usage(i32 1, i32 1)
%7 = load i32, i32* @EX_USAGE
br label %107
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %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 %107
16: ; preds = %8
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %5
22: ; preds = %19, %16
%23 = phi i32 [ 0, %16 ], [ 1, %19 ]
%24 = 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), %19 ]
%25 = add nsw i32 %0, -1
br label %26
26: ; preds = %35, %22
%27 = phi i32 [ %3, %22 ], [ %36, %35 ]
%28 = phi i32 [ 0, %22 ], [ %37, %35 ]
%29 = phi i32 [ 0, %22 ], [ %38, %35 ]
%30 = phi i32 [ 0, %22 ], [ %39, %35 ]
%31 = phi i8* [ null, %22 ], [ %40, %35 ]
%32 = phi i8* [ null, %22 ], [ %41, %35 ]
%33 = phi i8* [ null, %22 ], [ %42, %35 ]
%34 = tail call i32 @getopt(i32 %25, i8** %9, i8* %24)
switch i32 %34, label %87 [
i32 -1, label %91
i32 52, label %43
i32 54, label %49
i32 100, label %35
i32 115, label %55
i32 107, label %56
i32 114, label %57
i32 97, label %64
i32 112, label %71
i32 104, label %78
i32 58, label %83
i32 63, label %82
]
35: ; preds = %26, %76, %69, %62, %56, %55, %49, %43
%36 = phi i32 [ %27, %76 ], [ %27, %69 ], [ %27, %62 ], [ %27, %56 ], [ %27, %55 ], [ %54, %49 ], [ %48, %43 ], [ %27, %26 ]
%37 = phi i32 [ %28, %76 ], [ %28, %69 ], [ %28, %62 ], [ %28, %56 ], [ %28, %55 ], [ %28, %49 ], [ %28, %43 ], [ 1, %26 ]
%38 = phi i32 [ %29, %76 ], [ %29, %69 ], [ %29, %62 ], [ %29, %56 ], [ 1, %55 ], [ %29, %49 ], [ %29, %43 ], [ %29, %26 ]
%39 = phi i32 [ %30, %76 ], [ %30, %69 ], [ %30, %62 ], [ 1, %56 ], [ %30, %55 ], [ %30, %49 ], [ %30, %43 ], [ %30, %26 ]
%40 = phi i8* [ %31, %76 ], [ %31, %69 ], [ %63, %62 ], [ %31, %56 ], [ %31, %55 ], [ %31, %49 ], [ %31, %43 ], [ %31, %26 ]
%41 = phi i8* [ %32, %76 ], [ %70, %69 ], [ %32, %62 ], [ %32, %56 ], [ %32, %55 ], [ %32, %49 ], [ %32, %43 ], [ %32, %26 ]
%42 = phi i8* [ %77, %76 ], [ %33, %69 ], [ %33, %62 ], [ %33, %56 ], [ %33, %55 ], [ %33, %49 ], [ %33, %43 ], [ %33, %26 ]
br label %26
43: ; preds = %26
%44 = load i32, i32* @AF_INET6
%45 = icmp eq i32 %27, %44
%46 = load i32, i32* @AF_UNSPEC
%47 = load i32, i32* @AF_INET
%48 = select i1 %45, i32 %46, i32 %47
br label %35
49: ; preds = %26
%50 = load i32, i32* @AF_INET
%51 = icmp eq i32 %27, %50
%52 = load i32, i32* @AF_UNSPEC
%53 = load i32, i32* @AF_INET6
%54 = select i1 %51, i32 %52, i32 %53
br label %35
55: ; preds = %26
br label %35
56: ; preds = %26
br label %35
57: ; preds = %26
%58 = icmp eq i8* %31, null
br i1 %58, label %62, label %59
59: ; preds = %57
%60 = load i32, i32* @EX_USAGE
%61 = tail call i32 @errx(i32 %60, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %62
62: ; preds = %59, %57
%63 = load i8*, i8** @optarg
br label %35
64: ; preds = %26
%65 = icmp eq i8* %32, null
br i1 %65, label %69, label %66
66: ; preds = %64
%67 = load i32, i32* @EX_USAGE
%68 = tail call i32 @errx(i32 %67, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %69
69: ; preds = %66, %64
%70 = load i8*, i8** @optarg
br label %35
71: ; preds = %26
%72 = icmp eq i8* %33, null
br i1 %72, label %76, label %73
73: ; preds = %71
%74 = load i32, i32* @EX_USAGE
%75 = tail call i32 @errx(i32 %74, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %76
76: ; preds = %73, %71
%77 = load i8*, i8** @optarg
br label %35
78: ; preds = %26
%79 = zext i1 %18 to i32
%80 = tail call i32 @print_usage(i32 %79, i32 %23)
%81 = load i32, i32* @EXIT_SUCCESS
br label %107
82: ; preds = %26
br label %83
83: ; preds = %26, %82
%84 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), %82 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), %26 ]
%85 = load i32, i32* @optopt
%86 = tail call i32 @warnx(i8* %84, i32 %85)
br label %87
87: ; preds = %26, %83
%88 = zext i1 %18 to i32
%89 = tail call i32 @print_usage(i32 %88, i32 %23)
%90 = load i32, i32* @EX_USAGE
br label %107
91: ; preds = %26
%92 = icmp eq i8* %31, null
%93 = icmp eq i8* %33, null
%94 = select i1 %92, i1 true, i1 %93
br i1 %94, label %98, label %95
95: ; preds = %91
%96 = icmp eq i8* %32, null
%97 = select i1 %18, i1 %96, i1 false
br i1 %97, label %98, label %102
98: ; preds = %95, %91
%99 = zext i1 %18 to i32
%100 = tail call i32 @print_usage(i32 %99, i32 %23)
%101 = load i32, i32* @EX_USAGE
br label %107
102: ; preds = %95
br i1 %18, label %105, label %103
103: ; preds = %102
%104 = tail call i32 @main_d(i32 %28, i32 %29, i32 %30, i32 %27, i8* %31, i8* %32, i8* %33)
br label %107
105: ; preds = %102
%106 = tail call i32 @main_c(i32 %27, i8* %31, i8* %32, i8* %33)
br label %107
107: ; preds = %13, %78, %87, %5, %103, %105, %98
%108 = phi i32 [ %101, %98 ], [ %104, %103 ], [ %106, %105 ], [ %15, %13 ], [ %81, %78 ], [ %90, %87 ], [ %7, %5 ]
ret i32 %108
}