#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*/ printf(char *);
void print_usage() {
  printf("tcp2d :: Author: Morgan Phillips (winter2718@gmail.com) "
         "(http://k8pl.us)\n");
  printf("tcp2d is a program for building usable data sets in csv or arff "
         "format out of TCP streams.\n");
  printf(
      "TCP packets are reassembled, and duplicates dropped, by default.\n\n");
  printf("Options with arguments:\n");
  printf("-f --filename     	  (path to a packet capture file to be "
         "used)\n");
  printf("-o --output 	  	  (name/path to an output file)\n");
  printf("-d --delimitor	  	  (change the field delimitor, default "
         "is ',')\n");
  printf("-c --classification-rules (allows classification of individual "
         "packets)\n");
  printf("-r --rule-file		  (load classification rules from a "
         "file)\n");
  printf("-l --default-label	  (set default label for classification "
         "rules)\n");
  printf("-m --format	  	  (change the fields displayed)\n");
  printf("-h --format-file	  (load format options from a file)\n\n");
  printf("format example: -m 'srcip;dstip;tcpflags;ip_len;payload;'\n");
  printf("will output the source ip, destination ip, tcp flags, ip length, and "
         "payload.\n");
  printf("All data available in the header structs from netinet/ip.h and "
         "netinet/tcp.h is");
  printf("available and generally follows the naming convention of the struct "
         "variable name");
  printf("(i.e. ip_len) and must be followed by a semicolon.\n\n");
  printf("Flags:\n");
  printf("-L --list-conversations (shows all tcp conversations available in a "
         "data set)\n");
  printf("-A --arff-header  (adds an arff header to the top of any output)\n");
  printf("-H --no-header	  (disables column headings)\n");
  printf("-T --text-payload (remove all non-printable values from payloads)\n");
  printf("-X --hex-payload  (show all payloads as hex, most useful for "
         "document classification of payloads)\n");
  printf("-S --split-output (split output streams into individual files)\n");
  printf("-M --mash	  (print requests and responses on a single line)\n");
  printf("-B --binary-dump  (dumps binary payloads from streams into indidual "
         "files for pcap mining)\n");
  printf("-D --keep-duplicates (turns off dropping of duplicate packets)\n");
  printf("-Q --quiet	  (disable stdout)\n");
  printf("-N --no-wrap	  (print results as a single line)\n");
  printf("-! --wait-for-args(load pcap into memory and wait for arguments)\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
lea    0xf73(%rip),%rdi
call   1030 <printf@plt>
lea    0xfaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xfec(%rip),%rdi
call   1030 <printf@plt>
lea    0x1011(%rip),%rdi
call   1030 <printf@plt>
lea    0x1047(%rip),%rdi
call   1030 <printf@plt>
lea    0x1084(%rip),%rdi
call   1030 <printf@plt>
lea    0x10b3(%rip),%rdi
call   1030 <printf@plt>
lea    0x10ea(%rip),%rdi
call   1030 <printf@plt>
lea    0x110e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1139(%rip),%rdi
call   1030 <printf@plt>
lea    0x1168(%rip),%rdi
call   1030 <printf@plt>
lea    0x11ab(%rip),%rdi
call   1030 <printf@plt>
lea    0x11ef(%rip),%rdi
call   1030 <printf@plt>
lea    0x1235(%rip),%rdi
call   1030 <printf@plt>
lea    0x125e(%rip),%rdi
call   1030 <printf@plt>
lea    0x125a(%rip),%rdi
call   1030 <printf@plt>
lea    0x129d(%rip),%rdi
call   1030 <printf@plt>
lea    0x12d3(%rip),%rdi
call   1030 <printf@plt>
lea    0x12f4(%rip),%rdi
call   1030 <printf@plt>
lea    0x132b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1382(%rip),%rdi
call   1030 <printf@plt>
lea    0x13b6(%rip),%rdi
call   1030 <printf@plt>
lea    0x13e7(%rip),%rdi
call   1030 <printf@plt>
lea    0x1437(%rip),%rdi
call   1030 <printf@plt>
lea    0x146b(%rip),%rdi
call   1030 <printf@plt>
lea    0x147e(%rip),%rdi
call   1030 <printf@plt>
lea    0x14a3(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb7(%rip),%rdi
call   1030 <puts@plt>
lea    0x1006(%rip),%rdi
call   1030 <puts@plt>
lea    0x103c(%rip),%rdi
call   1030 <puts@plt>
lea    0x1048(%rip),%rdi
call   1030 <puts@plt>
lea    0x107c(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a0(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1111(%rip),%rdi
call   1030 <puts@plt>
lea    0x113f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1175(%rip),%rdi
call   1030 <puts@plt>
lea    0x1198(%rip),%rdi
call   1030 <puts@plt>
lea    0x11c2(%rip),%rdi
call   1030 <puts@plt>
lea    0x11f0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe30(%rip),%rdi
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
lea    0x121a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1242(%rip),%rdi
call   1030 <puts@plt>
lea    0x123d(%rip),%rdi
call   1030 <puts@plt>
lea    0x127f(%rip),%rdi
call   1030 <puts@plt>
lea    0x12b4(%rip),%rdi
call   1030 <puts@plt>
lea    0x12d4(%rip),%rdi
call   1030 <puts@plt>
lea    0x130a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1360(%rip),%rdi
call   1030 <puts@plt>
lea    0x1393(%rip),%rdi
call   1030 <puts@plt>
lea    0x13c3(%rip),%rdi
call   1030 <puts@plt>
lea    0x1412(%rip),%rdi
call   1030 <puts@plt>
lea    0x1445(%rip),%rdi
call   1030 <puts@plt>
lea    0x1457(%rip),%rdi
call   1030 <puts@plt>
lea    0x147b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"tcp2d :: Author: Morgan Phillips (winter2718@gmail.com) (http://k8pl.us)\0A\00"
@.str.1 = [92 x i8] c"tcp2d is a program for building usable data sets in csv or arff format out of TCP streams.\0A\00"
@.str.2 = [67 x i8] c"TCP packets are reassembled, and duplicates dropped, by default.\0A\0A\00"
@.str.3 = [25 x i8] c"Options with arguments:\0A\00"
@.str.4 = [65 x i8] c"-f --filename \09 (path to a packet capture file to be used)\0A\00"
@.str.5 = [49 x i8] c"-o --output \09 \09 (name/path to an output file)\0A\00"
@.str.6 = [66 x i8] c"-d --delimitor\09 \09 (change the field delimitor, default is ',')\0A\00"
@.str.7 = [73 x i8] c"-c --classification-rules (allows classification of individual packets)\0A\00"
@.str.8 = [59 x i8] c"-r --rule-file\09\09 (load classification rules from a file)\0A\00"
@.str.9 = [67 x i8] c"-l --default-label\09 (set default label for classification rules)\0A\00"
@.str.10 = [48 x i8] c"-m --format\09 \09 (change the fields displayed)\0A\00"
@.str.11 = [55 x i8] c"-h --format-file\09 (load format options from a file)\0A\0A\00"
@.str.12 = [59 x i8] c"format example: -m 'srcip;dstip;tcpflags;ip_len;payload;'\0A\00"
@.str.13 = [79 x i8] c"will output the source ip, destination ip, tcp flags, ip length, and payload.\0A\00"
@.str.14 = [80 x i8] c"All data available in the header structs from netinet/ip.h and netinet/tcp.h is\00"
@.str.15 = [82 x i8] c"available and generally follows the naming convention of the struct variable name\00"
@.str.16 = [53 x i8] c"(i.e. ip_len) and must be followed by a semicolon.\0A\0A\00"
@.str.17 = [8 x i8] c"Flags:\0A\00"
@.str.18 = [79 x i8] c"-L --list-conversations (shows all tcp conversations available in a data set)\0A\00"
@.str.19 = [66 x i8] c"-A --arff-header (adds an arff header to the top of any output)\0A\00"
@.str.20 = [45 x i8] c"-H --no-header\09 (disables column headings)\0A\00"
@.str.21 = [67 x i8] c"-T --text-payload (remove all non-printable values from payloads)\0A\00"
@.str.22 = [99 x i8] c"-X --hex-payload (show all payloads as hex, most useful for document classification of payloads)\0A\00"
@.str.23 = [64 x i8] c"-S --split-output (split output streams into individual files)\0A\00"
@.str.24 = [61 x i8] c"-M --mash\09 (print requests and responses on a single line)\0A\00"
@.str.25 = [92 x i8] c"-B --binary-dump (dumps binary payloads from streams into indidual files for pcap mining)\0A\00"
@.str.26 = [64 x i8] c"-D --keep-duplicates (turns off dropping of duplicate packets)\0A\00"
@.str.27 = [31 x i8] c"-Q --quiet\09 (disable stdout)\0A\00"
@.str.28 = [49 x i8] c"-N --no-wrap\09 (print results as a single line)\0A\00"
@.str.29 = [66 x i8] c"-! --wait-for-args(load pcap into memory and wait for arguments)\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.15, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.18, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.19, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.20, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.21, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.22, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.23, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.24, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.25, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.26, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.27, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.28, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.29, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.14 = [80 x i8] c"All data available in the header structs from netinet/ip.h and netinet/tcp.h is\00"
@.str.15 = [82 x i8] c"available and generally follows the naming convention of the struct variable name\00"
@str = [73 x i8] c"tcp2d :: Author: Morgan Phillips (winter2718@gmail.com) (http://k8pl.us)\00"
@str.30 = [91 x i8] c"tcp2d is a program for building usable data sets in csv or arff format out of TCP streams.\00"
@str.31 = [66 x i8] c"TCP packets are reassembled, and duplicates dropped, by default.\0A\00"
@str.32 = [24 x i8] c"Options with arguments:\00"
@str.33 = [64 x i8] c"-f --filename \09 (path to a packet capture file to be used)\00"
@str.34 = [48 x i8] c"-o --output \09 \09 (name/path to an output file)\00"
@str.35 = [65 x i8] c"-d --delimitor\09 \09 (change the field delimitor, default is ',')\00"
@str.36 = [72 x i8] c"-c --classification-rules (allows classification of individual packets)\00"
@str.37 = [58 x i8] c"-r --rule-file\09\09 (load classification rules from a file)\00"
@str.38 = [66 x i8] c"-l --default-label\09 (set default label for classification rules)\00"
@str.39 = [47 x i8] c"-m --format\09 \09 (change the fields displayed)\00"
@str.40 = [54 x i8] c"-h --format-file\09 (load format options from a file)\0A\00"
@str.41 = [58 x i8] c"format example: -m 'srcip;dstip;tcpflags;ip_len;payload;'\00"
@str.42 = [78 x i8] c"will output the source ip, destination ip, tcp flags, ip length, and payload.\00"
@str.43 = [52 x i8] c"(i.e. ip_len) and must be followed by a semicolon.\0A\00"
@str.44 = [7 x i8] c"Flags:\00"
@str.45 = [78 x i8] c"-L --list-conversations (shows all tcp conversations available in a data set)\00"
@str.46 = [65 x i8] c"-A --arff-header (adds an arff header to the top of any output)\00"
@str.47 = [44 x i8] c"-H --no-header\09 (disables column headings)\00"
@str.48 = [66 x i8] c"-T --text-payload (remove all non-printable values from payloads)\00"
@str.49 = [98 x i8] c"-X --hex-payload (show all payloads as hex, most useful for document classification of payloads)\00"
@str.50 = [63 x i8] c"-S --split-output (split output streams into individual files)\00"
@str.51 = [60 x i8] c"-M --mash\09 (print requests and responses on a single line)\00"
@str.52 = [91 x i8] c"-B --binary-dump (dumps binary payloads from streams into indidual files for pcap mining)\00"
@str.53 = [63 x i8] c"-D --keep-duplicates (turns off dropping of duplicate packets)\00"
@str.54 = [30 x i8] c"-Q --quiet\09 (disable stdout)\00"
@str.55 = [48 x i8] c"-N --no-wrap\09 (print results as a single line)\00"
@str.56 = [65 x i8] c"-! --wait-for-args(load pcap into memory and wait for arguments)\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.30, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.31, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.32, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.33, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.34, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.35, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.36, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.37, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.38, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.39, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.40, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.41, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.42, i64 0, i64 0))
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.14, i64 0, i64 0))
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str.15, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.43, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.44, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.45, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.46, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.47, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.48, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str.49, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.50, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.51, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.52, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.53, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.54, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.55, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.56, i64 0, i64 0))
ret void
}