#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 *);
int usage(int result) {
  printf("Usage: serialdump [-x] [-s[on]] [-i] [-dDELAY] [-bSPEED] "
         "[SERIALDEVICE]\n");
  printf("       -x for hexadecimal output\n");
  printf("       -i for decimal output\n");
  printf("       -s for automatic SLIP mode\n");
  printf("       -so for SLIP only mode (all data is SLIP packets)\n");
  printf("       -sn to hide SLIP packages\n");
  printf("       -T[format] to add time for each text line\n");
  printf("       -dDELAY delay in us between 2 consecutive writes (must be "
         "different from 0)\n");
  printf("         (see man page for strftime() for format description)\n");
  return result;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
lea    0xf43(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf88(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9e(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc4(%rip),%rdi
call   1030 <printf@plt>
lea    0x100c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xf48(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa0(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc5(%rip),%rdi
call   1030 <puts@plt>
lea    0x100c(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: serialdump [-x] [-s[on]] [-i] [-dDELAY] [-bSPEED] [SERIALDEVICE]\0A\00"
@.str.1 = [34 x i8] c" -x for hexadecimal output\0A\00"
@.str.2 = [30 x i8] c" -i for decimal output\0A\00"
@.str.3 = [35 x i8] c" -s for automatic SLIP mode\0A\00"
@.str.4 = [58 x i8] c" -so for SLIP only mode (all data is SLIP packets)\0A\00"
@.str.5 = [34 x i8] c" -sn to hide SLIP packages\0A\00"
@.str.6 = [50 x i8] c" -T[format] to add time for each text line\0A\00"
@.str.7 = [84 x i8] c" -dDELAY delay in us between 2 consecutive writes (must be different from 0)\0A\00"
@.str.8 = [63 x i8] c" (see man page for strftime() for format description)\0A\00"
define i32 @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@str = [72 x i8] c"Usage: serialdump [-x] [-s[on]] [-i] [-dDELAY] [-bSPEED] [SERIALDEVICE]\00"
@str.9 = [33 x i8] c" -x for hexadecimal output\00"
@str.10 = [29 x i8] c" -i for decimal output\00"
@str.11 = [34 x i8] c" -s for automatic SLIP mode\00"
@str.12 = [57 x i8] c" -so for SLIP only mode (all data is SLIP packets)\00"
@str.13 = [33 x i8] c" -sn to hide SLIP packages\00"
@str.14 = [49 x i8] c" -T[format] to add time for each text line\00"
@str.15 = [83 x i8] c" -dDELAY delay in us between 2 consecutive writes (must be different from 0)\00"
@str.16 = [62 x i8] c" (see man page for strftime() for format description)\00"
define i32 @usage(i32 returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.9, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.16, i64 0, i64 0))
ret i32 %0
}