#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*/ printf(char *, ...);
void online_menu(unsigned char *string) {
  printf(
      "%s is an administration tool to manage RapidDisk RAM disk devices and\n"
      "\tRapidDisk-Cache mappings.\n\n",
      string);
  printf("Usage: %s [ -h | -v ] function [ parameters ]\n\n", string);
  printf(
      "Description:\n\t%s is a RapidDisk module management tool to manage "
      "RapidDisk\n"
      "\tRAM disk devices. Dynamically create, remove, resize RAM volumes and "
      "if\n"
      "\tdesired, map or unmap them as a cache volume to any block device.\n\n",
      string);
  printf("Functions:\n"
         "\t-a\t\tAttach RAM disk device (size in MBytes).\n"
         "\t-b\t\tBackend block device absolute path (for cache mapping).\n"
         "\t-c\t\tInput capacity for size or resize of RAM disk device (in "
         "MBytes).\n"
         "\t-d\t\tDetach RAM disk device.\n"
         "\t-f\t\tErase all data to a specified RapidDisk device "
         "\033[31;1m(dangerous)\033[0m.\n"
         "\t-h\t\tDisplay the help menu.\n"
         "\t-j\t\tEnable JSON formatted output.\n"
         "\t-l\t\tList all attached RAM disk devices.\n"
         "\t-m\t\tMap an RapidDisk device as a caching node to another block "
         "device.\n"
         "\t-p\t\tDefine cache policy: write-through, write-around or "
         "writeback \033[31;1m(dangerous)\033[0m\n"
         "\t\t\t(default: write-through).\n"
         "\t-r\t\tDynamically grow the size of an existing RapidDisk device.\n"
         "\t-s\t\tObtain RapidDisk-Cache Mappings statistics.\n"
         "\t-u\t\tUnmap a RapidDisk device from another block device.\n"
         "\t-v\t\tDisplay the utility version string.\n\n");
  printf("Example Usage:\n\trapiddisk -a 64\n"
         "\trapiddisk -d rd2\n"
         "\trapiddisk -r rd2 -c 128\n"
         "\trapiddisk -m rd1 -b /dev/sdb\n"
         "\trapiddisk -m rd1 -b /dev/sdb -p wt\n"
         "\trapiddisk -m rd3 -b /dev/mapper/rc-wa_sdb -p wb\n"
         "\trapiddisk -u rc-wt_sdb\n"
         "\trapiddisk -f rd2\n\n");
}


x86 assembly (clang, -O0):
<online_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1013(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1327(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<online_menu>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf27(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf46(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x100e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1323(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [99 x i8] c"%s is an administration tool to manage RapidDisk RAM disk devices and\0A\09RapidDisk-Cache mappings.\0A\0A\00"
@.str.1 = [48 x i8] c"Usage: %s [ -h | -v ] function [ parameters ]\0A\0A\00"
@.str.2 = [217 x i8] c"Description:\0A\09%s is a RapidDisk module management tool to manage RapidDisk\0A\09RAM disk devices. Dynamically create, remove, resize RAM volumes and if\0A\09desired, map or unmap them as a cache volume to any block device.\0A\0A\00"
@.str.3 = [802 x i8] c"Functions:\0A\09-a\09\09Attach RAM disk device (size in MBytes).\0A\09-b\09\09Backend block device absolute path (for cache mapping).\0A\09-c\09\09Input capacity for size or resize of RAM disk device (in MBytes).\0A\09-d\09\09Detach RAM disk device.\0A\09-f\09\09Erase all data to a specified RapidDisk device \1B[31;1m(dangerous)\1B[0m.\0A\09-h\09\09Display the help menu.\0A\09-j\09\09Enable JSON formatted output.\0A\09-l\09\09List all attached RAM disk devices.\0A\09-m\09\09Map an RapidDisk device as a caching node to another block device.\0A\09-p\09\09Define cache policy: write-through, write-around or writeback \1B[31;1m(dangerous)\1B[0m\0A\09\09\09(default: write-through).\0A\09-r\09\09Dynamically grow the size of an existing RapidDisk device.\0A\09-s\09\09Obtain RapidDisk-Cache Mappings statistics.\0A\09-u\09\09Unmap a RapidDisk device from another block device.\0A\09-v\09\09Display the utility version string.\0A\0A\00"
@.str.4 = [234 x i8] c"Example Usage:\0A\09rapiddisk -a 64\0A\09rapiddisk -d rd2\0A\09rapiddisk -r rd2 -c 128\0A\09rapiddisk -m rd1 -b /dev/sdb\0A\09rapiddisk -m rd1 -b /dev/sdb -p wt\0A\09rapiddisk -m rd3 -b /dev/mapper/rc-wa_sdb -p wb\0A\09rapiddisk -u rc-wt_sdb\0A\09rapiddisk -f rd2\0A\0A\00"
define void @online_menu(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([802 x i8], [802 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [99 x i8] c"%s is an administration tool to manage RapidDisk RAM disk devices and\0A\09RapidDisk-Cache mappings.\0A\0A\00"
@.str.1 = [48 x i8] c"Usage: %s [ -h | -v ] function [ parameters ]\0A\0A\00"
@.str.2 = [217 x i8] c"Description:\0A\09%s is a RapidDisk module management tool to manage RapidDisk\0A\09RAM disk devices. Dynamically create, remove, resize RAM volumes and if\0A\09desired, map or unmap them as a cache volume to any block device.\0A\0A\00"
@str = [801 x i8] c"Functions:\0A\09-a\09\09Attach RAM disk device (size in MBytes).\0A\09-b\09\09Backend block device absolute path (for cache mapping).\0A\09-c\09\09Input capacity for size or resize of RAM disk device (in MBytes).\0A\09-d\09\09Detach RAM disk device.\0A\09-f\09\09Erase all data to a specified RapidDisk device \1B[31;1m(dangerous)\1B[0m.\0A\09-h\09\09Display the help menu.\0A\09-j\09\09Enable JSON formatted output.\0A\09-l\09\09List all attached RAM disk devices.\0A\09-m\09\09Map an RapidDisk device as a caching node to another block device.\0A\09-p\09\09Define cache policy: write-through, write-around or writeback \1B[31;1m(dangerous)\1B[0m\0A\09\09\09(default: write-through).\0A\09-r\09\09Dynamically grow the size of an existing RapidDisk device.\0A\09-s\09\09Obtain RapidDisk-Cache Mappings statistics.\0A\09-u\09\09Unmap a RapidDisk device from another block device.\0A\09-v\09\09Display the utility version string.\0A\00"
@str.5 = [233 x i8] c"Example Usage:\0A\09rapiddisk -a 64\0A\09rapiddisk -d rd2\0A\09rapiddisk -r rd2 -c 128\0A\09rapiddisk -m rd1 -b /dev/sdb\0A\09rapiddisk -m rd1 -b /dev/sdb -p wt\0A\09rapiddisk -m rd3 -b /dev/mapper/rc-wa_sdb -p wb\0A\09rapiddisk -u rc-wt_sdb\0A\09rapiddisk -f rd2\0A\00"
define void @online_menu(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([217 x i8], [217 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([801 x i8], [801 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([233 x i8], [233 x i8]* @str.5, i64 0, i64 0))
ret void
}