#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_app_usage(void) {
  printf(
      "\n--- Data loopback verification of half-duplex Serial Port, 8n1 ---\n");
  printf("Usage: [-h] [-v] [-T interval] [-N duration] [-b baudrate] [-p "
         "pattern] -d device\n");
  printf("-h          Help\n");
  printf("-v          Verbose Status\n");
  printf("-d (str)    Serial Device, Default=%s\n", "/dev/ttyS0");
  printf(
      "-T (uint)   Word Send Interval, milliseconds, >1, <=1000, Default=%d\n",
      100);
  printf("-N (uint)   Test Duration, seconds,  >=1, Default=%d\n", 1);
  printf("-b (uint)   Baud Rate: 9600, 115200, 230400, Default=%d\n", 115200);
  printf("-p (str)    ASCII Test Pattern (len<%d), newline appended\n", 42 - 2);
  printf("            First char of pattern must be unique\n");
  printf("            Default Pattern: #{xx},a0a0,a0a0,a0a0,a0a0,cc\n");
  printf("            where {xx} is an 8-bit send counter, hex\n");
  printf("            Overriding pattern with -p becomes a fixed pattern\n");
  printf("Notes: - Assumes port is connected to an echoing device or loopback "
         "dongle\n");
  printf("       - Some combinations of parameters may exceed the interface "
         "bandwidth\n");
  printf("       - Accessing the Serial Ports may require sudo privileges\n");
  printf("       - Specifying a custom Test Pattern may require argument "
         "string in \"\" quotes\n");
  return;
}


x86 assembly (clang, -O0):
<print_app_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf73(%rip),%rdi
lea    0xf93(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf90(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc3(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe6(%rip),%rdi
mov    $0x1c200,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100c(%rip),%rdi
mov    $0x28,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1034(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1058(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1085(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10df(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x111d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x115c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x118f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_app_usage>:
push   %rax
lea    0xffa(%rip),%rdi
call   1030 <puts@plt>
lea    0x1032(%rip),%rdi
call   1030 <puts@plt>
lea    0x1078(%rip),%rdi
call   1030 <puts@plt>
lea    0x107d(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1b(%rip),%rdi
mov    $0x1c200,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x28,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x102b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1050(%rip),%rdi
call   1030 <puts@plt>
lea    0x107e(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a7(%rip),%rdi
call   1030 <puts@plt>
lea    0x10da(%rip),%rdi
call   1030 <puts@plt>
lea    0x1119(%rip),%rdi
call   1030 <puts@plt>
lea    0x1159(%rip),%rdi
call   1030 <puts@plt>
lea    0x118d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"\0A--- Data loopback verification of half-duplex Serial Port, 8n1 ---\0A\00"
@.str.1 = [83 x i8] c"Usage: [-h] [-v] [-T interval] [-N duration] [-b baudrate] [-p pattern] -d device\0A\00"
@.str.2 = [18 x i8] c"-h Help\0A\00"
@.str.3 = [28 x i8] c"-v Verbose Status\0A\00"
@.str.4 = [39 x i8] c"-d (str) Serial Device, Default=%s\0A\00"
@.str.5 = [11 x i8] c"/dev/ttyS0\00"
@.str.6 = [70 x i8] c"-T (uint) Word Send Interval, milliseconds, >1, <=1000, Default=%d\0A\00"
@.str.7 = [54 x i8] c"-N (uint) Test Duration, seconds, >=1, Default=%d\0A\00"
@.str.8 = [57 x i8] c"-b (uint) Baud Rate: 9600, 115200, 230400, Default=%d\0A\00"
@.str.9 = [59 x i8] c"-p (str) ASCII Test Pattern (len<%d), newline appended\0A\00"
@.str.10 = [50 x i8] c" First char of pattern must be unique\0A\00"
@.str.11 = [59 x i8] c" Default Pattern: #{xx},a0a0,a0a0,a0a0,a0a0,cc\0A\00"
@.str.12 = [54 x i8] c" where {xx} is an 8-bit send counter, hex\0A\00"
@.str.13 = [64 x i8] c" Overriding pattern with -p becomes a fixed pattern\0A\00"
@.str.14 = [76 x i8] c"Notes: - Assumes port is connected to an echoing device or loopback dongle\0A\00"
@.str.15 = [77 x i8] c" - Some combinations of parameters may exceed the interface bandwidth\0A\00"
@.str.16 = [65 x i8] c" - Accessing the Serial Ports may require sudo privileges\0A\00"
@.str.17 = [84 x i8] c" - Specifying a custom Test Pattern may require argument string in \22\22 quotes\0A\00"
define void @print_app_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i32 100)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i32 1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0), i32 115200)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 40)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.13, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.14, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.15, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.16, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.17, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.4 = [39 x i8] c"-d (str) Serial Device, Default=%s\0A\00"
@.str.5 = [11 x i8] c"/dev/ttyS0\00"
@.str.6 = [70 x i8] c"-T (uint) Word Send Interval, milliseconds, >1, <=1000, Default=%d\0A\00"
@.str.7 = [54 x i8] c"-N (uint) Test Duration, seconds, >=1, Default=%d\0A\00"
@.str.8 = [57 x i8] c"-b (uint) Baud Rate: 9600, 115200, 230400, Default=%d\0A\00"
@.str.9 = [59 x i8] c"-p (str) ASCII Test Pattern (len<%d), newline appended\0A\00"
@str = [68 x i8] c"\0A--- Data loopback verification of half-duplex Serial Port, 8n1 ---\00"
@str.18 = [82 x i8] c"Usage: [-h] [-v] [-T interval] [-N duration] [-b baudrate] [-p pattern] -d device\00"
@str.19 = [17 x i8] c"-h Help\00"
@str.20 = [27 x i8] c"-v Verbose Status\00"
@str.21 = [49 x i8] c" First char of pattern must be unique\00"
@str.22 = [58 x i8] c" Default Pattern: #{xx},a0a0,a0a0,a0a0,a0a0,cc\00"
@str.23 = [53 x i8] c" where {xx} is an 8-bit send counter, hex\00"
@str.24 = [63 x i8] c" Overriding pattern with -p becomes a fixed pattern\00"
@str.25 = [75 x i8] c"Notes: - Assumes port is connected to an echoing device or loopback dongle\00"
@str.26 = [76 x i8] c" - Some combinations of parameters may exceed the interface bandwidth\00"
@str.27 = [64 x i8] c" - Accessing the Serial Ports may require sudo privileges\00"
@str.28 = [83 x i8] c" - Specifying a custom Test Pattern may require argument string in \22\22 quotes\00"
define void @print_app_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.18, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.19, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.20, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i32 100)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i32 1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0), i32 115200)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 40)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.26, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.27, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.28, i64 0, i64 0))
ret void
}