#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 usage(char **argv) {
  printf("TOSR-0n controller by Héctor Cordobés.\n");
  printf("Usage: %s [options]\n\n", argv[0]);
  printf("Available options are:\n");
  printf("  -t <device>          Serial device to use\n");
  printf("  -e <relay numbers>   Enables relay(s)\n");
  printf("  -E                   Enables all relays\n");
  printf("  -d <relay numbers>   Disables relay(s)\n");
  printf("  -D                   Disables all relays\n");
  printf("  -S                   Returns relay state\n");
  printf("  -s <relaynumber>     Returns shell code 0 if relay is active\n");
  printf("  -i                   Returns TOSR SW version\n");
  printf("  -v                   Returns DC input voltage\n");
  printf("  -h                   Shows this help message\n\n");
  printf("Besides the device name, only one option can be used at a time.\n");
  printf("If a device is not specified, /dev/ttyUSB0 will be used.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1007(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x102a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x104d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1080(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf79(%rip),%rdi
call   1030 <puts@plt>
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xfea(%rip),%rdi
call   1030 <puts@plt>
lea    0x100d(%rip),%rdi
call   1030 <puts@plt>
lea    0x1031(%rip),%rdi
call   1030 <puts@plt>
lea    0x1055(%rip),%rdi
call   1030 <puts@plt>
lea    0x1089(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"TOSR-0n controller by H\C3\A9ctor Cordob\C3\A9s.\0A\00"
@.str.1 = [22 x i8] c"Usage: %s [options]\0A\0A\00"
@.str.2 = [24 x i8] c"Available options are:\0A\00"
@.str.3 = [45 x i8] c" -t <device> Serial device to use\0A\00"
@.str.4 = [41 x i8] c" -e <relay numbers> Enables relay(s)\0A\00"
@.str.5 = [43 x i8] c" -E Enables all relays\0A\00"
@.str.6 = [42 x i8] c" -d <relay numbers> Disables relay(s)\0A\00"
@.str.7 = [44 x i8] c" -D Disables all relays\0A\00"
@.str.8 = [44 x i8] c" -S Returns relay state\0A\00"
@.str.9 = [64 x i8] c" -s <relaynumber> Returns shell code 0 if relay is active\0A\00"
@.str.10 = [48 x i8] c" -i Returns TOSR SW version\0A\00"
@.str.11 = [49 x i8] c" -v Returns DC input voltage\0A\00"
@.str.12 = [49 x i8] c" -h Shows this help message\0A\0A\00"
@.str.13 = [65 x i8] c"Besides the device name, only one option can be used at a time.\0A\00"
@.str.14 = [58 x i8] c"If a device is not specified, /dev/ttyUSB0 will be used.\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.13, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"Usage: %s [options]\0A\0A\00"
@str = [41 x i8] c"TOSR-0n controller by H\C3\A9ctor Cordob\C3\A9s.\00"
@str.15 = [23 x i8] c"Available options are:\00"
@str.16 = [44 x i8] c" -t <device> Serial device to use\00"
@str.17 = [40 x i8] c" -e <relay numbers> Enables relay(s)\00"
@str.18 = [42 x i8] c" -E Enables all relays\00"
@str.19 = [41 x i8] c" -d <relay numbers> Disables relay(s)\00"
@str.20 = [43 x i8] c" -D Disables all relays\00"
@str.21 = [43 x i8] c" -S Returns relay state\00"
@str.22 = [63 x i8] c" -s <relaynumber> Returns shell code 0 if relay is active\00"
@str.23 = [47 x i8] c" -i Returns TOSR SW version\00"
@str.24 = [48 x i8] c" -v Returns DC input voltage\00"
@str.25 = [48 x i8] c" -h Shows this help message\0A\00"
@str.26 = [64 x i8] c"Besides the device name, only one option can be used at a time.\00"
@str.27 = [57 x i8] c"If a device is not specified, /dev/ttyUSB0 will be used.\00"
define void @usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.15, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.16, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.17, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.18, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.19, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.20, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.21, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.22, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.23, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.24, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.25, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.26, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.27, i64 0, i64 0))
ret void
}