#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(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-Dsbnoiealv]\n", prog);
  puts("  -D --device      device to use (default /dev/i2c-0)\n"
       "  -s --slave_addr  address of the i2c slave device\n"
       "  -p --probe       checks if the device is present\n"
       "  -b --block_size  size of data blocks for read/writes (bytes)\n"
       "  -n --num_blocks  the number of data blocks to read/write\n"
       "  -o --offset      address offset from the start of the device\n"
       "  -i --iter        number of times to repeat the test\n"
       "  -e --eeprom      write and read back from the EEPROM. Original\n"
       "                   data is restored\n"
       "  -a --asc         fill write buffer with ascending values (0..0xff)\n"
       "                   rather then the default random values.\n"
       "  -l --scan        scans the i2c bus for slaves (lists devices)\n"
       "  -v --verbose     verbose\n"
       "\n"
       "*ONLY* use with an i2c-bus *ANALYSER/EMULATOR* device:\n"
       "  -w --write       number of bytes to write for write-then-read\n"
       "                   test (not eeprom test). default is no write.\n"
       "  -r --read        number of bytes to read for write-then-read\n"
       "                   test (not eeprom test). default is no read.\n"
       "  -c --rd_wr_cnt   when --write is set this option sets the\n"
       "                   number of writes. When --read is set, this\n"
       "                   option sets the number of reads. When both\n"
       "                   are set, this option creates a mix array\n"
       "                   such that wr-0,rd-0,wr-1,rd-1,...wr-n,rd-n.\n"
       "                   When none is set, this option has no effect.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s [-Dsbnoiealv]\0A\00"
@.str.1 = [1396 x i8] c" -D --device device to use (default /dev/i2c-0)\0A -s --slave_addr address of the i2c slave device\0A -p --probe checks if the device is present\0A -b --block_size size of data blocks for read/writes (bytes)\0A -n --num_blocks the number of data blocks to read/write\0A -o --offset address offset from the start of the device\0A -i --iter number of times to repeat the test\0A -e --eeprom write and read back from the EEPROM. Original\0A data is restored\0A -a --asc fill write buffer with ascending values (0..0xff)\0A rather then the default random values.\0A -l --scan scans the i2c bus for slaves (lists devices)\0A -v --verbose verbose\0A\0A*ONLY* use with an i2c-bus *ANALYSER/EMULATOR* device:\0A -w --write number of bytes to write for write-then-read\0A test (not eeprom test). default is no write.\0A -r --read number of bytes to read for write-then-read\0A test (not eeprom test). default is no read.\0A -c --rd_wr_cnt when --write is set this option sets the\0A number of writes. When --read is set, this\0A option sets the number of reads. When both\0A are set, this option creates a mix array\0A such that wr-0,rd-0,wr-1,rd-1,...wr-n,rd-n.\0A When none is set, this option has no effect.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([1396 x i8], [1396 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s [-Dsbnoiealv]\0A\00"
@.str.1 = [1396 x i8] c" -D --device device to use (default /dev/i2c-0)\0A -s --slave_addr address of the i2c slave device\0A -p --probe checks if the device is present\0A -b --block_size size of data blocks for read/writes (bytes)\0A -n --num_blocks the number of data blocks to read/write\0A -o --offset address offset from the start of the device\0A -i --iter number of times to repeat the test\0A -e --eeprom write and read back from the EEPROM. Original\0A data is restored\0A -a --asc fill write buffer with ascending values (0..0xff)\0A rather then the default random values.\0A -l --scan scans the i2c bus for slaves (lists devices)\0A -v --verbose verbose\0A\0A*ONLY* use with an i2c-bus *ANALYSER/EMULATOR* device:\0A -w --write number of bytes to write for write-then-read\0A test (not eeprom test). default is no write.\0A -r --read number of bytes to read for write-then-read\0A test (not eeprom test). default is no read.\0A -c --rd_wr_cnt when --write is set this option sets the\0A number of writes. When --read is set, this\0A option sets the number of reads. When both\0A are set, this option creates a mix array\0A such that wr-0,rd-0,wr-1,rd-1,...wr-n,rd-n.\0A When none is set, this option has no effect.\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([1396 x i8], [1396 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}