#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printUsage(char *appname) {
  char *usage =
      "%s usage:\n\n"
      "\t-h                 Print help\n"
      "\t-v                 Print debug information\n"
      "\t-d <device name>   Serial port device (default: /dev/ttyS0)\n"
      "\t-a <address>       Remote host address (default: 127.0.0.1)\n"
      "\t-p <port>          Remote UDP port (default: 9999)\n"
      "\t-f                 Disable flow control (default: HW)\n"
      "\t-r <address>       RS-485 address to listen (default: 0x20)\n"
      "\t-i                 Send all messages by UDP (default: only modbus "
      "data)\n"
      "\t-n                 Don't send acknowledge at all\n"
      "\t-o                 Send acknowledge to all addresses\n"
      "\t-t                 Test mode\n"
      "\t-l <port>          Local UDP port for read commands (default: 10000)\n"
      "\t-w <port>          Local UDP port for write commands (default: "
      "10001)\n"
      "\t-q                 Print data in log format\n";
  fprintf(stderr, usage, appname);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [770 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-v Print debug information\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> Remote host address (default: 127.0.0.1)\0A\09-p <port> Remote UDP port (default: 9999)\0A\09-f Disable flow control (default: HW)\0A\09-r <address> RS-485 address to listen (default: 0x20)\0A\09-i Send all messages by UDP (default: only modbus data)\0A\09-n Don't send acknowledge at all\0A\09-o Send acknowledge to all addresses\0A\09-t Test mode\0A\09-l <port> Local UDP port for read commands (default: 10000)\0A\09-w <port> Local UDP port for write commands (default: 10001)\0A\09-q Print data in log format\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([770 x i8], [770 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [770 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-v Print debug information\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> Remote host address (default: 127.0.0.1)\0A\09-p <port> Remote UDP port (default: 9999)\0A\09-f Disable flow control (default: HW)\0A\09-r <address> RS-485 address to listen (default: 0x20)\0A\09-i Send all messages by UDP (default: only modbus data)\0A\09-n Don't send acknowledge at all\0A\09-o Send acknowledge to all addresses\0A\09-t Test mode\0A\09-l <port> Local UDP port for read commands (default: 10000)\0A\09-w <port> Local UDP port for write commands (default: 10001)\0A\09-q Print data in log format\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([770 x i8], [770 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}