#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(void) {
  fprintf(
      stderr,
      "\n"
      "NAME\n"
      "       iombench - microbenchmark for storage devices/systems\n"
      "\n"
      "SYNOPSIS\n"
      "       iombench  [ -d time ] [ -f filename ] [ -n count ] [ -H ]\n"
      "                [ -p size ] [ -o filename ] [ -P ] [ -r percent ]\n"
      "                [ -R time ] [ -s addr ] [ -S addr ] [ -t count ]\n"
      "                [ -w percent ]\n"
      "       iombench  -h\n"
      "\n"
      "DESCRIPTION\n"
      "       iombench is a microbenchmark for storage systems or devices\n"
      "       such as hard disk and flash SSD. It provides the following\n"
      "       features:\n"
      "           - Various IO sequences including sequential/random\n"
      "             reads/writes, and mixed IOs with any R/W ratio.\n"
      "           - Multi-threading to simulate multiple outstanding IOs.\n"
      "           - Using O_SYNC and O_DIRECT to try to bypass OS or file\n"
      "             system buffer. Support raw IO on device file.\n"
      "       It is recommended to tune your devices/systems for prefetching\n"
      "       or write-back cache with some tools like hdparm.\n"
      "\n"
      "OPTIONS\n"
      "   -d <time>       Duration of test of each thread in seconds. \n"
      "                   The longer the better, especially for SSDs.\n"
      "\n"
      "   -f <filename>   Filename for test. Can be device file like /dev/sda."
      "\n"
      "                   This is a recommended way to test new drives.\n"
      "                   Make sure you have correct permissions.\n"
      "                   WARNING! All data include partition table will be\n"
      "                   overwritten! Cannot be recovered!\n"
      "\n"
      "   -n <count>      Send <number> of requests per thread. Program will\n"
      "                   terminate by -n or -d which happens first.\n"
      "\n"
      "   -H              Human friendly output.\n"
      "\n"
      "   -o <filename>   Output file to append. Default output to console.\n"
      "\n"
      "   -p <size>       Page size in sector (512B) for IO. This number\n"
      "                   is multiplied by 512. For example, -p 8 uses 4096\n"
      "                   as page size.\n"
      "\n"
      "   -P              Output the execution details of each request.\n"
      "\n"
      "   -r              Use random addresses. Random IO.\n"
      "\n"
      "   -R <time>       Rampup interval in seconds between threads.\n"
      "\n"
      "   -s <addr>       Initial file offset. Automatically aligned by 512.\n"
      "                   Default to 0.\n"
      "\n"
      "   -S <addr>       End offset. Automatically aligned by 512. Note\n"
      "                   that lseek64 is not defined on OSX, so the largest\n"
      "                   offset on Mac may be 2G even you specify larger\n"
      "                   value.\n"
      "                   If this value is larger than file length, reads\n"
      "                   or writes may happen on the hole of the file. Run\n"
      "                   'man lseek' to see the details. A safe way is to \n"
      "                   generate the file in advance using this tool or\n"
      "                   dd, then set the end offset smaller than the file\n"
      "                   length.\n"
      "                   For sequential read/write, file offset will be\n"
      "                   reset to initial address (-s) when file offset\n"
      "                   reaches this value.\n"
      "                   Within the valid address space, set this value the\n"
      "                   larger the better, which ensures large disk head\n"
      "                   movement in random access for hard disk, and might\n"
      "                   trigger more data movements and block erasures\n"
      "                   inside SSDs (it highly depends on implementation\n"
      "                   of FTL).\n"
      "                   Set this value to the capacity of disk when testing\n"
      "                   with device file.\n"
      "\n"
      "   -t <count>      Number of threads.\n"
      "\n"
      "   -w <percent>    Percent of write requests. 0-100. Default 50.\n"
      "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x3ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3440 x i8] c"\0ANAME\0A iombench - microbenchmark for storage devices/systems\0A\0ASYNOPSIS\0A iombench [ -d time ] [ -f filename ] [ -n count ] [ -H ]\0A [ -p size ] [ -o filename ] [ -P ] [ -r percent ]\0A [ -R time ] [ -s addr ] [ -S addr ] [ -t count ]\0A [ -w percent ]\0A iombench -h\0A\0ADESCRIPTION\0A iombench is a microbenchmark for storage systems or devices\0A such as hard disk and flash SSD. It provides the following\0A features:\0A - Various IO sequences including sequential/random\0A reads/writes, and mixed IOs with any R/W ratio.\0A - Multi-threading to simulate multiple outstanding IOs.\0A - Using O_SYNC and O_DIRECT to try to bypass OS or file\0A system buffer. Support raw IO on device file.\0A It is recommended to tune your devices/systems for prefetching\0A or write-back cache with some tools like hdparm.\0A\0AOPTIONS\0A -d <time> Duration of test of each thread in seconds. \0A The longer the better, especially for SSDs.\0A\0A -f <filename> Filename for test. Can be device file like /dev/sda.\0A This is a recommended way to test new drives.\0A Make sure you have correct permissions.\0A WARNING! All data include partition table will be\0A overwritten! Cannot be recovered!\0A\0A -n <count> Send <number> of requests per thread. Program will\0A terminate by -n or -d which happens first.\0A\0A -H Human friendly output.\0A\0A -o <filename> Output file to append. Default output to console.\0A\0A -p <size> Page size in sector (512B) for IO. This number\0A is multiplied by 512. For example, -p 8 uses 4096\0A as page size.\0A\0A -P Output the execution details of each request.\0A\0A -r Use random addresses. Random IO.\0A\0A -R <time> Rampup interval in seconds between threads.\0A\0A -s <addr> Initial file offset. Automatically aligned by 512.\0A Default to 0.\0A\0A -S <addr> End offset. Automatically aligned by 512. Note\0A that lseek64 is not defined on OSX, so the largest\0A offset on Mac may be 2G even you specify larger\0A value.\0A If this value is larger than file length, reads\0A or writes may happen on the hole of the file. Run\0A 'man lseek' to see the details. A safe way is to \0A generate the file in advance using this tool or\0A dd, then set the end offset smaller than the file\0A length.\0A For sequential read/write, file offset will be\0A reset to initial address (-s) when file offset\0A reaches this value.\0A Within the valid address space, set this value the\0A larger the better, which ensures large disk head\0A movement in random access for hard disk, and might\0A trigger more data movements and block erasures\0A inside SSDs (it highly depends on implementation\0A of FTL).\0A Set this value to the capacity of disk when testing\0A with device file.\0A\0A -t <count> Number of threads.\0A\0A -w <percent> Percent of write requests. 0-100. Default 50.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3440 x i8], [3440 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3440 x i8] c"\0ANAME\0A iombench - microbenchmark for storage devices/systems\0A\0ASYNOPSIS\0A iombench [ -d time ] [ -f filename ] [ -n count ] [ -H ]\0A [ -p size ] [ -o filename ] [ -P ] [ -r percent ]\0A [ -R time ] [ -s addr ] [ -S addr ] [ -t count ]\0A [ -w percent ]\0A iombench -h\0A\0ADESCRIPTION\0A iombench is a microbenchmark for storage systems or devices\0A such as hard disk and flash SSD. It provides the following\0A features:\0A - Various IO sequences including sequential/random\0A reads/writes, and mixed IOs with any R/W ratio.\0A - Multi-threading to simulate multiple outstanding IOs.\0A - Using O_SYNC and O_DIRECT to try to bypass OS or file\0A system buffer. Support raw IO on device file.\0A It is recommended to tune your devices/systems for prefetching\0A or write-back cache with some tools like hdparm.\0A\0AOPTIONS\0A -d <time> Duration of test of each thread in seconds. \0A The longer the better, especially for SSDs.\0A\0A -f <filename> Filename for test. Can be device file like /dev/sda.\0A This is a recommended way to test new drives.\0A Make sure you have correct permissions.\0A WARNING! All data include partition table will be\0A overwritten! Cannot be recovered!\0A\0A -n <count> Send <number> of requests per thread. Program will\0A terminate by -n or -d which happens first.\0A\0A -H Human friendly output.\0A\0A -o <filename> Output file to append. Default output to console.\0A\0A -p <size> Page size in sector (512B) for IO. This number\0A is multiplied by 512. For example, -p 8 uses 4096\0A as page size.\0A\0A -P Output the execution details of each request.\0A\0A -r Use random addresses. Random IO.\0A\0A -R <time> Rampup interval in seconds between threads.\0A\0A -s <addr> Initial file offset. Automatically aligned by 512.\0A Default to 0.\0A\0A -S <addr> End offset. Automatically aligned by 512. Note\0A that lseek64 is not defined on OSX, so the largest\0A offset on Mac may be 2G even you specify larger\0A value.\0A If this value is larger than file length, reads\0A or writes may happen on the hole of the file. Run\0A 'man lseek' to see the details. A safe way is to \0A generate the file in advance using this tool or\0A dd, then set the end offset smaller than the file\0A length.\0A For sequential read/write, file offset will be\0A reset to initial address (-s) when file offset\0A reaches this value.\0A Within the valid address space, set this value the\0A larger the better, which ensures large disk head\0A movement in random access for hard disk, and might\0A trigger more data movements and block erasures\0A inside SSDs (it highly depends on implementation\0A of FTL).\0A Set this value to the capacity of disk when testing\0A with device file.\0A\0A -t <count> Number of threads.\0A\0A -w <percent> Percent of write requests. 0-100. Default 50.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3440 x i8], [3440 x i8]* @.str, i64 0, i64 0))
ret void
}