#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
void __attribute__((__noreturn__)) usage(FILE *out) {
  fputs(
      "\nUsage:\n"
      "  fscryptctl <command> [arguments] [options]\n"
      "\nCommands:\n"
      "  fscryptctl get_descriptor\n"
      "    Read a key from stdin, and print the hex descriptor of the key.\n"
      "  fscryptctl insert_key\n"
      "    Read a key from stdin, insert the key into the current session\n"
      "    keyring (or the user session keyring if a session keyring does not\n"
      "    exist), and print the descriptor of the key.\n"
      "  fscryptctl get_policy <file or directory>\n"
      "    Print out the encryption policy for the specified path.\n"
      "  fscryptctl set_policy <key descriptor> <directory>\n"
      "    Set up an encryption policy on the specified directory with the\n"
      "    specified key descriptor.\n"
      "\nOptions:\n"
      "    -h, --help\n"
      "        print this help screen\n"
      "    -v, --version\n"
      "        print the version of fscrypt\n"
      "    insert_key\n"
      "        --ext4\n"
      "            for use with an ext4 filesystem before kernel v4.8\n"
      "        --f2fs\n"
      "            for use with an F2FS filesystem before kernel v4.6\n"
      "    set_policy\n"
      "        --contents=<mode>\n"
      "            contents encryption mode (default: AES-256-XTS)\n"
      "        --filenames=<mode>\n"
      "            filenames encryption mode (default: AES-256-CTS)\n"
      "        --padding=<bytes>\n"
      "            bytes of zero padding for filenames (default: 32)\n"
      "\nNotes:\n"
      "  All input keys are 64 bytes long and formatted as binary.\n"
      "  All descriptors are 8 bytes and formatted as hex (16 characters).\n",
      out);
  exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    1161 <usage+0x41>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    116d <usage+0x4d>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x529,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2e9c(%rip),%rax
cmp    %rbx,(%rax)
jne    1157 <usage+0x37>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [1322 x i8] c"\0AUsage:\0A fscryptctl <command> [arguments] [options]\0A\0ACommands:\0A fscryptctl get_descriptor\0A Read a key from stdin, and print the hex descriptor of the key.\0A fscryptctl insert_key\0A Read a key from stdin, insert the key into the current session\0A keyring (or the user session keyring if a session keyring does not\0A exist), and print the descriptor of the key.\0A fscryptctl get_policy <file or directory>\0A Print out the encryption policy for the specified path.\0A fscryptctl set_policy <key descriptor> <directory>\0A Set up an encryption policy on the specified directory with the\0A specified key descriptor.\0A\0AOptions:\0A -h, --help\0A print this help screen\0A -v, --version\0A print the version of fscrypt\0A insert_key\0A --ext4\0A for use with an ext4 filesystem before kernel v4.8\0A --f2fs\0A for use with an F2FS filesystem before kernel v4.6\0A set_policy\0A --contents=<mode>\0A contents encryption mode (default: AES-256-XTS)\0A --filenames=<mode>\0A filenames encryption mode (default: AES-256-CTS)\0A --padding=<bytes>\0A bytes of zero padding for filenames (default: 32)\0A\0ANotes:\0A All input keys are 64 bytes long and formatted as binary.\0A All descriptors are 8 bytes and formatted as hex (16 characters).\0A\00"
@stderr = global i32* null
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([1322 x i8], [1322 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = load i32*, i32** @stderr
%7 = icmp eq i32* %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
br label %12
10: ; preds = %1
%11 = load i32, i32* @EXIT_SUCCESS
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [1322 x i8] c"\0AUsage:\0A fscryptctl <command> [arguments] [options]\0A\0ACommands:\0A fscryptctl get_descriptor\0A Read a key from stdin, and print the hex descriptor of the key.\0A fscryptctl insert_key\0A Read a key from stdin, insert the key into the current session\0A keyring (or the user session keyring if a session keyring does not\0A exist), and print the descriptor of the key.\0A fscryptctl get_policy <file or directory>\0A Print out the encryption policy for the specified path.\0A fscryptctl set_policy <key descriptor> <directory>\0A Set up an encryption policy on the specified directory with the\0A specified key descriptor.\0A\0AOptions:\0A -h, --help\0A print this help screen\0A -v, --version\0A print the version of fscrypt\0A insert_key\0A --ext4\0A for use with an ext4 filesystem before kernel v4.8\0A --f2fs\0A for use with an F2FS filesystem before kernel v4.6\0A set_policy\0A --contents=<mode>\0A contents encryption mode (default: AES-256-XTS)\0A --filenames=<mode>\0A filenames encryption mode (default: AES-256-CTS)\0A --padding=<bytes>\0A bytes of zero padding for filenames (default: 32)\0A\0ANotes:\0A All input keys are 64 bytes long and formatted as binary.\0A All descriptors are 8 bytes and formatted as hex (16 characters).\0A\00"
@stderr = global i32* null
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([1322 x i8], [1322 x i8]* @.str, i64 0, i64 0), i64 1321, i64 1, i32* %0)
%3 = load i32*, i32** @stderr
%4 = icmp eq i32* %3, %0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @exit(i32 %7)
unreachable
}