#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 *, ...);
int /*<<< orphan*/ stderr;
void usage(int argc, char *argv[]) {
  fprintf(stderr,
          "Usage: %s [-s switchmask] [-S] [-v [mask]]"
          "[-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]\n",
          argv[0]);
  fprintf(stderr, "    -r: rotate log every kbytes. (9 MB if unspecified).\n");
  fprintf(stderr, "    -f: log to file, default to /tmp/record-input.txt\n");
  fprintf(stderr, "    -s: print switch states for given bits\n");
  fprintf(stderr, "    -S: print all switch states\n");
  fprintf(stderr, "    -v: verbosity mask (errs=1, dev=2, name=4, info=8, "
                  "vers=16, pos. events=32, props=64)\n");
  fprintf(stderr, "    -d: show HID descriptor, if available\n");
  fprintf(stderr,
          "    -p: show possible events (errs, dev, name, pos. events)\n");
  fprintf(stderr, "    -i: show all device info and possible events\n");
  fprintf(stderr, "    -l: label event types and names in plain text\n");
  fprintf(stderr, "    -q: quiet (clear verbosity mask)\n");
  fprintf(stderr, "    -c: print given number of events then exit\n");
  fprintf(stderr, "    -d: remove log file\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xf32(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xf52(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
lea    0xf67(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xf71(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
lea    0xfb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xfc9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xfef(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
lea    0x100a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
lea    0x1026(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
lea    0x1035(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
lea    0x104e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsi),%rdx
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf29(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf52(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf79(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf95(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfa6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xff1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x100c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1039(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x105b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x107e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1094(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10b4(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [93 x i8] c"Usage: %s [-s switchmask] [-S] [-v [mask]][-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]\0A\00"
@.str.1 = [57 x i8] c" -r: rotate log every kbytes. (9 MB if unspecified).\0A\00"
@.str.2 = [55 x i8] c" -f: log to file, default to /tmp/record-input.txt\0A\00"
@.str.3 = [44 x i8] c" -s: print switch states for given bits\0A\00"
@.str.4 = [33 x i8] c" -S: print all switch states\0A\00"
@.str.5 = [91 x i8] c" -v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)\0A\00"
@.str.6 = [43 x i8] c" -d: show HID descriptor, if available\0A\00"
@.str.7 = [61 x i8] c" -p: show possible events (errs, dev, name, pos. events)\0A\00"
@.str.8 = [50 x i8] c" -i: show all device info and possible events\0A\00"
@.str.9 = [51 x i8] c" -l: label event types and names in plain text\0A\00"
@.str.10 = [38 x i8] c" -q: quiet (clear verbosity mask)\0A\00"
@.str.11 = [48 x i8] c" -c: print given number of events then exit\0A\00"
@.str.12 = [25 x i8] c" -d: remove log file\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [93 x i8] c"Usage: %s [-s switchmask] [-S] [-v [mask]][-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]\0A\00"
@.str.1 = [57 x i8] c" -r: rotate log every kbytes. (9 MB if unspecified).\0A\00"
@.str.2 = [55 x i8] c" -f: log to file, default to /tmp/record-input.txt\0A\00"
@.str.3 = [44 x i8] c" -s: print switch states for given bits\0A\00"
@.str.4 = [33 x i8] c" -S: print all switch states\0A\00"
@.str.5 = [91 x i8] c" -v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)\0A\00"
@.str.6 = [43 x i8] c" -d: show HID descriptor, if available\0A\00"
@.str.7 = [61 x i8] c" -p: show possible events (errs, dev, name, pos. events)\0A\00"
@.str.8 = [50 x i8] c" -i: show all device info and possible events\0A\00"
@.str.9 = [51 x i8] c" -l: label event types and names in plain text\0A\00"
@.str.10 = [38 x i8] c" -q: quiet (clear verbosity mask)\0A\00"
@.str.11 = [48 x i8] c" -c: print given number of events then exit\0A\00"
@.str.12 = [25 x i8] c" -d: remove log file\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
ret void
}