#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 EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int exit_status) {
  fprintf(
      exit_status == EXIT_SUCCESS ? stdout : stderr,
      "Usage: %s [options] [-l] [/dev/uioX [-m] [<addr> [<value>]]]\n"
      "\n"
      "Functions:\n"
      "  monitor (-m) the device for interrupts\n"
      "  list (-l) all devices and their mappings\n"
      "  read words from <addr>\n"
      "  write <value> to <addr> (will zero-pad word width)\n"
      "\n"
      "Options:\n"
      "  -r\tselect the device's memory region to map (default: 0)\n"
      "  -w\tword size (in bytes; default: %d)\n"
      "  -n\tnumber of words to read (in words; default: 1)\n"
      "  -x\texit with success after the first interrupt (implies -m mode)\n",
      "uioctl", 4);
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
jne    114e <usage+0x2e>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    115a <usage+0x3a>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xe9c(%rip),%rsi
lea    0x1064(%rip),%rdx
mov    $0x4,%ecx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
cmp    %edi,(%rax)
jne    1137 <usage+0x17>
mov    0x2ea3(%rip),%rax
jmp    113e <usage+0x1e>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
lea    0x1081(%rip),%rdx
mov    $0x4,%ecx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@.str = [463 x i8] c"Usage: %s [options] [-l] [/dev/uioX [-m] [<addr> [<value>]]]\0A\0AFunctions:\0A monitor (-m) the device for interrupts\0A list (-l) all devices and their mappings\0A read words from <addr>\0A write <value> to <addr> (will zero-pad word width)\0A\0AOptions:\0A -r\09select the device's memory region to map (default: 0)\0A -w\09word size (in bytes; default: %d)\0A -n\09number of words to read (in words; default: 1)\0A -x\09exit with success after the first interrupt (implies -m mode)\0A\00"
@.str.1 = [7 x i8] c"uioctl\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EXIT_SUCCESS
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @stdout
br label %10
8: ; preds = %1
%9 = load i32, i32* @stderr
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([463 x i8], [463 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 4)
%13 = load i32, i32* %2
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@.str = [463 x i8] c"Usage: %s [options] [-l] [/dev/uioX [-m] [<addr> [<value>]]]\0A\0AFunctions:\0A monitor (-m) the device for interrupts\0A list (-l) all devices and their mappings\0A read words from <addr>\0A write <value> to <addr> (will zero-pad word width)\0A\0AOptions:\0A -r\09select the device's memory region to map (default: 0)\0A -w\09word size (in bytes; default: %d)\0A -n\09number of words to read (in words; default: 1)\0A -x\09exit with success after the first interrupt (implies -m mode)\0A\00"
@.str.1 = [7 x i8] c"uioctl\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @stdout
%5 = load i32, i32* @stderr
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([463 x i8], [463 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 4)
%8 = tail call i32 @exit(i32 %0)
unreachable
}