#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*/ copyright();
int /*<<< orphan*/ printf(char *);
void usage() {
  copyright();
  printf("Usage: slsnif [options] <port>\n\n");
  printf("REQUIRED PARAMETERS:\n");
  printf("  <port>     - serial port to use (i.e /dev/ttyS0, /dev/ttyS1, "
         "etc.)\n\n");
  printf("OPTIONS:\n");
  printf("  -h (--help)             - displays this help.\n");
  printf("  -b (--bytes)            - print number of bytes transmitted on "
         "every read.\n");
  printf("  -n (--nolock)           - don't try to lock the port.\n");
  printf(
      "  -t (--timestamp)        - print timestamp for every transmission.\n");
  printf("  -l (--log) <logfile>    - file to store output in, defaults to "
         "stdout.\n");
  printf("  -i (--in-tee)  <file>   - write raw data from device to this "
         "file(s).\n");
  printf("  -o (--out-tee) <file>   - write raw data from host to this "
         "file(s).\n");
  printf(
      "  -s (--speed) <speed>    - baudrate to use, defaults to 9600 baud.\n");
  printf("  --parity <type>         - Set parity options, one of none, even or "
         "odd.\n");
  printf("  -w (--wait) <time>      - time in ms to wait for more data to "
         "arrive.\n");
  printf("  -p (--port2) <port2>    - serial port to use instead of pty.\n");
  printf("  -x (--hex)              - display hexadecimal ascii values.\n");
  printf("  -d (--hexdump)          - display in \"hexdump\" format (hex plus "
         "ascii)\n");
  printf("  -u (--unix98)           - use SYSV (unix98) ptys instead of BSD "
         "ones\n");
  printf("  --color      <color>    - color to use for normal output.\n");
  printf("  --timecolor  <color>    - color to use for timestamp.\n");
  printf("  --bytescolor <color>    - color to use for number of bytes "
         "transmitted.\n\n");
  printf("Following names are valid colors:\n");
  printf(" \tblack, red, green, yellow, blue, magenta, cyan, white,\n");
  printf("\tbrightblack,brightred, brightgreen, brightyellow,\n");
  printf("\tbrightblue, brightmagenta, brightcyan, brightwhite\n\n");
  printf("Example: slsnif -l log.txt -s 2400 /dev/ttyS1\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <copyright@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8d(%rip),%rdi
call   1030 <printf@plt>
lea    0xfba(%rip),%rdi
call   1030 <printf@plt>
lea    0xff3(%rip),%rdi
call   1030 <printf@plt>
lea    0x1031(%rip),%rdi
call   1030 <printf@plt>
lea    0x106e(%rip),%rdi
call   1030 <printf@plt>
lea    0x10a9(%rip),%rdi
call   1030 <printf@plt>
lea    0x10e2(%rip),%rdi
call   1030 <printf@plt>
lea    0x1121(%rip),%rdi
call   1030 <printf@plt>
lea    0x115e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1192(%rip),%rdi
call   1030 <printf@plt>
lea    0x11c5(%rip),%rdi
call   1030 <printf@plt>
lea    0x1203(%rip),%rdi
call   1030 <printf@plt>
lea    0x123f(%rip),%rdi
call   1030 <printf@plt>
lea    0x1270(%rip),%rdi
call   1030 <printf@plt>
lea    0x129d(%rip),%rdi
call   1030 <printf@plt>
lea    0x12dd(%rip),%rdi
call   1030 <printf@plt>
lea    0x12f4(%rip),%rdi
call   1030 <printf@plt>
lea    0x1323(%rip),%rdi
call   1030 <printf@plt>
lea    0x134b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1375(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1040 <copyright@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xfee(%rip),%rdi
call   1030 <puts@plt>
lea    0x102b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1067(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a1(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d9(%rip),%rdi
call   1030 <puts@plt>
lea    0x1117(%rip),%rdi
call   1030 <puts@plt>
lea    0x1153(%rip),%rdi
call   1030 <puts@plt>
lea    0x1186(%rip),%rdi
call   1030 <puts@plt>
lea    0x11b8(%rip),%rdi
call   1030 <puts@plt>
lea    0x11f5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1230(%rip),%rdi
call   1030 <puts@plt>
lea    0x1260(%rip),%rdi
call   1030 <puts@plt>
lea    0x128c(%rip),%rdi
call   1030 <puts@plt>
lea    0x12cb(%rip),%rdi
call   1030 <puts@plt>
lea    0x12e1(%rip),%rdi
call   1030 <puts@plt>
lea    0x130f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1336(%rip),%rdi
call   1030 <puts@plt>
lea    0x135f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: slsnif [options] <port>\0A\0A\00"
@.str.1 = [22 x i8] c"REQUIRED PARAMETERS:\0A\00"
@.str.2 = [71 x i8] c" <port> - serial port to use (i.e /dev/ttyS0, /dev/ttyS1, etc.)\0A\0A\00"
@.str.3 = [10 x i8] c"OPTIONS:\0A\00"
@.str.4 = [49 x i8] c" -h (--help) - displays this help.\0A\00"
@.str.5 = [78 x i8] c" -b (--bytes) - print number of bytes transmitted on every read.\0A\00"
@.str.6 = [57 x i8] c" -n (--nolock) - don't try to lock the port.\0A\00"
@.str.7 = [69 x i8] c" -t (--timestamp) - print timestamp for every transmission.\0A\00"
@.str.8 = [74 x i8] c" -l (--log) <logfile> - file to store output in, defaults to stdout.\0A\00"
@.str.9 = [73 x i8] c" -i (--in-tee) <file> - write raw data from device to this file(s).\0A\00"
@.str.10 = [71 x i8] c" -o (--out-tee) <file> - write raw data from host to this file(s).\0A\00"
@.str.11 = [69 x i8] c" -s (--speed) <speed> - baudrate to use, defaults to 9600 baud.\0A\00"
@.str.12 = [75 x i8] c" --parity <type> - Set parity options, one of none, even or odd.\0A\00"
@.str.13 = [73 x i8] c" -w (--wait) <time> - time in ms to wait for more data to arrive.\0A\00"
@.str.14 = [64 x i8] c" -p (--port2) <port2> - serial port to use instead of pty.\0A\00"
@.str.15 = [63 x i8] c" -x (--hex) - display hexadecimal ascii values.\0A\00"
@.str.16 = [74 x i8] c" -d (--hexdump) - display in \22hexdump\22 format (hex plus ascii)\0A\00"
@.str.17 = [72 x i8] c" -u (--unix98) - use SYSV (unix98) ptys instead of BSD ones\0A\00"
@.str.18 = [61 x i8] c" --color <color> - color to use for normal output.\0A\00"
@.str.19 = [57 x i8] c" --timecolor <color> - color to use for timestamp.\0A\00"
@.str.20 = [76 x i8] c" --bytescolor <color> - color to use for number of bytes transmitted.\0A\0A\00"
@.str.21 = [35 x i8] c"Following names are valid colors:\0A\00"
@.str.22 = [59 x i8] c"\C2\A0\09black, red, green, yellow, blue, magenta, cyan, white,\0A\00"
@.str.23 = [52 x i8] c"\09brightblack,brightred, brightgreen, brightyellow,\0A\00"
@.str.24 = [54 x i8] c"\09brightblue, brightmagenta, brightcyan, brightwhite\0A\0A\00"
@.str.25 = [48 x i8] c"Example: slsnif -l log.txt -s 2400 /dev/ttyS1\0A\0A\00"
define void @usage() {
%1 = call i32 (...) @copyright()
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.17, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.19, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.20, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.22, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.23, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.24, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.25, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: slsnif [options] <port>\0A\00"
@str.26 = [21 x i8] c"REQUIRED PARAMETERS:\00"
@str.27 = [70 x i8] c" <port> - serial port to use (i.e /dev/ttyS0, /dev/ttyS1, etc.)\0A\00"
@str.28 = [9 x i8] c"OPTIONS:\00"
@str.29 = [48 x i8] c" -h (--help) - displays this help.\00"
@str.30 = [77 x i8] c" -b (--bytes) - print number of bytes transmitted on every read.\00"
@str.31 = [56 x i8] c" -n (--nolock) - don't try to lock the port.\00"
@str.32 = [68 x i8] c" -t (--timestamp) - print timestamp for every transmission.\00"
@str.33 = [73 x i8] c" -l (--log) <logfile> - file to store output in, defaults to stdout.\00"
@str.34 = [72 x i8] c" -i (--in-tee) <file> - write raw data from device to this file(s).\00"
@str.35 = [70 x i8] c" -o (--out-tee) <file> - write raw data from host to this file(s).\00"
@str.36 = [68 x i8] c" -s (--speed) <speed> - baudrate to use, defaults to 9600 baud.\00"
@str.37 = [74 x i8] c" --parity <type> - Set parity options, one of none, even or odd.\00"
@str.38 = [72 x i8] c" -w (--wait) <time> - time in ms to wait for more data to arrive.\00"
@str.39 = [63 x i8] c" -p (--port2) <port2> - serial port to use instead of pty.\00"
@str.40 = [62 x i8] c" -x (--hex) - display hexadecimal ascii values.\00"
@str.41 = [73 x i8] c" -d (--hexdump) - display in \22hexdump\22 format (hex plus ascii)\00"
@str.42 = [71 x i8] c" -u (--unix98) - use SYSV (unix98) ptys instead of BSD ones\00"
@str.43 = [60 x i8] c" --color <color> - color to use for normal output.\00"
@str.44 = [56 x i8] c" --timecolor <color> - color to use for timestamp.\00"
@str.45 = [75 x i8] c" --bytescolor <color> - color to use for number of bytes transmitted.\0A\00"
@str.46 = [34 x i8] c"Following names are valid colors:\00"
@str.47 = [58 x i8] c"\C2\A0\09black, red, green, yellow, blue, magenta, cyan, white,\00"
@str.48 = [51 x i8] c"\09brightblack,brightred, brightgreen, brightyellow,\00"
@str.49 = [53 x i8] c"\09brightblue, brightmagenta, brightcyan, brightwhite\0A\00"
@str.50 = [47 x i8] c"Example: slsnif -l log.txt -s 2400 /dev/ttyS1\0A\00"
define void @usage() {
%1 = tail call i32 (...) @copyright()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.26, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.27, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.28, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.29, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.30, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.31, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.32, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.33, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.34, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.35, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.36, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.37, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.38, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.39, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.40, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.41, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.42, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.43, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.44, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.45, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.46, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.47, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.48, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.49, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.50, i64 0, i64 0))
ret void
}