#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_help() {
  printf("Usage: linux-serial-test [OPTION]\n"
         "\n"
         "  -h, --help\n"
         "  -b, --baud        Baud rate, 115200, etc (115200 is default)\n"
         "  -p, --port        Port (/dev/ttyS0, etc) (must be specified)\n"
         "  -d, --divisor     UART Baud rate divisor (can be used to set "
         "custom baud rates)\n"
         "  -R, --rx_dump     Dump Rx data (ascii, raw)\n"
         "  -T, --detailed_tx Detailed Tx data\n"
         "  -s, --stats       Dump serial port stats every 5s\n"
         "  -S, --stop-on-err Stop program if we encounter an error\n"
         "  -y, --single-byte Send specified byte to the serial port\n"
         "  -z, --second-byte Send another specified byte to the serial port\n"
         "  -c, --rts-cts     Enable RTS/CTS flow control\n"
         "  -B, --2-stop-bit  Use two stop bits per character\n"
         "  -P, --parity      Use parity bit (odd, even, mark, space)\n"
         "  -e, --dump-err    Display errors\n"
         "  -r, --no-rx       Don't receive data (can be used to test flow "
         "control)\n"
         "                    when serial driver buffer is full\n"
         "  -t, --no-tx       Don't transmit data\n"
         "  -l, --rx-delay    Delay between reading data (ms) (can be used to "
         "test flow control)\n"
         "  -a, --tx-delay    Delay between writing data (ms)\n"
         "  -w, --tx-bytes    Number of bytes for each write (default is to "
         "repeatedly write 1024 bytes\n"
         "                    until no more are accepted)\n"
         "  -q, --rs485       Enable RS485 direction control on port, and set "
         "delay\n"
         "                    from when TX is finished and RS485 driver enable "
         "is\n"
         "                    de-asserted. Delay is specified in bit times.\n"
         "  -o, --tx-time     Number of seconds to transmit for (defaults to "
         "0, meaning no limit)\n"
         "  -i, --rx-time     Number of seconds to receive for (defaults to 0, "
         "meaning no limit)\n"
         "\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1608 x i8] c"Usage: linux-serial-test [OPTION]\0A\0A -h, --help\0A -b, --baud Baud rate, 115200, etc (115200 is default)\0A -p, --port Port (/dev/ttyS0, etc) (must be specified)\0A -d, --divisor UART Baud rate divisor (can be used to set custom baud rates)\0A -R, --rx_dump Dump Rx data (ascii, raw)\0A -T, --detailed_tx Detailed Tx data\0A -s, --stats Dump serial port stats every 5s\0A -S, --stop-on-err Stop program if we encounter an error\0A -y, --single-byte Send specified byte to the serial port\0A -z, --second-byte Send another specified byte to the serial port\0A -c, --rts-cts Enable RTS/CTS flow control\0A -B, --2-stop-bit Use two stop bits per character\0A -P, --parity Use parity bit (odd, even, mark, space)\0A -e, --dump-err Display errors\0A -r, --no-rx Don't receive data (can be used to test flow control)\0A when serial driver buffer is full\0A -t, --no-tx Don't transmit data\0A -l, --rx-delay Delay between reading data (ms) (can be used to test flow control)\0A -a, --tx-delay Delay between writing data (ms)\0A -w, --tx-bytes Number of bytes for each write (default is to repeatedly write 1024 bytes\0A until no more are accepted)\0A -q, --rs485 Enable RS485 direction control on port, and set delay\0A from when TX is finished and RS485 driver enable is\0A de-asserted. Delay is specified in bit times.\0A -o, --tx-time Number of seconds to transmit for (defaults to 0, meaning no limit)\0A -i, --rx-time Number of seconds to receive for (defaults to 0, meaning no limit)\0A\0A\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([1608 x i8], [1608 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [1607 x i8] c"Usage: linux-serial-test [OPTION]\0A\0A -h, --help\0A -b, --baud Baud rate, 115200, etc (115200 is default)\0A -p, --port Port (/dev/ttyS0, etc) (must be specified)\0A -d, --divisor UART Baud rate divisor (can be used to set custom baud rates)\0A -R, --rx_dump Dump Rx data (ascii, raw)\0A -T, --detailed_tx Detailed Tx data\0A -s, --stats Dump serial port stats every 5s\0A -S, --stop-on-err Stop program if we encounter an error\0A -y, --single-byte Send specified byte to the serial port\0A -z, --second-byte Send another specified byte to the serial port\0A -c, --rts-cts Enable RTS/CTS flow control\0A -B, --2-stop-bit Use two stop bits per character\0A -P, --parity Use parity bit (odd, even, mark, space)\0A -e, --dump-err Display errors\0A -r, --no-rx Don't receive data (can be used to test flow control)\0A when serial driver buffer is full\0A -t, --no-tx Don't transmit data\0A -l, --rx-delay Delay between reading data (ms) (can be used to test flow control)\0A -a, --tx-delay Delay between writing data (ms)\0A -w, --tx-bytes Number of bytes for each write (default is to repeatedly write 1024 bytes\0A until no more are accepted)\0A -q, --rs485 Enable RS485 direction control on port, and set delay\0A from when TX is finished and RS485 driver enable is\0A de-asserted. Delay is specified in bit times.\0A -o, --tx-time Number of seconds to transmit for (defaults to 0, meaning no limit)\0A -i, --rx-time Number of seconds to receive for (defaults to 0, meaning no limit)\0A\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([1607 x i8], [1607 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}