#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 [-4Dscibkvnd]\n", prog);
  puts("\n"
       " Maxim MAX1202 MAX1203 MAX1204 SPI adc utility\n"
       " Copyright (C) 2012  Alberto Panu\n"
       " http://www.panu.it/raspandmax/\n"
       "\n"
       " This program comes with ABSOLUTELY NO WARRANTY.\n"
       " This is free software, and you are welcome to redistribute it\n"
       " under certain conditions see GNU GPL v3\n"
       "\n"
       " Usage:\n"
       " -4 --max1204 select max1204 10 bit adc, default is max1202/3 12 bit\n"
       " -f --full full scale value, default are:\n"
       "      0 to 4.095 volt for unipolar mode\n"
       "      -2.048 to 2.047 volt for bipolar mode\n"
       " -D --device device to use (default /dev/spidev0.0)\n"
       " -s --speed SPI bus speed (Hz), default 500000\n"
       " -c --chipsel disable chipsel at read end, default don't disable\n"
       " -i --input chose input channel 0 to 7, default 0\n"
       " -b --bipolar set to bipolar mode, default unipolar, you need a -5V\n"
       "      power supply on pin 9!\n"
       " -k --clock set internal clock mode, default external\n"
       " -v --verbose print extra info usefoul for debug\n"
       " -r --raw raw mode ouput\n"
       " -n --newline suppress new line at non verbose output end\n"
       " -d --diff set to differential mode,\n"
       "      default is single ended, see table\n"
       "      for input channel selection:\n"
       "\n"
       "       ---------------\n"
       "      | Input l + | - |\n"
       "       ---------------\n"
       "      |   0   | 0 | 1 |\n"
       "       ---------------\n"
       "      |   1   | 2 | 3 |\n"
       "       ---------------\n"
       "      |   2   | 4 | 5 |\n"
       "       ---------------\n"
       "      |   3   | 6 | 7 |\n"
       "       ---------------\n"
       "      |   4   | 1 | 0 |\n"
       "       ---------------\n"
       "      |   5   | 3 | 2 |\n"
       "       ---------------\n"
       "      |   6   | 5 | 4 |\n"
       "       ---------------\n"
       "      |   7   | 7 | 6 |\n"
       "       ---------------\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 [-4Dscibkvnd]\0A\00"
@.str.1 = [1530 x i8] c"\0A Maxim MAX1202 MAX1203 MAX1204 SPI adc utility\0A Copyright (C) 2012 Alberto Panu\0A http://www.panu.it/raspandmax/\0A\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions see GNU GPL v3\0A\0A Usage:\0A -4 --max1204 select max1204 10 bit adc, default is max1202/3 12 bit\0A -f --full full scale value, default are:\0A 0 to 4.095 volt for unipolar mode\0A -2.048 to 2.047 volt for bipolar mode\0A -D --device device to use (default /dev/spidev0.0)\0A -s --speed SPI bus speed (Hz), default 500000\0A -c --chipsel disable chipsel at read end, default don't disable\0A -i --input chose input channel 0 to 7, default 0\0A -b --bipolar set to bipolar mode, default unipolar, you need a -5V\0A power supply on pin 9!\0A -k --clock set internal clock mode, default external\0A -v --verbose print extra info usefoul for debug\0A -r --raw raw mode ouput\0A -n --newline suppress new line at non verbose output end\0A -d --diff set to differential mode,\0A default is single ended, see table\0A for input channel selection:\0A\0A ---------------\0A | Input l + | - |\0A ---------------\0A | 0 | 0 | 1 |\0A ---------------\0A | 1 | 2 | 3 |\0A ---------------\0A | 2 | 4 | 5 |\0A ---------------\0A | 3 | 6 | 7 |\0A ---------------\0A | 4 | 1 | 0 |\0A ---------------\0A | 5 | 3 | 2 |\0A ---------------\0A | 6 | 5 | 4 |\0A ---------------\0A | 7 | 7 | 6 |\0A ---------------\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 ([1530 x i8], [1530 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 [-4Dscibkvnd]\0A\00"
@.str.1 = [1530 x i8] c"\0A Maxim MAX1202 MAX1203 MAX1204 SPI adc utility\0A Copyright (C) 2012 Alberto Panu\0A http://www.panu.it/raspandmax/\0A\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions see GNU GPL v3\0A\0A Usage:\0A -4 --max1204 select max1204 10 bit adc, default is max1202/3 12 bit\0A -f --full full scale value, default are:\0A 0 to 4.095 volt for unipolar mode\0A -2.048 to 2.047 volt for bipolar mode\0A -D --device device to use (default /dev/spidev0.0)\0A -s --speed SPI bus speed (Hz), default 500000\0A -c --chipsel disable chipsel at read end, default don't disable\0A -i --input chose input channel 0 to 7, default 0\0A -b --bipolar set to bipolar mode, default unipolar, you need a -5V\0A power supply on pin 9!\0A -k --clock set internal clock mode, default external\0A -v --verbose print extra info usefoul for debug\0A -r --raw raw mode ouput\0A -n --newline suppress new line at non verbose output end\0A -d --diff set to differential mode,\0A default is single ended, see table\0A for input channel selection:\0A\0A ---------------\0A | Input l + | - |\0A ---------------\0A | 0 | 0 | 1 |\0A ---------------\0A | 1 | 2 | 3 |\0A ---------------\0A | 2 | 4 | 5 |\0A ---------------\0A | 3 | 6 | 7 |\0A ---------------\0A | 4 | 1 | 0 |\0A ---------------\0A | 5 | 3 | 2 |\0A ---------------\0A | 6 | 5 | 4 |\0A ---------------\0A | 7 | 7 | 6 |\0A ---------------\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 ([1530 x i8], [1530 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}