#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void __attribute__((noreturn)) usage(void) {
  fprintf(stdout, "Usage: ./usage -[rwa]     \n");
  fprintf(stdout, "       -r -> only read    \n");
  fprintf(stdout, "       -w -> only write   \n");
  fprintf(stdout, "       -i -> only ioctl   \n");
  fprintf(stdout, "       -a -> all          \n");
  putchar('\n');
  fprintf(stdout, "Examples:                 \n");
  fprintf(stdout, "       ./usage -r         \n");
  fprintf(stdout, "       ./usage -w         \n");
  fprintf(stdout, "       ./usage -a         \n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedb(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee9(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
lea    0xefb(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf09(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf17(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf25(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [28 x i8] c"Usage: ./usage -[rwa] \0A\00"
@.str.1 = [28 x i8] c" -r -> only read \0A\00"
@.str.2 = [28 x i8] c" -w -> only write \0A\00"
@.str.3 = [28 x i8] c" -i -> only ioctl \0A\00"
@.str.4 = [28 x i8] c" -a -> all \0A\00"
@.str.5 = [28 x i8] c"Examples: \0A\00"
@.str.6 = [28 x i8] c" ./usage -r \0A\00"
@.str.7 = [28 x i8] c" ./usage -w \0A\00"
@.str.8 = [28 x i8] c" ./usage -a \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @putchar(i8 signext 10)
%12 = load i32, i32* @stdout
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stdout
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [28 x i8] c"Usage: ./usage -[rwa] \0A\00"
@.str.1 = [28 x i8] c" -r -> only read \0A\00"
@.str.2 = [28 x i8] c" -w -> only write \0A\00"
@.str.3 = [28 x i8] c" -i -> only ioctl \0A\00"
@.str.4 = [28 x i8] c" -a -> all \0A\00"
@.str.5 = [28 x i8] c"Examples: \0A\00"
@.str.6 = [28 x i8] c" ./usage -r \0A\00"
@.str.7 = [28 x i8] c" ./usage -w \0A\00"
@.str.8 = [28 x i8] c" ./usage -a \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @putchar(i8 signext 10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stdout
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
}