#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strrchr(char *, char);
void usage(char *argv0) {
  char *basename = strrchr(argv0, '/');
  if (!basename)
    basename = argv0;
  fprintf(
      stderr,
      "Usage: %s [-g GPIO_BASE] COMMAND\n"
      "\twhere COMMAND is one of:\n"
      "\t\t-i\t\tInput value from GPIO and print it\n"
      "\t\t-o\tVALUE\tOutput value to GPIO\n"
      "\t\t-c\t\tCylon test pattern\n"
      "\t\t-k\t\t KIT test pattern\n"
      "\tGPIO_BASE indicates which GPIO chip to talk to (The number can be \n"
      "\tfound at /sys/class/gpio/gpiochipN).\n"
      "\tThe highest gpiochipN is the first gpio listed in the dts file, \n"
      "\tand the lowest gpiochipN is the last gpio listed in the dts file.\n"
      "\tE.g.If the gpiochip240 is the LED_8bit gpio, and I want to output '1' "
      "\n"
      "\tto the LED_8bit gpio, the command should be:\n"
      "\t\tgpio-demo -g 240 -o 1\n"
      "\n"
      "\tgpio-demo written by Xilinx Inc.\n"
      "\n",
      basename);
  exit(-2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <usage+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [599 x i8] c"Usage: %s [-g GPIO_BASE] COMMAND\0A\09where COMMAND is one of:\0A\09\09-i\09\09Input value from GPIO and print it\0A\09\09-o\09VALUE\09Output value to GPIO\0A\09\09-c\09\09Cylon test pattern\0A\09\09-k\09\09 KIT test pattern\0A\09GPIO_BASE indicates which GPIO chip to talk to (The number can be \0A\09found at /sys/class/gpio/gpiochipN).\0A\09The highest gpiochipN is the first gpio listed in the dts file, \0A\09and the lowest gpiochipN is the last gpio listed in the dts file.\0A\09E.g.If the gpiochip240 is the LED_8bit gpio, and I want to output '1' \0A\09to the LED_8bit gpio, the command should be:\0A\09\09gpio-demo -g 240 -o 1\0A\0A\09gpio-demo written by Xilinx Inc.\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([599 x i8], [599 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 -2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [599 x i8] c"Usage: %s [-g GPIO_BASE] COMMAND\0A\09where COMMAND is one of:\0A\09\09-i\09\09Input value from GPIO and print it\0A\09\09-o\09VALUE\09Output value to GPIO\0A\09\09-c\09\09Cylon test pattern\0A\09\09-k\09\09 KIT test pattern\0A\09GPIO_BASE indicates which GPIO chip to talk to (The number can be \0A\09found at /sys/class/gpio/gpiochipN).\0A\09The highest gpiochipN is the first gpio listed in the dts file, \0A\09and the lowest gpiochipN is the last gpio listed in the dts file.\0A\09E.g.If the gpiochip240 is the LED_8bit gpio, and I want to output '1' \0A\09to the LED_8bit gpio, the command should be:\0A\09\09gpio-demo -g 240 -o 1\0A\0A\09gpio-demo written by Xilinx Inc.\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([599 x i8], [599 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = tail call i32 @exit(i32 -2)
unreachable
}