#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 */
typedef scalar_t__ uint16_t;
struct sockaddr_in {
  int dummy;
};
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ const member_1;
};

/* Variables and functions */
int O_NONBLOCK;
int O_RDWR;
int O_WRONLY;
void *atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dumprtp(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt_long(int, char **, char *, struct option *, int *);
int makeclientsocket(char *, int, int, struct sockaddr_in *);
#define no_argument 129
int open(char *, int);
char *optarg;
int /*<<< orphan*/ perror(char *);
#define required_argument 128
int /*<<< orphan*/ set_ts_filt(int, scalar_t__, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int fda, fdv;
  int fd_dvr;
  uint16_t vpid = 0;
  uint16_t apid = 0;
  struct sockaddr_in si;
  int socketIn;
  char *ip = "224.0.1.2";
  int port = 5004;
  static struct option long_options[] = {
      {"group", required_argument, NULL, 'g'},
      {"port", required_argument, NULL, 'p'},
      {"vpid", required_argument, NULL, 'v'},
      {"apid", required_argument, NULL, 'a'},
      {"help", no_argument, NULL, 'h'},
      {0}};
  int c;
  int option_index = 0;
  fprintf(stderr, "*** rtpfeed 0.1 ***\n");
  while ((c = getopt_long(argc, argv, "g:p:v:a:h", long_options,
                          &option_index)) != -1) {
    switch (c) {
    case 'g':
      ip = optarg;
      break;
    case 'p':
      port = atoi(optarg);
      break;
    case 'v':
      vpid = atoi(optarg);
      break;
    case 'a':
      apid = atoi(optarg);
      break;
    case 'h':
      fprintf(stderr,
              "Usage: %s [-g group] [-p port] [-v video PID] [-a audio PID] \n",
              argv[0]);
      exit(1);
    }
  }
  if ((fd_dvr = open("/dev/ost/dvr", O_WRONLY)) < 0) {
    perror("DVR DEVICE: ");
    return -1;
  }
  if (vpid != 0) {
    if ((fdv = open("/dev/ost/demux", O_RDWR | O_NONBLOCK)) < 0) {
      perror("DEMUX DEVICE: ");
      return -1;
    }
    set_ts_filt(fdv, vpid, 1);
  }
  if (apid != 0) {
    if ((fda = open("/dev/ost/demux", O_RDWR | O_NONBLOCK)) < 0) {
      perror("DEMUX DEVICE: ");
      return -1;
    }
    set_ts_filt(fda, apid, 2);
  }
  socketIn = makeclientsocket(ip, port, 2, &si);
  dumprtp(socketIn, fd_dvr);
  close(socketIn);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0x48(%rbp)
movl   $0x138c,-0x4c(%rbp)
movl   $0x0,-0x54(%rbp)
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdx
lea    0x2e75(%rip),%rcx
lea    -0x54(%rbp),%r8
call   1040 <getopt_long@plt>
mov    %eax,-0x50(%rbp)
cmp    $0xffffffff,%eax
je     12d0 <main+0x130>
mov    -0x50(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x15,%eax
ja     12cb <main+0x12b>
mov    -0x60(%rbp),%rax
lea    0xdc0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2da8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    12cb <main+0x12b>
mov    0x2d95(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x4c(%rbp)
jmp    12cb <main+0x12b>
mov    0x2d7e(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,-0x28(%rbp)
jmp    12cb <main+0x12b>
mov    0x2d66(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,-0x30(%rbp)
jmp    12cb <main+0x12b>
mov    0x2d1e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    11f6 <main+0x56>
mov    0x2ce1(%rip),%rax
mov    (%rax),%esi
lea    0xdfa(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1309 <main+0x169>
lea    0xdef(%rip),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f7 <main+0x257>
cmpq   $0x0,-0x28(%rbp)
je     1367 <main+0x1c7>
mov    0x2cc5(%rip),%rax
mov    (%rax),%esi
mov    0x2cb4(%rip),%rax
or     (%rax),%esi
lea    0xdc7(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1356 <main+0x1b6>
lea    0xdbe(%rip),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f7 <main+0x257>
mov    -0x18(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1030 <set_ts_filt@plt>
cmpq   $0x0,-0x30(%rbp)
je     13c5 <main+0x225>
mov    0x2c67(%rip),%rax
mov    (%rax),%esi
mov    0x2c56(%rip),%rax
or     (%rax),%esi
lea    0xd69(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    13b4 <main+0x214>
lea    0xd60(%rip),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f7 <main+0x257>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <set_ts_filt@plt>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    $0x2,%edx
lea    -0x38(%rbp),%rcx
call   1070 <makeclientsocket@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1080 <dumprtp@plt>
mov    -0x3c(%rbp),%edi
call   1050 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x138c,%eax
mov    %rax,0x10(%rsp)
lea    0xe6e(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe9b(%rip),%r14
lea    0x2e83(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xdf7(%rip),%r13
xor    %eax,%eax
jmp    121f <main+0x7f>
nopl   (%rax)
mov    0x2de1(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,0x20(%rsp)
jmp    1235 <main+0x95>
cs nopw 0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     1297 <main+0xf7>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1040 <getopt_long@plt>
lea    -0x61(%rax),%ecx
cmp    $0x15,%ecx
ja     1230 <main+0x90>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    0x2d97(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,0x28(%rsp)
jmp    1235 <main+0x95>
mov    0x2d81(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    1235 <main+0x95>
mov    0x2d70(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,0x10(%rsp)
jmp    1235 <main+0x95>
mov    0x2d1a(%rip),%rax
mov    (%rax),%esi
lea    0xe33(%rip),%rdi
call   1090 <open@plt>
test   %eax,%eax
js     1377 <main+0x1d7>
mov    %eax,%r14d
mov    0x20(%rsp),%rbx
test   %rbx,%rbx
mov    0x28(%rsp),%rbp
je     12fb <main+0x15b>
mov    0x2d13(%rip),%rax
mov    0x2d04(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe15(%rip),%rdi
call   1090 <open@plt>
test   %eax,%eax
js     136e <main+0x1ce>
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <set_ts_filt@plt>
test   %rbp,%rbp
je     1331 <main+0x191>
mov    0x2cd9(%rip),%rax
mov    0x2cca(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xddb(%rip),%rdi
call   1090 <open@plt>
test   %eax,%eax
js     136e <main+0x1ce>
mov    %eax,%edi
mov    %rbp,%rsi
mov    $0x2,%edx
call   1030 <set_ts_filt@plt>
lea    0x30(%rsp),%rcx
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    $0x2,%edx
call   1070 <makeclientsocket@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r14d,%esi
call   1080 <dumprtp@plt>
mov    %ebp,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd8e(%rip),%rdi
jmp    137e <main+0x1de>
lea    0xd69(%rip),%rdi
call   10a0 <perror@plt>
mov    $0xffffffff,%eax
jmp    135f <main+0x1bf>
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcfe(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
%struct.sockaddr_in = type { i32 }
@.str = [10 x i8] c"224.0.1.2\00"
@main.long_options = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32* null, i32 103 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32* null, i32 112 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32* null, i32 118 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -128, i32* null, i32 97 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8 -127, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str.1 = [6 x i8] c"group\00"
@.str.2 = [5 x i8] c"port\00"
@.str.3 = [5 x i8] c"vpid\00"
@.str.4 = [5 x i8] c"apid\00"
@.str.5 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.6 = [21 x i8] c"*** rtpfeed 0.1 ***\0A\00"
@.str.7 = [10 x i8] c"g:p:v:a:h\00"
@optarg = global i8* null
@.str.8 = [63 x i8] c"Usage: %s [-g group] [-p port] [-v video PID] [-a audio PID] \0A\00"
@.str.9 = [13 x i8] c"/dev/ost/dvr\00"
@O_WRONLY = global i32 0
@.str.10 = [13 x i8] c"DVR DEVICE: \00"
@.str.11 = [15 x i8] c"/dev/ost/demux\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str.12 = [15 x i8] c"DEMUX DEVICE: \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 i64
%10 = alloca i64
%11 = alloca %struct.sockaddr_in
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %9
store i64 0, i64* %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %13
store i32 5004, i32* %14
store i32 0, i32* %16
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %47, %2
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @getopt_long(i32 %20, i8** %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %16)
store i32 %22, i32* %15
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %48
24: ; preds = %19
%25 = load i32, i32* %15
switch i32 %25, label %47 [
i32 103, label %26
i32 112, label %28
i32 118, label %32
i32 97, label %36
i32 104, label %40
]
26: ; preds = %24
%27 = load i8*, i8** @optarg
store i8* %27, i8** %13
br label %47
28: ; preds = %24
%29 = load i8*, i8** @optarg
%30 = call i8* @atoi(i8* %29)
%31 = ptrtoint i8* %30 to i32
store i32 %31, i32* %14
br label %47
32: ; preds = %24
%33 = load i8*, i8** @optarg
%34 = call i8* @atoi(i8* %33)
%35 = ptrtoint i8* %34 to i64
store i64 %35, i64* %9
br label %47
36: ; preds = %24
%37 = load i8*, i8** @optarg
%38 = call i8* @atoi(i8* %37)
%39 = ptrtoint i8* %38 to i64
store i64 %39, i64* %10
br label %47
40: ; preds = %24
%41 = load i32, i32* @stderr
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %24, %36, %32, %28, %26
br label %19
48: ; preds = %19
%49 = load i32, i32* @O_WRONLY
%50 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %49)
store i32 %50, i32* %8
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
store i32 -1, i32* %3
br label %93
54: ; preds = %48
%55 = load i64, i64* %9
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %69
57: ; preds = %54
%58 = load i32, i32* @O_RDWR
%59 = load i32, i32* @O_NONBLOCK
%60 = or i32 %58, %59
%61 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %60)
store i32 %61, i32* %7
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
store i32 -1, i32* %3
br label %93
65: ; preds = %57
%66 = load i32, i32* %7
%67 = load i64, i64* %9
%68 = call i32 @set_ts_filt(i32 %66, i64 %67, i32 1)
br label %69
69: ; preds = %65, %54
%70 = load i64, i64* %10
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %84
72: ; preds = %69
%73 = load i32, i32* @O_RDWR
%74 = load i32, i32* @O_NONBLOCK
%75 = or i32 %73, %74
%76 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %75)
store i32 %76, i32* %6
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %72
%79 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
store i32 -1, i32* %3
br label %93
80: ; preds = %72
%81 = load i32, i32* %6
%82 = load i64, i64* %10
%83 = call i32 @set_ts_filt(i32 %81, i64 %82, i32 2)
br label %84
84: ; preds = %80, %69
%85 = load i8*, i8** %13
%86 = load i32, i32* %14
%87 = call i32 @makeclientsocket(i8* %85, i32 %86, i32 2, %struct.sockaddr_in* %11)
store i32 %87, i32* %12
%88 = load i32, i32* %12
%89 = load i32, i32* %8
%90 = call i32 @dumprtp(i32 %88, i32 %89)
%91 = load i32, i32* %12
%92 = call i32 @close(i32 %91)
store i32 0, i32* %3
br label %93
93: ; preds = %84, %78, %63, %52
%94 = load i32, i32* %3
ret i32 %94
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
%struct.sockaddr_in = type { i32 }
@.str = [10 x i8] c"224.0.1.2\00"
@main.long_options = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32* null, i32 103 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32* null, i32 112 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32* null, i32 118 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -128, i32* null, i32 97 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8 -127, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str.1 = [6 x i8] c"group\00"
@.str.2 = [5 x i8] c"port\00"
@.str.3 = [5 x i8] c"vpid\00"
@.str.4 = [5 x i8] c"apid\00"
@.str.5 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.6 = [21 x i8] c"*** rtpfeed 0.1 ***\0A\00"
@.str.7 = [10 x i8] c"g:p:v:a:h\00"
@optarg = global i8* null
@.str.8 = [63 x i8] c"Usage: %s [-g group] [-p port] [-v video PID] [-a audio PID] \0A\00"
@.str.9 = [13 x i8] c"/dev/ost/dvr\00"
@O_WRONLY = global i32 0
@.str.10 = [13 x i8] c"DVR DEVICE: \00"
@.str.11 = [15 x i8] c"/dev/ost/demux\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str.12 = [15 x i8] c"DEMUX DEVICE: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %9
9: ; preds = %36, %2
%10 = phi i64 [ %39, %36 ], [ 0, %2 ]
%11 = phi i64 [ %15, %36 ], [ 0, %2 ]
%12 = phi i8* [ %19, %36 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%13 = phi i32 [ %22, %36 ], [ 5004, %2 ]
br label %14
14: ; preds = %9, %32
%15 = phi i64 [ %11, %9 ], [ %35, %32 ]
%16 = phi i8* [ %12, %9 ], [ %19, %32 ]
%17 = phi i32 [ %13, %9 ], [ %22, %32 ]
br label %18
18: ; preds = %14, %25
%19 = phi i8* [ %16, %14 ], [ %26, %25 ]
%20 = phi i32 [ %17, %14 ], [ %22, %25 ]
br label %21
21: ; preds = %18, %27
%22 = phi i32 [ %20, %18 ], [ %31, %27 ]
br label %23
23: ; preds = %21, %23
%24 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %4)
switch i32 %24, label %23 [
i32 -1, label %45
i32 103, label %25
i32 112, label %27
i32 118, label %32
i32 97, label %36
i32 104, label %40
]
25: ; preds = %23
%26 = load i8*, i8** @optarg
br label %18
27: ; preds = %23
%28 = load i8*, i8** @optarg
%29 = call i8* @atoi(i8* %28)
%30 = ptrtoint i8* %29 to i64
%31 = trunc i64 %30 to i32
br label %21
32: ; preds = %23
%33 = load i8*, i8** @optarg
%34 = call i8* @atoi(i8* %33)
%35 = ptrtoint i8* %34 to i64
br label %14
36: ; preds = %23
%37 = load i8*, i8** @optarg
%38 = call i8* @atoi(i8* %37)
%39 = ptrtoint i8* %38 to i64
br label %9
40: ; preds = %23
%41 = load i32, i32* @stderr
%42 = load i8*, i8** %1
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i8* %42)
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %23
%46 = load i32, i32* @O_WRONLY
%47 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %46)
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %79
51: ; preds = %45
%52 = icmp eq i64 %15, 0
br i1 %52, label %63, label %53
53: ; preds = %51
%54 = load i32, i32* @O_RDWR
%55 = load i32, i32* @O_NONBLOCK
%56 = or i32 %55, %54
%57 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %56)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
br label %79
61: ; preds = %53
%62 = call i32 @set_ts_filt(i32 %57, i64 %15, i32 1)
br label %63
63: ; preds = %61, %51
%64 = icmp eq i64 %10, 0
br i1 %64, label %75, label %65
65: ; preds = %63
%66 = load i32, i32* @O_RDWR
%67 = load i32, i32* @O_NONBLOCK
%68 = or i32 %67, %66
%69 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %68)
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %65
%72 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
br label %79
73: ; preds = %65
%74 = call i32 @set_ts_filt(i32 %69, i64 %10, i32 2)
br label %75
75: ; preds = %73, %63
%76 = call i32 @makeclientsocket(i8* %19, i32 %22, i32 2, %struct.sockaddr_in* %3)
%77 = call i32 @dumprtp(i32 %76, i32 %47)
%78 = call i32 @close(i32 %76)
br label %79
79: ; preds = %75, %71, %59, %49
%80 = phi i32 [ -1, %49 ], [ -1, %59 ], [ -1, %71 ], [ 0, %75 ]
ret i32 %80
}