#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*/ puts(char *);
void local_display_usage(void) {
  puts("");
  puts("The purpose of this program is write a file on the UART. This can be "
       "handy when");
  puts("you want to use a IDE like EMACS or even Eclipse to write PLC scripts "
       "instead");
  puts("of typing each line in the prompt or switching pen drives.");
  puts("");
  puts("USAGE");
  puts("");
  puts("    dxtr filename [-t timeout seconds] [-u uart address] [-d]");
  puts("");
  puts("It will open /dev/tty.usbserial and dump the file there. ");
  puts("");
  puts("Parameters:");
  puts("");
  puts("  filename          File to be written in the serial port.");
  puts("  -u uart_address   UART address. If not specified, assume "
       "/dev/tty.usbserial.");
  puts("  -s speed          UART speed. If not specified will assume 9600 baud "
       "as default.");
  puts("  -t timeout        Whenever the PLC takes more than timeout (n) "
       "seconds to print ");
  puts("                    anything back, execution will be finished. Default "
       "timeout ");
  puts("                    is two seconds.");
  puts("  -d                Enable the Recovery Protocol (tech spec ART "
       "1309280001.1)");
  puts("                    first sending a notification byte followed by a "
       "32-bit LE ");
  puts("                    integer with the amount of incoming data, not "
       "including ");
  puts("                    the first 5 bytes.");
  puts("  -h                Display this help message.");
  puts("  -b                Enable binary mode. In binary mode, all data will "
       "be sent as it.");
  puts("");
}


x86 assembly (clang, -O0):
<local_display_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0x103b(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5f(%rip),%rdi
call   1030 <puts@plt>
lea    0x100b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf82(%rip),%rdi
call   1030 <puts@plt>
lea    0xff3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xfdb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfab(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0xfdb(%rip),%rdi
call   1030 <puts@plt>
lea    0x101e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1065(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ac(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f0(%rip),%rdi
call   1030 <puts@plt>
lea    0x1108(%rip),%rdi
call   1030 <puts@plt>
lea    0x114a(%rip),%rdi
call   1030 <puts@plt>
lea    0x118d(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ce(%rip),%rdi
call   1030 <puts@plt>
lea    0x11e9(%rip),%rdi
call   1030 <puts@plt>
lea    0x120c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_display_usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xf12(%rip),%rdi
call   1040 <puts@plt>
lea    0xf54(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf79(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf69(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf91(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfab(%rip),%rdi
call   1040 <puts@plt>
lea    0xfda(%rip),%rdi
call   1040 <puts@plt>
lea    0x101d(%rip),%rdi
call   1040 <puts@plt>
lea    0x1064(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ab(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ef(%rip),%rdi
call   1040 <puts@plt>
lea    0x1107(%rip),%rdi
call   1040 <puts@plt>
lea    0x1149(%rip),%rdi
call   1040 <puts@plt>
lea    0x118c(%rip),%rdi
call   1040 <puts@plt>
lea    0x11cd(%rip),%rdi
call   1040 <puts@plt>
lea    0x11e8(%rip),%rdi
call   1040 <puts@plt>
lea    0x120b(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [80 x i8] c"The purpose of this program is write a file on the UART. This can be handy when\00"
@.str.2 = [78 x i8] c"you want to use a IDE like EMACS or even Eclipse to write PLC scripts instead\00"
@.str.3 = [59 x i8] c"of typing each line in the prompt or switching pen drives.\00"
@.str.4 = [6 x i8] c"USAGE\00"
@.str.5 = [62 x i8] c" dxtr filename [-t timeout seconds] [-u uart address] [-d]\00"
@.str.6 = [58 x i8] c"It will open /dev/tty.usbserial and dump the file there. \00"
@.str.7 = [12 x i8] c"Parameters:\00"
@.str.8 = [59 x i8] c" filename File to be written in the serial port.\00"
@.str.9 = [79 x i8] c" -u uart_address UART address. If not specified, assume /dev/tty.usbserial.\00"
@.str.10 = [83 x i8] c" -s speed UART speed. If not specified will assume 9600 baud as default.\00"
@.str.11 = [83 x i8] c" -t timeout Whenever the PLC takes more than timeout (n) seconds to print \00"
@.str.12 = [80 x i8] c" anything back, execution will be finished. Default timeout \00"
@.str.13 = [36 x i8] c" is two seconds.\00"
@.str.14 = [78 x i8] c" -d Enable the Recovery Protocol (tech spec ART 1309280001.1)\00"
@.str.15 = [79 x i8] c" first sending a notification byte followed by a 32-bit LE \00"
@.str.16 = [77 x i8] c" integer with the amount of incoming data, not including \00"
@.str.17 = [39 x i8] c" the first 5 bytes.\00"
@.str.18 = [47 x i8] c" -h Display this help message.\00"
@.str.19 = [85 x i8] c" -b Enable binary mode. In binary mode, all data will be sent as it.\00"
define void @local_display_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.14, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.15, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.16, i64 0, i64 0))
%23 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0))
%24 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.18, i64 0, i64 0))
%25 = call i32 @puts(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.19, i64 0, i64 0))
%26 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [80 x i8] c"The purpose of this program is write a file on the UART. This can be handy when\00"
@.str.2 = [78 x i8] c"you want to use a IDE like EMACS or even Eclipse to write PLC scripts instead\00"
@.str.3 = [59 x i8] c"of typing each line in the prompt or switching pen drives.\00"
@.str.4 = [6 x i8] c"USAGE\00"
@.str.5 = [62 x i8] c" dxtr filename [-t timeout seconds] [-u uart address] [-d]\00"
@.str.6 = [58 x i8] c"It will open /dev/tty.usbserial and dump the file there. \00"
@.str.7 = [12 x i8] c"Parameters:\00"
@.str.8 = [59 x i8] c" filename File to be written in the serial port.\00"
@.str.9 = [79 x i8] c" -u uart_address UART address. If not specified, assume /dev/tty.usbserial.\00"
@.str.10 = [83 x i8] c" -s speed UART speed. If not specified will assume 9600 baud as default.\00"
@.str.11 = [83 x i8] c" -t timeout Whenever the PLC takes more than timeout (n) seconds to print \00"
@.str.12 = [80 x i8] c" anything back, execution will be finished. Default timeout \00"
@.str.13 = [36 x i8] c" is two seconds.\00"
@.str.14 = [78 x i8] c" -d Enable the Recovery Protocol (tech spec ART 1309280001.1)\00"
@.str.15 = [79 x i8] c" first sending a notification byte followed by a 32-bit LE \00"
@.str.16 = [77 x i8] c" integer with the amount of incoming data, not including \00"
@.str.17 = [39 x i8] c" the first 5 bytes.\00"
@.str.18 = [47 x i8] c" -h Display this help message.\00"
@.str.19 = [85 x i8] c" -b Enable binary mode. In binary mode, all data will be sent as it.\00"
define void @local_display_usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.9, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.10, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.11, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.12, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.14, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.15, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.16, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.18, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str.19, i64 0, i64 0))
%26 = tail call i32 @putchar(i32 10)
ret void
}