#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*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
scalar_t__ _dispatch(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int _open_stream(int, char **);
int /*<<< orphan*/ _usage(char *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(int);
char *optarg;
int optind;
int optopt;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int tun_alloc(char *);
int main(int argc, char **argv) {
  int c;
  int stream_fd = -1;
  int iface_fd = -1;
  while ((c = getopt(argc, argv, "hI:")) >= 0) {
    switch (c) {
    case 'h':
      _usage(argv[0]);
      return 0;
    case 'I':
      iface_fd = tun_alloc(optarg);
      if (iface_fd < 0) {
        perror("Could not open TUN interface");
        return 1;
      }
      break;
    case '?':
      switch (optopt) {
      case 'I':
        fprintf(stderr, "Option -%c requires an argument", optopt);
        break;
      default:
        if (isprint(optopt)) {
          fprintf(stderr, "Unknown option '-%c'\n", optopt);
        } else {
          fprintf(stderr, "Unknown option character \\%02x\n", optopt);
        }
        break;
      }
      _usage(argv[0]);
      return 1;
    default:
      abort();
    }
  }
  if ((argc - optind) < 1) {
    fputs("Serial or TCP connection required\n", stderr);
    _usage(argv[0]);
    return 1;
  }
  stream_fd = _open_stream(argc - optind, &argv[optind]);
  if (stream_fd < 0) {
    perror("Could not open serial or TCP connection");
    return 1;
  }
  if (iface_fd < 0) {
    iface_fd = tun_alloc("sl0");
    if (iface_fd < 0) {
      perror("Could not open TUN interface");
      return 1;
    }
  }
  while ((stream_fd < 0) ||
         (_dispatch(iface_fd, stream_fd, STDIN_FILENO, STDOUT_FILENO) < 0)) {
    fprintf(stderr, "Reconnecting %s ... ", argv[optind]);
    stream_fd = _open_stream(argc - optind, &argv[optind]);
    if (stream_fd < 0) {
      perror("");
    } else {
      fputs("Success\n", stderr);
    }
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe1e(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     133b <main+0x18b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x3f,%eax
je     127a <main+0xca>
jmp    1207 <main+0x57>
mov    -0x20(%rbp),%eax
sub    $0x49,%eax
je     1241 <main+0x91>
jmp    1218 <main+0x68>
mov    -0x20(%rbp),%eax
sub    $0x68,%eax
jne    132f <main+0x17f>
jmp    1229 <main+0x79>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    14eb <main+0x33b>
mov    0x2db0(%rip),%rax
mov    (%rax),%rdi
call   1060 <tun_alloc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1275 <main+0xc5>
lea    0xda0(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14eb <main+0x33b>
jmp    1336 <main+0x186>
mov    0x2d57(%rip),%rax
mov    (%rax),%eax
sub    $0x49,%eax
jne    12b6 <main+0x106>
jmp    1291 <main+0xe1>
mov    0x2d28(%rip),%rax
mov    (%rax),%edi
mov    0x2d37(%rip),%rax
mov    (%rax),%edx
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1317 <main+0x167>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
call   1090 <isprint@plt>
cmp    $0x0,%eax
je     12f2 <main+0x142>
mov    0x2cec(%rip),%rax
mov    (%rax),%edi
mov    0x2cfb(%rip),%rax
mov    (%rax),%edx
lea    0xd5b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1312 <main+0x162>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
mov    0x2cd6(%rip),%rax
mov    (%rax),%edx
lea    0xd4c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1317 <main+0x167>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14eb <main+0x33b>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11d4 <main+0x24>
mov    -0x8(%rbp),%eax
mov    0x2c8b(%rip),%rcx
sub    (%rcx),%eax
cmp    $0x1,%eax
jge    137d <main+0x1cd>
mov    0x2c69(%rip),%rax
mov    (%rax),%esi
lea    0xd17(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14eb <main+0x33b>
mov    -0x8(%rbp),%edi
mov    0x2c49(%rip),%rax
sub    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2c3c(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1070 <_open_stream@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    13c8 <main+0x218>
lea    0xce3(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14eb <main+0x33b>
cmpl   $0x0,-0x1c(%rbp)
jge    1408 <main+0x258>
lea    0xce9(%rip),%rdi
call   1060 <tun_alloc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1403 <main+0x253>
lea    0xc12(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14eb <main+0x33b>
jmp    1408 <main+0x258>
jmp    140d <main+0x25d>
mov    $0x1,%al
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x21(%rbp)
jl     1443 <main+0x293>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x2b8f(%rip),%rax
mov    (%rax),%edx
mov    0x2bb6(%rip),%rax
mov    (%rax),%ecx
call   10c0 <_dispatch@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1453 <main+0x2a3>
jmp    14e4 <main+0x334>
mov    0x2b66(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x2b69(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x8(%rbp),%edi
mov    0x2b4a(%rip),%rax
sub    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2b3d(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1070 <_open_stream@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    14c0 <main+0x310>
lea    0xba0(%rip),%rdi
call   10a0 <perror@plt>
jmp    14d5 <main+0x325>
mov    0x2af9(%rip),%rax
mov    (%rax),%esi
lea    0xc0b(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x2,%edi
call   10d0 <sleep@plt>
jmp    140d <main+0x25d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xe38(%rip),%rdx
call   10b0 <getopt@plt>
test   %eax,%eax
js     122d <main+0x7d>
mov    0x2e20(%rip),%r12
lea    0xe21(%rip),%r15
nop
cmp    $0x49,%eax
jne    120c <main+0x5c>
mov    (%r12),%rdi
call   1060 <tun_alloc@plt>
test   %eax,%eax
js     1398 <main+0x1e8>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   10b0 <getopt@plt>
test   %eax,%eax
jns    11e0 <main+0x30>
jmp    1232 <main+0x82>
cmp    $0x3f,%eax
je     131c <main+0x16c>
cmp    $0x68,%eax
jne    13a6 <main+0x1f6>
mov    (%rbx),%rdi
call   1040 <_usage@plt>
xor    %eax,%eax
jmp    137b <main+0x1cb>
mov    $0xffffffff,%ebp
mov    0x2d97(%rip),%r13
movslq 0x0(%r13),%rax
mov    %r14d,%edi
sub    %eax,%edi
jle    1305 <main+0x155>
lea    (%rbx,%rax,8),%rsi
call   1070 <_open_stream@plt>
test   %eax,%eax
js     138a <main+0x1da>
mov    %eax,%r12d
test   %ebp,%ebp
jns    1276 <main+0xc6>
lea    0xe5b(%rip),%rdi
call   1060 <tun_alloc@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1398 <main+0x1e8>
mov    0x2d43(%rip),%r15
jmp    12cb <main+0x11b>
nop
mov    (%r15),%edi
movslq 0x0(%r13),%rax
mov    (%rbx,%rax,8),%rdx
lea    0xe34(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
movslq 0x0(%r13),%rax
mov    %r14d,%edi
sub    %eax,%edi
lea    (%rbx,%rax,8),%rsi
call   1070 <_open_stream@plt>
mov    %eax,%r12d
test   %eax,%eax
js     12f3 <main+0x143>
mov    (%r15),%esi
lea    0xe1f(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x2,%edi
call   10d0 <sleep@plt>
test   %r12d,%r12d
js     1280 <main+0xd0>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edx
mov    0x2d08(%rip),%rax
mov    (%rax),%ecx
mov    %ebp,%edi
mov    %r12d,%esi
call   10c0 <_dispatch@plt>
test   %rax,%rax
js     1280 <main+0xd0>
jmp    1301 <main+0x151>
lea    0xd5c(%rip),%rdi
call   10a0 <perror@plt>
jmp    12c1 <main+0x111>
xor    %eax,%eax
jmp    137b <main+0x1cb>
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
lea    0xd62(%rip),%rdi
call   1050 <fputs@plt>
jmp    136e <main+0x1be>
mov    0x2cb5(%rip),%rax
mov    (%rax),%ebp
cmp    $0x49,%ebp
jne    1341 <main+0x191>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
lea    0xce7(%rip),%rsi
mov    $0x49,%edx
jmp    1367 <main+0x1b7>
mov    %ebp,%edi
call   1090 <isprint@plt>
mov    0x2c71(%rip),%rcx
mov    (%rcx),%edi
test   %eax,%eax
je     135e <main+0x1ae>
lea    0xce5(%rip),%rsi
jmp    1365 <main+0x1b5>
lea    0xcf2(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%rdi
call   1040 <_usage@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd09(%rip),%rdi
call   10a0 <perror@plt>
jmp    1376 <main+0x1c6>
lea    0xc65(%rip),%rdi
call   10a0 <perror@plt>
jmp    1376 <main+0x1c6>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"hI:\00"
@optarg = global i8* null
@.str.1 = [29 x i8] c"Could not open TUN interface\00"
@optopt = global i32 0
@stderr = global i32 0
@.str.2 = [32 x i8] c"Option -%c requires an argument\00"
@.str.3 = [22 x i8] c"Unknown option '-%c'\0A\00"
@.str.4 = [32 x i8] c"Unknown option character \\%02x\0A\00"
@optind = global i32 0
@.str.5 = [35 x i8] c"Serial or TCP connection required\0A\00"
@.str.6 = [40 x i8] c"Could not open serial or TCP connection\00"
@.str.7 = [4 x i8] c"sl0\00"
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@.str.8 = [21 x i8] c"Reconnecting %s ... \00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [9 x i8] c"Success\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %7
store i32 -1, i32* %8
br label %9
9: ; preds = %55, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %56
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %53 [
i32 104, label %16
i32 73, label %21
i32 63, label %29
]
16: ; preds = %14
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @_usage(i8* %19)
store i32 0, i32* %3
br label %130
21: ; preds = %14
%22 = load i8*, i8** @optarg
%23 = call i32 @tun_alloc(i8* %22)
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %130
28: ; preds = %21
br label %55
29: ; preds = %14
%30 = load i32, i32* @optopt
switch i32 %30, label %35 [
i32 73, label %31
]
31: ; preds = %29
%32 = load i32, i32* @stderr
%33 = load i32, i32* @optopt
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %33)
br label %48
35: ; preds = %29
%36 = load i32, i32* @optopt
%37 = call i32 @isprint(i32 %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load i32, i32* @stderr
%41 = load i32, i32* @optopt
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %47
43: ; preds = %35
%44 = load i32, i32* @stderr
%45 = load i32, i32* @optopt
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %43, %39
br label %48
48: ; preds = %47, %31
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 0
%51 = load i8*, i8** %50
%52 = call i32 @_usage(i8* %51)
store i32 1, i32* %3
br label %130
53: ; preds = %14
%54 = call i32 (...) @abort()
unreachable
55: ; preds = %28
br label %9
56: ; preds = %9
%57 = load i32, i32* %4
%58 = load i32, i32* @optind
%59 = sub nsw i32 %57, %58
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %68
61: ; preds = %56
%62 = load i32, i32* @stderr
%63 = call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %62)
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = call i32 @_usage(i8* %66)
store i32 1, i32* %3
br label %130
68: ; preds = %56
%69 = load i32, i32* %4
%70 = load i32, i32* @optind
%71 = sub nsw i32 %69, %70
%72 = load i8**, i8*** %5
%73 = load i32, i32* @optind
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %72, i64 %74
%76 = call i32 @_open_stream(i32 %71, i8** %75)
store i32 %76, i32* %7
%77 = load i32, i32* %7
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %68
%80 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %130
81: ; preds = %68
%82 = load i32, i32* %8
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %91
84: ; preds = %81
%85 = call i32 @tun_alloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
store i32 %85, i32* %8
%86 = load i32, i32* %8
%87 = icmp slt i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %84
%89 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %130
90: ; preds = %84
br label %91
91: ; preds = %90, %81
br label %92
92: ; preds = %127, %91
%93 = load i32, i32* %7
%94 = icmp slt i32 %93, 0
br i1 %94, label %102, label %95
95: ; preds = %92
%96 = load i32, i32* %8
%97 = load i32, i32* %7
%98 = load i32, i32* @STDIN_FILENO
%99 = load i32, i32* @STDOUT_FILENO
%100 = call i64 @_dispatch(i32 %96, i32 %97, i32 %98, i32 %99)
%101 = icmp slt i64 %100, 0
br label %102
102: ; preds = %95, %92
%103 = phi i1 [ true, %92 ], [ %101, %95 ]
br i1 %103, label %104, label %129
104: ; preds = %102
%105 = load i32, i32* @stderr
%106 = load i8**, i8*** %5
%107 = load i32, i32* @optind
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %106, i64 %108
%110 = load i8*, i8** %109
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %110)
%112 = load i32, i32* %4
%113 = load i32, i32* @optind
%114 = sub nsw i32 %112, %113
%115 = load i8**, i8*** %5
%116 = load i32, i32* @optind
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8*, i8** %115, i64 %117
%119 = call i32 @_open_stream(i32 %114, i8** %118)
store i32 %119, i32* %7
%120 = load i32, i32* %7
%121 = icmp slt i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %104
%123 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
br label %127
124: ; preds = %104
%125 = load i32, i32* @stderr
%126 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %124, %122
%128 = call i32 @sleep(i32 2)
br label %92
129: ; preds = %102
store i32 0, i32* %3
br label %130
130: ; preds = %129, %88, %79, %61, %48, %26, %16
%131 = load i32, i32* %3
ret i32 %131
}

LLVM IR (-O2):
@.str = [4 x i8] c"hI:\00"
@optarg = global i8* null
@.str.1 = [29 x i8] c"Could not open TUN interface\00"
@optopt = global i32 0
@stderr = global i32 0
@.str.2 = [32 x i8] c"Option -%c requires an argument\00"
@.str.3 = [22 x i8] c"Unknown option '-%c'\0A\00"
@.str.4 = [32 x i8] c"Unknown option character \\%02x\0A\00"
@optind = global i32 0
@.str.5 = [35 x i8] c"Serial or TCP connection required\0A\00"
@.str.6 = [40 x i8] c"Could not open serial or TCP connection\00"
@.str.7 = [4 x i8] c"sl0\00"
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@.str.8 = [21 x i8] c"Reconnecting %s ... \00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [9 x i8] c"Success\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %3, -1
br i1 %4, label %8, label %38
5: ; preds = %13
%6 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %38
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
switch i32 %9, label %36 [
i32 104, label %10
i32 73, label %13
i32 63, label %19
]
10: ; preds = %8
%11 = load i8*, i8** %1
%12 = tail call i32 @_usage(i8* %11)
br label %92
13: ; preds = %8
%14 = load i8*, i8** @optarg
%15 = tail call i32 @tun_alloc(i8* %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %13
%18 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %92
19: ; preds = %8
%20 = load i32, i32* @optopt
%21 = icmp eq i32 %20, 73
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 73)
br label %33
25: ; preds = %19
%26 = tail call i32 @isprint(i32 %20)
%27 = icmp eq i32 %26, 0
%28 = load i32, i32* @stderr
br i1 %27, label %31, label %29
29: ; preds = %25
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %33
31: ; preds = %25
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %20)
br label %33
33: ; preds = %29, %31, %22
%34 = load i8*, i8** %1
%35 = tail call i32 @_usage(i8* %34)
br label %92
36: ; preds = %8
%37 = tail call i32 (...) @abort()
unreachable
38: ; preds = %5, %2
%39 = phi i32 [ -1, %2 ], [ %15, %5 ]
%40 = load i32, i32* @optind
%41 = sub nsw i32 %0, %40
%42 = icmp slt i32 %41, 1
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load i32, i32* @stderr
%45 = tail call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = load i8*, i8** %1
%47 = tail call i32 @_usage(i8* %46)
br label %92
48: ; preds = %38
%49 = sext i32 %40 to i64
%50 = getelementptr inbounds i8*, i8** %1, i64 %49
%51 = tail call i32 @_open_stream(i32 %41, i8** %50)
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %48
%54 = tail call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %92
55: ; preds = %48
%56 = icmp slt i32 %39, 0
br i1 %56, label %57, label %62
57: ; preds = %55
%58 = tail call i32 @tun_alloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp slt i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %92
62: ; preds = %57, %55
%63 = phi i32 [ %58, %57 ], [ %39, %55 ]
br label %64
64: ; preds = %90, %62
%65 = phi i32 [ %51, %62 ], [ %83, %90 ]
%66 = icmp slt i32 %65, 0
br i1 %66, label %72, label %67
67: ; preds = %64
%68 = load i32, i32* @STDIN_FILENO
%69 = load i32, i32* @STDOUT_FILENO
%70 = tail call i64 @_dispatch(i32 %63, i32 %65, i32 %68, i32 %69)
%71 = icmp slt i64 %70, 0
br i1 %71, label %72, label %92
72: ; preds = %64, %67
%73 = load i32, i32* @stderr
%74 = load i32, i32* @optind
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %1, i64 %75
%77 = load i8*, i8** %76
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %77)
%79 = load i32, i32* @optind
%80 = sub nsw i32 %0, %79
%81 = sext i32 %79 to i64
%82 = getelementptr inbounds i8*, i8** %1, i64 %81
%83 = tail call i32 @_open_stream(i32 %80, i8** %82)
%84 = icmp slt i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %72
%86 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
br label %90
87: ; preds = %72
%88 = load i32, i32* @stderr
%89 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %88)
br label %90
90: ; preds = %87, %85
%91 = tail call i32 @sleep(i32 2)
br label %64
92: ; preds = %67, %60, %53, %43, %33, %17, %10
%93 = phi i32 [ 1, %33 ], [ 1, %17 ], [ 0, %10 ], [ 1, %43 ], [ 1, %53 ], [ 1, %60 ], [ 0, %67 ]
ret i32 %93
}