#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 const *);
int /*<<< orphan*/ stderr;
void say_usage() {
  static const char *usage[] = {
      " ",
      "Decode an SPI bytestream to "
      ", "
      ", and the console",
      "Usage: spi_decode [-cn] [-f]",
      "  -cn  inputs from COM port n (default 5) and appends to ",
      "  -f   inputs from file "
      " instead",
      "  -r   record 'receive enable' in the packet file",
      ""};
  int i = 0;
  while (usage[i][0] != '\0')
    fprintf(stderr, "%s\n", usage[i++]);
}


x86 assembly (clang, -O0):
<say_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f06(%rip),%rax
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116d <say_usage+0x5d>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
movslq %eax,%rcx
lea    0x2ed8(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0xf77(%rip),%rsi
call   1030 <fprintf@plt>
jmp    111f <say_usage+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_usage>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0xfb5(%rip),%rbx
lea    0xf59(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xec2(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xee0(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeeb(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf13(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf22(%rip),%rdx
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@say_usage.usage = internal global [7 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i32 0, i32 0)]
@.str = [2 x i8] c" \00"
@.str.1 = [48 x i8] c"Decode an SPI bytestream to , , and the console\00"
@.str.2 = [29 x i8] c"Usage: spi_decode [-cn] [-f]\00"
@.str.3 = [58 x i8] c" -cn inputs from COM port n (default 5) and appends to \00"
@.str.4 = [33 x i8] c" -f inputs from file instead\00"
@.str.5 = [50 x i8] c" -r record 'receive enable' in the packet file\00"
@.str.6 = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.7 = [4 x i8] c"%s\0A\00"
define void @say_usage() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [7 x i8*], [7 x i8*]* @say_usage.usage, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [7 x i8*], [7 x i8*]* @say_usage.usage, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %17)
br label %2
19: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [48 x i8] c"Decode an SPI bytestream to , , and the console\00"
@.str.2 = [29 x i8] c"Usage: spi_decode [-cn] [-f]\00"
@.str.3 = [58 x i8] c" -cn inputs from COM port n (default 5) and appends to \00"
@.str.4 = [33 x i8] c" -f inputs from file instead\00"
@.str.5 = [50 x i8] c" -r record 'receive enable' in the packet file\00"
@stderr = global i32 0
@.str.7 = [4 x i8] c"%s\0A\00"
define void @say_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
ret void
}